comparison libinterp/corefcn/error.h @ 31607:aac27ad79be6 stable

maint: Re-indent code after switch to using namespace macros. * build-env.h, build-env.in.cc, Cell.h, __betainc__.cc, __eigs__.cc, __ftp__.cc, __ichol__.cc, __ilu__.cc, __isprimelarge__.cc, __magick_read__.cc, __pchip_deriv__.cc, amd.cc, base-text-renderer.cc, base-text-renderer.h, besselj.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.h, call-stack.cc, call-stack.h, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc, dasrt.cc, data.cc, debug.cc, defaults.cc, defaults.h, det.cc, display.cc, display.h, dlmread.cc, dynamic-ld.cc, dynamic-ld.h, ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.h, event-manager.cc, event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h, fft.cc, fft2.cc, file-io.cc, filter.cc, find.cc, ft-text-renderer.cc, ft-text-renderer.h, gcd.cc, gl-render.cc, gl-render.h, gl2ps-print.cc, gl2ps-print.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc, gsvd.cc, gtk-manager.cc, gtk-manager.h, help.cc, help.h, hook-fcn.cc, hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h, inv.cc, jsondecode.cc, jsonencode.cc, latex-text-renderer.cc, latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h, lookup.cc, ls-hdf5.cc, ls-mat4.cc, ls-mat5.cc, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex.cc, mexproto.h, mxarray.h, mxtypes.in.h, oct-errno.in.cc, oct-hdf5-types.cc, oct-hist.cc, oct-hist.h, oct-map.cc, oct-map.h, oct-opengl.h, oct-prcstrm.h, oct-process.cc, oct-process.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, octave-default-image.h, ordqz.cc, ordschur.cc, pager.cc, pager.h, pinv.cc, pow2.cc, pr-output.cc, psi.cc, qr.cc, quadcc.cc, rand.cc, regexp.cc, settings.cc, settings.h, sighandlers.cc, sighandlers.h, sparse-xpow.cc, sqrtm.cc, stack-frame.cc, stack-frame.h, stream-euler.cc, strfns.cc, svd.cc, syminfo.cc, syminfo.h, symrcm.cc, symrec.cc, symrec.h, symscope.cc, symscope.h, symtab.cc, symtab.h, sysdep.cc, sysdep.h, text-engine.cc, text-engine.h, text-renderer.cc, text-renderer.h, time.cc, toplev.cc, typecast.cc, url-handle-manager.cc, url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc, variables.h, xdiv.cc, __delaunayn__.cc, __init_fltk__.cc, __init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audioread.cc, convhulln.cc, gzip.cc, cdef-class.cc, cdef-class.h, cdef-fwd.h, cdef-manager.cc, cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h, cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h, cdef-utils.cc, cdef-utils.h, ov-base-diag.cc, ov-base-int.cc, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc, ov-base.cc, ov-base.h, ov-bool-mat.cc, ov-bool-mat.h, ov-bool-sparse.cc, ov-bool.cc, ov-builtin.h, ov-cell.cc, ov-ch-mat.cc, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h, ov-complex.cc, ov-cx-diag.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-dld-fcn.cc, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h, ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc, ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-flt-re-mat.h, ov-intx.h, ov-java.cc, ov-lazy-idx.cc, ov-legacy-range.cc, ov-magic-int.cc, ov-mex-fcn.cc, ov-mex-fcn.h, ov-null-mat.cc, ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc, ov-re-mat.h, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc, ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, ovl.h, octave.cc, octave.h, op-b-sbm.cc, op-bm-sbm.cc, op-cs-scm.cc, op-fm-fcm.cc, op-fs-fcm.cc, op-s-scm.cc, op-scm-cs.cc, op-scm-s.cc, op-sm-cs.cc, ops.h, anon-fcn-validator.cc, anon-fcn-validator.h, bp-table.cc, bp-table.h, comment-list.cc, comment-list.h, filepos.h, lex.h, oct-lvalue.cc, oct-lvalue.h, parse.h, profiler.cc, profiler.h, pt-anon-scopes.cc, pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h, pt-args-block.cc, pt-args-block.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h, pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h, pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc, pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc, pt-id.h, pt-idx.cc, pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-spmd.cc, pt-spmd.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-walk.cc, pt-walk.h, pt.cc, pt.h, token.cc, token.h, Range.cc, Range.h, idx-vector.cc, idx-vector.h, range-fwd.h, CollocWt.cc, CollocWt.h, aepbalance.cc, aepbalance.h, chol.cc, chol.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h, lo-mappers.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h, oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc, randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h, lo-sysinfo.cc, lo-sysinfo.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h, oct-password.cc, oct-password.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h, action-container.cc, action-container.h, base-list.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, f77-fcn.h, file-info.cc, file-info.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-hash.cc, lo-hash.h, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-utils.cc, lo-utils.h, oct-base64.cc, oct-base64.h, oct-glob.cc, oct-glob.h, oct-inttypes.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h, oct-sparse.cc, oct-sparse.h, oct-string.h, octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc, quit.h, unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h: Re-indent code after switch to using namespace macros.
author Rik <rik@octave.org>
date Thu, 01 Dec 2022 18:02:15 -0800
parents e88a07dec498
children 23664317f0d3 597f3ee61a48
comparison
equal deleted inserted replaced
31605:e88a07dec498 31607:aac27ad79be6
40 40
41 OCTAVE_BEGIN_NAMESPACE(octave) 41 OCTAVE_BEGIN_NAMESPACE(octave)
42 42
43 class execution_exception; 43 class execution_exception;
44 44
45 class error_system 45 class error_system
46 { 46 {
47 public: 47 public:
48 48
49 OCTINTERP_API error_system (interpreter& interp); 49 OCTINTERP_API error_system (interpreter& interp);
50 50
51 error_system (const error_system&) = delete; 51 error_system (const error_system&) = delete;
52 52
53 error_system& operator = (const error_system&) = delete; 53 error_system& operator = (const error_system&) = delete;
54 54
55 ~error_system (void) = default; 55 ~error_system (void) = default;
56 56
57 OCTINTERP_API octave_value 57 OCTINTERP_API octave_value
58 debug_on_error (const octave_value_list& args, int nargout); 58 debug_on_error (const octave_value_list& args, int nargout);
59 59
60 void set_debug_on_error (bool flag) { m_debug_on_error = flag; } 60 void set_debug_on_error (bool flag) { m_debug_on_error = flag; }
61 61
62 bool debug_on_error (void) const { return m_debug_on_error; } 62 bool debug_on_error (void) const { return m_debug_on_error; }
63 63
64 bool debug_on_error (bool flag) 64 bool debug_on_error (bool flag)
65 { 65 {
66 bool val = m_debug_on_error; 66 bool val = m_debug_on_error;
67 m_debug_on_error = flag; 67 m_debug_on_error = flag;
68 return val; 68 return val;
69 } 69 }
70 70
71 OCTINTERP_API octave_value 71 OCTINTERP_API octave_value
72 debug_on_caught (const octave_value_list& args, int nargout); 72 debug_on_caught (const octave_value_list& args, int nargout);
73 73
74 void set_debug_on_caught (bool flag) { m_debug_on_caught = flag; } 74 void set_debug_on_caught (bool flag) { m_debug_on_caught = flag; }
75 75
76 bool debug_on_caught (void) const { return m_debug_on_caught; } 76 bool debug_on_caught (void) const { return m_debug_on_caught; }
77 77
78 bool debug_on_caught (bool flag) 78 bool debug_on_caught (bool flag)
79 { 79 {
80 bool val = m_debug_on_caught; 80 bool val = m_debug_on_caught;
81 m_debug_on_caught = flag; 81 m_debug_on_caught = flag;
82 return val; 82 return val;
83 } 83 }
84 84
85 OCTINTERP_API octave_value 85 OCTINTERP_API octave_value
86 debug_on_warning (const octave_value_list& args, int nargout); 86 debug_on_warning (const octave_value_list& args, int nargout);
87 87
88 void set_debug_on_warning (bool flag) { m_debug_on_warning = flag; } 88 void set_debug_on_warning (bool flag) { m_debug_on_warning = flag; }
89 89
90 bool debug_on_warning (void) const { return m_debug_on_warning; } 90 bool debug_on_warning (void) const { return m_debug_on_warning; }
91 91
92 bool debug_on_warning (bool flag) 92 bool debug_on_warning (bool flag)
93 { 93 {
94 bool val = m_debug_on_warning; 94 bool val = m_debug_on_warning;
95 m_debug_on_warning = flag; 95 m_debug_on_warning = flag;
96 return val; 96 return val;
97 } 97 }
98 98
99 OCTINTERP_API octave_value 99 OCTINTERP_API octave_value
100 discard_warning_messages (const octave_value_list& args, int nargout); 100 discard_warning_messages (const octave_value_list& args, int nargout);
101 101
102 void set_discard_warning_messages (bool flag) 102 void set_discard_warning_messages (bool flag)
103 { 103 {
104 m_discard_warning_messages = flag; 104 m_discard_warning_messages = flag;
105 } 105 }
106 106
107 bool discard_warning_messages (void) const 107 bool discard_warning_messages (void) const
108 { 108 {
109 return m_discard_warning_messages; 109 return m_discard_warning_messages;
110 } 110 }
111 111
112 bool discard_warning_messages (bool flag) 112 bool discard_warning_messages (bool flag)
113 { 113 {
114 bool val = m_discard_warning_messages; 114 bool val = m_discard_warning_messages;
115 m_discard_warning_messages = flag; 115 m_discard_warning_messages = flag;
116 return val; 116 return val;
117 } 117 }
118 118
119 OCTINTERP_API octave_value 119 OCTINTERP_API octave_value
120 beep_on_error (const octave_value_list& args, int nargout); 120 beep_on_error (const octave_value_list& args, int nargout);
121 121
122 void set_beep_on_error (bool flag) { m_beep_on_error = flag; } 122 void set_beep_on_error (bool flag) { m_beep_on_error = flag; }
123 123
124 bool beep_on_error (void) const { return m_beep_on_error; } 124 bool beep_on_error (void) const { return m_beep_on_error; }
125 125
126 bool beep_on_error (bool flag) 126 bool beep_on_error (bool flag)
127 { 127 {
128 bool val = m_beep_on_error; 128 bool val = m_beep_on_error;
129 m_beep_on_error = flag; 129 m_beep_on_error = flag;
130 return val; 130 return val;
131 } 131 }
132 132
133 OCTINTERP_API octave_value 133 OCTINTERP_API octave_value
134 backtrace_on_warning (const octave_value_list& args, int nargout); 134 backtrace_on_warning (const octave_value_list& args, int nargout);
135 135
136 void set_backtrace_on_warning (bool flag) { m_backtrace_on_warning = flag; } 136 void set_backtrace_on_warning (bool flag) { m_backtrace_on_warning = flag; }
137 137
138 bool backtrace_on_warning (void) const { return m_backtrace_on_warning; } 138 bool backtrace_on_warning (void) const { return m_backtrace_on_warning; }
139 139
140 bool backtrace_on_warning (bool flag) 140 bool backtrace_on_warning (bool flag)
141 { 141 {
142 bool val = m_backtrace_on_warning; 142 bool val = m_backtrace_on_warning;
143 m_backtrace_on_warning = flag; 143 m_backtrace_on_warning = flag;
144 return val; 144 return val;
145 } 145 }
146 146
147 OCTINTERP_API octave_value 147 OCTINTERP_API octave_value
148 verbose_warning (const octave_value_list& args, int nargout); 148 verbose_warning (const octave_value_list& args, int nargout);
149 149
150 void set_verbose_warning (bool flag) { m_verbose_warning = flag; } 150 void set_verbose_warning (bool flag) { m_verbose_warning = flag; }
151 151
152 bool verbose_warning (void) const { return m_verbose_warning; } 152 bool verbose_warning (void) const { return m_verbose_warning; }
153 153
154 bool verbose_warning (bool flag) 154 bool verbose_warning (bool flag)
155 { 155 {
156 bool val = m_verbose_warning; 156 bool val = m_verbose_warning;
157 m_verbose_warning = flag; 157 m_verbose_warning = flag;
158 return val; 158 return val;
159 } 159 }
160 160
161 OCTINTERP_API octave_value 161 OCTINTERP_API octave_value
162 quiet_warning (const octave_value_list& args, int nargout); 162 quiet_warning (const octave_value_list& args, int nargout);
163 163
164 void set_quiet_warning (bool flag) { m_quiet_warning = flag; } 164 void set_quiet_warning (bool flag) { m_quiet_warning = flag; }
165 165
166 bool quiet_warning (void) const { return m_quiet_warning; } 166 bool quiet_warning (void) const { return m_quiet_warning; }
167 167
168 bool quiet_warning (bool flag) 168 bool quiet_warning (bool flag)
169 { 169 {
170 bool val = m_quiet_warning; 170 bool val = m_quiet_warning;
171 m_quiet_warning = flag; 171 m_quiet_warning = flag;
172 return val; 172 return val;
173 } 173 }
174 174
175 octave_map warning_options (void) const { return m_warning_options; } 175 octave_map warning_options (void) const { return m_warning_options; }
176 176
177 void set_warning_options (const octave_map& val) 177 void set_warning_options (const octave_map& val)
178 { m_warning_options = val; } 178 { m_warning_options = val; }
179 179
180 octave_map warning_options (const octave_map& new_val) 180 octave_map warning_options (const octave_map& new_val)
181 { 181 {
182 octave_map val = m_warning_options; 182 octave_map val = m_warning_options;
183 m_warning_options = new_val; 183 m_warning_options = new_val;
184 return val; 184 return val;
185 } 185 }
186 186
187 OCTINTERP_API octave_value 187 OCTINTERP_API octave_value
188 last_error_message (const octave_value_list& args, int nargout); 188 last_error_message (const octave_value_list& args, int nargout);
189 189
190 void set_last_error_message (const std::string& val) 190 void set_last_error_message (const std::string& val)
191 { m_last_error_message = val; } 191 { m_last_error_message = val; }
192 192
193 std::string last_error_message (void) const { return m_last_error_message; } 193 std::string last_error_message (void) const { return m_last_error_message; }
194 194
195 std::string last_error_message (const std::string& s) 195 std::string last_error_message (const std::string& s)
196 { 196 {
197 std::string val = m_last_error_message; 197 std::string val = m_last_error_message;
198 m_last_error_message = s; 198 m_last_error_message = s;
199 return val; 199 return val;
200 } 200 }
201 201
202 OCTINTERP_API octave_value 202 OCTINTERP_API octave_value
203 last_warning_message (const octave_value_list& args, int nargout); 203 last_warning_message (const octave_value_list& args, int nargout);
204 204
205 void set_last_warning_message (const std::string& val) 205 void set_last_warning_message (const std::string& val)
206 { m_last_warning_message = val; } 206 { m_last_warning_message = val; }
207 207
208 std::string last_warning_message (void) const 208 std::string last_warning_message (void) const
209 { return m_last_warning_message; } 209 { return m_last_warning_message; }
210 210
211 std::string last_warning_message (const std::string& s) 211 std::string last_warning_message (const std::string& s)
212 { 212 {
213 std::string val = m_last_warning_message; 213 std::string val = m_last_warning_message;
214 m_last_warning_message = s; 214 m_last_warning_message = s;
215 return val; 215 return val;
216 } 216 }
217 217
218 OCTINTERP_API octave_value 218 OCTINTERP_API octave_value
219 last_warning_id (const octave_value_list& args, int nargout); 219 last_warning_id (const octave_value_list& args, int nargout);
220 220
221 void set_last_warning_id (const std::string& val) 221 void set_last_warning_id (const std::string& val)
222 { m_last_warning_id = val; } 222 { m_last_warning_id = val; }
223 223
224 std::string last_warning_id (void) const { return m_last_warning_id; } 224 std::string last_warning_id (void) const { return m_last_warning_id; }
225 225
226 std::string last_warning_id (const std::string& s) 226 std::string last_warning_id (const std::string& s)
227 { 227 {
228 std::string val = m_last_warning_id; 228 std::string val = m_last_warning_id;
229 m_last_warning_id = s; 229 m_last_warning_id = s;
230 return val; 230 return val;
231 } 231 }
232 232
233 OCTINTERP_API octave_value 233 OCTINTERP_API octave_value
234 last_error_id (const octave_value_list& args, int nargout); 234 last_error_id (const octave_value_list& args, int nargout);
235 235
236 void set_last_error_id (const std::string& val) { m_last_error_id = val; } 236 void set_last_error_id (const std::string& val) { m_last_error_id = val; }
237 237
238 std::string last_error_id (void) const { return m_last_error_id; } 238 std::string last_error_id (void) const { return m_last_error_id; }
239 239
240 std::string last_error_id (const std::string& s) 240 std::string last_error_id (const std::string& s)
241 { 241 {
242 std::string val = m_last_error_id; 242 std::string val = m_last_error_id;
243 m_last_error_id = s; 243 m_last_error_id = s;
244 return val; 244 return val;
245 } 245 }
246 246
247 void set_last_error_stack (const octave_map& val) 247 void set_last_error_stack (const octave_map& val)
248 { 248 {
249 m_last_error_stack = val; 249 m_last_error_stack = val;
250 } 250 }
251 251
252 octave_map last_error_stack (void) const { return m_last_error_stack; } 252 octave_map last_error_stack (void) const { return m_last_error_stack; }
253 253
254 octave_map last_error_stack (const octave_map& new_val) 254 octave_map last_error_stack (const octave_map& new_val)
255 { 255 {
256 octave_map val = m_last_error_stack; 256 octave_map val = m_last_error_stack;
257 m_last_error_stack = new_val; 257 m_last_error_stack = new_val;
258 return val; 258 return val;
259 } 259 }
260 260
261 static OCTINTERP_API octave_map 261 static OCTINTERP_API octave_map
262 make_stack_map (const std::list<frame_info>& frames); 262 make_stack_map (const std::list<frame_info>& frames);
263 263
264 static OCTINTERP_API std::list<frame_info> 264 static OCTINTERP_API std::list<frame_info>
265 make_stack_frame_list (const octave_map& stack); 265 make_stack_frame_list (const octave_map& stack);
266 266
267 //! For given warning ID, return 0 if warnings are disabled, 1 if 267 //! For given warning ID, return 0 if warnings are disabled, 1 if
268 //! enabled, and 2 if the given ID should be an error instead of a 268 //! enabled, and 2 if the given ID should be an error instead of a
269 //! warning. 269 //! warning.
270 270
271 OCTINTERP_API int warning_enabled (const std::string& id); 271 OCTINTERP_API int warning_enabled (const std::string& id);
272 272
273 OCTINTERP_API void 273 OCTINTERP_API void
274 verror (bool save_last_error, std::ostream& os, const char *name, 274 verror (bool save_last_error, std::ostream& os, const char *name,
275 const char *id, const char *fmt, va_list args, 275 const char *id, const char *fmt, va_list args,
276 bool with_cfn = false); 276 bool with_cfn = false);
277 277
278 OCTINTERP_API void 278 OCTINTERP_API void
279 vwarning (const char *name, const char *id, const char *fmt, 279 vwarning (const char *name, const char *id, const char *fmt,
280 va_list args); 280 va_list args);
281 281
282 OCTAVE_NORETURN 282 OCTAVE_NORETURN
283 OCTINTERP_API void 283 OCTINTERP_API void
284 error_1 (execution_exception& ee, const char *id, const char *fmt, 284 error_1 (execution_exception& ee, const char *id, const char *fmt,
285 va_list args); 285 va_list args);
286 286
287 OCTAVE_NORETURN 287 OCTAVE_NORETURN
288 OCTINTERP_API void error_1 (const char *id, const char *fmt, va_list args); 288 OCTINTERP_API void error_1 (const char *id, const char *fmt, va_list args);
289 289
290 OCTAVE_NORETURN 290 OCTAVE_NORETURN
291 OCTINTERP_API void vusage (const char *id, const char *fmt, va_list args); 291 OCTINTERP_API void vusage (const char *id, const char *fmt, va_list args);
292 292
293 OCTINTERP_API void vwarning (const char *id, const char *fmt, va_list args); 293 OCTINTERP_API void vwarning (const char *id, const char *fmt, va_list args);
294 294
295 OCTAVE_NORETURN 295 OCTAVE_NORETURN
296 OCTINTERP_API void 296 OCTINTERP_API void
297 rethrow_error (const std::string& id, const std::string& msg, 297 rethrow_error (const std::string& id, const std::string& msg,
298 const octave_map& stack); 298 const octave_map& stack);
299 299
300 OCTAVE_NORETURN 300 OCTAVE_NORETURN
301 OCTINTERP_API void vpanic (const char *fmt, va_list args); 301 OCTINTERP_API void vpanic (const char *fmt, va_list args);
302 302
303 OCTAVE_NORETURN 303 OCTAVE_NORETURN
304 OCTINTERP_API void panic (const char *fmt, ...); 304 OCTINTERP_API void panic (const char *fmt, ...);
305 305
306 OCTINTERP_API octave_scalar_map warning_query (const std::string& id_arg); 306 OCTINTERP_API octave_scalar_map warning_query (const std::string& id_arg);
307 307
308 OCTINTERP_API std::string default_warning_state (void); 308 OCTINTERP_API std::string default_warning_state (void);
309 309
310 OCTINTERP_API void display_warning_options (std::ostream& os); 310 OCTINTERP_API void display_warning_options (std::ostream& os);
311 311
312 OCTINTERP_API void 312 OCTINTERP_API void
313 set_warning_option (const std::string& state, const std::string& id); 313 set_warning_option (const std::string& state, const std::string& id);
314 314
315 OCTINTERP_API void disable_warning (const std::string& id); 315 OCTINTERP_API void disable_warning (const std::string& id);
316 316
317 OCTINTERP_API void initialize_default_warning_state (void); 317 OCTINTERP_API void initialize_default_warning_state (void);
318 318
319 OCTINTERP_API void interpreter_try (unwind_protect& frame); 319 OCTINTERP_API void interpreter_try (unwind_protect& frame);
320 320
321 // Throw execution_exception or, if debug_on_error is TRUE, enter 321 // Throw execution_exception or, if debug_on_error is TRUE, enter
322 // debugger. If stack_info is empty, use current call stack. 322 // debugger. If stack_info is empty, use current call stack.
323 323
324 OCTAVE_NORETURN 324 OCTAVE_NORETURN
325 OCTINTERP_API void 325 OCTINTERP_API void
326 throw_error (const std::string& err_type, 326 throw_error (const std::string& err_type,
327 const std::string& id, 327 const std::string& id,
328 const std::string& message, 328 const std::string& message,
329 const std::list<frame_info>& stack_info 329 const std::list<frame_info>& stack_info
330 = std::list<frame_info> ()); 330 = std::list<frame_info> ());
331 331
332 OCTAVE_NORETURN 332 OCTAVE_NORETURN
333 OCTINTERP_API void throw_error (execution_exception& ee); 333 OCTINTERP_API void throw_error (execution_exception& ee);
334 334
335 OCTINTERP_API void save_exception (const execution_exception& ee); 335 OCTINTERP_API void save_exception (const execution_exception& ee);
336 336
337 // FIXME 337 // FIXME
338 //#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) 338 //#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
339 OCTAVE_DEPRECATED (7, "second argument is no longer accepted") 339 OCTAVE_DEPRECATED (7, "second argument is no longer accepted")
340 OCTINTERP_API void display_exception (const execution_exception& ee, 340 OCTINTERP_API void display_exception (const execution_exception& ee,
341 std::ostream& os) const; 341 std::ostream& os) const;
342 //#endif 342 //#endif
343 343
344 OCTINTERP_API void display_exception (const execution_exception& ee) const; 344 OCTINTERP_API void display_exception (const execution_exception& ee) const;
345 345
346 private: 346 private:
347 347
348 interpreter& m_interpreter; 348 interpreter& m_interpreter;
349 349
350 //! TRUE means that Octave will try to enter the debugger when an error 350 //! TRUE means that Octave will try to enter the debugger when an error
351 //! is encountered. This will also inhibit printing of the normal 351 //! is encountered. This will also inhibit printing of the normal
352 //! traceback message (you will only see the top-level error message). 352 //! traceback message (you will only see the top-level error message).
353 353
354 bool m_debug_on_error; 354 bool m_debug_on_error;
355 355
356 //! TRUE means that Octave will try to enter the debugger when an error 356 //! TRUE means that Octave will try to enter the debugger when an error
357 //! is encountered within the 'try' section of a 'try' / 'catch' block. 357 //! is encountered within the 'try' section of a 'try' / 'catch' block.
358 358
359 bool m_debug_on_caught; 359 bool m_debug_on_caught;
360 360
361 //! TRUE means that Octave will try to enter the debugger when a warning 361 //! TRUE means that Octave will try to enter the debugger when a warning
362 //! is encountered. 362 //! is encountered.
363 363
364 bool m_debug_on_warning; 364 bool m_debug_on_warning;
365 365
366 //! TRUE means warning messages are turned off. 366 //! TRUE means warning messages are turned off.
367 367
368 bool m_discard_warning_messages; 368 bool m_discard_warning_messages;
369 369
370 //! TRUE means that Octave will try to beep obnoxiously before 370 //! TRUE means that Octave will try to beep obnoxiously before
371 //! printing error messages. 371 //! printing error messages.
372 bool m_beep_on_error; 372 bool m_beep_on_error;
373 373
374 //! TRUE means that Octave will try to display a stack trace when a 374 //! TRUE means that Octave will try to display a stack trace when a
375 //! warning is encountered. 375 //! warning is encountered.
376 bool m_backtrace_on_warning; 376 bool m_backtrace_on_warning;
377 377
378 //! TRUE means that Octave will print a verbose warning. Currently 378 //! TRUE means that Octave will print a verbose warning. Currently
379 //! unused. 379 //! unused.
380 bool m_verbose_warning; 380 bool m_verbose_warning;
381 381
382 //! TRUE means that Octave will print no warnings, but lastwarn will 382 //! TRUE means that Octave will print no warnings, but lastwarn will
383 //! be updated 383 //! be updated
384 bool m_quiet_warning; 384 bool m_quiet_warning;
385 385
386 //! A structure containing (most of) the current state of warnings. 386 //! A structure containing (most of) the current state of warnings.
387 octave_map m_warning_options; 387 octave_map m_warning_options;
388 388
389 //! The text of the last error message. 389 //! The text of the last error message.
390 std::string m_last_error_message; 390 std::string m_last_error_message;
391 391
392 //! The text of the last warning message. 392 //! The text of the last warning message.
393 std::string m_last_warning_message; 393 std::string m_last_warning_message;
394 394
395 //! The last warning message id. 395 //! The last warning message id.
396 std::string m_last_warning_id; 396 std::string m_last_warning_id;
397 397
398 //! The last error message id. 398 //! The last error message id.
399 std::string m_last_error_id; 399 std::string m_last_error_id;
400 400
401 //! The last file in which an error occurred. 401 //! The last file in which an error occurred.
402 octave_map m_last_error_stack; 402 octave_map m_last_error_stack;
403 }; 403 };
404 404
405 OCTAVE_END_NAMESPACE(octave) 405 OCTAVE_END_NAMESPACE(octave)
406 406
407 // FIXME: should we move the following functions inside the octave 407 // FIXME: should we move the following functions inside the octave
408 // namespace? If so, should the functions outside of the namespace be 408 // namespace? If so, should the functions outside of the namespace be