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 |
|
31 class |
|
32 octave_dynamic_loader |
|
33 { |
|
34 protected: |
|
35 |
2926
|
36 octave_dynamic_loader (void) { } |
2894
|
37 |
|
38 public: |
|
39 |
2926
|
40 virtual ~octave_dynamic_loader (void) { } |
1
|
41 |
5864
|
42 static bool load_oct (const std::string& fcn_name, |
6323
|
43 const std::string& file_name = std::string (), |
|
44 bool relative = false); |
5864
|
45 |
|
46 static bool load_mex (const std::string& fcn_name, |
6323
|
47 const std::string& file_name = std::string (), |
|
48 bool relative = false); |
3325
|
49 |
3523
|
50 static bool remove (const std::string& fcn_name, octave_shlib& shl); |
2894
|
51 |
|
52 private: |
|
53 |
|
54 // No copying! |
|
55 |
|
56 octave_dynamic_loader (const octave_dynamic_loader&); |
|
57 |
|
58 octave_dynamic_loader& operator = (const octave_dynamic_loader&); |
2926
|
59 |
|
60 static octave_dynamic_loader *instance; |
|
61 |
|
62 static bool instance_ok (void); |
|
63 |
5864
|
64 bool do_load_oct (const std::string& fcn_name, |
6323
|
65 const std::string& file_name = std::string (), |
|
66 bool relative = false); |
5864
|
67 |
|
68 bool do_load_mex (const std::string& fcn_name, |
6323
|
69 const std::string& file_name = std::string (), |
|
70 bool relative = false); |
3325
|
71 |
3523
|
72 bool do_remove (const std::string& fcn_name, octave_shlib& shl); |
3325
|
73 |
|
74 static bool doing_load; |
2926
|
75 |
|
76 protected: |
|
77 |
3523
|
78 static std::string mangle_name (const std::string& name); |
2894
|
79 }; |
1
|
80 |
|
81 #endif |
|
82 |
|
83 /* |
|
84 ;;; Local Variables: *** |
|
85 ;;; mode: C++ *** |
|
86 ;;; End: *** |
|
87 */ |