3329
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
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. |
3329
|
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/>. |
3329
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
|
24 #include <config.h> |
|
25 #endif |
|
26 |
|
27 #include "oct-shlib.h" |
|
28 |
|
29 #include <defaults.h> |
|
30 #include "dynamic-ld.h" |
|
31 #include "error.h" |
|
32 #include "oct-obj.h" |
|
33 #include "ov-dld-fcn.h" |
|
34 #include "ov.h" |
|
35 |
|
36 DEFINE_OCTAVE_ALLOCATOR (octave_dld_function); |
|
37 |
|
38 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_dld_function, |
4612
|
39 "dynamically-linked function", |
3329
|
40 "dynamically-linked function"); |
|
41 |
|
42 |
|
43 octave_dld_function::octave_dld_function |
|
44 (octave_builtin::fcn ff, const octave_shlib& shl, |
3523
|
45 const std::string& nm, const std::string& ds) |
3329
|
46 : octave_builtin (ff, nm, ds), sh_lib (shl) |
|
47 { |
|
48 mark_fcn_file_up_to_date (time_parsed ()); |
|
49 |
3523
|
50 std::string file_name = fcn_file_name (); |
3329
|
51 |
|
52 system_fcn_file |
|
53 = (! file_name.empty () |
5397
|
54 && Voct_file_dir == file_name.substr (0, Voct_file_dir.length ())); |
3329
|
55 } |
|
56 |
|
57 octave_dld_function::~octave_dld_function (void) |
|
58 { |
|
59 octave_dynamic_loader::remove (my_name, sh_lib); |
|
60 } |
|
61 |
3536
|
62 std::string |
3329
|
63 octave_dld_function::fcn_file_name (void) const |
|
64 { |
|
65 return sh_lib.file_name (); |
|
66 } |
|
67 |
|
68 octave_time |
|
69 octave_dld_function::time_parsed (void) const |
|
70 { |
|
71 return sh_lib.time_loaded (); |
|
72 } |
|
73 |
|
74 /* |
|
75 ;;; Local Variables: *** |
|
76 ;;; mode: C++ *** |
|
77 ;;; End: *** |
|
78 */ |