Operators and Keywords

Function List:

C++ API File Reference

#include <cassert>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <new>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <sys/types.h>
#include <unistd.h>
#include "cmd-edit.h"
#include "file-ops.h"
#include "lo-error.h"
#include "lo-mappers.h"
#include "oct-env.h"
#include "quit.h"
#include "str-vec.h"
#include "oct-locbuf.h"
#include <defaults.h>
#include "defun.h"
#include "error.h"
#include "file-io.h"
#include "input.h"
#include "lex.h"
#include <oct-conf.h>
#include "oct-hist.h"
#include "oct-map.h"
#include "oct-obj.h"
#include "pager.h"
#include "parse.h"
#include "pathsearch.h"
#include "procstream.h"
#include "ov.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


#define SAFE_CALL(F, ARGS)


enum  system_exec_type { et_sync, et_async }


void recover_from_exception (void)
int main_loop (void)
void clean_up_and_exit (int retval)
 DEFUN (quit, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} exit (@var{status})\n\ @deftypefnx {Built-in Function} {} quit (@var{status})\n\ Exit the current Octave session. If the optional integer value\n\ @var{status} is supplied, pass that value to the operating system as the\n\ Octave's exit status. The default value is zero.\n\ @end deftypefn")
 DEFALIAS (exit, quit)
 DEFUN (warranty,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} warranty ()\n\ Describe the conditions for copying and distributing Octave.\n\ @end deftypefn")
 DEFUN (system, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{status}, @var{output}]} system (@var{string}, @var{return_output}, @var{type})\n\ @deftypefnx {Built-in Function} {[@var{status}, @var{output}]} shell_cmd (@var{string}, @var{return_output}, @var{type})\n\ Execute a shell command specified by @var{string}.\n\ If the optional argument @var{type} is @code{\"async\"}, the process\n\ is started in the background and the process id of the child process\n\ is returned immediately. Otherwise, the process is started, and\n\ Octave waits until it exits. If the @var{type} argument is omitted, a\n\ value of @code{\"sync\"} is assumed.\n\ \n\ If the optional argument @var{return_output} is true and the subprocess\n\ is started synchronously, or if @var{system} is called with one input\n\ argument and one or more output arguments, the output from the command\n\ is returned. Otherwise, if the subprocess is executed synchronously, its\n\ output is sent to the standard output. To send the output of a command\n\ executed with @code{system} through the pager, use a command like\n\ \n\ @example\n\ disp (system (cmd, 1));\n\ @end example\n\ \n\ @noindent\n\ or\n\ \n\ @example\n\ printf (\"%s\\n\", system (cmd, 1));\n\ @end example\n\ \n\ The @code{system} function can return two values. The first is the\n\ exit status of the command and the second is any output from the\n\ command that was written to the standard output stream. For example,\n\ \n\ @example\n\ [status, output] = system (\"echo foo; exit 2\");\n\ @end example\n\ \n\ @noindent\n\ will set the variable @code{output} to the string @samp{foo}, and the\n\ variable @code{status} to the integer @samp{2}.\n\ \n\ For commands run asynchronously, @var{status} is the process id of the\n\ command shell that is started to run the command.\n\ @end deftypefn")
 DEFALIAS (shell_cmd, system)
void do_octave_atexit (void)
void octave_add_atexit_function (const std::string &fname)
bool octave_remove_atexit_function (const std::string &fname)
 DEFUN (atexit, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} atexit (@var{fcn})\n\ @deftypefnx {Built-in Function} {} atexit (@var{fcn}, @var{flag})\n\ Register a function to be called when Octave exits. For example,\n\ \n\ @example\n\ @group\n\ function last_words ()\n\ disp (\"Bye bye\");\n\ endfunction\n\ atexit (\"last_words\");\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ will print the message \"Bye bye\" when Octave exits.\n\ \n\ The additional argument @var{flag} will register or unregister\n\ @var{fcn} from the list of functions to be called when Octave\n\ exits. If @var{flag} is true, the function is registered, and if\n\ @var{flag} is false, it is unregistered. For example,\n\ after registering the function @code{last_words} above,\n\ \n\ @example\n\ atexit (\"last_words\", false);\n\ @end example\n\ \n\ @noindent\n\ will remove the function from the list and Octave will not call\n\ @code{last_words} when it exits.\n\ \n\ Note that @code{atexit} only removes the first occurrence of a function\n\ from the list, so if a function was placed in the list multiple\n\ times with @code{atexit}, it must also be removed from the list\n\ multiple times.\n\ @end deftypefn")
 DEFUN (octave_config_info, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} octave_config_info ()\n\ @deftypefnx {Built-in Function} {} octave_config_info (@var{option})\n\ Return a structure containing configuration and installation\n\ information for Octave.\n\ \n\ If @var{option} is a string, return the configuration information for the\n\ specified option.\n\ \n\ @end deftypefn")


void(* octave_exit )(int) = ::exit
bool quit_allowed = true
bool quitting_gracefully = false
int exit_status = 0
bool octave_interpreter_ready = false
bool octave_initialized = false
tree_statement_listglobal_command = 0
std::list< std::string > octave_atexit_functions

Define Documentation

#define IGNORE_EXCEPTION (   E  ) 
catch (E) \
    { \
      std::cerr << "error: ignoring " #E " while preparing to exit" << std::endl; \
      recover_from_exception (); \
#define SAFE_CALL (   F,
try \
    { \
      F ARGS; \
    } \
  IGNORE_EXCEPTION (octave_interrupt_exception) \
  IGNORE_EXCEPTION (octave_execution_exception) \
  IGNORE_EXCEPTION (std::bad_alloc)

Enumeration Type Documentation


Function Documentation

void clean_up_and_exit ( int  retval  ) 
DEFALIAS ( exit  ,
DEFALIAS ( shell_cmd  ,
DEFUN ( system  ,
args  ,
DEFUN ( octave_config_info  ,
DEFUN ( quit  ,
DEFUN ( warranty   ) 
DEFUN ( atexit  ,
args  ,
void do_octave_atexit ( void   ) 
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   ) 

Variable Documentation

int exit_status = 0
std::list<std::string> octave_atexit_functions
void(* octave_exit)(int) = ::exit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines