Mercurial > octave
annotate libinterp/corefcn/dynamic-ld.h @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
1 | 1 /* |
2 | |
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
3 Copyright (C) 1993-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
5 See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
6 or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
7 |
1 | 8 |
9 This file is part of Octave. | |
10 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23696
diff
changeset
|
11 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23696
diff
changeset
|
13 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 (at your option) any later version. |
1 | 15 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
16 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
17 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
19 GNU General Public License for more details. |
1 | 20 |
21 You should have received a copy of the GNU General Public License | |
7016 | 22 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23696
diff
changeset
|
23 <https://www.gnu.org/licenses/>. |
1 | 24 |
25 */ | |
26 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
27 #if ! defined (octave_dynamic_ld_h) |
383 | 28 #define octave_dynamic_ld_h 1 |
1 | 29 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
30 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
31 |
22999
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
32 #include <list> |
2862 | 33 #include <string> |
34 | |
3325 | 35 #include "oct-shlib.h" |
2894 | 36 |
7336 | 37 class octave_function; |
38 | |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
39 namespace octave |
2894 | 40 { |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
41 class interpreter; |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
42 |
22999
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
43 class |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
44 dynamic_loader |
22999
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
45 { |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
46 private: |
2894 | 47 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
48 class |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
49 shlibs_list |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
50 { |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
51 public: |
2894 | 52 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
53 typedef std::list<dynamic_library>::iterator iterator; |
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
54 typedef std::list<dynamic_library>::const_iterator const_iterator; |
2894 | 55 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
56 shlibs_list (void) : m_lib_list () { } |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
57 |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
58 // No copying! |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
59 |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
60 shlibs_list (const shlibs_list&) = delete; |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
61 |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
62 shlibs_list& operator = (const shlibs_list&) = delete; |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
63 |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
64 ~shlibs_list (void) = default; |
1 | 65 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
66 void append (const dynamic_library& shl); |
22999
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
67 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
68 std::list<std::string> remove (dynamic_library& shl); |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
69 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
70 dynamic_library find_file (const std::string& file_name) const; |
5864 | 71 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
72 void display (void) const; |
22999
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
73 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
74 private: |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
75 |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
76 // List of libraries we have loaded. |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
77 std::list<dynamic_library> m_lib_list; |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
78 }; |
7872 | 79 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
80 |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
81 public: |
2894 | 82 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
83 dynamic_loader (interpreter& interp) |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
84 : m_interpreter (interp), m_loaded_shlibs (), m_doing_load (false) |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
85 { } |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
86 |
22999
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
87 // No copying! |
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
88 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
89 dynamic_loader (const dynamic_loader&) = delete; |
2894 | 90 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
91 dynamic_loader& operator = (const dynamic_loader&) = delete; |
2894 | 92 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
93 virtual ~dynamic_loader (void) = default; |
2926 | 94 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
95 octave_function * |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
96 load_oct (const std::string& fcn_name, |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
97 const std::string& file_name = "", |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
98 bool relative = false); |
2926 | 99 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
100 octave_function * |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
101 load_mex (const std::string& fcn_name, |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
102 const std::string& file_name = "", |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
103 bool relative = false); |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
104 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
105 bool remove_oct (const std::string& fcn_name, |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
106 dynamic_library& shl); |
2926 | 107 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
108 bool remove_mex (const std::string& fcn_name, |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
109 dynamic_library& shl); |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
110 |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
111 private: |
5864 | 112 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
113 void clear_function (const std::string& fcn_name); |
7872 | 114 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
115 void clear (dynamic_library& oct_file); |
3325 | 116 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
117 interpreter& m_interpreter; |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
118 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
119 shlibs_list m_loaded_shlibs; |
2926 | 120 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23554
diff
changeset
|
121 bool m_doing_load; |
7336 | 122 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
123 static std::string name_mangler (const std::string& name); |
22999
f4781639f847
convert octave_shlib_list from singleton to ordinary object
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
124 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
125 static std::string name_uscore_mangler (const std::string& name); |
7872 | 126 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
127 static std::string mex_mangler (const std::string& name); |
7872 | 128 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
129 static std::string mex_uscore_mangler (const std::string& name); |
7872 | 130 |
23000
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
131 static std::string mex_f77_mangler (const std::string& name); |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
132 }; |
f981282a3bd0
move octave_dynamic_loader into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22999
diff
changeset
|
133 } |
1 | 134 |
135 #endif |