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 |
7872
|
54 static bool remove_oct (const std::string& fcn_name, octave_shlib& shl); |
|
55 |
|
56 static bool remove_mex (const std::string& fcn_name, octave_shlib& shl); |
2894
|
57 |
|
58 private: |
|
59 |
|
60 // No copying! |
|
61 |
|
62 octave_dynamic_loader (const octave_dynamic_loader&); |
|
63 |
|
64 octave_dynamic_loader& operator = (const octave_dynamic_loader&); |
2926
|
65 |
|
66 static octave_dynamic_loader *instance; |
|
67 |
|
68 static bool instance_ok (void); |
|
69 |
7336
|
70 octave_function * |
|
71 do_load_oct (const std::string& fcn_name, |
|
72 const std::string& file_name = std::string (), |
|
73 bool relative = false); |
5864
|
74 |
7336
|
75 octave_function * |
|
76 do_load_mex (const std::string& fcn_name, |
|
77 const std::string& file_name = std::string (), |
|
78 bool relative = false); |
3325
|
79 |
7872
|
80 bool do_remove_oct (const std::string& fcn_name, octave_shlib& shl); |
|
81 |
|
82 bool do_remove_mex (const std::string& fcn_name, octave_shlib& shl); |
3325
|
83 |
|
84 static bool doing_load; |
2926
|
85 |
|
86 protected: |
|
87 |
3523
|
88 static std::string mangle_name (const std::string& name); |
7336
|
89 |
|
90 static std::string xmangle_name (const std::string& name); |
7872
|
91 |
|
92 static std::string mex_mangler (const std::string& name); |
|
93 |
|
94 static std::string mex_uscore_mangler (const std::string& name); |
|
95 |
|
96 static std::string mex_f77_mangler (const std::string& name); |
2894
|
97 }; |
1
|
98 |
|
99 #endif |
|
100 |
|
101 /* |
|
102 ;;; Local Variables: *** |
|
103 ;;; mode: C++ *** |
|
104 ;;; End: *** |
|
105 */ |