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