26 #if defined (HAVE_CONFIG_H)
44 if (
f.is_function_handle ())
48 error (
"onCleanup: no default dispatch for function handle");
57 if (pl !=
nullptr && pl->length () > 0)
58 warning (
"onCleanup: cleanup action takes parameters");
64 error (
"onCleanup: argument must be a function handle");
84 warning (
"save: unable to save onCleanup variables, skipping");
100 warning (
"save: unable to save onCleanup variables, skipping");
118 warning (
"save: unable to save onCleanup variables, skipping");
156 octave::unwind_protect frame;
173 interp.feval (the_fcn);
175 catch (
const octave::interrupt_exception&)
177 interp.recover_from_exception ();
179 warning (
"onCleanup: interrupt occurred in cleanup action");
181 catch (
const octave::execution_exception& ee)
183 interp.recover_from_exception ();
185 std::string msg = ee.message ();
187 warning (
"onCleanup: error caught while executing cleanup function:\n%s\n",
191 catch (
const octave::exit_exception&)
194 warning (
"onCleanup: exit disabled while executing cleanup function");
199 warning (
"onCleanup: internal error: unhandled exception in cleanup action");
205 DEFUN (onCleanup, args, ,
235 if (args.length () != 1)
255 OCTAVE_END_NAMESPACE(
octave)
void newline(std::ostream &os) const
friend class octave_value
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
void call_object_destructor()
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
octave_scalar_map scalar_map_value() const
bool save_binary(std::ostream &os, bool save_as_floats)
bool load_ascii(std::istream &is)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
void print(std::ostream &os, bool pr_as_read_syntax=false)
bool save_ascii(std::ostream &os)
octave_oncleanup()=default
void setfield(const std::string &key, const octave_value &val)
octave::tree_parameter_list * parameter_list()
bool is_undefined() const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning(const char *fmt,...)
void() error(const char *fmt,...)
void interpreter_try(octave::unwind_protect &)
interpreter & __get_interpreter__()
F77_RET_T const F77_DBLE const F77_DBLE * f
FloatComplex(* fptr)(const FloatComplex &, float, int, octave_idx_type &)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
std::atomic< sig_atomic_t > octave_interrupt_state