#include <cstdio>
#include <cstring>
#include <iomanip>
#include <list>
#include <set>
#include <string>
#include "file-stat.h"
#include "oct-env.h"
#include "file-ops.h"
#include "glob-match.h"
#include "lo-regexp.h"
#include "str-vec.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "event-manager.h"
#include "help.h"
#include "input.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "lex.h"
#include "load-path.h"
#include "octave-preserve-stream-state.h"
#include "oct-map.h"
#include "ovl.h"
#include "ov.h"
#include "ov-class.h"
#include "ov-usr-fcn.h"
#include "pager.h"
#include "parse.h"
#include "pt-eval.h"
#include "syminfo.h"
#include "symtab.h"
#include "sysdep.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Go to the source code of this file.
Macros | |
#define | GET_IDX(LEN) static_cast<int> (((LEN)-1) * static_cast<double> (rand ()) / RAND_MAX) |
Functions | |
static octave::unwind_protect * | curr_fcn_unwind_protect_frame (void) |
static void | do_clear_functions (interpreter &interp, const string_vector &argv, int argc, int idx, bool exclusive=false) |
static void | do_clear_globals (interpreter &interp, const string_vector &argv, int argc, int idx, bool exclusive=false) |
static void | do_clear_symbols (interpreter &interp, const string_vector &argv, int argc, int idx, bool exclusive=false) |
static void | do_clear_variables (interpreter &interp, const string_vector &argv, int argc, int idx, bool exclusive=false, bool have_regexp=false) |
static void | do_matlab_compatible_clear (interpreter &interp, const string_vector &argv, int argc, int idx) |
OCTAVE_EXPORT octave_value_list | F__varval__ (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fclear (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fexist (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fisglobal (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fmislocked (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fmissing_component_hook (const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Fmissing_function_hook (const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Fmlock (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fmunlock (octave::interpreter &interp, const octave_value_list &args, int) |
octave_function * | is_valid_function (const octave_value &arg, const std::string &warn_for, bool warn) |
octave_function * | is_valid_function (const std::string &fcn_name, const std::string &warn_for, bool warn) |
std::string | maybe_missing_function_hook (const std::string &name) |
static void | maybe_warn_exclusive (bool exclusive) |
static bool | name_matches_any_pattern (const std::string &nm, const string_vector &argv, int argc, int idx, bool have_regexp=false) |
octave_value | set_internal_variable (bool &var, const octave_value_list &args, int nargout, const char *nm) |
octave_value | set_internal_variable (char &var, const octave_value_list &args, int nargout, const char *nm) |
octave_value | set_internal_variable (double &var, const octave_value_list &args, int nargout, const char *nm, double minval, double maxval) |
octave_value | set_internal_variable (int &var, const octave_value_list &args, int nargout, const char *nm, const char **choices) |
octave_value | set_internal_variable (int &var, const octave_value_list &args, int nargout, const char *nm, int minval, int maxval) |
octave_value | set_internal_variable (std::string &var, const octave_value_list &args, int nargout, const char *nm, bool empty_ok) |
octave_value | set_internal_variable (std::string &var, const octave_value_list &args, int nargout, const char *nm, const char **choices) |
int | symbol_exist (const std::string &name, const std::string &type) |
static int | symbol_exist (interpreter &interp, const std::string &name, const std::string &type="any") |
template<typename T > | |
static bool | try_local_protect (T &var) |
std::string | unique_symbol_name (const std::string &basename) |
static bool | wants_local_change (const octave_value_list &args, int &nargin) |
Variables | |
static std::string | Vmissing_component_hook |
static std::string | Vmissing_function_hook = "__unimplemented__" |
#define GET_IDX | ( | LEN | ) | static_cast<int> (((LEN)-1) * static_cast<double> (rand ()) / RAND_MAX) |
Definition at line 336 of file variables.cc.
|
static |
Definition at line 561 of file variables.cc.
References __get_evaluator__().
Referenced by try_local_protect().
|
static |
Definition at line 974 of file variables.cc.
References interpreter::clear_function(), interpreter::clear_function_pattern(), interpreter::clear_functions(), name_matches_any_pattern(), and interpreter::user_function_names().
Referenced by do_clear_symbols(), do_matlab_compatible_clear(), and Fclear().
|
static |
Definition at line 1001 of file variables.cc.
References interpreter::clear_global_variable(), interpreter::clear_global_variable_pattern(), interpreter::clear_variable(), interpreter::clear_variable_pattern(), interpreter::global_variable_names(), and name_matches_any_pattern().
Referenced by do_matlab_compatible_clear(), and Fclear().
|
static |
Definition at line 1076 of file variables.cc.
References interpreter::clear_symbol_pattern(), interpreter::clear_variables(), do_clear_functions(), and do_clear_variables().
Referenced by Fclear().
|
static |
Definition at line 1044 of file variables.cc.
References interpreter::clear_variable(), interpreter::clear_variable_pattern(), interpreter::clear_variable_regexp(), interpreter::clear_variables(), name_matches_any_pattern(), and interpreter::variable_names().
Referenced by do_clear_symbols(), and Fclear().
|
static |
Definition at line 1105 of file variables.cc.
References interpreter::clear_all(), octave_class::clear_exemplar_map(), interpreter::clear_objects(), interpreter::clear_symbol_pattern(), interpreter::clear_variables(), do_clear_functions(), do_clear_globals(), and interpreter::is_local_variable().
Referenced by Fclear().
OCTAVE_EXPORT octave_value_list F__varval__ | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 1471 of file variables.cc.
References stack_frame::ARG_NAMES, tree_evaluator::get_auto_fcn_var(), and print_usage().
OCTAVE_EXPORT octave_value_list Fclear | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 1233 of file variables.cc.
References octave_class::clear_exemplar_map(), event_manager::clear_workspace(), do_clear_functions(), do_clear_globals(), do_clear_symbols(), do_clear_variables(), do_matlab_compatible_clear(), maybe_warn_exclusive(), ovl(), print_usage(), and warning().
Referenced by main_window::handle_clear_workspace_request().
OCTAVE_EXPORT octave_value_list Fexist | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 433 of file variables.cc.
References btyp_unknown, ovl(), print_usage(), and symbol_exist().
Referenced by main_window::handle_edit_mfile_request().
OCTAVE_EXPORT octave_value_list Fisglobal | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 139 of file variables.cc.
References ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Fmislocked | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 911 of file variables.cc.
References ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Fmissing_component_hook | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 1517 of file variables.cc.
References set_internal_variable(), and Vmissing_component_hook.
OCTAVE_EXPORT octave_value_list Fmissing_function_hook | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 1403 of file variables.cc.
References set_internal_variable(), and Vmissing_function_hook.
OCTAVE_EXPORT octave_value_list Fmlock | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 864 of file variables.cc.
References ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Fmunlock | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 883 of file variables.cc.
References ovl(), and print_usage().
octave_function* is_valid_function | ( | const octave_value & | arg, |
const std::string & | warn_for, | ||
bool | warn | ||
) |
Definition at line 101 of file variables.cc.
References error(), octave_value::is_string(), is_valid_function(), and octave_value::string_value().
octave_function* is_valid_function | ( | const std::string & | fcn_name, |
const std::string & | warn_for, | ||
bool | warn | ||
) |
Definition at line 77 of file variables.cc.
References __get_symbol_table__(), error(), octave_value::function_value(), and octave_value::is_defined().
Referenced by named_hook_function::is_valid(), and is_valid_function().
std::string maybe_missing_function_hook | ( | const std::string & | name | ) |
Definition at line 1410 of file variables.cc.
References __get_interpreter__(), feval(), octave_value::is_defined(), octave_value_list::length(), and Vmissing_function_hook.
Referenced by tree_identifier::eval_undefined_error().
|
inlinestatic |
|
inlinestatic |
Definition at line 932 of file variables.cc.
References regexp::is_match(), and glob_match::match().
Referenced by do_clear_functions(), do_clear_globals(), and do_clear_variables().
octave_value set_internal_variable | ( | bool & | var, |
const octave_value_list & | args, | ||
int | nargout, | ||
const char * | nm | ||
) |
Definition at line 584 of file variables.cc.
References octave_value_list::length(), print_usage(), try_local_protect(), wants_local_change(), and warning().
Referenced by error_system::backtrace_on_warning(), error_system::beep_on_error(), load_save_system::crash_dumps_octave_core(), error_system::debug_on_caught(), error_system::debug_on_error(), error_system::debug_on_warning(), error_system::discard_warning_messages(), settings::display_tokens(), environment::editor(), environment::exec_path(), F__enable_vm_eval__(), F__parser_debug_flag__(), Fconfirm_recursive_rmdir(), Fdebug_on_interrupt(), Ffixed_point_format(), Fhistory_control(), Fhistory_file(), Fhistory_save(), Fhistory_size(), Fmissing_component_hook(), Fmissing_function_hook(), Foptimize_subsasgn_calls(), Foutput_precision(), Fprint_empty_dimensions(), Fprint_struct_array_contents(), Fsave_precision(), Fsighup_dumps_octave_core(), Fsigquit_dumps_octave_core(), Fsigterm_dumps_octave_core(), Fsplit_long_rows(), Fstruct_levels_to_print(), Fsvd_driver(), environment::image_path(), history_system::input_from_tmp_file(), error_system::last_error_id(), error_system::last_error_message(), error_system::last_warning_id(), error_system::last_warning_message(), settings::lexer_debug_flag(), tree_evaluator::max_recursion_depth(), call_stack::max_stack_depth(), load_save_system::octave_core_file_limit(), load_save_system::octave_core_file_name(), load_save_system::octave_core_file_options(), output_system::page_output_immediately(), output_system::page_screen_output(), output_system::PAGER(), output_system::PAGER_FLAGS(), tree_evaluator::PS4(), error_system::quiet_warning(), load_save_system::save_default_options(), load_save_system::save_header_format_string(), tree_evaluator::silent_functions(), tree_evaluator::string_fill_char(), history_system::timestamp_format_string(), error_system::verbose_warning(), and tree_evaluator::whos_line_format().
octave_value set_internal_variable | ( | char & | var, |
const octave_value_list & | args, | ||
int | nargout, | ||
const char * | nm | ||
) |
Definition at line 614 of file variables.cc.
References error(), octave_value_list::length(), print_usage(), try_local_protect(), wants_local_change(), and warning().
octave_value set_internal_variable | ( | double & | var, |
const octave_value_list & | args, | ||
int | nargout, | ||
const char * | nm, | ||
double | minval, | ||
double | maxval | ||
) |
Definition at line 693 of file variables.cc.
References error(), octave_value_list::length(), print_usage(), try_local_protect(), wants_local_change(), and warning().
octave_value set_internal_variable | ( | int & | var, |
const octave_value_list & | args, | ||
int | nargout, | ||
const char * | nm, | ||
const char ** | choices | ||
) |
Definition at line 762 of file variables.cc.
References error(), error_unless(), octave_value_list::length(), print_usage(), try_local_protect(), wants_local_change(), and warning().
octave_value set_internal_variable | ( | int & | var, |
const octave_value_list & | args, | ||
int | nargout, | ||
const char * | nm, | ||
int | minval, | ||
int | maxval | ||
) |
Definition at line 657 of file variables.cc.
References error(), octave_value_list::length(), print_usage(), try_local_protect(), wants_local_change(), and warning().
octave_value set_internal_variable | ( | std::string & | var, |
const octave_value_list & | args, | ||
int | nargout, | ||
const char * | nm, | ||
bool | empty_ok | ||
) |
Definition at line 729 of file variables.cc.
References error(), octave_value_list::length(), print_usage(), try_local_protect(), wants_local_change(), and warning().
octave_value set_internal_variable | ( | std::string & | var, |
const octave_value_list & | args, | ||
int | nargout, | ||
const char * | nm, | ||
const char ** | choices | ||
) |
Definition at line 807 of file variables.cc.
References error(), octave_value_list::length(), print_usage(), try_local_protect(), wants_local_change(), and warning().
int symbol_exist | ( | const std::string & | name, |
const std::string & | type | ||
) |
Definition at line 328 of file variables.cc.
References __get_interpreter__(), and symbol_exist().
|
static |
Definition at line 161 of file variables.cc.
References drive_or_unc_share(), error(), file_in_path(), symbol_table::find_cmdline_function(), load_path::find_fcn(), symbol_table::find_function(), load_path::find_method(), interpreter::get_evaluator(), interpreter::get_load_path(), interpreter::get_symbol_table(), octave_value::is_anonymous_function(), symbol_table::is_built_in_function_name(), octave_value::is_classdef_meta(), octave_value::is_constant(), octave_value::is_defined(), octave_value::is_function_handle(), octave_value::is_inline_function(), iskeyword(), octave_value::isobject(), len, tree_evaluator::lookup_autoload(), and interpreter::varval().
Referenced by Fexist(), interpreter::quit(), variable_editor_model::retrieve_variable(), symbol_exist(), and unique_symbol_name().
|
static |
Definition at line 570 of file variables.cc.
References curr_fcn_unwind_protect_frame().
Referenced by set_internal_variable().
std::string unique_symbol_name | ( | const std::string & | basename | ) |
Definition at line 340 of file variables.cc.
References __get_interpreter__(), basename(), GET_IDX, len, and symbol_exist().
|
static |
Definition at line 544 of file variables.cc.
References error_with_cfn().
Referenced by set_internal_variable().
|
static |
Definition at line 1489 of file variables.cc.
Referenced by Fmissing_component_hook().
|
static |
Definition at line 1389 of file variables.cc.
Referenced by Fmissing_function_hook(), and maybe_missing_function_hook().