GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
octave.cc File Reference
#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>
Include dependency graph for octave.cc:

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_typeF77_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

Function Documentation

static bool check_starting_gui ( void  )
static
DEFUN ( __version_info__  ,
args   
)
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 void execute_command_line_file ( const std::string &  fname)
static
static int execute_eval_option_code ( const std::string &  code)
static
static void execute_startup_files ( void  )
static
F77_RET_T F77_FUNC ( xerbla  ,
XERBLA   
)
static void gripe_safe_source_exception ( const std::string &  file,
const std::string &  msg 
)
static

Definition at line 251 of file octave.cc.

Referenced by safe_source_file().

static void initialize_error_handlers ( )
static
static void initialize_version_info ( void  )
static
void install_builtins ( void  )

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().

static void intern_argv ( int  argc,
char **  argv 
)
static
static void lo_error_handler ( const char fmt,
  ... 
)
static

Definition at line 445 of file octave.cc.

References octave_throw_execution_exception(), and verror_with_cfn().

Referenced by initialize_error_handlers().

static void lo_error_with_id_handler ( const char id,
const char fmt,
  ... 
)
static

Definition at line 456 of file octave.cc.

References octave_throw_execution_exception(), and verror_with_id_cfn().

Referenced by initialize_error_handlers().

static void maximum_braindamage ( void  )
static
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  )

Definition at line 947 of file octave.cc.

References check_starting_gui(), and start_gui.

Referenced by main().

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 () 
)
static

Variable Documentation

std::string code_to_eval
static
std::list<std::string> command_line_path
static
std::string exec_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

Definition at line 86 of file octave.cc.

bool force_gui_option = false
static

Definition at line 130 of file octave.cc.

Referenced by check_starting_gui(), and octave_process_command_line().

bool forced_line_editing = false
static

Definition at line 138 of file octave.cc.

Referenced by octave_initialize_interpreter(), and octave_process_command_line().

std::string image_path
static

Definition at line 154 of file octave.cc.

Referenced by octave_initialize_interpreter(), and octave_process_command_line().

bool inhibit_startup_message = false
static
bool line_editing = true
static

Definition at line 106 of file octave.cc.

Referenced by octave_initialize_interpreter(), and octave_process_command_line().

bool no_gui_option = false
static

Definition at line 134 of file octave.cc.

Referenced by check_starting_gui(), and octave_process_command_line().

bool no_window_system = false
static
string_vector octave_argv
static

Definition at line 95 of file octave.cc.

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().

std::string octave_program_invocation_name
static

Definition at line 99 of file octave.cc.

Referenced by DEFUN(), execute_command_line_file(), and octave_initialize_interpreter().

std::string octave_program_name
static

Definition at line 102 of file octave.cc.

Referenced by DEFUN(), execute_command_line_file(), and octave_initialize_interpreter().

bool persist = false
static
bool read_history_file = true
static

Definition at line 142 of file octave.cc.

Referenced by octave_initialize_interpreter(), and octave_process_command_line().

bool read_init_files = true
static

Definition at line 110 of file octave.cc.

Referenced by execute_startup_files(), and octave_process_command_line().

bool read_site_files = true
static

Definition at line 114 of file octave.cc.

Referenced by execute_startup_files(), and octave_process_command_line().

bool set_initial_path = true
static
bool start_gui = false
static

Definition at line 167 of file octave.cc.

Referenced by DEFUN(), main(), and octave_starting_gui().

bool traditional = false
static

Definition at line 170 of file octave.cc.

Referenced by octave_initialize_interpreter(), and octave_process_command_line().

bool verbose_flag = false
static

Definition at line 126 of file octave.cc.

Referenced by execute_startup_files(), and octave_process_command_line().