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 |
|
23 #if defined (__GNUG__) |
|
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, |
|
43 "dynamically-linked function"); |
|
44 |
|
45 |
|
46 octave_dld_function::octave_dld_function |
|
47 (octave_builtin::fcn ff, const octave_shlib& shl, |
3523
|
48 const std::string& nm, const std::string& ds) |
3329
|
49 : octave_builtin (ff, nm, ds), sh_lib (shl) |
|
50 { |
|
51 mark_fcn_file_up_to_date (time_parsed ()); |
|
52 |
3523
|
53 std::string file_name = fcn_file_name (); |
3329
|
54 |
|
55 system_fcn_file |
|
56 = (! file_name.empty () |
|
57 && Vfcn_file_dir.compare (file_name, 0, Vfcn_file_dir.length ()) == 0); |
|
58 } |
|
59 |
|
60 octave_dld_function::~octave_dld_function (void) |
|
61 { |
|
62 octave_dynamic_loader::remove (my_name, sh_lib); |
|
63 } |
|
64 |
|
65 string |
|
66 octave_dld_function::fcn_file_name (void) const |
|
67 { |
|
68 return sh_lib.file_name (); |
|
69 } |
|
70 |
|
71 octave_time |
|
72 octave_dld_function::time_parsed (void) const |
|
73 { |
|
74 return sh_lib.time_loaded (); |
|
75 } |
|
76 |
|
77 /* |
|
78 ;;; Local Variables: *** |
|
79 ;;; mode: C++ *** |
|
80 ;;; End: *** |
|
81 */ |