Mercurial > cpython-lru_cache-weakref
annotate Include/pyerrors.h @ 10072:ecebcd84df37 legacy-trunk
put the preferences file in a folder called "Python" inside the prefs folder, just like the IDE does -- jvr
| author | Just van Rossum <just@lettererror.com> |
|---|---|
| date | Tue, 02 Feb 1999 15:49:03 +0000 |
| parents | 60fdb1db1175 |
| children | 3be935be3781 |
| 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 | |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
13 Permission to use, copy, modify, and distribute this software and its |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
14 documentation for any purpose and without fee is hereby granted, |
| 145 | 15 provided that the above copyright notice appear in all copies and that |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
16 both that copyright notice and this permission notice appear in |
| 145 | 17 supporting documentation, and that the names of Stichting Mathematisch |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
18 Centrum or CWI or Corporation for National Research Initiatives or |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
19 CNRI not be used in advertising or publicity pertaining to |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
20 distribution of the software without specific, written prior |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
21 permission. |
| 145 | 22 |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
23 While CWI is the initial source for this software, a modified version |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
24 is made available by the Corporation for National Research Initiatives |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
25 (CNRI) at the Internet address ftp://ftp.python.org. |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
26 |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
27 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
28 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
29 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
30 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
31 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
32 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
33 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2436
diff
changeset
|
34 PERFORMANCE OF THIS SOFTWARE. |
| 145 | 35 |
| 36 ******************************************************************/ | |
| 37 | |
| 6 | 38 /* Error handling definitions */ |
| 39 | |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
40 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
|
41 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
|
42 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
|
43 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
|
44 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
|
45 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
|
46 DL_IMPORT(void) PyErr_Restore Py_PROTO((PyObject *, PyObject *, PyObject *)); |
| 6 | 47 |
|
6146
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
48 /* 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
|
49 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
|
50 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
|
51 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
|
52 |
|
a2a1df0ca808
Three new C API functions:
Barry Warsaw <barry@python.org>
parents:
5230
diff
changeset
|
53 |
| 86 | 54 /* Predefined exceptions */ |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
55 |
|
6318
cdc5a40fcf97
Introduce PyExc_Exception as the conceptual root class for all exceptions.
Guido van Rossum <guido@python.org>
parents:
6191
diff
changeset
|
56 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
|
57 extern DL_IMPORT(PyObject *) PyExc_StandardError; |
|
6323
3f8d7f74f1bc
[Py_Exc]NumberError => [Py_Exc]ArithmeticError
Barry Warsaw <barry@python.org>
parents:
6318
diff
changeset
|
58 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
|
59 extern DL_IMPORT(PyObject *) PyExc_LookupError; |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
60 |
| 5230 | 61 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
|
62 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
|
63 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
|
64 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
|
65 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
|
66 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
|
67 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
|
68 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
|
69 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
|
70 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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 extern DL_IMPORT(PyObject *) PyExc_RuntimeError; |
|
9564
d13a60b44b45
Added PyExc_NotImplementedError
Barry Warsaw <barry@python.org>
parents:
8703
diff
changeset
|
76 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
|
77 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
|
78 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
|
79 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
|
80 extern DL_IMPORT(PyObject *) PyExc_TypeError; |
|
fa98dda07877
make the type a parameter of the DL_IMPORT macro, for Borland C
Guido van Rossum <guido@python.org>
parents:
2146
diff
changeset
|
81 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
|
82 extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError; |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
83 |
|
6191
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
84 extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst; |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
85 |
|
3a6b7a377dc3
Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents:
6146
diff
changeset
|
86 |
|
10
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
diff
changeset
|
87 /* Convenience functions */ |
|
a71e896ed047
Made exception objects extern.
Guido van Rossum <guido@python.org>
parents:
6
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(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
|
90 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
|
91 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
|
92 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
|
93 extern DL_IMPORT(PyObject *) PyErr_Format Py_PROTO((PyObject *, const char *, ...)); |
|
23
08562de01668
Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents:
10
diff
changeset
|
94 |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
9564
diff
changeset
|
95 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
|
96 |
|
6324
20b5647a067e
New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents:
6323
diff
changeset
|
97 /* 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
|
98 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
|
99 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
|
100 |
|
4864
a53908d09a04
Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents:
4654
diff
changeset
|
101 /* 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
|
102 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
|
103 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
|
104 |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
105 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
106 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
107 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
108 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
109 #endif /* !Py_ERRORS_H */ |
