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 |
4318
|
33 extern void reset_error_handler (void); |
|
34 |
5781
|
35 extern int warning_enabled (const std::string& id); |
|
36 |
1
|
37 extern void message (const char *name, const char *fmt, ...); |
|
38 extern void usage (const char *fmt, ...); |
|
39 extern void warning (const char *fmt, ...); |
|
40 extern void error (const char *fmt, ...); |
1005
|
41 extern void parse_error (const char *fmt, ...); |
5567
|
42 |
|
43 extern void |
|
44 message_with_id (const char *id, const char *name, const char *fmt, ...); |
|
45 |
|
46 extern void |
|
47 usage_with_id (const char *id, const char *fmt, ...); |
|
48 |
|
49 extern void |
|
50 warning_with_id (const char *id, const char *fmt, ...); |
|
51 |
|
52 extern void |
|
53 error_with_id (const char *id, const char *fmt, ...); |
|
54 |
|
55 extern void |
|
56 parse_error_with_id (const char *id, const char *fmt, ...); |
|
57 |
2440
|
58 extern void panic (const char *fmt, ...) GCC_ATTR_NORETURN; |
1
|
59 |
4732
|
60 // Helper function for print_usage defined in defun.cc. |
|
61 extern void defun_usage_message (const std::string& msg); |
|
62 |
5904
|
63 extern void disable_warning (const std::string& id); |
5794
|
64 extern void initialize_default_warning_state (void); |
|
65 |
143
|
66 // Current error state. |
|
67 extern int error_state; |
|
68 |
3489
|
69 // Current warning state. |
|
70 extern int warning_state; |
|
71 |
1489
|
72 // Tell the error handler whether to print messages, or just store |
|
73 // them for later. Used for handling errors in eval() and |
|
74 // the `unwind_protect' statement. |
4699
|
75 extern int buffer_error_messages; |
1489
|
76 |
3815
|
77 // TRUE means error messages are turned off. |
|
78 extern bool discard_error_messages; |
|
79 |
4452
|
80 // TRUE means warning messages are turned off. |
|
81 extern bool discard_warning_messages; |
|
82 |
1
|
83 #endif |
|
84 |
|
85 /* |
|
86 ;;; Local Variables: *** |
|
87 ;;; mode: C++ *** |
|
88 ;;; End: *** |
|
89 */ |