128 buffer_error_messages = 0;
137 initw.
setfield (
"identifier",
"all");
140 warning_options = initw;
152 vwarning (
const char *
name,
const char *
id,
const char *fmt, va_list args)
159 std::ostringstream output_buf;
167 std::string base_msg = output_buf.str ();
168 std::string msg_string;
171 msg_string = std::string (name) +
": ";
173 msg_string += base_msg +
"\n";
182 std::cerr << msg_string;
187 verror (
bool save_last_error, std::ostream& os,
188 const char *
name,
const char *
id,
const char *fmt, va_list args,
189 bool with_cfn =
false)
194 if (! buffer_error_messages)
201 std::ostringstream output_buf;
205 std::string base_msg = output_buf.str ();
209 std::string msg_string;
211 if (to_beep_or_not_to_beep_p)
215 msg_string += std::string (name) +
": ";
226 std::string cfn = curfcn->
name ();
230 if (cfn.length () > base_msg.length ()
231 || base_msg.compare (0, cfn.length (), cfn) != 0)
233 msg_string += cfn +
' ';
239 msg_string += base_msg +
"\n";
241 if (! error_state && save_last_error)
260 if (! buffer_error_messages)
274 size_t len = strlen (fmt);
278 if (fmt[len - 1] ==
'\n')
283 tmp_fmt[len - 1] =
'\0';
284 verror (
false, std::cerr, 0,
"", tmp_fmt, args);
289 verror (
false, std::cerr, 0,
"", fmt, args);
294 panic (
"pr_where_2: invalid format");
301 va_start (args, fmt);
309 std::list<octave_call_stack::stack_frame> frames
312 size_t nframes = frames.size ();
317 for (std::list<octave_call_stack::stack_frame>::const_iterator p = frames.begin ();
318 p != frames.end (); p++)
322 std::string fcn_name = elt.
fcn_name ();
324 int column = elt.
column ();
327 fcn_name.c_str (), line, column);
337 const char *fmt, va_list args,
bool with_cfn =
false)
339 if (error_state != -2)
343 size_t len = strlen (fmt);
347 if (fmt[len - 1] ==
'\n')
352 std::string tmp_fmt (fmt, len - 1);
353 verror (
true, os, name,
id, tmp_fmt.c_str (),
361 verror (
true, os, name,
id, fmt, args, with_cfn);
369 panic (
"error_1: invalid format");
376 verror (
false, std::cerr, name,
"", fmt, args);
383 va_start (args, fmt);
392 verror (
false, std::cerr, name,
id, fmt, args);
399 va_start (args, fmt);
405 usage_1 (
const char *
id,
const char *fmt, va_list args)
407 verror (
true, std::cerr,
"usage",
id, fmt, args);
421 va_start (args, fmt);
436 va_start (args, fmt);
442 error_2 (
const char *
id,
const char *fmt, va_list args,
bool with_cfn =
false)
446 error_1 (std::cerr,
"error",
id, fmt, args, with_cfn);
479 va_start (args, fmt);
494 va_start (args, fmt);
509 va_start (args, fmt);
524 va_start (args, fmt);
539 else if (state ==
"on")
541 else if (state ==
"error")
563 Cell identifier = warning_options.
contents (
"identifier");
566 bool all_found =
false;
567 bool id_found =
false;
574 if (! all_found && ovs ==
"all")
582 if (! id_found && ovs ==
id)
590 if (all_found && id_found)
604 else if (all_state == 1)
606 if (id_state == 0 || id_state == 2)
611 else if (all_state == 2)
623 warning_1 (
const char *
id,
const char *fmt, va_list args)
633 else if (warn_opt == 1)
635 bool fmt_suppresses_backtrace =
false;
636 size_t fmt_len = fmt ? strlen (fmt) : 0;
637 fmt_suppresses_backtrace = (fmt_len > 0 && fmt[fmt_len-1] ==
'\n');
639 if (fmt_suppresses_backtrace && fmt_len > 1)
642 std::string tmp_fmt (fmt, fmt_len - 1);
643 vwarning (
"warning",
id, tmp_fmt.c_str (), args);
646 vwarning (
"warning",
id, fmt, args);
651 if (! fmt_suppresses_backtrace && in_user_code
684 va_start (args, fmt);
699 va_start (args, fmt);
707 error_1 (std::cerr, 0,
"", fmt, args);
714 va_start (args, fmt);
722 error_1 (std::cerr, 0,
id, fmt, args);
729 va_start (args, fmt);
738 va_start (args, fmt);
739 error_1 (std::cerr, 0,
id, fmt, args);
747 va_start (args, fmt);
748 buffer_error_messages = 0;
750 verror (
false, std::cerr,
"panic",
"", fmt, args);
759 va_start (args, fmt);
770 typedef void (*
error_fun)(
const char *,
const char *, ...);
782 int nargin = args.
length ();
813 size_t len = strlen (msg);
817 if (msg[len - 1] ==
'\n')
822 tmp_msg[len - 1] =
'\0';
823 f (
id,
"%s\n", tmp_msg);
838 DEFUN (rethrow, args, ,
840 @deftypefn {Built-in Function} {} rethrow (@var{err})\n\
841 Reissue a previous error as defined by @var{err}.\n\
843 @var{err} is a structure that must contain at least the @qcode{\"message\"}\n\
844 and @qcode{\"identifier\"} fields. @var{err} can also contain a field\n\
845 @qcode{\"stack\"} that gives information on the assumed location of the\n\
846 error. Typically @var{err} is returned from @code{lasterror}.\n\
847 @seealso{lasterror, lasterr, error}\n\
851 int nargin = args.
length ();
865 int len = msg.length ();
878 if (err_stack.
numel () > 0)
895 char *tmp_msg =
strsave (msg.c_str ());
896 if (tmp_msg[len-1] ==
'\n')
900 tmp_msg[len - 1] =
'\0';
911 Vlast_error_stack = err_stack;
933 pr_where_1 (
"error: called from '%s' near line %d, column %d",
936 pr_where_1 (
"error: called from '%d' near line %d",
948 pr_where_1 (
"error: in file %s near line %d, column %d",
949 file.c_str (), l, c);
960 pr_where_1 (
"error: called from '%s' in file %s near line %d, column %d",
961 nm.c_str (), file.c_str (), l, c);
963 pr_where_1 (
"error: called from '%d' in file %s near line %d",
964 nm.c_str (), file.c_str (), l);
971 error (
"rethrow: ERR structure must contain the fields 'message and 'identifier'");
989 int nargin = args.
length ();
991 bool have_fmt = nargin > 1;
995 std::string arg1 = args(0).string_value ();
1004 if (arg1.find_first_of (
"% \f\n\r\t\v") == std::string::npos
1005 && arg1.find (
':') != std::string::npos
1007 && arg1[arg1.length ()-1] !=
':')
1015 for (
int i = 1; i < nargin; i++)
1016 nargs(i-1) = args(i);
1019 nargs(0) =
"call to " + caller
1020 +
" with message identifier requires message";
1030 @deftypefn {Built-in Function} {} error (@var{template}, @dots{})\n\
1031 @deftypefnx {Built-in Function} {} error (@var{id}, @var{template}, @dots{})\n\
1032 Display an error message and stop m-file execution.\n\
1034 Format the optional arguments under the control of the template string\n\
1035 @var{template} using the same rules as the @code{printf} family of\n\
1036 functions (@pxref{Formatted Output}) and print the resulting message\n\
1037 on the @code{stderr} stream. The message is prefixed by the character\n\
1038 string @samp{error: }.\n\
1040 Calling @code{error} also sets Octave's internal error state such that\n\
1041 control will return to the top level without evaluating any further\n\
1042 commands. This is useful for aborting from functions or scripts.\n\
1044 If the error message does not end with a newline character, Octave will\n\
1045 print a traceback of all the function calls leading to the error. For\n\
1046 example, given the following function definitions:\n\
1050 function f () g (); end\n\
1051 function g () h (); end\n\
1052 function h () nargin == 1 || error (\"nargin != 1\"); end\n\
1057 calling the function @code{f} will result in a list of messages that\n\
1058 can help you to quickly locate the exact location of the error:\n\
1063 error: nargin != 1\n\
1064 error: called from:\n\
1065 error: error at line -1, column -1\n\
1066 error: h at line 1, column 27\n\
1067 error: g at line 1, column 15\n\
1068 error: f at line 1, column 15\n\
1072 If the error message ends in a newline character, Octave will print the\n\
1073 message but will not display any traceback messages as it returns\n\
1074 control to the top level. For example, modifying the error message\n\
1075 in the previous example to end in a newline causes Octave to only print\n\
1076 a single message:\n\
1080 function h () nargin == 1 || error (\"nargin != 1\\n\"); end\n\
1082 error: nargin != 1\n\
1086 A null string (\"\") input to @code{error} will be ignored and the code\n\
1087 will continue running as if the statement were a NOP@. This is for\n\
1088 compatibility with @sc{matlab}. It also makes it possible to write code such\n\
1095 err_msg = \"CONDITION 1 found\";\n\
1096 elseif (CONDITION2)\n\
1097 err_msg = \"CONDITION 2 found\";\n\
1105 which will only stop execution if an error has been found.\n\
1107 Implementation Note: For compatibility with @sc{matlab}, escape\n\
1108 sequences in @var{template} (e.g., @qcode{\"@xbackslashchar{}n\"} =>\n\
1109 newline) are processed regardless of whether @var{template} has been defined\n\
1110 with single quotes, as long as there are two or more input arguments. To\n\
1111 disable escape sequence expansion use a second backslash before the sequence\n\
1112 (e.g., @qcode{\"@xbackslashchar{}@xbackslashchar{}n\"}) or use the\n\
1113 @code{regexptranslate} function.\n\
1114 @seealso{warning, lasterror}\n\
1119 int nargin = args.
length ();
1129 bool have_fmt =
false;
1131 if (nargin == 1 && args(0).
is_map ())
1185 std::string
id = id_arg;
1203 val =
state(i).string_value ();
1215 val =
state(i).string_value ();
1224 retval.
assign (
"identifier",
id);
1225 retval.
assign (
"state", val);
1228 error (
"warning: unable to find default warning state!");
1236 std::string retval =
"on";
1247 retval =
state(i).string_value ();
1265 if (all_state ==
"on")
1266 os <<
"By default, warnings are enabled.";
1267 else if (all_state ==
"off")
1268 os <<
"By default, warnings are disabled.";
1269 else if (all_state ==
"error")
1270 os <<
"By default, warnings are treated as errors.";
1281 std::string tid = ident(i).string_value ();
1282 std::string tst =
state(i).string_value ();
1284 os << std::setw (7) << tst <<
" " << tid <<
"\n";
1301 if (state !=
"on" && state !=
"off" && state !=
"error")
1302 error (
"invalid warning state: %s", state.c_str ());
1317 if (state == all_state)
1319 for (i = i + 1; i < nel; i++)
1331 warning_options.
clear ();
1333 warning_options.
assign (
"identifier", tid);
1334 warning_options.
assign (
"state", tst);
1348 warning_options.
clear ();
1350 warning_options.
assign (
"identifier", tid);
1351 warning_options.
assign (
"state", tst);
1356 @deftypefn {Built-in Function} {} warning (@var{template}, @dots{})\n\
1357 @deftypefnx {Built-in Function} {} warning (@var{id}, @var{template}, @dots{})\n\
1358 @deftypefnx {Built-in Function} {} warning (\"on\", @var{id})\n\
1359 @deftypefnx {Built-in Function} {} warning (\"off\", @var{id})\n\
1360 @deftypefnx {Built-in Function} {} warning (\"query\", @var{id})\n\
1361 @deftypefnx {Built-in Function} {} warning (\"error\", @var{id})\n\
1362 @deftypefnx {Built-in Function} {} warning (@var{state}, \"backtrace\")\n\
1363 @deftypefnx {Built-in Function} {} warning (@var{state}, @var{id}, \"local\")\n\
1364 Display a warning message or control the behavior of Octave's warning system.\n\
1366 Format the optional arguments under the control of the template string\n\
1367 @var{template} using the same rules as the @code{printf} family of\n\
1368 functions (@pxref{Formatted Output}) and print the resulting message\n\
1369 on the @code{stderr} stream. The message is prefixed by the character\n\
1370 string @samp{warning: }.\n\
1371 You should use this function when you want to notify the user\n\
1372 of an unusual condition, but only when it makes sense for your program\n\
1375 The optional message identifier allows users to enable or disable\n\
1376 warnings tagged by @var{id}. A message identifier is of the form\n\
1377 \"NAMESPACE:WARNING-NAME\". Octave's own warnings use the @qcode{\"Octave\"}\n\
1378 namespace (@pxref{XREFwarning_ids}). The special identifier @qcode{\"all\"}\n\
1379 may be used to set the state of all warnings.\n\
1381 If the first argument is @qcode{\"on\"} or @qcode{\"off\"},\n\
1382 set the state of a particular warning using the identifier @var{id}. If the\n\
1383 first argument is @qcode{\"query\"}, query the state of this warning\n\
1384 instead. If the identifier is omitted, a value of @qcode{\"all\"} is\n\
1385 assumed. If you set the state of a warning to @qcode{\"error\"}, the\n\
1386 warning named by @var{id} is handled as if it were an error instead. So,\n\
1387 for example, the following handles all warnings as errors:\n\
1391 warning (\"error\");\n\
1395 If the state is @qcode{\"on\"} or @qcode{\"off\"} and the third argument\n\
1396 is @qcode{\"backtrace\"}, then a stack trace is printed along with the\n\
1397 warning message when warnings occur inside function calls. This option\n\
1398 is enabled by default.\n\
1400 If the state is @qcode{\"on\"}, @qcode{\"off\"}, or @qcode{\"error\"}\n\
1401 and the third argument is @qcode{\"local\"}, then the warning state\n\
1402 will be set temporarily, until the end of the current function.\n\
1403 Changes to warning states that are set locally affect the current\n\
1404 function and all functions called from the current scope. The\n\
1405 previous warning state is restored on return from the current\n\
1406 function. The @qcode{\"local\"} option is ignored if used in the top-level\n\
1409 Implementation Note: For compatibility with @sc{matlab}, escape\n\
1410 sequences in @var{template} (e.g., @qcode{\"@xbackslashchar{}n\"} =>\n\
1411 newline) are processed regardless of whether @var{template} has been defined\n\
1412 with single quotes, as long as there are two or more input arguments. To\n\
1413 disable escape sequence expansion use a second backslash before the sequence\n\
1414 (e.g., @qcode{\"@xbackslashchar{}@xbackslashchar{}n\"}) or use the\n\
1415 @code{regexptranslate} function.\n\
1416 @seealso{warning_ids, lastwarn, error}\n\
1421 int nargin = args.
length ();
1422 int argc = nargin + 1;
1426 if (argc > 1 && args.all_strings_p ())
1432 std::string arg1 = argv(1);
1433 std::string arg2 =
"all";
1438 if (arg1 ==
"on" || arg1 ==
"off" || arg1 ==
"error")
1442 if (argc == 4 && argv(3) ==
"local"
1469 fields(0) =
"identifier";
1470 fields(1) =
"state";
1484 for (i = 0; i < nel; i++)
1486 std::string
id = ids(i).string_value ();
1493 states(i) = curr_state;
1507 states(nel) = curr_state;
1514 (
".saved_warning_states.", m, scope, context);
1537 && warning_options.
contains (
"identifier"))
1552 if (key ==
"Octave:language-extension"
1553 || key ==
"Octave:single-quote-string")
1567 tmp.
assign (
"identifier",
id);
1568 tmp.
assign (
"state", st);
1570 warning_options = tmp;
1574 else if (arg2 ==
"backtrace")
1576 if (arg1 !=
"error")
1582 else if (arg2 ==
"debug")
1584 if (arg1 !=
"error")
1590 else if (arg2 ==
"verbose")
1592 if (arg1 !=
"error")
1598 else if (arg2 ==
"quiet")
1600 if (arg1 !=
"error")
1616 if (done && nargout > 0)
1617 retval = old_warning_options;
1619 else if (arg1 ==
"query")
1623 else if (arg2 ==
"backtrace" || arg2 ==
"debug"
1624 || arg2 ==
"verbose" || arg2 ==
"quiet")
1627 tmp.
assign (
"identifier", arg2);
1628 if (arg2 ==
"backtrace")
1630 else if (arg2 ==
"debug")
1632 else if (arg2 ==
"verbose")
1676 std::string tst =
state(i).string_value ();
1677 std::string tid = ident(i).string_value ();
1686 error (
"warning: expecting structure with fields 'identifier' and 'state'");
1691 retval = old_warning_options;
1695 if (! (error_state || done))
1709 "unspecified warning", nargs,
1763 DEFUN (lasterror, args, ,
1765 @deftypefn {Built-in Function} {@var{lasterr} =} lasterror ()\n\
1766 @deftypefnx {Built-in Function} {} lasterror (@var{err})\n\
1767 @deftypefnx {Built-in Function} {} lasterror (\"reset\")\n\
1768 Query or set the last error message structure.\n\
1770 When called without arguments, return a structure containing the last error\n\
1771 message and other information related to this error. The elements of the\n\
1776 The text of the last error message\n\
1779 The message identifier of this error message\n\
1782 A structure containing information on where the message occurred. This may\n\
1783 be an empty structure if the information cannot be obtained. The fields of\n\
1784 the structure are:\n\
1788 The name of the file where the error occurred\n\
1791 The name of function in which the error occurred\n\
1794 The line number at which the error occurred\n\
1797 An optional field with the column number at which the error occurred\n\
1801 The last error structure may be set by passing a scalar structure, @var{err},\n\
1802 as input. Any fields of @var{err} that match those above are set while any\n\
1803 unspecified fields are initialized with default values.\n\
1805 If @code{lasterror} is called with the argument @qcode{\"reset\"}, all\n\
1806 fields are set to their default values.\n\
1807 @seealso{lasterr, error, lastwarn}\n\
1811 int nargin = args.
length ();
1839 error (
"lasterror: unrecognized string argument");
1841 else if (args(0).
is_map ())
1845 std::string new_error_message;
1846 std::string new_error_id;
1847 std::string new_error_file;
1848 std::string new_error_name;
1849 int new_error_line = -1;
1850 int new_error_column = -1;
1852 if (! error_state && new_err.
contains (
"message"))
1854 const std::string tmp =
1856 new_error_message = tmp;
1859 if (! error_state && new_err.
contains (
"identifier"))
1861 const std::string tmp =
1866 if (! error_state && new_err.
contains (
"stack"))
1871 if (! error_state && new_err_stack.
contains (
"file"))
1873 const std::string tmp =
1875 new_error_file = tmp;
1878 if (! error_state && new_err_stack.
contains (
"name"))
1880 const std::string tmp =
1882 new_error_name = tmp;
1885 if (! error_state && new_err_stack.
contains (
"line"))
1889 new_error_line = tmp;
1892 if (! error_state && new_err_stack.
contains (
"column"))
1896 new_error_column = tmp;
1907 new_err_stack.
setfield (
"file", new_error_file);
1908 new_err_stack.
setfield (
"name", new_error_name);
1909 new_err_stack.
setfield (
"line", new_error_line);
1910 new_err_stack.
setfield (
"column", new_error_column);
1911 Vlast_error_stack = new_err_stack;
1924 error (
"lasterror: argument must be a structure or a string");
1936 DEFUN (lasterr, args, nargout,
1938 @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lasterr ()\n\
1939 @deftypefnx {Built-in Function} {} lasterr (@var{msg})\n\
1940 @deftypefnx {Built-in Function} {} lasterr (@var{msg}, @var{msgid})\n\
1941 Query or set the last error message.\n\
1943 When called without input arguments, return the last error message and\n\
1944 message identifier.\n\
1946 With one argument, set the last error message to @var{msg}.\n\
1948 With two arguments, also set the last message identifier.\n\
1949 @seealso{lasterror, error, lastwarn}\n\
1959 int argc = args.length () + 1;
1976 if (argc == 1 || nargout > 0)
1978 retval(1) = prev_error_id;
1979 retval(0) = prev_error_message;
1983 error (
"lasterr: all arguments must be strings");
1991 DEFUN (lastwarn, args, nargout,
1993 @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lastwarn ()\n\
1994 @deftypefnx {Built-in Function} {} lastwarn (@var{msg})\n\
1995 @deftypefnx {Built-in Function} {} lastwarn (@var{msg}, @var{msgid})\n\
1996 Query or set the last warning message.\n\
1998 When called without input arguments, return the last warning message and\n\
1999 message identifier.\n\
2001 With one argument, set the last warning message to @var{msg}.\n\
2003 With two arguments, also set the last message identifier.\n\
2004 @seealso{warning, lasterror, lasterr}\n\
2009 int argc = args.
length () + 1;
2026 if (argc == 1 || nargout > 0)
2029 retval(1) = prev_warning_id;
2030 retval(0) = prev_warning_message;
2034 error (
"lastwarn: all arguments must be strings");
2043 DEFUN (__usage__, args, ,
2045 @deftypefn {Built-in Function} {} usage (@var{msg})\n\
2046 Print the message @var{msg}, prefixed by the string @samp{usage: }, and\n\
2047 set Octave's internal error state such that control will return to the\n\
2048 top level without evaluating any more commands. This is useful for\n\
2049 aborting from functions.\n\
2051 After @code{usage} is evaluated, Octave will print a traceback of all\n\
2052 the function calls leading to the usage message.\n\
2054 You should use this function for reporting problems errors that result\n\
2055 from an improper call to a function, such as calling a function with an\n\
2056 incorrect number of arguments, or with arguments of the wrong type. For\n\
2057 example, most functions distributed with Octave begin with code like\n\
2063 usage (\"foo (a, b)\");\n\
2069 to check for the proper number of arguments.\n\
2077 DEFUN (beep_on_error, args, nargout,
2079 @deftypefn {Built-in Function} {@var{val} =} beep_on_error ()\n\
2080 @deftypefnx {Built-in Function} {@var{old_val} =} beep_on_error (@var{new_val})\n\
2081 @deftypefnx {Built-in Function} {} beep_on_error (@var{new_val}, \"local\")\n\
2082 Query or set the internal variable that controls whether Octave will try\n\
2083 to ring the terminal bell before printing an error message.\n\
2085 When called from inside a function with the @qcode{\"local\"} option, the\n\
2086 variable is changed locally for the function and any subroutines it calls.\n\
2087 The original variable value is restored when exiting the function.\n\
2093 DEFUN (debug_on_error, args, nargout,
2095 @deftypefn {Built-in Function} {@var{val} =} debug_on_error ()\n\
2096 @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_error (@var{new_val})\n\
2097 @deftypefnx {Built-in Function} {} debug_on_error (@var{new_val}, \"local\")\n\
2098 Query or set the internal variable that controls whether Octave will try\n\
2099 to enter the debugger when an error is encountered.\n\
2101 This will also inhibit printing of the normal traceback message (you will\n\
2102 only see the top-level error message).\n\
2104 When called from inside a function with the @qcode{\"local\"} option, the\n\
2105 variable is changed locally for the function and any subroutines it calls.\n\
2106 The original variable value is restored when exiting the function.\n\
2107 @seealso{debug_on_warning, debug_on_interrupt}\n\
2113 DEFUN (debug_on_warning, args, nargout,
2115 @deftypefn {Built-in Function} {@var{val} =} debug_on_warning ()\n\
2116 @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_warning (@var{new_val})\n\
2117 @deftypefnx {Built-in Function} {} debug_on_warning (@var{new_val}, \"local\")\n\
2118 Query or set the internal variable that controls whether Octave will try\n\
2119 to enter the debugger when a warning is encountered.\n\
2121 When called from inside a function with the @qcode{\"local\"} option, the\n\
2122 variable is changed locally for the function and any subroutines it calls.\n\
2123 The original variable value is restored when exiting the function.\n\
2124 @seealso{debug_on_error, debug_on_interrupt}\n\
2168 buffer_error_messages++;
int warning_enabled(const std::string &id)
void panic(const char *fmt,...)
void warning_with_id(const char *id, const char *fmt,...)
size_t octave_vformat(std::ostream &os, const char *fmt, va_list args)
const Cell & contents(const_iterator p) const
octave_idx_type nfields(void) const
std::string fcn_name(bool print_subfn=true) const
static void display_warning_options(std::ostream &os)
static bool at_top_level(void)
static bool Vbeep_on_error
void vparse_error(const char *fmt, va_list args)
void assign(const std::string &k, const Cell &val)
static uint32_t state[624]
static void pr_where_2(const char *fmt, va_list args)
static std::string default_warning_state(void)
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
void verror_with_id(const char *id, const char *fmt, va_list args)
void rethrow_error(const char *id, const char *fmt,...)
octave_idx_type length(void) const
const octave_value & contents(const_iterator p) const
octave_map map_value(void) const
virtual int nint_value(bool=false) const
bool contains(const std::string &name) const
bool is_defined(void) const
static void vwarning(const char *name, const char *id, const char *fmt, va_list args)
bool contains(const std::string &name) const
static char * strsave(const char *s)
void vmessage(const char *name, const char *fmt, va_list args)
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
std::string name(void) const
#define SET_INTERNAL_VARIABLE(NM)
static octave_function * current(void)
void setfield(const std::string &key, const octave_value &val)
static octave_map initialize_last_error_stack(void)
void interpreter_try(unwind_protect &frame)
static std::string Vlast_error_message
void message_with_id(const char *name, const char *id, const char *fmt,...)
octave_idx_type numel(void) const
static bool Vverbose_warning
static void error_2(const char *id, const char *fmt, va_list args, bool with_cfn=false)
octave_value_list set_warning_state(const std::string &id, const std::string &state)
static std::string Vlast_warning_id
static bool maybe_extract_message_id(const std::string &caller, const octave_value_list &args, octave_value_list &nargs, std::string &id)
void usage(const char *fmt,...)
void usage_with_id(const char *id, const char *fmt,...)
bool is_empty(void) const
static octave_value varval(const std::string &name, scope_id scope=xcurrent_scope, context_id context=xdefault_context)
virtual symbol_table::scope_id scope(void)
std::string last_warning_id(void)
virtual bool is_map(void) const
static std::string Vlast_warning_message
static bool Vquiet_warning
static std::string handle_message(error_fun f, const char *id, const char *msg, const octave_value_list &args, bool have_fmt)
static bool Vbacktrace_on_warning
void message(const char *name, const char *fmt,...)
void verror_with_cfn(const char *fmt, va_list args)
int buffer_error_messages
static octave_user_code * caller_user_code(size_t nskip=0)
void verror_with_id_cfn(const char *id, const char *fmt, va_list args)
static void pr_where(const char *who)
F77_RET_T const double const double * f
static symbol_table::scope_id current_scope(void)
static size_t current_frame(void)
static octave_scalar_map warning_query(const std::string &id_arg)
void defun_usage_message(const std::string &msg)
static octave_map Vlast_error_stack
static llvm::LLVMContext & context
std::string string_value(bool force=false) const
void error_with_cfn(const char *fmt,...)
virtual std::string string_value(bool force=false) const
void error_with_id(const char *id, const char *fmt,...)
int nint_value(bool frc_str_conv=false) const
static void pr_where_1(const char *fmt,...)
octave_map last_error_stack(void)
void vusage_with_id(const char *id, const char *fmt, va_list args)
bool is_string(void) const
void vparse_error_with_id(const char *id, const char *fmt, va_list args)
static void set_warning_option(const std::string &state, const std::string &ident)
void resize(const dim_vector &dv, const T &rfv)
OCTAVE_EXPORT octave_value_list Fwarning(const octave_value_list &args, int nargout)
void initialize_default_warning_state(void)
void vmessage_with_id(const char *name, const char *id, const char *fmt, va_list args)
std::string last_warning_message(void)
#define panic_impossible()
void reset_error_handler(void)
static void assign(const std::string &name, const octave_value &value=octave_value(), scope_id scope=xcurrent_scope, context_id context=xdefault_context, bool force_add=false)
octave_idx_type length(void) const
static void warning_1(const char *id, const char *fmt, va_list args)
void parse_error(const char *fmt,...)
static void error_1(std::ostream &os, const char *name, const char *id, const char *fmt, va_list args, bool with_cfn=false)
void vusage(const char *fmt, va_list args)
void disable_warning(const std::string &id)
void warning(const char *fmt,...)
bool is_empty(void) const
void usage_1(const char *id, const char *fmt, va_list args)
static void defun_usage_message_1(const char *fmt,...)
static size_t current_frame
static std::string Vlast_error_id
octave_scalar_map scalar_map_value(void) const
static octave_map warning_options
static void verror(bool save_last_error, std::ostream &os, const char *name, const char *id, const char *fmt, va_list args, bool with_cfn=false)
virtual bool is_string(void) const
void assign(const std::string &k, const octave_value &val)
static symbol_table::context_id current_context(void)
void error_with_id_cfn(const char *id, const char *fmt,...)
void(* error_fun)(const char *, const char *,...)
static void initialize_warning_options(const std::string &state)
static std::list< octave_call_stack::stack_frame > backtrace_frames(size_t nskip=0)
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
void parse_error_with_id(const char *id, const char *fmt,...)
std::string last_error_id(void)
octave_value getfield(const std::string &key) const
void resize(const dim_vector &dv, bool fill=false)
static octave_map empty_backtrace(void)
void vwarning_with_id(const char *id, const char *fmt, va_list args)
bool discard_warning_messages
bool discard_error_messages
static int check_state(const std::string &state)
octave_value_list Fsprintf(const octave_value_list &, int)
static octave_map backtrace(size_t nskip=0)
std::string last_error_message(void)