Mercurial > cpython-lru_cache-weakref
annotate Include/pyerrors.h @ 13255:916fb024ce94 legacy-trunk
Change copyright notice.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 30 Jun 2000 23:50:40 +0000 |
| parents | 24199c1b9182 |
| children | 87ee82e5c56d |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
1 #ifndef Py_ERRORS_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
2 #define Py_ERRORS_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
6 |
| 145 | 7 /*********************************************************** |
| 2058 | 8 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 9 The Netherlands. | |
| 145 | 10 |
| 11 All Rights Reserved | |
| 12 | |
|
13255
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
11963
diff
changeset
|
13 Copyright (c) 2000, BeOpen.com. |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
11963
diff
changeset
|
14 Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
11963
diff
changeset
|
15 Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
11963
diff
changeset
|
16 All rights reserved. |
| 145 | 17 |
|
13255
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
11963
diff
changeset
|
18 See the file "Misc/COPYRIGHT" for information on usage and |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
11963
diff
changeset
|
19 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 145 | 20 |
| 21 ******************************************************************/ | |
| 22 | |
| 6 | 23 /* Error handling definitions */ |
| 24 | |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
25 DL_IMPORT(void) PyErr_SetNone Py_PROTO((PyObject *)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
26 DL_IMPORT(void) PyErr_SetObject Py_PROTO((PyObject *, PyObject *)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
27 DL_IMPORT(void) PyErr_SetString Py_PROTO((PyObject *, const char *)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
28 DL_IMPORT(PyObject *) PyErr_Occurred Py_PROTO((void)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
29 DL_IMPORT(void) PyErr_Clear Py_PROTO((void)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
30 DL_IMPORT(void) PyErr_Fetch Py_PROTO((PyObject **, PyObject **, PyObject **)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
31 DL_IMPORT(void) PyErr_Restore Py_PROTO((PyObject *, PyObject *, PyObject *)); |
| 6 | 32 |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
33 /* Error testing and normalization */ |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
34 DL_IMPORT(int) PyErr_GivenExceptionMatches Py_PROTO((PyObject *, PyObject *)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
35 DL_IMPORT(int) PyErr_ExceptionMatches Py_PROTO((PyObject *)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
36 DL_IMPORT(void) PyErr_NormalizeException Py_PROTO((PyObject**, PyObject**, PyObject**)); |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
37 |
|
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
38 |
| 86 | 39 /* Predefined exceptions */ |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
40 |
|
6318
cdc5a40fcf97
Introduce PyExc_Exception as the conceptual root class for all exceptions.
Guido van Rossum <guido@python.org>
parents:
6191
diff
changeset
|
41 extern DL_IMPORT(PyObject *) PyExc_Exception; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
42 extern DL_IMPORT(PyObject *) PyExc_StandardError; |
|
6323
3f8d7f74f1bc
[Py_Exc]NumberError => [Py_Exc]ArithmeticError
Barry Warsaw <barry@python.org>
parents:
6318
diff
changeset
|
43 extern DL_IMPORT(PyObject *) PyExc_ArithmeticError; |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
44 extern DL_IMPORT(PyObject *) PyExc_LookupError; |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
45 |
| 5230 | 46 extern DL_IMPORT(PyObject *) PyExc_AssertionError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
47 extern DL_IMPORT(PyObject *) PyExc_AttributeError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
48 extern DL_IMPORT(PyObject *) PyExc_EOFError; |
|
5117
2bb0bda1585c
Changes for Lee Busby's SIGFPE patch set.
Guido van Rossum <guido@python.org>
parents:
5106
diff
changeset
|
49 extern DL_IMPORT(PyObject *) PyExc_FloatingPointError; |
|
8703
50757465fa70
New global variables: PyExc_EnvironmentError and PyExc_OSError
Barry Warsaw <barry@python.org>
parents:
6324
diff
changeset
|
50 extern DL_IMPORT(PyObject *) PyExc_EnvironmentError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
51 extern DL_IMPORT(PyObject *) PyExc_IOError; |
|
8703
50757465fa70
New global variables: PyExc_EnvironmentError and PyExc_OSError
Barry Warsaw <barry@python.org>
parents:
6324
diff
changeset
|
52 extern DL_IMPORT(PyObject *) PyExc_OSError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
53 extern DL_IMPORT(PyObject *) PyExc_ImportError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
54 extern DL_IMPORT(PyObject *) PyExc_IndexError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
55 extern DL_IMPORT(PyObject *) PyExc_KeyError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
56 extern DL_IMPORT(PyObject *) PyExc_KeyboardInterrupt; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
57 extern DL_IMPORT(PyObject *) PyExc_MemoryError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
58 extern DL_IMPORT(PyObject *) PyExc_NameError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
59 extern DL_IMPORT(PyObject *) PyExc_OverflowError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
60 extern DL_IMPORT(PyObject *) PyExc_RuntimeError; |
|
9564
d13a60b44b45
Added PyExc_NotImplementedError
Barry Warsaw <barry@python.org>
parents:
8703
diff
changeset
|
61 extern DL_IMPORT(PyObject *) PyExc_NotImplementedError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
62 extern DL_IMPORT(PyObject *) PyExc_SyntaxError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
63 extern DL_IMPORT(PyObject *) PyExc_SystemError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
64 extern DL_IMPORT(PyObject *) PyExc_SystemExit; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
65 extern DL_IMPORT(PyObject *) PyExc_TypeError; |
| 11030 | 66 extern DL_IMPORT(PyObject *) PyExc_UnboundLocalError; |
|
11963
24199c1b9182
Marc-Andre Lemburg: add PyExc_UnicodeError
Guido van Rossum <guido@python.org>
parents:
11799
diff
changeset
|
67 extern DL_IMPORT(PyObject *) PyExc_UnicodeError; |
|
2436
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
68 extern DL_IMPORT(PyObject *) PyExc_ValueError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
69 extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError; |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
70 #ifdef MS_WINDOWS |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
71 extern DL_IMPORT(PyObject *) PyExc_WindowsError; |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
72 #endif |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
73 |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
74 extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst; |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
75 |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
76 |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
77 /* Convenience functions */ |
|
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
78 |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
79 extern DL_IMPORT(int) PyErr_BadArgument Py_PROTO((void)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
80 extern DL_IMPORT(PyObject *) PyErr_NoMemory Py_PROTO((void)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
81 extern DL_IMPORT(PyObject *) PyErr_SetFromErrno Py_PROTO((PyObject *)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
82 extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename Py_PROTO((PyObject *, char *)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
83 extern DL_IMPORT(PyObject *) PyErr_Format Py_PROTO((PyObject *, const char *, ...)); |
|
11799
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
84 #ifdef MS_WINDOWS |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
85 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *); |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
86 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int); |
|
3678dd685867
Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents:
11030
diff
changeset
|
87 #endif |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
88 |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
89 extern DL_IMPORT(void) PyErr_BadInternalCall Py_PROTO((void)); |
|
1288
9fed5726a36d
Several changes in one:
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
90 |
|
6324
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
91 /* Function to create a new exception */ |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
92 DL_IMPORT(PyObject *) PyErr_NewException Py_PROTO((char *name, PyObject *base, |
|
6324
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
93 PyObject *dict)); |
|
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
94 |
|
4864
a53908d09a04
Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents:
4654
diff
changeset
|
95 /* In sigcheck.c or signalmodule.c */ |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
96 extern DL_IMPORT(int) PyErr_CheckSignals Py_PROTO((void)); |
|
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
97 extern DL_IMPORT(void) PyErr_SetInterrupt Py_PROTO((void)); |
|
4864
a53908d09a04
Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents:
4654
diff
changeset
|
98 |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
99 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
100 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
101 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
102 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
103 #endif /* !Py_ERRORS_H */ |
