Mercurial > hg > octave-nkf
annotate src/error.h @ 10313:f3b65e1ae355
untabify src header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:16:43 -0500 |
parents | cd96d29c5efa |
children | 1834132fb50b |
rev | line source |
---|---|
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", \ | |
10313 | 32 __FILE__, __LINE__) |
1 | 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 |
9753
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
50 extern OCTINTERP_API void verror_with_cfn (const char *fmt, va_list args); |
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
51 extern OCTINTERP_API void error_with_cfn (const char *fmt, ...); |
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
52 |
6338 | 53 extern OCTINTERP_API void vparse_error (const char *fmt, va_list args); |
6109 | 54 extern OCTINTERP_API void parse_error (const char *fmt, ...); |
5567 | 55 |
6109 | 56 extern OCTINTERP_API void |
6338 | 57 vmessage_with_id (const char *id, const char *name, const char *fmt, va_list args); |
58 | |
59 extern OCTINTERP_API void | |
5567 | 60 message_with_id (const char *id, const char *name, const char *fmt, ...); |
61 | |
6109 | 62 extern OCTINTERP_API void |
6338 | 63 vusage_with_id (const char *id, const char *fmt, va_list args); |
64 | |
65 extern OCTINTERP_API void | |
5567 | 66 usage_with_id (const char *id, const char *fmt, ...); |
67 | |
6109 | 68 extern OCTINTERP_API void |
6338 | 69 vwarning_with_id (const char *id, const char *fmt, va_list args); |
70 | |
71 extern OCTINTERP_API void | |
5567 | 72 warning_with_id (const char *id, const char *fmt, ...); |
73 | |
6109 | 74 extern OCTINTERP_API void |
6338 | 75 verror_with_id (const char *id, const char *fmt, va_list args); |
76 | |
77 extern OCTINTERP_API void | |
5567 | 78 error_with_id (const char *id, const char *fmt, ...); |
79 | |
6109 | 80 extern OCTINTERP_API void |
9753
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
81 verror_with_id_cfn (const char *id, const char *fmt, va_list args); |
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
82 |
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
83 extern OCTINTERP_API void |
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
84 error_with_id_cfn (const char *id, const char *fmt, ...); |
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
85 |
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
86 extern OCTINTERP_API void |
6338 | 87 vparse_error_with_id (const char *id, const char *fmt, va_list args); |
88 | |
89 extern OCTINTERP_API void | |
5567 | 90 parse_error_with_id (const char *id, const char *fmt, ...); |
91 | |
6109 | 92 extern OCTINTERP_API void panic (const char *fmt, ...) GCC_ATTR_NORETURN; |
1 | 93 |
4732 | 94 // Helper function for print_usage defined in defun.cc. |
6109 | 95 extern OCTINTERP_API void defun_usage_message (const std::string& msg); |
4732 | 96 |
6109 | 97 extern OCTINTERP_API void disable_warning (const std::string& id); |
98 extern OCTINTERP_API void initialize_default_warning_state (void); | |
5794 | 99 |
7353 | 100 // TRUE means that Octave will try to enter the debugger when an error |
101 // is encountered. This will also inhibit printing of the normal | |
102 // traceback message (you will only see the top-level error message). | |
103 extern OCTINTERP_API bool Vdebug_on_error; | |
104 | |
105 // TRUE means that Octave will try to enter the debugger when a warning | |
106 // is encountered. | |
107 extern OCTINTERP_API bool Vdebug_on_warning; | |
108 | |
143 | 109 // Current error state. |
6109 | 110 extern OCTINTERP_API int error_state; |
143 | 111 |
3489 | 112 // Current warning state. |
6109 | 113 extern OCTINTERP_API int warning_state; |
3489 | 114 |
1489 | 115 // Tell the error handler whether to print messages, or just store |
116 // them for later. Used for handling errors in eval() and | |
117 // the `unwind_protect' statement. | |
6109 | 118 extern OCTINTERP_API int buffer_error_messages; |
1489 | 119 |
3815 | 120 // TRUE means error messages are turned off. |
6109 | 121 extern OCTINTERP_API bool discard_error_messages; |
3815 | 122 |
4452 | 123 // TRUE means warning messages are turned off. |
6109 | 124 extern OCTINTERP_API bool discard_warning_messages; |
4452 | 125 |
7977
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
126 // Helper functions to pass last error and warning messages and ids |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
127 extern OCTINTERP_API std::string last_error_message (void); |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
128 extern OCTINTERP_API std::string last_error_id (void); |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
129 extern OCTINTERP_API std::string last_warning_message (void); |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
130 extern OCTINTERP_API std::string last_warning_id (void); |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
131 |
1 | 132 #endif |