#include <cassert>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <new>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#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>
Defines | |
#define | IGNORE_EXCEPTION(E) |
#define | SAFE_CALL(F, ARGS) |
Enumerations | |
enum | system_exec_type { et_sync, et_async } |
Functions | |
void | recover_from_exception (void) |
int | main_loop (void) |
void | clean_up_and_exit (int retval) |
DEFUN (quit, args, nargout,"-*- 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} {} system (@var{string}, @var{return_output}, @var{type})\n\ Execute a shell command specified by @var{string}. The second\n\ argument is optional. If @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 two input arguments are given (the actual value of\n\ @var{return_output} is irrelevant) and the subprocess is started\n\ synchronously, or if @var{system} is called with one input argument and\n\ one or more output arguments, the output from the command is returned.\n\ Otherwise, if the subprocess is executed synchronously, its output is\n\ sent to the standard output. To send the output of a command executed\n\ with @var{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\ @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 (@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") | |
Variables | |
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_list * | global_command = 0 |
std::list< std::string > | octave_atexit_functions |
#define IGNORE_EXCEPTION | ( | E | ) |
Value:
catch (E) \ { \ std::cerr << "error: ignoring " #E " while preparing to exit" << std::endl; \ recover_from_exception (); \ }
#define SAFE_CALL | ( | F, | |||
ARGS | ) |
Value:
try \ { \ F ARGS; \ } \ IGNORE_EXCEPTION (octave_interrupt_exception) \ IGNORE_EXCEPTION (octave_execution_exception) \ IGNORE_EXCEPTION (std::bad_alloc)
enum system_exec_type |
void clean_up_and_exit | ( | int | retval | ) |
DEFALIAS | ( | shell_cmd | , | |
system | ||||
) |
DEFALIAS | ( | exit | , | |
quit | ||||
) |
DEFUN | ( | octave_config_info | , | |
args | ||||
) |
DEFUN | ( | atexit | , | |
args | , | |||
nargout | ||||
) |
DEFUN | ( | system | , | |
args | , | |||
nargout | ||||
) |
DEFUN | ( | warranty | ) |
DEFUN | ( | quit | , | |
args | , | |||
nargout | ||||
) |
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 | ) |
int exit_status = 0 |
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 |