1
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, |
7353
|
4 2004, 2005, 2006, 2007, 2008 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
1
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
1
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_error_h) |
|
25 #define octave_error_h 1 |
1
|
26 |
6355
|
27 #include <cstdarg> |
3935
|
28 #include <string> |
1489
|
29 |
1
|
30 #define panic_impossible() \ |
|
31 panic ("impossible state reached in file `%s' at line %d", \ |
|
32 __FILE__, __LINE__) |
|
33 |
6109
|
34 extern OCTINTERP_API void reset_error_handler (void); |
4318
|
35 |
6109
|
36 extern OCTINTERP_API int warning_enabled (const std::string& id); |
5781
|
37 |
6338
|
38 extern OCTINTERP_API void vmessage (const char *name, const char *fmt, va_list args); |
6109
|
39 extern OCTINTERP_API void message (const char *name, const char *fmt, ...); |
6338
|
40 |
|
41 extern OCTINTERP_API void vusage (const char *fmt, va_list args); |
6109
|
42 extern OCTINTERP_API void usage (const char *fmt, ...); |
6338
|
43 |
|
44 extern OCTINTERP_API void vwarning (const char *fmt, va_list args); |
6109
|
45 extern OCTINTERP_API void warning (const char *fmt, ...); |
6338
|
46 |
|
47 extern OCTINTERP_API void verror (const char *fmt, va_list args); |
6109
|
48 extern OCTINTERP_API void error (const char *fmt, ...); |
6338
|
49 |
|
50 extern OCTINTERP_API void vparse_error (const char *fmt, va_list args); |
6109
|
51 extern OCTINTERP_API void parse_error (const char *fmt, ...); |
5567
|
52 |
6109
|
53 extern OCTINTERP_API void |
6338
|
54 vmessage_with_id (const char *id, const char *name, const char *fmt, va_list args); |
|
55 |
|
56 extern OCTINTERP_API void |
5567
|
57 message_with_id (const char *id, const char *name, const char *fmt, ...); |
|
58 |
6109
|
59 extern OCTINTERP_API void |
6338
|
60 vusage_with_id (const char *id, const char *fmt, va_list args); |
|
61 |
|
62 extern OCTINTERP_API void |
5567
|
63 usage_with_id (const char *id, const char *fmt, ...); |
|
64 |
6109
|
65 extern OCTINTERP_API void |
6338
|
66 vwarning_with_id (const char *id, const char *fmt, va_list args); |
|
67 |
|
68 extern OCTINTERP_API void |
5567
|
69 warning_with_id (const char *id, const char *fmt, ...); |
|
70 |
6109
|
71 extern OCTINTERP_API void |
6338
|
72 verror_with_id (const char *id, const char *fmt, va_list args); |
|
73 |
|
74 extern OCTINTERP_API void |
5567
|
75 error_with_id (const char *id, const char *fmt, ...); |
|
76 |
6109
|
77 extern OCTINTERP_API void |
6338
|
78 vparse_error_with_id (const char *id, const char *fmt, va_list args); |
|
79 |
|
80 extern OCTINTERP_API void |
5567
|
81 parse_error_with_id (const char *id, const char *fmt, ...); |
|
82 |
6109
|
83 extern OCTINTERP_API void panic (const char *fmt, ...) GCC_ATTR_NORETURN; |
1
|
84 |
4732
|
85 // Helper function for print_usage defined in defun.cc. |
6109
|
86 extern OCTINTERP_API void defun_usage_message (const std::string& msg); |
4732
|
87 |
6109
|
88 extern OCTINTERP_API void disable_warning (const std::string& id); |
|
89 extern OCTINTERP_API void initialize_default_warning_state (void); |
5794
|
90 |
7353
|
91 // TRUE means that Octave will try to enter the debugger when an error |
|
92 // is encountered. This will also inhibit printing of the normal |
|
93 // traceback message (you will only see the top-level error message). |
|
94 extern OCTINTERP_API bool Vdebug_on_error; |
|
95 |
|
96 // TRUE means that Octave will try to enter the debugger when a warning |
|
97 // is encountered. |
|
98 extern OCTINTERP_API bool Vdebug_on_warning; |
|
99 |
143
|
100 // Current error state. |
6109
|
101 extern OCTINTERP_API int error_state; |
143
|
102 |
3489
|
103 // Current warning state. |
6109
|
104 extern OCTINTERP_API int warning_state; |
3489
|
105 |
1489
|
106 // Tell the error handler whether to print messages, or just store |
|
107 // them for later. Used for handling errors in eval() and |
|
108 // the `unwind_protect' statement. |
6109
|
109 extern OCTINTERP_API int buffer_error_messages; |
1489
|
110 |
3815
|
111 // TRUE means error messages are turned off. |
6109
|
112 extern OCTINTERP_API bool discard_error_messages; |
3815
|
113 |
4452
|
114 // TRUE means warning messages are turned off. |
6109
|
115 extern OCTINTERP_API bool discard_warning_messages; |
4452
|
116 |
1
|
117 #endif |
|
118 |
|
119 /* |
|
120 ;;; Local Variables: *** |
|
121 ;;; mode: C++ *** |
|
122 ;;; End: *** |
|
123 */ |