blob: 431d2e61a8be4227b6aa28bb191535449d0ab3b9 [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 Rossum5799b521995-01-04 19:06:22 +00008Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
9The Netherlands.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000010
11 All Rights Reserved
12
Guido van Rossumd266eb41996-10-25 14:44:06 +000013Permission to use, copy, modify, and distribute this software and its
14documentation for any purpose and without fee is hereby granted,
Guido van Rossumf70e43a1991-02-19 12:39:46 +000015provided that the above copyright notice appear in all copies and that
Guido van Rossumd266eb41996-10-25 14:44:06 +000016both that copyright notice and this permission notice appear in
Guido van Rossumf70e43a1991-02-19 12:39:46 +000017supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumd266eb41996-10-25 14:44:06 +000018Centrum or CWI or Corporation for National Research Initiatives or
19CNRI not be used in advertising or publicity pertaining to
20distribution of the software without specific, written prior
21permission.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000022
Guido van Rossumd266eb41996-10-25 14:44:06 +000023While CWI is the initial source for this software, a modified version
24is made available by the Corporation for National Research Initiatives
25(CNRI) at the Internet address ftp://ftp.python.org.
26
27STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
28REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
29MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
30CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
31DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
32PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
33TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
34PERFORMANCE OF THIS SOFTWARE.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000035
36******************************************************************/
37
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000038/* Error handling definitions */
39
Guido van Rossumcaa63801995-01-12 11:45:45 +000040void PyErr_SetNone Py_PROTO((PyObject *));
41void PyErr_SetObject Py_PROTO((PyObject *, PyObject *));
Guido van Rossum067998f1996-12-10 15:33:34 +000042void PyErr_SetString Py_PROTO((PyObject *, const char *));
Guido van Rossumcaa63801995-01-12 11:45:45 +000043PyObject *PyErr_Occurred Py_PROTO((void));
44void PyErr_Clear Py_PROTO((void));
45void PyErr_Fetch Py_PROTO((PyObject **, PyObject **, PyObject **));
46void PyErr_Restore Py_PROTO((PyObject *, PyObject *, PyObject *));
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000047
Guido van Rossum3f5da241990-12-20 15:06:42 +000048/* Predefined exceptions */
Guido van Rossum5c600e11990-10-14 20:00:25 +000049
Guido van Rossum051ab121995-02-27 10:17:52 +000050extern DL_IMPORT(PyObject *) PyExc_AccessError;
51extern DL_IMPORT(PyObject *) PyExc_AttributeError;
52extern DL_IMPORT(PyObject *) PyExc_ConflictError;
53extern DL_IMPORT(PyObject *) PyExc_EOFError;
54extern DL_IMPORT(PyObject *) PyExc_IOError;
55extern DL_IMPORT(PyObject *) PyExc_ImportError;
56extern DL_IMPORT(PyObject *) PyExc_IndexError;
57extern DL_IMPORT(PyObject *) PyExc_KeyError;
58extern DL_IMPORT(PyObject *) PyExc_KeyboardInterrupt;
59extern DL_IMPORT(PyObject *) PyExc_MemoryError;
60extern DL_IMPORT(PyObject *) PyExc_NameError;
61extern DL_IMPORT(PyObject *) PyExc_OverflowError;
62extern DL_IMPORT(PyObject *) PyExc_RuntimeError;
63extern DL_IMPORT(PyObject *) PyExc_SyntaxError;
64extern DL_IMPORT(PyObject *) PyExc_SystemError;
65extern DL_IMPORT(PyObject *) PyExc_SystemExit;
66extern DL_IMPORT(PyObject *) PyExc_TypeError;
67extern DL_IMPORT(PyObject *) PyExc_ValueError;
68extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError;
Guido van Rossum3e55cb61990-10-21 22:09:30 +000069
Guido van Rossum5c600e11990-10-14 20:00:25 +000070/* Convenience functions */
71
Guido van Rossumcaa63801995-01-12 11:45:45 +000072extern int PyErr_BadArgument Py_PROTO((void));
73extern PyObject *PyErr_NoMemory Py_PROTO((void));
74extern PyObject *PyErr_SetFromErrno Py_PROTO((PyObject *));
Guido van Rossum3e55cb61990-10-21 22:09:30 +000075
Guido van Rossumcaa63801995-01-12 11:45:45 +000076extern void PyErr_BadInternalCall Py_PROTO((void));
Guido van Rossum25831651993-05-19 14:50:45 +000077
Barry Warsawf3f41a91997-01-03 00:15:03 +000078/* In sigcheck.c or signalmodule.c */
79extern int PyErr_CheckSignals Py_PROTO((void));
80extern void PyErr_SetInterrupt Py_PROTO((void));
81
Guido van Rossumb6775db1994-08-01 11:34:53 +000082
Guido van Rossuma3309961993-07-28 09:05:47 +000083#ifdef __cplusplus
84}
85#endif
86#endif /* !Py_ERRORS_H */