Bump version to 0.9.1.
[python/dscho.git] / Include / pyerrors.h
blobf461068ab28fd90f4e5d2c9281c534a7a085c2da
1 #ifndef Py_ERRORS_H
2 #define Py_ERRORS_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
7 /***********************************************************
8 Copyright (c) 2000, BeOpen.com.
9 Copyright (c) 1995-2000, Corporation for National Research Initiatives.
10 Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
11 All rights reserved.
13 See the file "Misc/COPYRIGHT" for information on usage and
14 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 ******************************************************************/
17 /* Error handling definitions */
19 DL_IMPORT(void) PyErr_SetNone(PyObject *);
20 DL_IMPORT(void) PyErr_SetObject(PyObject *, PyObject *);
21 DL_IMPORT(void) PyErr_SetString(PyObject *, const char *);
22 DL_IMPORT(PyObject *) PyErr_Occurred(void);
23 DL_IMPORT(void) PyErr_Clear(void);
24 DL_IMPORT(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
25 DL_IMPORT(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
27 /* Error testing and normalization */
28 DL_IMPORT(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
29 DL_IMPORT(int) PyErr_ExceptionMatches(PyObject *);
30 DL_IMPORT(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
33 /* Predefined exceptions */
35 extern DL_IMPORT(PyObject *) PyExc_Exception;
36 extern DL_IMPORT(PyObject *) PyExc_StandardError;
37 extern DL_IMPORT(PyObject *) PyExc_ArithmeticError;
38 extern DL_IMPORT(PyObject *) PyExc_LookupError;
40 extern DL_IMPORT(PyObject *) PyExc_AssertionError;
41 extern DL_IMPORT(PyObject *) PyExc_AttributeError;
42 extern DL_IMPORT(PyObject *) PyExc_EOFError;
43 extern DL_IMPORT(PyObject *) PyExc_FloatingPointError;
44 extern DL_IMPORT(PyObject *) PyExc_EnvironmentError;
45 extern DL_IMPORT(PyObject *) PyExc_IOError;
46 extern DL_IMPORT(PyObject *) PyExc_OSError;
47 extern DL_IMPORT(PyObject *) PyExc_ImportError;
48 extern DL_IMPORT(PyObject *) PyExc_IndexError;
49 extern DL_IMPORT(PyObject *) PyExc_KeyError;
50 extern DL_IMPORT(PyObject *) PyExc_KeyboardInterrupt;
51 extern DL_IMPORT(PyObject *) PyExc_MemoryError;
52 extern DL_IMPORT(PyObject *) PyExc_NameError;
53 extern DL_IMPORT(PyObject *) PyExc_OverflowError;
54 extern DL_IMPORT(PyObject *) PyExc_RuntimeError;
55 extern DL_IMPORT(PyObject *) PyExc_NotImplementedError;
56 extern DL_IMPORT(PyObject *) PyExc_SyntaxError;
57 extern DL_IMPORT(PyObject *) PyExc_IndentationError;
58 extern DL_IMPORT(PyObject *) PyExc_TabError;
59 extern DL_IMPORT(PyObject *) PyExc_SystemError;
60 extern DL_IMPORT(PyObject *) PyExc_SystemExit;
61 extern DL_IMPORT(PyObject *) PyExc_TypeError;
62 extern DL_IMPORT(PyObject *) PyExc_UnboundLocalError;
63 extern DL_IMPORT(PyObject *) PyExc_UnicodeError;
64 extern DL_IMPORT(PyObject *) PyExc_ValueError;
65 extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError;
66 #ifdef MS_WINDOWS
67 extern DL_IMPORT(PyObject *) PyExc_WindowsError;
68 #endif
70 extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst;
73 /* Convenience functions */
75 extern DL_IMPORT(int) PyErr_BadArgument(void);
76 extern DL_IMPORT(PyObject *) PyErr_NoMemory(void);
77 extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *);
78 extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
79 extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...);
80 #ifdef MS_WINDOWS
81 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *);
82 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int);
83 #endif
85 extern DL_IMPORT(void) PyErr_BadInternalCall(void);
87 /* Function to create a new exception */
88 DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base,
89 PyObject *dict);
91 /* In sigcheck.c or signalmodule.c */
92 extern DL_IMPORT(int) PyErr_CheckSignals(void);
93 extern DL_IMPORT(void) PyErr_SetInterrupt(void);
96 #ifdef __cplusplus
98 #endif
99 #endif /* !Py_ERRORS_H */