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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
4192
|
23 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
3329
|
24 #pragma implementation |
|
25 #endif |
|
26 |
|
27 #ifdef HAVE_CONFIG_H |
|
28 #include <config.h> |
|
29 #endif |
|
30 |
|
31 #include "oct-shlib.h" |
|
32 |
|
33 #include <defaults.h> |
|
34 #include "dynamic-ld.h" |
|
35 #include "error.h" |
|
36 #include "oct-obj.h" |
|
37 #include "ov-dld-fcn.h" |
|
38 #include "ov.h" |
|
39 |
|
40 DEFINE_OCTAVE_ALLOCATOR (octave_dld_function); |
|
41 |
|
42 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_dld_function, |
4612
|
43 "dynamically-linked function", |
3329
|
44 "dynamically-linked function"); |
|
45 |
|
46 |
|
47 octave_dld_function::octave_dld_function |
|
48 (octave_builtin::fcn ff, const octave_shlib& shl, |
3523
|
49 const std::string& nm, const std::string& ds) |
3329
|
50 : octave_builtin (ff, nm, ds), sh_lib (shl) |
|
51 { |
|
52 mark_fcn_file_up_to_date (time_parsed ()); |
|
53 |
3523
|
54 std::string file_name = fcn_file_name (); |
3329
|
55 |
|
56 system_fcn_file |
|
57 = (! file_name.empty () |
3565
|
58 && Vfcn_file_dir == file_name.substr (0, Vfcn_file_dir.length ())); |
3329
|
59 } |
|
60 |
|
61 octave_dld_function::~octave_dld_function (void) |
|
62 { |
|
63 octave_dynamic_loader::remove (my_name, sh_lib); |
|
64 } |
|
65 |
3536
|
66 std::string |
3329
|
67 octave_dld_function::fcn_file_name (void) const |
|
68 { |
|
69 return sh_lib.file_name (); |
|
70 } |
|
71 |
|
72 octave_time |
|
73 octave_dld_function::time_parsed (void) const |
|
74 { |
|
75 return sh_lib.time_loaded (); |
|
76 } |
|
77 |
|
78 /* |
|
79 ;;; Local Variables: *** |
|
80 ;;; mode: C++ *** |
|
81 ;;; End: *** |
|
82 */ |