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 (octave_dld_function_h) |
|
24 #define octave_dld_function_h 1 |
|
25 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
3329
|
27 #pragma interface |
|
28 #endif |
|
29 |
4642
|
30 #include <cstdlib> |
|
31 |
3329
|
32 #include <string> |
|
33 |
|
34 #include "oct-shlib.h" |
|
35 |
|
36 #include "ov-fcn.h" |
|
37 #include "ov-builtin.h" |
|
38 #include "ov-typeinfo.h" |
|
39 |
|
40 class octave_shlib; |
|
41 |
|
42 class octave_value; |
|
43 class octave_value_list; |
|
44 |
|
45 // Dynamically-linked functions. |
|
46 |
|
47 class |
|
48 octave_dld_function : public octave_builtin |
|
49 { |
|
50 public: |
|
51 |
4642
|
52 octave_dld_function (void) { abort (); } |
4641
|
53 |
3329
|
54 octave_dld_function (octave_builtin::fcn ff, const octave_shlib& shl, |
3523
|
55 const std::string& nm = std::string (), |
|
56 const std::string& ds = std::string ()); |
3329
|
57 |
|
58 ~octave_dld_function (void); |
|
59 |
|
60 void mark_fcn_file_up_to_date (const octave_time& t) { t_checked = t; } |
|
61 |
3523
|
62 std::string fcn_file_name (void) const; |
3329
|
63 |
|
64 octave_time time_parsed (void) const; |
|
65 |
|
66 octave_time time_checked (void) const { return t_checked; } |
|
67 |
|
68 bool is_system_fcn_file (void) const { return system_fcn_file; } |
|
69 |
|
70 bool is_builtin_function (void) const { return false; } |
|
71 |
|
72 bool is_dld_function (void) const { return true; } |
|
73 |
|
74 private: |
|
75 |
|
76 octave_dld_function (const octave_dld_function& m); |
|
77 |
|
78 octave_shlib sh_lib; |
|
79 |
|
80 // The time the file was last checked to see if it needs to be |
|
81 // parsed again. |
|
82 mutable octave_time t_checked; |
|
83 |
|
84 // True if this function came from a file that is considered to be a |
|
85 // system function. This affects whether we check the time stamp |
|
86 // on the file to see if it has changed. |
|
87 bool system_fcn_file; |
|
88 |
4612
|
89 DECLARE_OCTAVE_ALLOCATOR |
3329
|
90 |
4612
|
91 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
3329
|
92 }; |
|
93 |
|
94 #endif |
|
95 |
|
96 /* |
|
97 ;;; Local Variables: *** |
|
98 ;;; mode: C++ *** |
|
99 ;;; End: *** |
|
100 */ |