Mercurial > hg > octave-jordi
comparison src/variables.h @ 5794:1138ced03f14
[project @ 2006-05-08 20:23:04 by jwe]
author | jwe |
---|---|
date | Mon, 08 May 2006 20:23:07 +0000 |
parents | 70215aff5ccf |
children | c9f0839c583f |
comparison
equal
deleted
inserted
replaced
5793:395382df0d8a | 5794:1138ced03f14 |
---|---|
34 class octave_value_list; | 34 class octave_value_list; |
35 class octave_builtin; | 35 class octave_builtin; |
36 class octave_mapper; | 36 class octave_mapper; |
37 class string_vector; | 37 class string_vector; |
38 | 38 |
39 #include <climits> | |
40 #include <cfloat> | |
41 | |
39 #include <string> | 42 #include <string> |
40 | 43 |
41 #include "ov.h" | 44 #include "ov.h" |
42 #include "ov-builtin.h" | 45 #include "ov-builtin.h" |
43 #include "symtab.h" | 46 #include "symtab.h" |
44 | 47 |
45 extern bool at_top_level (void); | 48 extern bool at_top_level (void); |
46 | 49 |
47 extern void initialize_symbol_tables (void); | 50 extern void initialize_symbol_tables (void); |
48 | 51 |
49 extern bool is_builtin_variable (const std::string&); | |
50 extern bool is_command_name (const std::string&); | 52 extern bool is_command_name (const std::string&); |
51 | 53 |
52 // The next three are here temporarily... | 54 // The next three are here temporarily... |
53 extern bool is_marked_as_rawcommand (const std::string& s); | 55 extern bool is_marked_as_rawcommand (const std::string& s); |
54 extern void mark_as_rawcommand (const std::string& s); | 56 extern void mark_as_rawcommand (const std::string& s); |
107 | 109 |
108 extern void set_global_value (const std::string& nm, const octave_value& val); | 110 extern void set_global_value (const std::string& nm, const octave_value& val); |
109 | 111 |
110 extern octave_value | 112 extern octave_value |
111 set_internal_variable (bool& var, const octave_value_list& args, | 113 set_internal_variable (bool& var, const octave_value_list& args, |
112 const char *nm); | 114 int nargout, const char *nm); |
115 | |
116 extern octave_value | |
117 set_internal_variable (char& var, const octave_value_list& args, | |
118 int nargout, const char *nm); | |
119 | |
120 extern octave_value | |
121 set_internal_variable (int& var, const octave_value_list& args, | |
122 int nargout, const char *nm, | |
123 int minval = INT_MIN, int maxval = INT_MAX); | |
124 | |
125 extern octave_value | |
126 set_internal_variable (double& var, const octave_value_list& args, | |
127 int nargout, const char *nm, | |
128 double minval = DBL_MIN, double maxval = DBL_MAX); | |
113 | 129 |
114 extern octave_value | 130 extern octave_value |
115 set_internal_variable (std::string& var, const octave_value_list& args, | 131 set_internal_variable (std::string& var, const octave_value_list& args, |
116 const char *nm); | 132 int nargout, const char *nm, bool empty_ok = true); |
117 | 133 |
118 #define SET_INTERNAL_VARIABLE(NM) set_internal_variable (V ## NM, args, #NM) | 134 #define SET_INTERNAL_VARIABLE(NM) \ |
135 set_internal_variable (V ## NM, args, nargout, #NM) | |
136 | |
137 #define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM) \ | |
138 set_internal_variable (V ## NM, args, nargout, #NM, false) | |
139 | |
140 #define SET_INTERNAL_VARIABLE_WITH_LIMITS(NM, MINVAL, MAXVAL) \ | |
141 set_internal_variable (V ## NM, args, nargout, #NM, MINVAL, MAXVAL) | |
119 | 142 |
120 extern std::string builtin_string_variable (const std::string&); | 143 extern std::string builtin_string_variable (const std::string&); |
121 extern int builtin_real_scalar_variable (const std::string&, double&); | 144 extern int builtin_real_scalar_variable (const std::string&, double&); |
122 extern octave_value builtin_any_variable (const std::string&); | 145 extern octave_value builtin_any_variable (const std::string&); |
123 | 146 |
127 extern void force_link_to_function (const std::string&); | 150 extern void force_link_to_function (const std::string&); |
128 | 151 |
129 extern void bind_ans (const octave_value& val, bool print); | 152 extern void bind_ans (const octave_value& val, bool print); |
130 | 153 |
131 extern void | 154 extern void |
132 bind_builtin_variable (const std::string&, const octave_value&, | 155 bind_internal_variable (const std::string& fname, const octave_value& val); |
133 bool protect = false, bool eternal = false, | |
134 symbol_record::change_function f = 0, | |
135 const std::string& help = std::string ()); | |
136 | 156 |
137 extern void mlock (const std::string&); | 157 extern void mlock (const std::string&); |
138 extern void munlock (const std::string&); | 158 extern void munlock (const std::string&); |
139 extern bool mislocked (const std::string&); | 159 extern bool mislocked (const std::string&); |
140 | 160 |