GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <cassert>
#include <clocale>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <fcntl.h>
#include <getopt.h>
#include <sys/types.h>
#include <unistd.h>
#include "cmd-edit.h"
#include "f77-fcn.h"
#include "file-ops.h"
#include "file-stat.h"
#include "lo-error.h"
#include "oct-env.h"
#include "str-vec.h"
#include "builtins.h"
#include "defaults.h"
#include "Cell.h"
#include "defun.h"
#include "display.h"
#include "error.h"
#include "file-io.h"
#include "help.h"
#include "input.h"
#include "lex.h"
#include "load-path.h"
#include "load-save.h"
#include "octave.h"
#include "oct-conf.h"
#include "oct-hist.h"
#include "oct-map.h"
#include "oct-mutex.h"
#include "oct-obj.h"
#include "ops.h"
#include "options-usage.h"
#include "ov.h"
#include "ov-classdef.h"
#include "ov-range.h"
#include "toplev.h"
#include "parse.h"
#include "procstream.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include <version.h>
Go to the source code of this file.
Functions | |
static bool | check_starting_gui (void) |
static void | execute_command_line_file (const std::string &fname) |
static int | execute_eval_option_code (const std::string &code) |
static void | execute_startup_files (void) |
F77_RET_T | F77_FUNC (xerbla, XERBLA)(F77_CONST_CHAR_ARG_DECL |
OCTAVE_EXPORT octave_value_list | F__version_info__ (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fargv (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fisguirunning (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fprogram_invocation_name (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fprogram_name (const octave_value_list &args, int) |
static void | gripe_safe_source_exception (const std::string &file, const std::string &msg) |
static void | initialize_error_handlers () |
static void | initialize_version_info (void) |
void | install_builtins (void) |
static void | intern_argv (int argc, char **argv) |
static void | lo_error_handler (const char *fmt,...) |
static void | lo_error_with_id_handler (const char *id, const char *fmt,...) |
static void | maximum_braindamage (void) |
int | octave_execute_interpreter (void) |
void | octave_initialize_interpreter (int argc, char **argv, int embedded) |
int | octave_main (int argc, char **argv, int embedded) |
void | octave_process_command_line (int argc, char **argv) |
int | octave_starting_gui (void) |
static void | safe_source_file (const std::string &file_name, const std::string &context=std::string(), bool verbose=false, bool require_file=true, const std::string &warn_for=std::string()) |
Variables | |
static bool | an_octave_program = false |
static std::string | code_to_eval |
static std::list< std::string > | command_line_path |
static std::string | exec_path |
F77_RET_T const octave_idx_type & | F77_CHAR_ARG_LEN_DECL |
static bool | force_gui_option = false |
static bool | forced_line_editing = false |
static std::string | image_path |
static bool | inhibit_startup_message = false |
static bool | line_editing = true |
static bool | no_gui_option = false |
static bool | no_window_system = false |
static string_vector | octave_argv |
int | octave_cmdline_argc |
char ** | octave_cmdline_argv |
int | octave_embedded |
static std::string | octave_program_invocation_name |
static std::string | octave_program_name |
static bool | persist = false |
static bool | read_history_file = true |
static bool | read_init_files = true |
static bool | read_site_files = true |
static bool | set_initial_path = true |
static bool | start_gui = false |
static bool | traditional = false |
static bool | verbose_flag = false |
|
static |
Definition at line 929 of file octave.cc.
References code_to_eval, display_info::display_available(), force_gui_option, inhibit_startup_message, no_gui_option, no_window_system, persist, and warning().
Referenced by octave_starting_gui().
|
static |
Definition at line 415 of file octave.cc.
References can_interrupt, context, file_ops::dir_sep_chars(), interactive, octave_bad_alloc_hook, octave_catch_interrupts(), octave_initialized, octave_interrupt_hook, octave_program_invocation_name, octave_program_name, octave_save_signal_mask(), octave_signal_handler(), octave_signal_hook, action_container::protect_var(), and safe_source_file().
Referenced by octave_execute_interpreter().
|
static |
Definition at line 371 of file octave.cc.
References can_interrupt, clean_up_and_exit(), eval_string(), exit_status, interactive, octave_bad_alloc_hook, octave_catch_interrupts(), octave_initialized, octave_interrupt_hook, octave_save_signal_mask(), octave_signal_handler(), octave_signal_hook, octave_stdout, action_container::protect_var(), quitting_gracefully, and recover_from_exception().
Referenced by octave_execute_interpreter().
|
static |
Definition at line 299 of file octave.cc.
References context, octave_env::get_home_directory(), octave_env::getenv(), inhibit_startup_message, octave_env::make_absolute(), read_init_files, read_site_files, safe_source_file(), same_file(), verbose_flag, Vlocal_site_defaults_file, and Vsite_defaults_file.
Referenced by octave_execute_interpreter().
Referenced by octave_initialize_interpreter().
OCTAVE_EXPORT octave_value_list F__version_info__ | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 206 of file octave.cc.
References octave_map::assign(), octave_lvalue::idx, octave_map::length(), octave_map::nfields(), octave_map::numel(), print_usage(), and octave_map::resize().
Referenced by initialize_version_info().
OCTAVE_EXPORT octave_value_list Fargv | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1021 of file octave.cc.
References print_usage().
OCTAVE_EXPORT octave_value_list Fisguirunning | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 986 of file octave.cc.
References print_usage(), and start_gui.
OCTAVE_EXPORT octave_value_list Fprogram_invocation_name | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1048 of file octave.cc.
References octave_program_invocation_name, and print_usage().
OCTAVE_EXPORT octave_value_list Fprogram_name | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1071 of file octave.cc.
References octave_program_name, and print_usage().
|
static |
Definition at line 259 of file octave.cc.
Referenced by safe_source_file().
|
static |
Definition at line 475 of file octave.cc.
References lo_error_handler(), lo_error_with_id_handler(), set_liboctave_error_handler(), set_liboctave_error_with_id_handler(), set_liboctave_warning_handler(), set_liboctave_warning_with_id_handler(), warning(), and warning_with_id().
Referenced by octave_initialize_interpreter().
|
static |
Definition at line 246 of file octave.cc.
References F__version_info__(), OCTAVE_RELEASE, OCTAVE_RELEASE_DATE, and OCTAVE_VERSION.
Referenced by octave_initialize_interpreter().
void install_builtins | ( | void | ) |
Definition at line 1708 of file builtins.cc.
References install___contourc___fcns(), install___dispatch___fcns(), install___dsearchn___fcns(), install___ichol___fcns(), install___ilu___fcns(), install___lin_interpn___fcns(), install___pchip_deriv___fcns(), install___qp___fcns(), install_balance_fcns(), install_besselj_fcns(), install_betainc_fcns(), install_bitfcns_fcns(), install_bsxfun_fcns(), install_built_in_docstrings(), install_cellfun_fcns(), install_colloc_fcns(), install_conv2_fcns(), install_daspk_fcns(), install_dasrt_fcns(), install_dassl_fcns(), install_data_fcns(), install_debug_fcns(), install_defaults_fcns(), install_det_fcns(), install_dirfns_fcns(), install_dlmread_fcns(), install_dot_fcns(), install_eig_fcns(), install_ellipj_fcns(), install_error_fcns(), install_fft2_fcns(), install_fft_fcns(), install_fftn_fcns(), install_file_io_fcns(), install_filter_fcns(), install_find_fcns(), install_gammainc_fcns(), install_gcd_fcns(), install_getgrent_fcns(), install_getpwent_fcns(), install_getrusage_fcns(), install_givens_fcns(), install_graphics_fcns(), install_help_fcns(), install_hess_fcns(), install_hex2num_fcns(), install_input_fcns(), install_inv_fcns(), install_kron_fcns(), install_lex_fcns(), install_load_path_fcns(), install_load_save_fcns(), install_lookup_fcns(), install_ls_oct_ascii_fcns(), install_lsode_fcns(), install_lu_fcns(), install_luinc_fcns(), install_mappers_fcns(), install_matrix_type_fcns(), install_max_fcns(), install_md5sum_fcns(), install_mgorth_fcns(), install_nproc_fcns(), install_oct_hist_fcns(), install_oct_parse_fcns(), install_octave_fcns(), install_octave_link_fcns(), install_ordschur_fcns(), install_ov_base_fcns(), install_ov_bool_mat_fcns(), install_ov_cell_fcns(), install_ov_class_fcns(), install_ov_classdef_fcns(), install_ov_fcn_handle_fcns(), install_ov_fcn_inline_fcns(), install_ov_fcns(), install_ov_flt_re_mat_fcns(), install_ov_int16_fcns(), install_ov_int32_fcns(), install_ov_int64_fcns(), install_ov_int8_fcns(), install_ov_java_fcns(), install_ov_null_mat_fcns(), install_ov_oncleanup_fcns(), install_ov_range_fcns(), install_ov_re_mat_fcns(), install_ov_struct_fcns(), install_ov_typeinfo_fcns(), install_ov_uint16_fcns(), install_ov_uint32_fcns(), install_ov_uint64_fcns(), install_ov_uint8_fcns(), install_ov_usr_fcn_fcns(), install_pager_fcns(), install_pinv_fcns(), install_pr_output_fcns(), install_profiler_fcns(), install_pt_arg_list_fcns(), install_pt_binop_fcns(), install_pt_eval_fcns(), install_pt_jit_fcns(), install_pt_mat_fcns(), install_quad_fcns(), install_quadcc_fcns(), install_qz_fcns(), install_rand_fcns(), install_rcond_fcns(), install_regexp_fcns(), install_schur_fcns(), install_sighandlers_fcns(), install_sparse_fcns(), install_spparms_fcns(), install_sqrtm_fcns(), install_str2double_fcns(), install_strfind_fcns(), install_strfns_fcns(), install_sub2ind_fcns(), install_svd_fcns(), install_sylvester_fcns(), install_symtab_fcns(), install_syscalls_fcns(), install_sysdep_fcns(), install_time_fcns(), install_toplev_fcns(), install_tril_fcns(), install_tsearch_fcns(), install_typecast_fcns(), install_urlwrite_fcns(), install_utils_fcns(), and install_variables_fcns().
Referenced by octave_initialize_interpreter().
Definition at line 183 of file octave.cc.
References symbol_table::assign(), symbol_table::at_top_level(), symbol_table::mark_hidden(), and string_vector::resize().
Referenced by octave_execute_interpreter(), and octave_initialize_interpreter().
|
static |
Definition at line 453 of file octave.cc.
References octave_throw_execution_exception(), and verror_with_cfn().
Referenced by initialize_error_handlers().
Definition at line 464 of file octave.cc.
References octave_throw_execution_exception(), and verror_with_id_cfn().
Referenced by initialize_error_handlers().
|
static |
Definition at line 486 of file octave.cc.
References disable_warning(), Fbeep_on_error(), Fconfirm_recursive_rmdir(), Fcrash_dumps_octave_core(), Fdisable_diagonal_matrix(), Fdisable_permutation_matrix(), Fdisable_range(), Ffixed_point_format(), Fhistory_timestamp_format_string(), Fpage_screen_output(), Fprint_empty_dimensions(), FPS1(), FPS2(), FPS4(), Fsave_default_options(), Fstruct_levels_to_print(), and persist.
Referenced by octave_initialize_interpreter().
int octave_execute_interpreter | ( | void | ) |
Definition at line 844 of file octave.cc.
References command_editor::blink_matching_paren(), clean_up_and_exit(), code_to_eval, ECHO_CMD_LINE, error_state, execute_command_line_file(), execute_eval_option_code(), execute_startup_files(), Fecho_executing_commands(), forced_interactive, inhibit_startup_message, intern_argv(), main_loop(), octave_prepare_hdf5(), octave_startup_message(), persist, quitting_gracefully, reading_startup_message_printed, and command_editor::reset_current_command_number().
Referenced by octave_interpreter::execute(), main(), octave_main(), and octave_cli_thread::run().
Definition at line 725 of file octave.cc.
References an_octave_program, exec_path, F77_CHAR_ARG_LEN, F77_FUNC(), command_editor::force_default_editor(), forced_interactive, forced_line_editing, octave_env::get_program_invocation_name(), octave_env::get_program_name(), image_path, inhibit_startup_message, octave_thread::init(), init_signals(), load_path::initialize(), initialize_command_input(), initialize_default_warning_state(), initialize_error_handlers(), initialize_file_io(), initialize_history(), initialize_version_info(), install_builtins(), install_classdef(), install_ops(), install_signal_handlers(), install_types(), interactive, intern_argv(), line_editing, maximum_braindamage(), display_info::no_window_system(), no_window_system, octave_ieee_init(), octave_interpreter_ready, octave_NaN, octave_program_invocation_name, octave_program_name, octave_env::putenv(), quit_allowed, read_history_file, load_path::set_command_line_path(), set_default_prompts(), set_exec_path(), set_image_path(), set_initial_path, octave_env::set_program_name(), traditional, and xerbla().
Referenced by octave_interpreter::execute(), main(), octave_main(), and octave_cli_thread::run().
Definition at line 516 of file octave.cc.
References install_defaults(), octave_execute_interpreter(), octave_initialize_interpreter(), octave_process_command_line(), and sysdep_init().
Definition at line 530 of file octave.cc.
References an_octave_program, BUILT_IN_DOCSTRINGS_FILE_OPTION, code_to_eval, DEBUG_JIT_OPTION, DOC_CACHE_FILE_OPTION, ECHO_CMD_LINE, ECHO_FUNCTIONS, ECHO_SCRIPTS, error(), EVAL_OPTION, exec_path, EXEC_PATH_OPTION, Fbuilt_in_docstrings_file(), Fdebug_jit(), Fdoc_cache_file(), Fecho_executing_commands(), Fhistory_save(), Finfo_file(), Finfo_program(), Fjit_enable(), FORCE_GUI_OPTION, force_gui_option, forced_interactive, forced_line_editing, Ftexi_macros_file(), image_path, IMAGE_PATH_OPTION, INFO_FILE_OPTION, INFO_PROG_OPTION, inhibit_startup_message, JIT_COMPILER_OPTION, line_editing, LINE_EDITING_OPTION, long_opts, NO_GUI_OPTION, no_gui_option, NO_INIT_FILE_OPTION, NO_INIT_PATH_OPTION, NO_LINE_EDITING_OPTION, NO_SITE_FILE_OPTION, no_window_system, octave_debug, octave_print_terse_usage_and_exit(), octave_print_verbose_usage_and_exit(), octave_print_version_and_exit(), panic_impossible, persist, PERSIST_OPTION, read_history_file, read_init_files, read_site_files, set_initial_path, short_opts, TEXI_MACROS_FILE_OPTION, traditional, TRADITIONAL_OPTION, and verbose_flag.
Referenced by main(), and octave_main().
int octave_starting_gui | ( | void | ) |
Definition at line 975 of file octave.cc.
References check_starting_gui(), and start_gui.
Referenced by main().
|
static |
Definition at line 273 of file octave.cc.
References clean_up_and_exit(), context, exit_status, gripe_safe_source_exception(), octave_stdout, quitting_gracefully, recover_from_exception(), and source_file().
Referenced by execute_command_line_file(), and execute_startup_files().
|
static |
Definition at line 178 of file octave.cc.
Referenced by octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 162 of file octave.cc.
Referenced by check_starting_gui(), octave_execute_interpreter(), and octave_process_command_line().
|
static |
Definition at line 146 of file octave.cc.
Referenced by load_path::do_get_command_line_path(), install_load_path_fcns(), and load_path::set_command_line_path().
|
static |
Definition at line 150 of file octave.cc.
Referenced by octave_initialize_interpreter(), and octave_process_command_line().
F77_RET_T const octave_idx_type& F77_CHAR_ARG_LEN_DECL |
|
static |
Definition at line 130 of file octave.cc.
Referenced by check_starting_gui(), and octave_process_command_line().
|
static |
Definition at line 138 of file octave.cc.
Referenced by octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 154 of file octave.cc.
Referenced by octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 122 of file octave.cc.
Referenced by check_starting_gui(), execute_startup_files(), octave_execute_interpreter(), octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 106 of file octave.cc.
Referenced by octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 134 of file octave.cc.
Referenced by check_starting_gui(), and octave_process_command_line().
|
static |
Definition at line 158 of file octave.cc.
Referenced by check_starting_gui(), octave_initialize_interpreter(), and octave_process_command_line().
|
static |
int octave_cmdline_argc |
Definition at line 91 of file octave.cc.
Referenced by octave_interpreter::execute().
char** octave_cmdline_argv |
Definition at line 92 of file octave.cc.
Referenced by octave_interpreter::execute().
int octave_embedded |
Definition at line 93 of file octave.cc.
Referenced by octave_interpreter::execute().
|
static |
Definition at line 99 of file octave.cc.
Referenced by execute_command_line_file(), Fprogram_invocation_name(), and octave_initialize_interpreter().
|
static |
Definition at line 102 of file octave.cc.
Referenced by execute_command_line_file(), Fprogram_name(), and octave_initialize_interpreter().
|
static |
Definition at line 166 of file octave.cc.
Referenced by check_starting_gui(), maximum_braindamage(), octave_execute_interpreter(), octave_process_command_line(), and property::property().
|
static |
Definition at line 142 of file octave.cc.
Referenced by octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 110 of file octave.cc.
Referenced by execute_startup_files(), and octave_process_command_line().
|
static |
Definition at line 114 of file octave.cc.
Referenced by execute_startup_files(), and octave_process_command_line().
|
static |
Definition at line 118 of file octave.cc.
Referenced by load_path::initialize(), octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 169 of file octave.cc.
Referenced by Fisguirunning(), main(), and octave_starting_gui().
|
static |
Definition at line 173 of file octave.cc.
Referenced by octave_initialize_interpreter(), and octave_process_command_line().
|
static |
Definition at line 126 of file octave.cc.
Referenced by execute_startup_files(), and octave_process_command_line().