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 |
6109
|
47 extern OCTINTERP_API octave_function * |
3523
|
48 is_valid_function (const octave_value&, const std::string& = std::string (), |
3308
|
49 bool warn = false); |
593
|
50 |
6109
|
51 extern OCTINTERP_API octave_function * |
3523
|
52 is_valid_function (const std::string&, const std::string& = std::string (), |
3308
|
53 bool warn = false); |
3178
|
54 |
6109
|
55 extern OCTINTERP_API octave_function * |
3523
|
56 extract_function (const octave_value& arg, const std::string& warn_for, |
|
57 const std::string& fname, const std::string& header, |
|
58 const std::string& trailer); |
2796
|
59 |
6109
|
60 extern OCTINTERP_API string_vector |
3523
|
61 get_struct_elts (const std::string& text); |
2921
|
62 |
6109
|
63 extern OCTINTERP_API string_vector |
3523
|
64 generate_struct_completions (const std::string& text, std::string& prefix, |
|
65 std::string& hint); |
3020
|
66 |
6109
|
67 extern OCTINTERP_API bool |
3523
|
68 looks_like_struct (const std::string& text); |
2921
|
69 |
6109
|
70 extern OCTINTERP_API int |
4930
|
71 symbol_exist (const std::string& name, const std::string& type = "any"); |
4319
|
72 |
6109
|
73 extern OCTINTERP_API std::string |
4954
|
74 unique_symbol_name (const std::string& basename); |
|
75 |
6109
|
76 extern OCTINTERP_API octave_value lookup_function_handle (const std::string& nm); |
4988
|
77 |
6109
|
78 extern OCTINTERP_API octave_value |
5027
|
79 get_global_value (const std::string& nm, bool silent = false); |
3020
|
80 |
6109
|
81 extern OCTINTERP_API void set_global_value (const std::string& nm, const octave_value& val); |
3020
|
82 |
6109
|
83 extern OCTINTERP_API octave_value |
5791
|
84 set_internal_variable (bool& var, const octave_value_list& args, |
5794
|
85 int nargout, const char *nm); |
|
86 |
6109
|
87 extern OCTINTERP_API octave_value |
5794
|
88 set_internal_variable (char& var, const octave_value_list& args, |
|
89 int nargout, const char *nm); |
|
90 |
6109
|
91 extern OCTINTERP_API octave_value |
5794
|
92 set_internal_variable (int& var, const octave_value_list& args, |
|
93 int nargout, const char *nm, |
|
94 int minval = INT_MIN, int maxval = INT_MAX); |
|
95 |
6109
|
96 extern OCTINTERP_API octave_value |
5794
|
97 set_internal_variable (double& var, const octave_value_list& args, |
|
98 int nargout, const char *nm, |
|
99 double minval = DBL_MIN, double maxval = DBL_MAX); |
5791
|
100 |
6109
|
101 extern OCTINTERP_API octave_value |
5791
|
102 set_internal_variable (std::string& var, const octave_value_list& args, |
5794
|
103 int nargout, const char *nm, bool empty_ok = true); |
|
104 |
|
105 #define SET_INTERNAL_VARIABLE(NM) \ |
|
106 set_internal_variable (V ## NM, args, nargout, #NM) |
5791
|
107 |
5794
|
108 #define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM) \ |
|
109 set_internal_variable (V ## NM, args, nargout, #NM, false) |
|
110 |
|
111 #define SET_INTERNAL_VARIABLE_WITH_LIMITS(NM, MINVAL, MAXVAL) \ |
|
112 set_internal_variable (V ## NM, args, nargout, #NM, MINVAL, MAXVAL) |
5791
|
113 |
6109
|
114 extern OCTINTERP_API std::string builtin_string_variable (const std::string&); |
|
115 extern OCTINTERP_API int builtin_real_scalar_variable (const std::string&, double&); |
|
116 extern OCTINTERP_API octave_value builtin_any_variable (const std::string&); |
3020
|
117 |
6109
|
118 extern OCTINTERP_API void bind_ans (const octave_value& val, bool print); |
1162
|
119 |
6109
|
120 extern OCTINTERP_API void |
5794
|
121 bind_internal_variable (const std::string& fname, const octave_value& val); |
1406
|
122 |
7336
|
123 extern OCTINTERP_API void mlock (void); |
6109
|
124 extern OCTINTERP_API void munlock (const std::string&); |
|
125 extern OCTINTERP_API bool mislocked (const std::string&); |
4016
|
126 |
7336
|
127 extern OCTINTERP_API void clear_function (const std::string& nm); |
|
128 extern OCTINTERP_API void clear_variable (const std::string& nm); |
|
129 extern OCTINTERP_API void clear_symbol (const std::string& nm); |
4009
|
130 |
1
|
131 #endif |
|
132 |
|
133 /* |
|
134 ;;; Local Variables: *** |
|
135 ;;; mode: C++ *** |
|
136 ;;; End: *** |
|
137 */ |