1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
1
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
1
|
20 |
|
21 */ |
|
22 |
383
|
23 #if !defined (octave_dynamic_ld_h) |
|
24 #define octave_dynamic_ld_h 1 |
1
|
25 |
2862
|
26 #include <string> |
|
27 |
3325
|
28 #include "oct-shlib.h" |
2894
|
29 |
|
30 class |
|
31 octave_dynamic_loader |
|
32 { |
|
33 protected: |
|
34 |
2926
|
35 octave_dynamic_loader (void) { } |
2894
|
36 |
|
37 public: |
|
38 |
2926
|
39 virtual ~octave_dynamic_loader (void) { } |
1
|
40 |
5864
|
41 static bool load_oct (const std::string& fcn_name, |
6323
|
42 const std::string& file_name = std::string (), |
|
43 bool relative = false); |
5864
|
44 |
|
45 static bool load_mex (const std::string& fcn_name, |
6323
|
46 const std::string& file_name = std::string (), |
|
47 bool relative = false); |
3325
|
48 |
3523
|
49 static bool remove (const std::string& fcn_name, octave_shlib& shl); |
2894
|
50 |
|
51 private: |
|
52 |
|
53 // No copying! |
|
54 |
|
55 octave_dynamic_loader (const octave_dynamic_loader&); |
|
56 |
|
57 octave_dynamic_loader& operator = (const octave_dynamic_loader&); |
2926
|
58 |
|
59 static octave_dynamic_loader *instance; |
|
60 |
|
61 static bool instance_ok (void); |
|
62 |
5864
|
63 bool do_load_oct (const std::string& fcn_name, |
6323
|
64 const std::string& file_name = std::string (), |
|
65 bool relative = false); |
5864
|
66 |
|
67 bool do_load_mex (const std::string& fcn_name, |
6323
|
68 const std::string& file_name = std::string (), |
|
69 bool relative = false); |
3325
|
70 |
3523
|
71 bool do_remove (const std::string& fcn_name, octave_shlib& shl); |
3325
|
72 |
|
73 static bool doing_load; |
2926
|
74 |
|
75 protected: |
|
76 |
3523
|
77 static std::string mangle_name (const std::string& name); |
2894
|
78 }; |
1
|
79 |
|
80 #endif |
|
81 |
|
82 /* |
|
83 ;;; Local Variables: *** |
|
84 ;;; mode: C++ *** |
|
85 ;;; End: *** |
|
86 */ |