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