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
Macros | Enumerations | Functions | Variables
toplev.cc File Reference
#include <cassert>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <new>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <sys/select.h>
#include <sys/types.h>
#include <unistd.h>
#include "cmd-edit.h"
#include "cmd-hist.h"
#include "file-ops.h"
#include "lo-error.h"
#include "lo-mappers.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "quit.h"
#include "singleton-cleanup.h"
#include "str-vec.h"
#include "defaults.h"
#include "defun.h"
#include "error.h"
#include "file-io.h"
#include "graphics.h"
#include "input.h"
#include "lex.h"
#include "load-save.h"
#include "octave-link.h"
#include "oct-conf.h"
#include "oct-conf-features.h"
#include "oct-hist.h"
#include "oct-map.h"
#include "oct-obj.h"
#include "ov.h"
#include "pager.h"
#include "parse.h"
#include "pathsearch.h"
#include "procstream.h"
#include "pt-eval.h"
#include "pt-jump.h"
#include "pt-stmt.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "syswait.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "version.h"
Include dependency graph for toplev.cc:

Go to the source code of this file.

Macros

#define SHELL_PATH   "/bin/sh"

Enumerations

enum  system_exec_type { et_sync, et_async }

Functions

void clean_up_and_exit (int retval, bool safe_to_return)
static void do_octave_atexit (void)
OCTAVE_EXPORT octave_value_list Fatexit (const octave_value_list &args, int nargout)
OCTAVE_EXPORT octave_value_list Foctave_config_info (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fquit (const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Fsystem (const octave_value_list &args, int nargout)
OCTAVE_EXPORT octave_value_list Fwarranty (const octave_value_list &, int)
int main_loop (void)
void octave_add_atexit_function (const std::string &fname)
bool octave_remove_atexit_function (const std::string &fname)
void recover_from_exception (void)
static octave_value_list run_command_and_return_output (const std::string &cmd_str)
static int wait_for_input (int fid)

Variables

static const charbt_fieldnames []
static const octave_fields bt_fields (bt_fieldnames)
int exit_status = 0
static std::list< std::string > octave_atexit_functions
void(* octave_exit )(int) = ::exit
bool octave_initialized = false
bool octave_interpreter_ready = false
bool quit_allowed = true
bool quitting_gracefully = false

Macro Definition Documentation

#define SHELL_PATH   "/bin/sh"

Definition at line 85 of file toplev.cc.

Referenced by Fsystem().

Enumeration Type Documentation

Enumerator:
et_sync 
et_async 

Definition at line 905 of file toplev.cc.

Function Documentation

void clean_up_and_exit ( int  retval,
bool  safe_to_return 
)
static void do_octave_atexit ( void  )
static
OCTAVE_EXPORT octave_value_list Fatexit ( const octave_value_list args,
int  nargout 
)
OCTAVE_EXPORT octave_value_list Foctave_config_info ( const octave_value_list args,
int   
)

Definition at line 1214 of file toplev.cc.

References arg(), octave_scalar_map::assign(), octave_scalar_map::contents(), error(), error_state, oct_mach_info::float_format_as_string(), initialized, Array< T >::is_empty(), octave_scalar_map::isfield(), oct_mach_info::native_float_format(), OCTAVE_API_VERSION, OCTAVE_ARCHLIBDIR, OCTAVE_BINDIR, OCTAVE_CANONICAL_HOST_TYPE, OCTAVE_CONF_ALL_CFLAGS, OCTAVE_CONF_ALL_CXXFLAGS, OCTAVE_CONF_ALL_FFLAGS, OCTAVE_CONF_ALL_LDFLAGS, OCTAVE_CONF_AMD_CPPFLAGS, OCTAVE_CONF_AMD_LDFLAGS, OCTAVE_CONF_AMD_LIBS, OCTAVE_CONF_AR, OCTAVE_CONF_ARFLAGS, OCTAVE_CONF_ARPACK_CPPFLAGS, OCTAVE_CONF_ARPACK_LDFLAGS, OCTAVE_CONF_ARPACK_LIBS, OCTAVE_CONF_BLAS_LIBS, OCTAVE_CONF_CAMD_CPPFLAGS, OCTAVE_CONF_CAMD_LDFLAGS, OCTAVE_CONF_CAMD_LIBS, OCTAVE_CONF_CARBON_LIBS, OCTAVE_CONF_CC, OCTAVE_CONF_CC_VERSION, OCTAVE_CONF_CCOLAMD_CPPFLAGS, OCTAVE_CONF_CCOLAMD_LDFLAGS, OCTAVE_CONF_CCOLAMD_LIBS, OCTAVE_CONF_CFLAGS, OCTAVE_CONF_CHOLMOD_CPPFLAGS, OCTAVE_CONF_CHOLMOD_LDFLAGS, OCTAVE_CONF_CHOLMOD_LIBS, OCTAVE_CONF_COLAMD_CPPFLAGS, OCTAVE_CONF_COLAMD_LDFLAGS, OCTAVE_CONF_COLAMD_LIBS, OCTAVE_CONF_config_opts, OCTAVE_CONF_CPICFLAG, OCTAVE_CONF_CPPFLAGS, OCTAVE_CONF_CURL_CPPFLAGS, OCTAVE_CONF_CURL_LDFLAGS, OCTAVE_CONF_CURL_LIBS, OCTAVE_CONF_CXSPARSE_CPPFLAGS, OCTAVE_CONF_CXSPARSE_LDFLAGS, OCTAVE_CONF_CXSPARSE_LIBS, OCTAVE_CONF_CXX, OCTAVE_CONF_CXX_VERSION, OCTAVE_CONF_CXXCPP, OCTAVE_CONF_CXXFLAGS, OCTAVE_CONF_CXXPICFLAG, OCTAVE_CONF_DEFS, OCTAVE_CONF_DL_LD, OCTAVE_CONF_DL_LDFLAGS, OCTAVE_CONF_DL_LIBS, OCTAVE_CONF_ENABLE_DYNAMIC_LINKING, OCTAVE_CONF_EXEEXT, OCTAVE_CONF_F77, OCTAVE_CONF_F77_FLOAT_STORE_FLAG, OCTAVE_CONF_F77_INTEGER_8_FLAG, OCTAVE_CONF_FC, OCTAVE_CONF_FFLAGS, OCTAVE_CONF_FFTW3_CPPFLAGS, OCTAVE_CONF_FFTW3_LDFLAGS, OCTAVE_CONF_FFTW3_LIBS, OCTAVE_CONF_FFTW3F_CPPFLAGS, OCTAVE_CONF_FFTW3F_LDFLAGS, OCTAVE_CONF_FFTW3F_LIBS, OCTAVE_CONF_FLIBS, OCTAVE_CONF_FONTCONFIG_CFLAGS, OCTAVE_CONF_FPICFLAG, OCTAVE_CONF_FT2_CFLAGS, OCTAVE_CONF_FT2_LIBS, OCTAVE_CONF_GCC_VERSION, OCTAVE_CONF_GLPK_CPPFLAGS, OCTAVE_CONF_GLPK_LDFLAGS, OCTAVE_CONF_GLPK_LIBS, OCTAVE_CONF_GNUPLOT, OCTAVE_CONF_GRAPHICS_CFLAGS, OCTAVE_CONF_GRAPHICS_LIBS, OCTAVE_CONF_GXX_VERSION, OCTAVE_CONF_HDF5_CPPFLAGS, OCTAVE_CONF_HDF5_LDFLAGS, OCTAVE_CONF_HDF5_LIBS, OCTAVE_CONF_LAPACK_LIBS, OCTAVE_CONF_LD_CXX, OCTAVE_CONF_LD_STATIC_FLAG, OCTAVE_CONF_LDFLAGS, OCTAVE_CONF_LEX, OCTAVE_CONF_LEXLIB, OCTAVE_CONF_LFLAGS, OCTAVE_CONF_LIBEXT, OCTAVE_CONF_LIBFLAGS, OCTAVE_CONF_LIBOCTAVE, OCTAVE_CONF_LIBOCTINTERP, OCTAVE_CONF_LIBS, OCTAVE_CONF_LLVM_CPPFLAGS, OCTAVE_CONF_LLVM_LDFLAGS, OCTAVE_CONF_LLVM_LIBS, OCTAVE_CONF_LN_S, OCTAVE_CONF_MAGICK_CPPFLAGS, OCTAVE_CONF_MAGICK_LDFLAGS, OCTAVE_CONF_MAGICK_LIBS, OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS, OCTAVE_CONF_OCT_LINK_DEPS, OCTAVE_CONF_OCT_LINK_OPTS, OCTAVE_CONF_OCTAVE_LINK_DEPS, OCTAVE_CONF_OCTAVE_LINK_OPTS, OCTAVE_CONF_OPENGL_LIBS, OCTAVE_CONF_PCRE_CPPFLAGS, OCTAVE_CONF_PCRE_LIBS, OCTAVE_CONF_PTHREAD_CFLAGS, OCTAVE_CONF_PTHREAD_LIBS, OCTAVE_CONF_QHULL_CPPFLAGS, OCTAVE_CONF_QHULL_LDFLAGS, OCTAVE_CONF_QHULL_LIBS, OCTAVE_CONF_QRUPDATE_CPPFLAGS, OCTAVE_CONF_QRUPDATE_LDFLAGS, OCTAVE_CONF_QRUPDATE_LIBS, OCTAVE_CONF_QT_CPPFLAGS, OCTAVE_CONF_QT_LDFLAGS, OCTAVE_CONF_QT_LIBS, OCTAVE_CONF_RANLIB, OCTAVE_CONF_RDYNAMIC_FLAG, OCTAVE_CONF_READLINE_LIBS, OCTAVE_CONF_SED, OCTAVE_CONF_SH_LD, OCTAVE_CONF_SH_LDFLAGS, OCTAVE_CONF_SHARED_LIBS, OCTAVE_CONF_SHLEXT, OCTAVE_CONF_SHLEXT_VER, OCTAVE_CONF_SONAME_FLAGS, OCTAVE_CONF_STATIC_LIBS, OCTAVE_CONF_TERM_LIBS, OCTAVE_CONF_UMFPACK_CPPFLAGS, OCTAVE_CONF_UMFPACK_LDFLAGS, OCTAVE_CONF_UMFPACK_LIBS, OCTAVE_CONF_USE_64_BIT_IDX_T, OCTAVE_CONF_WARN_CFLAGS, OCTAVE_CONF_WARN_CXXFLAGS, OCTAVE_CONF_X11_INCFLAGS, OCTAVE_CONF_X11_LIBS, OCTAVE_CONF_XTRA_CFLAGS, OCTAVE_CONF_XTRA_CXXFLAGS, OCTAVE_CONF_YACC, OCTAVE_CONF_YFLAGS, OCTAVE_CONF_Z_CPPFLAGS, OCTAVE_CONF_Z_LDFLAGS, OCTAVE_CONF_Z_LIBS, octave_config_features(), OCTAVE_DATADIR, OCTAVE_DATAROOTDIR, OCTAVE_DEFAULT_PAGER, OCTAVE_EXEC_PREFIX, OCTAVE_FCNFILEDIR, OCTAVE_IMAGEDIR, OCTAVE_INCLUDEDIR, OCTAVE_INFODIR, OCTAVE_INFOFILE, OCTAVE_LIBDIR, OCTAVE_LIBEXECDIR, OCTAVE_LOCALAPIARCHLIBDIR, OCTAVE_LOCALAPIFCNFILEDIR, OCTAVE_LOCALAPIOCTFILEDIR, OCTAVE_LOCALARCHLIBDIR, OCTAVE_LOCALFCNFILEDIR, OCTAVE_LOCALOCTFILEDIR, OCTAVE_LOCALSTARTUPFILEDIR, OCTAVE_LOCALVERARCHLIBDIR, OCTAVE_LOCALVERFCNFILEDIR, OCTAVE_LOCALVEROCTFILEDIR, OCTAVE_MAN1DIR, OCTAVE_MAN1EXT, OCTAVE_MANDIR, OCTAVE_OCTETCDIR, OCTAVE_OCTFILEDIR, OCTAVE_OCTINCLUDEDIR, OCTAVE_OCTLIBDIR, OCTAVE_OCTTESTSDIR, OCTAVE_PREFIX, OCTAVE_STARTUPFILEDIR, OCTAVE_VERSION, print_usage(), subst_octave_home(), oct_mach_info::words_big_endian(), and oct_mach_info::words_little_endian().

OCTAVE_EXPORT octave_value_list Fquit ( const octave_value_list args,
int   
)
OCTAVE_EXPORT octave_value_list Fsystem ( const octave_value_list args,
int  nargout 
)
OCTAVE_EXPORT octave_value_list Fwarranty ( const octave_value_list ,
int   
)

Definition at line 805 of file toplev.cc.

References octave_name_version_and_copyright(), and octave_stdout.

int main_loop ( void  )
void octave_add_atexit_function ( const std::string &  fname)

Definition at line 1099 of file toplev.cc.

Referenced by Fatexit().

bool octave_remove_atexit_function ( const std::string &  fname)

Definition at line 1105 of file toplev.cc.

Referenced by Fatexit().

void recover_from_exception ( void  )
static octave_value_list run_command_and_return_output ( const std::string &  cmd_str)
static
static int wait_for_input ( int  fid)
static

Definition at line 831 of file toplev.cc.

Referenced by run_command_and_return_output().

Variable Documentation

const char* bt_fieldnames[]
static
Initial value:
{ "file", "name", "line",
"column", "scope", "context", 0
}

Definition at line 268 of file toplev.cc.

const octave_fields bt_fields(bt_fieldnames)
static
int exit_status = 0

Definition at line 96 of file toplev.cc.

Referenced by execute_eval_option_code(), main_loop(), and safe_source_file().

std::list<std::string> octave_atexit_functions
static

Definition at line 639 of file toplev.cc.

void(* octave_exit)(int) = ::exit

Definition at line 88 of file toplev.cc.

Referenced by clean_up_and_exit().

bool octave_initialized = false
bool octave_interpreter_ready = false

Definition at line 100 of file toplev.cc.

Referenced by execute_pkg_add_or_del(), and octave_initialize_interpreter().

bool quit_allowed = true
bool quitting_gracefully = false