1
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, |
|
4 2003, 2004, 2005, 2006, 2007 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
1
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
1
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_variables_h) |
|
25 #define octave_variables_h 1 |
1
|
26 |
2975
|
27 class octave_function; |
4700
|
28 class octave_user_function; |
1738
|
29 |
2390
|
30 class tree_identifier; |
2086
|
31 class octave_value; |
|
32 class octave_value_list; |
2892
|
33 class octave_builtin; |
1755
|
34 class string_vector; |
|
35 |
5794
|
36 #include <climits> |
|
37 #include <cfloat> |
|
38 |
1755
|
39 #include <string> |
1
|
40 |
2390
|
41 #include "ov.h" |
2975
|
42 #include "ov-builtin.h" |
2953
|
43 #include "symtab.h" |
195
|
44 |
6109
|
45 extern OCTINTERP_API void clear_mex_functions (void); |
195
|
46 |
7336
|
47 extern OCTINTERP_API void mark_as_command (const std::string&); |
6109
|
48 extern OCTINTERP_API bool is_command_name (const std::string&); |
5685
|
49 |
|
50 // The next three are here temporarily... |
6109
|
51 extern OCTINTERP_API bool is_marked_as_rawcommand (const std::string& s); |
|
52 extern OCTINTERP_API void mark_as_rawcommand (const std::string& s); |
|
53 extern OCTINTERP_API void unmark_rawcommand (const std::string& s); |
5685
|
54 |
6109
|
55 extern OCTINTERP_API bool is_rawcommand_name (const std::string&); |
593
|
56 |
6109
|
57 extern OCTINTERP_API octave_function * |
3523
|
58 is_valid_function (const octave_value&, const std::string& = std::string (), |
3308
|
59 bool warn = false); |
593
|
60 |
6109
|
61 extern OCTINTERP_API octave_function * |
3523
|
62 is_valid_function (const std::string&, const std::string& = std::string (), |
3308
|
63 bool warn = false); |
3178
|
64 |
6109
|
65 extern OCTINTERP_API octave_function * |
3523
|
66 extract_function (const octave_value& arg, const std::string& warn_for, |
|
67 const std::string& fname, const std::string& header, |
|
68 const std::string& trailer); |
2796
|
69 |
6109
|
70 extern OCTINTERP_API string_vector |
3523
|
71 get_struct_elts (const std::string& text); |
2921
|
72 |
6109
|
73 extern OCTINTERP_API string_vector |
3523
|
74 generate_struct_completions (const std::string& text, std::string& prefix, |
|
75 std::string& hint); |
3020
|
76 |
6109
|
77 extern OCTINTERP_API bool |
3523
|
78 looks_like_struct (const std::string& text); |
2921
|
79 |
6109
|
80 extern OCTINTERP_API int |
4930
|
81 symbol_exist (const std::string& name, const std::string& type = "any"); |
4319
|
82 |
6109
|
83 extern OCTINTERP_API std::string |
4954
|
84 unique_symbol_name (const std::string& basename); |
|
85 |
6109
|
86 extern OCTINTERP_API octave_value lookup_function_handle (const std::string& nm); |
4988
|
87 |
6109
|
88 extern OCTINTERP_API octave_value |
5027
|
89 get_global_value (const std::string& nm, bool silent = false); |
3020
|
90 |
6109
|
91 extern OCTINTERP_API void set_global_value (const std::string& nm, const octave_value& val); |
3020
|
92 |
6109
|
93 extern OCTINTERP_API octave_value |
5791
|
94 set_internal_variable (bool& var, const octave_value_list& args, |
5794
|
95 int nargout, const char *nm); |
|
96 |
6109
|
97 extern OCTINTERP_API octave_value |
5794
|
98 set_internal_variable (char& var, const octave_value_list& args, |
|
99 int nargout, const char *nm); |
|
100 |
6109
|
101 extern OCTINTERP_API octave_value |
5794
|
102 set_internal_variable (int& var, const octave_value_list& args, |
|
103 int nargout, const char *nm, |
|
104 int minval = INT_MIN, int maxval = INT_MAX); |
|
105 |
6109
|
106 extern OCTINTERP_API octave_value |
5794
|
107 set_internal_variable (double& var, const octave_value_list& args, |
|
108 int nargout, const char *nm, |
|
109 double minval = DBL_MIN, double maxval = DBL_MAX); |
5791
|
110 |
6109
|
111 extern OCTINTERP_API octave_value |
5791
|
112 set_internal_variable (std::string& var, const octave_value_list& args, |
5794
|
113 int nargout, const char *nm, bool empty_ok = true); |
|
114 |
|
115 #define SET_INTERNAL_VARIABLE(NM) \ |
|
116 set_internal_variable (V ## NM, args, nargout, #NM) |
5791
|
117 |
5794
|
118 #define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM) \ |
|
119 set_internal_variable (V ## NM, args, nargout, #NM, false) |
|
120 |
|
121 #define SET_INTERNAL_VARIABLE_WITH_LIMITS(NM, MINVAL, MAXVAL) \ |
|
122 set_internal_variable (V ## NM, args, nargout, #NM, MINVAL, MAXVAL) |
5791
|
123 |
6109
|
124 extern OCTINTERP_API std::string builtin_string_variable (const std::string&); |
|
125 extern OCTINTERP_API int builtin_real_scalar_variable (const std::string&, double&); |
|
126 extern OCTINTERP_API octave_value builtin_any_variable (const std::string&); |
3020
|
127 |
6109
|
128 extern OCTINTERP_API void bind_ans (const octave_value& val, bool print); |
1162
|
129 |
6109
|
130 extern OCTINTERP_API void |
5794
|
131 bind_internal_variable (const std::string& fname, const octave_value& val); |
1406
|
132 |
7336
|
133 extern OCTINTERP_API void mlock (void); |
6109
|
134 extern OCTINTERP_API void munlock (const std::string&); |
|
135 extern OCTINTERP_API bool mislocked (const std::string&); |
4016
|
136 |
7336
|
137 extern OCTINTERP_API void clear_function (const std::string& nm); |
|
138 extern OCTINTERP_API void clear_variable (const std::string& nm); |
|
139 extern OCTINTERP_API void clear_symbol (const std::string& nm); |
4009
|
140 |
1
|
141 #endif |
|
142 |
|
143 /* |
|
144 ;;; Local Variables: *** |
|
145 ;;; mode: C++ *** |
|
146 ;;; End: *** |
|
147 */ |