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 |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
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 |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
3329
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
|
28 #include "oct-shlib.h" |
|
29 |
|
30 #include <defaults.h> |
|
31 #include "dynamic-ld.h" |
|
32 #include "error.h" |
|
33 #include "oct-obj.h" |
|
34 #include "ov-dld-fcn.h" |
|
35 #include "ov.h" |
|
36 |
|
37 DEFINE_OCTAVE_ALLOCATOR (octave_dld_function); |
|
38 |
|
39 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_dld_function, |
4612
|
40 "dynamically-linked function", |
3329
|
41 "dynamically-linked function"); |
|
42 |
|
43 |
|
44 octave_dld_function::octave_dld_function |
|
45 (octave_builtin::fcn ff, const octave_shlib& shl, |
3523
|
46 const std::string& nm, const std::string& ds) |
3329
|
47 : octave_builtin (ff, nm, ds), sh_lib (shl) |
|
48 { |
|
49 mark_fcn_file_up_to_date (time_parsed ()); |
|
50 |
3523
|
51 std::string file_name = fcn_file_name (); |
3329
|
52 |
|
53 system_fcn_file |
|
54 = (! file_name.empty () |
5397
|
55 && Voct_file_dir == file_name.substr (0, Voct_file_dir.length ())); |
3329
|
56 } |
|
57 |
|
58 octave_dld_function::~octave_dld_function (void) |
|
59 { |
|
60 octave_dynamic_loader::remove (my_name, sh_lib); |
|
61 } |
|
62 |
3536
|
63 std::string |
3329
|
64 octave_dld_function::fcn_file_name (void) const |
|
65 { |
|
66 return sh_lib.file_name (); |
|
67 } |
|
68 |
|
69 octave_time |
|
70 octave_dld_function::time_parsed (void) const |
|
71 { |
|
72 return sh_lib.time_loaded (); |
|
73 } |
|
74 |
|
75 /* |
|
76 ;;; Local Variables: *** |
|
77 ;;; mode: C++ *** |
|
78 ;;; End: *** |
|
79 */ |