GNU Octave
3.8.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-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) |
DEFUN (__version_info__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {retval =} __version_info__ (@var{name}, @var{version}, @var{release}, @var{date})\n\ Undocumented internal function.\n\ @end deftypefn") | |
DEFUN (isguirunning, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isguirunning ()\n\ Return true if Octave is running in GUI mode and false otherwise.\n\ @end deftypefn") | |
DEFUN (argv, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} argv ()\n\ Return the command line arguments passed to Octave. For example,\n\ if you invoked Octave using the command\n\ \n\ @example\n\ octave --no-line-editing --silent\n\ @end example\n\ \n\ @noindent\n\ @code{argv} would return a cell array of strings with the elements\n\ @option{--no-line-editing} and @option{--silent}.\n\ \n\ If you write an executable Octave script, @code{argv} will return the\n\ list of arguments passed to the script. @xref{Executable Octave Programs},\n\ for an example of how to create an executable Octave script.\n\ @end deftypefn") | |
DEFUN (program_invocation_name, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} program_invocation_name ()\n\ Return the name that was typed at the shell prompt to run Octave.\n\ \n\ If executing a script from the command line (e.g., @code{octave foo.m})\n\ or using an executable Octave script, the program name is set to the\n\ name of the script. @xref{Executable Octave Programs}, for an example of\n\ how to create an executable Octave script.\n\ @seealso{program_name}\n\ @end deftypefn") | |
DEFUN (program_name, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} program_name ()\n\ Return the last component of the value returned by\n\ @code{program_invocation_name}.\n\ @seealso{program_invocation_name}\n\ @end deftypefn") | |
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 |
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 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 |
Definition at line 899 of file octave.cc.
References code_to_eval, display_info::display_available(), force_gui_option, inhibit_startup_message, isatty(), no_gui_option, no_window_system, persist, and warning().
Referenced by octave_starting_gui().
DEFUN | ( | __version_info__ | , |
args | |||
) |
Definition at line 194 of file octave.cc.
References octave_map::assign(), octave_map::length(), octave_map::nfields(), octave_map::numel(), print_usage(), and octave_map::resize().
DEFUN | ( | isguirunning | , |
args | |||
) |
Definition at line 953 of file octave.cc.
References print_usage(), and start_gui.
DEFUN | ( | argv | , |
args | |||
) |
Definition at line 974 of file octave.cc.
References print_usage().
DEFUN | ( | program_invocation_name | , |
args | |||
) |
Definition at line 1008 of file octave.cc.
References octave_program_invocation_name, and print_usage().
DEFUN | ( | program_name | , |
args | |||
) |
Definition at line 1035 of file octave.cc.
References octave_program_name, and print_usage().
|
static |
Definition at line 407 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 363 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().
Definition at line 291 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().
|
static |
Definition at line 251 of file octave.cc.
Referenced by safe_source_file().
|
static |
Definition at line 467 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().
Definition at line 238 of file octave.cc.
References F__version_info__(), OCTAVE_RELEASE, OCTAVE_RELEASE_DATE, and OCTAVE_VERSION.
Referenced by octave_initialize_interpreter().
Definition at line 1635 of file builtins.cc.
References install___contourc___fcns(), install___dispatch___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_ov_base_fcns(), install_ov_bool_mat_fcns(), install_ov_cell_fcns(), install_ov_class_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_syl_fcns(), install_symtab_fcns(), install_syscalls_fcns(), install_sysdep_fcns(), install_time_fcns(), install_toplev_fcns(), install_tril_fcns(), install_typecast_fcns(), install_urlwrite_fcns(), install_utils_fcns(), and install_variables_fcns().
Referenced by octave_initialize_interpreter().
Definition at line 175 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().
Definition at line 445 of file octave.cc.
References octave_throw_execution_exception(), and verror_with_cfn().
Referenced by initialize_error_handlers().
Definition at line 456 of file octave.cc.
References octave_throw_execution_exception(), and verror_with_id_cfn().
Referenced by initialize_error_handlers().
Definition at line 478 of file octave.cc.
References disable_warning(), Fallow_noninteger_range_as_index(), Fbeep_on_error(), Fconfirm_recursive_rmdir(), Fcrash_dumps_octave_core(), Fdo_braindead_shortcircuit_evaluation(), Ffixed_point_format(), Fhistory_timestamp_format_string(), Fpage_screen_output(), Fprint_empty_dimensions(), FPS1(), FPS2(), FPS4(), Fsave_default_options(), persist, and set_warning_state().
Referenced by octave_initialize_interpreter().
Definition at line 812 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, interactive, 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 709 of file octave.cc.
References exec_path, F77_CHAR_ARG_LEN, F77_FUNC(), command_editor::force_default_editor(), forced_line_editing, octave_env::get_program_invocation_name(), octave_env::get_program_name(), image_path, 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_ops(), install_signal_handlers(), install_types(), interactive, intern_argv(), isatty(), 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, 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 510 of file octave.cc.
References install_defaults(), octave_execute_interpreter(), octave_initialize_interpreter(), octave_process_command_line(), and sysdep_init().
Definition at line 524 of file octave.cc.
References 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().
Definition at line 947 of file octave.cc.
References check_starting_gui(), and start_gui.
Referenced by main().
|
static |
Definition at line 265 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 161 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(), 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 90 of file octave.cc.
Referenced by octave_interpreter::execute().
char** octave_cmdline_argv |
Definition at line 91 of file octave.cc.
Referenced by octave_interpreter::execute().
int octave_embedded |
Definition at line 92 of file octave.cc.
Referenced by octave_interpreter::execute().
|
static |
Definition at line 99 of file octave.cc.
Referenced by DEFUN(), execute_command_line_file(), and octave_initialize_interpreter().
|
static |
Definition at line 102 of file octave.cc.
Referenced by DEFUN(), execute_command_line_file(), and octave_initialize_interpreter().
|
static |
Definition at line 164 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 167 of file octave.cc.
Referenced by DEFUN(), main(), and octave_starting_gui().
|
static |
Definition at line 170 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().