00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_variables_h)
00025 #define octave_variables_h 1
00026
00027 class octave_function;
00028 class octave_user_function;
00029
00030 class tree_identifier;
00031 class octave_value;
00032 class octave_value_list;
00033 class octave_builtin;
00034 class string_vector;
00035
00036 #include <climits>
00037 #include <cfloat>
00038
00039 #include <string>
00040
00041 #include "ov.h"
00042 #include "ov-builtin.h"
00043 #include "symtab.h"
00044
00045 extern OCTINTERP_API void clear_mex_functions (void);
00046
00047 extern OCTINTERP_API octave_function *
00048 is_valid_function (const octave_value&, const std::string& = std::string (),
00049 bool warn = false);
00050
00051 extern OCTINTERP_API octave_function *
00052 is_valid_function (const std::string&, const std::string& = std::string (),
00053 bool warn = false);
00054
00055 extern OCTINTERP_API octave_function *
00056 extract_function (const octave_value& arg, const std::string& warn_for,
00057 const std::string& fname, const std::string& header,
00058 const std::string& trailer);
00059
00060 extern OCTINTERP_API string_vector
00061 get_struct_elts (const std::string& text);
00062
00063 extern OCTINTERP_API string_vector
00064 generate_struct_completions (const std::string& text, std::string& prefix,
00065 std::string& hint);
00066
00067 extern OCTINTERP_API bool
00068 looks_like_struct (const std::string& text);
00069
00070 extern OCTINTERP_API int
00071 symbol_exist (const std::string& name, const std::string& type = "any");
00072
00073 extern OCTINTERP_API std::string
00074 unique_symbol_name (const std::string& basename);
00075
00076 extern OCTINTERP_API octave_value lookup_function_handle (const std::string& nm);
00077
00078 extern OCTINTERP_API octave_value
00079 get_global_value (const std::string& nm, bool silent = false);
00080
00081 extern OCTINTERP_API void set_global_value (const std::string& nm, const octave_value& val);
00082
00083 extern OCTINTERP_API octave_value
00084 set_internal_variable (bool& var, const octave_value_list& args,
00085 int nargout, const char *nm);
00086
00087 extern OCTINTERP_API octave_value
00088 set_internal_variable (char& var, const octave_value_list& args,
00089 int nargout, const char *nm);
00090
00091 extern OCTINTERP_API octave_value
00092 set_internal_variable (int& var, const octave_value_list& args,
00093 int nargout, const char *nm,
00094 int minval = INT_MIN, int maxval = INT_MAX);
00095
00096 extern OCTINTERP_API octave_value
00097 set_internal_variable (double& var, const octave_value_list& args,
00098 int nargout, const char *nm,
00099 double minval = DBL_MIN, double maxval = DBL_MAX);
00100
00101 extern OCTINTERP_API octave_value
00102 set_internal_variable (std::string& var, const octave_value_list& args,
00103 int nargout, const char *nm, bool empty_ok = true);
00104
00105 #define SET_INTERNAL_VARIABLE(NM) \
00106 set_internal_variable (V ## NM, args, nargout, #NM)
00107
00108 #define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM) \
00109 set_internal_variable (V ## NM, args, nargout, #NM, false)
00110
00111 #define SET_INTERNAL_VARIABLE_WITH_LIMITS(NM, MINVAL, MAXVAL) \
00112 set_internal_variable (V ## NM, args, nargout, #NM, MINVAL, MAXVAL)
00113
00114 extern OCTINTERP_API std::string builtin_string_variable (const std::string&);
00115 extern OCTINTERP_API int builtin_real_scalar_variable (const std::string&, double&);
00116 extern OCTINTERP_API octave_value builtin_any_variable (const std::string&);
00117
00118 extern OCTINTERP_API void bind_ans (const octave_value& val, bool print);
00119
00120 extern OCTINTERP_API void
00121 bind_internal_variable (const std::string& fname, const octave_value& val);
00122
00123 extern OCTINTERP_API void mlock (void);
00124 extern OCTINTERP_API void munlock (const std::string&);
00125 extern OCTINTERP_API bool mislocked (const std::string&);
00126
00127 extern OCTINTERP_API void clear_function (const std::string& nm);
00128 extern OCTINTERP_API void clear_variable (const std::string& nm);
00129 extern OCTINTERP_API void clear_symbol (const std::string& nm);
00130
00131 #endif
00132
00133
00134
00135
00136
00137