blob: 33c7806ac8007b6b9a84c79458a6abc18bb3298c [file] [log] [blame]
Guido van Rossuma3309961993-07-28 09:05:47 +00001#ifndef Py_ERRORS_H
2#define Py_ERRORS_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
Guido van Rossumf70e43a1991-02-19 12:39:46 +00007/***********************************************************
Guido van Rossumb6775db1994-08-01 11:34:53 +00008Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
Guido van Rossum9bfef441993-03-29 10:43:31 +00009Amsterdam, The Netherlands.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000010
11 All Rights Reserved
12
13Permission to use, copy, modify, and distribute this software and its
14documentation for any purpose and without fee is hereby granted,
15provided that the above copyright notice appear in all copies and that
16both that copyright notice and this permission notice appear in
17supporting documentation, and that the names of Stichting Mathematisch
18Centrum or CWI not be used in advertising or publicity pertaining to
19distribution of the software without specific, written prior permission.
20
21STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
22THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
23FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
24FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
26ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
27OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28
29******************************************************************/
30
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000031/* Error handling definitions */
32
33void err_set PROTO((object *));
34void err_setval PROTO((object *, object *));
35void err_setstr PROTO((object *, char *));
Guido van Rossumb6775db1994-08-01 11:34:53 +000036object *err_occurred PROTO((void));
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000037void err_get PROTO((object **, object **));
38void err_clear PROTO((void));
39
Guido van Rossum3f5da241990-12-20 15:06:42 +000040/* Predefined exceptions */
Guido van Rossum5c600e11990-10-14 20:00:25 +000041
Guido van Rossume89bc751994-08-18 16:18:13 +000042extern DL_IMPORT object *AccessError;
43extern DL_IMPORT object *AttributeError;
44extern DL_IMPORT object *ConflictError;
45extern DL_IMPORT object *EOFError;
46extern DL_IMPORT object *IOError;
47extern DL_IMPORT object *ImportError;
48extern DL_IMPORT object *IndexError;
49extern DL_IMPORT object *KeyError;
50extern DL_IMPORT object *KeyboardInterrupt;
51extern DL_IMPORT object *MemoryError;
52extern DL_IMPORT object *NameError;
53extern DL_IMPORT object *OverflowError;
54extern DL_IMPORT object *RuntimeError;
55extern DL_IMPORT object *SyntaxError;
56extern DL_IMPORT object *SystemError;
57extern DL_IMPORT object *SystemExit;
58extern DL_IMPORT object *TypeError;
59extern DL_IMPORT object *ValueError;
60extern DL_IMPORT object *ZeroDivisionError;
Guido van Rossum3e55cb61990-10-21 22:09:30 +000061
Guido van Rossum5c600e11990-10-14 20:00:25 +000062/* Convenience functions */
63
64extern int err_badarg PROTO((void));
65extern object *err_nomem PROTO((void));
66extern object *err_errno PROTO((object *));
Guido van Rossum3e55cb61990-10-21 22:09:30 +000067
68extern void err_badcall PROTO((void));
Guido van Rossum25831651993-05-19 14:50:45 +000069
70extern object *err_getexc PROTO((void));
Guido van Rossuma3309961993-07-28 09:05:47 +000071
Guido van Rossumb6775db1994-08-01 11:34:53 +000072extern int sigcheck PROTO((void)); /* In sigcheck.c or signalmodule.c */
73
Guido van Rossuma3309961993-07-28 09:05:47 +000074#ifdef __cplusplus
75}
76#endif
77#endif /* !Py_ERRORS_H */