annotate src/error.h @ 5794:1138ced03f14

[project @ 2006-05-08 20:23:04 by jwe]
author jwe
date Mon, 08 May 2006 20:23:07 +0000
parents faafc2d98b8d
children 80d3933fb8b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2440
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
10 later version.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
5307
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 4732
diff changeset
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 4732
diff changeset
20 02110-1301, USA.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
23
383
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 240
diff changeset
24 #if !defined (octave_error_h)
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 240
diff changeset
25 #define octave_error_h 1
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
3935
1ea29376e43e [project @ 2002-05-16 05:30:51 by jwe]
jwe
parents: 3815
diff changeset
27 #include <string>
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1428
diff changeset
28
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
29 #define panic_impossible() \
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
30 panic ("impossible state reached in file `%s' at line %d", \
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
31 __FILE__, __LINE__)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
32
4318
115bffcecfd3 [project @ 2003-02-13 05:52:16 by jwe]
jwe
parents: 4051
diff changeset
33 extern void reset_error_handler (void);
115bffcecfd3 [project @ 2003-02-13 05:52:16 by jwe]
jwe
parents: 4051
diff changeset
34
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5567
diff changeset
35 extern int warning_enabled (const std::string& id);
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5567
diff changeset
36
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
37 extern void message (const char *name, const char *fmt, ...);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
38 extern void usage (const char *fmt, ...);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
39 extern void warning (const char *fmt, ...);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
40 extern void error (const char *fmt, ...);
1005
46a2983cb297 [project @ 1995-01-03 02:08:32 by jwe]
jwe
parents: 672
diff changeset
41 extern void parse_error (const char *fmt, ...);
5567
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
42
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
43 extern void
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
44 message_with_id (const char *id, const char *name, const char *fmt, ...);
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
45
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
46 extern void
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
47 usage_with_id (const char *id, const char *fmt, ...);
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
48
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
49 extern void
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
50 warning_with_id (const char *id, const char *fmt, ...);
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
51
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
52 extern void
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
53 error_with_id (const char *id, const char *fmt, ...);
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
54
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
55 extern void
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
56 parse_error_with_id (const char *id, const char *fmt, ...);
80e629357483 [project @ 2005-12-07 06:31:28 by jwe]
jwe
parents: 5307
diff changeset
57
2440
d95b5eb82e22 [project @ 1996-10-30 17:53:42 by jwe]
jwe
parents: 2173
diff changeset
58 extern void panic (const char *fmt, ...) GCC_ATTR_NORETURN;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
59
4732
b484cdca27be [project @ 2004-02-04 04:32:48 by jwe]
jwe
parents: 4699
diff changeset
60 // Helper function for print_usage defined in defun.cc.
b484cdca27be [project @ 2004-02-04 04:32:48 by jwe]
jwe
parents: 4699
diff changeset
61 extern void defun_usage_message (const std::string& msg);
b484cdca27be [project @ 2004-02-04 04:32:48 by jwe]
jwe
parents: 4699
diff changeset
62
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
63 extern void initialize_default_warning_state (void);
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
64
143
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 104
diff changeset
65 // Current error state.
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 104
diff changeset
66 extern int error_state;
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 104
diff changeset
67
3489
cbee5fbb696d [project @ 2000-01-28 09:14:32 by jwe]
jwe
parents: 3018
diff changeset
68 // Current warning state.
cbee5fbb696d [project @ 2000-01-28 09:14:32 by jwe]
jwe
parents: 3018
diff changeset
69 extern int warning_state;
cbee5fbb696d [project @ 2000-01-28 09:14:32 by jwe]
jwe
parents: 3018
diff changeset
70
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1428
diff changeset
71 // Tell the error handler whether to print messages, or just store
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1428
diff changeset
72 // them for later. Used for handling errors in eval() and
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1428
diff changeset
73 // the `unwind_protect' statement.
4699
5e2c68946f30 [project @ 2004-01-20 23:04:46 by jwe]
jwe
parents: 4452
diff changeset
74 extern int buffer_error_messages;
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1428
diff changeset
75
3815
c554ad71bafc [project @ 2001-04-19 19:50:52 by jwe]
jwe
parents: 3811
diff changeset
76 // TRUE means error messages are turned off.
c554ad71bafc [project @ 2001-04-19 19:50:52 by jwe]
jwe
parents: 3811
diff changeset
77 extern bool discard_error_messages;
c554ad71bafc [project @ 2001-04-19 19:50:52 by jwe]
jwe
parents: 3811
diff changeset
78
4452
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4318
diff changeset
79 // TRUE means warning messages are turned off.
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4318
diff changeset
80 extern bool discard_warning_messages;
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4318
diff changeset
81
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
82 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
83
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
84 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
85 ;;; Local Variables: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
86 ;;; mode: C++ ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
87 ;;; End: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
88 */