annotate Include/pyerrors.h @ 24042:63fbbed10714 legacy-trunk

Simplify HTTPSConnection constructor. See discussion in SF bug 458463.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Fri, 28 Jun 2002 23:38:14 +0000
parents 3f242cdd0904
children 3db261a93a5b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
853b736a6a9e Added copyright notice.
Guido van Rossum <guido@python.org>
parents: 86
diff changeset
7
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 /* Error handling definitions */
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
13435
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
10 DL_IMPORT(void) PyErr_SetNone(PyObject *);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
11 DL_IMPORT(void) PyErr_SetObject(PyObject *, PyObject *);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
12 DL_IMPORT(void) PyErr_SetString(PyObject *, const char *);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
13 DL_IMPORT(PyObject *) PyErr_Occurred(void);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
14 DL_IMPORT(void) PyErr_Clear(void);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
15 DL_IMPORT(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
16 DL_IMPORT(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
17
6146
a2a1df0ca808 Three new C API functions:
Barry Warsaw <barry@python.org>
parents: 5230
diff changeset
18 /* Error testing and normalization */
13435
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
19 DL_IMPORT(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
20 DL_IMPORT(int) PyErr_ExceptionMatches(PyObject *);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
21 DL_IMPORT(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
6146
a2a1df0ca808 Three new C API functions:
Barry Warsaw <barry@python.org>
parents: 5230
diff changeset
22
a2a1df0ca808 Three new C API functions:
Barry Warsaw <barry@python.org>
parents: 5230
diff changeset
23
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents: 23
diff changeset
24 /* Predefined exceptions */
10
a71e896ed047 Made exception objects extern.
Guido van Rossum <guido@python.org>
parents: 6
diff changeset
25
6318
cdc5a40fcf97 Introduce PyExc_Exception as the conceptual root class for all exceptions.
Guido van Rossum <guido@python.org>
parents: 6191
diff changeset
26 extern DL_IMPORT(PyObject *) PyExc_Exception;
17597
32e7d0898eab Iterators phase 1. This comprises:
Guido van Rossum <guido@python.org>
parents: 16849
diff changeset
27 extern DL_IMPORT(PyObject *) PyExc_StopIteration;
6191
3a6b7a377dc3 Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents: 6146
diff changeset
28 extern DL_IMPORT(PyObject *) PyExc_StandardError;
6323
3f8d7f74f1bc [Py_Exc]NumberError => [Py_Exc]ArithmeticError
Barry Warsaw <barry@python.org>
parents: 6318
diff changeset
29 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
30 extern DL_IMPORT(PyObject *) PyExc_LookupError;
3a6b7a377dc3 Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents: 6146
diff changeset
31
5230
0e60de2a42af Added AssertionError.
Guido van Rossum <guido@python.org>
parents: 5226
diff changeset
32 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
33 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
34 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
35 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
36 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
37 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
38 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
39 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
40 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
41 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
42 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
43 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
44 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
45 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
46 extern DL_IMPORT(PyObject *) PyExc_RuntimeError;
9564
d13a60b44b45 Added PyExc_NotImplementedError
Barry Warsaw <barry@python.org>
parents: 8703
diff changeset
47 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
48 extern DL_IMPORT(PyObject *) PyExc_SyntaxError;
13435
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
49 extern DL_IMPORT(PyObject *) PyExc_IndentationError;
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
50 extern DL_IMPORT(PyObject *) PyExc_TabError;
20279
8b3ea7335c1b weakref.ReferenceError becomes a built-in exception now that weak ref objects
Fred Drake <fdrake@acm.org>
parents: 19433
diff changeset
51 extern DL_IMPORT(PyObject *) PyExc_ReferenceError;
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
52 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
53 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
54 extern DL_IMPORT(PyObject *) PyExc_TypeError;
11030
3be935be3781 Patch by Tim Peters:
Guido van Rossum <guido@python.org>
parents: 9586
diff changeset
55 extern DL_IMPORT(PyObject *) PyExc_UnboundLocalError;
11963
24199c1b9182 Marc-Andre Lemburg: add PyExc_UnicodeError
Guido van Rossum <guido@python.org>
parents: 11799
diff changeset
56 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
57 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
58 extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError;
11799
3678dd685867 Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents: 11030
diff changeset
59 #ifdef MS_WINDOWS
3678dd685867 Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents: 11030
diff changeset
60 extern DL_IMPORT(PyObject *) PyExc_WindowsError;
3678dd685867 Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents: 11030
diff changeset
61 #endif
23
08562de01668 Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents: 10
diff changeset
62
6191
3a6b7a377dc3 Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents: 6146
diff changeset
63 extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst;
3a6b7a377dc3 Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents: 6146
diff changeset
64
15589
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
65 /* Predefined warning categories */
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
66 extern DL_IMPORT(PyObject *) PyExc_Warning;
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
67 extern DL_IMPORT(PyObject *) PyExc_UserWarning;
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
68 extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning;
23564
3f242cdd0904 As discussed on python-dev, add a mechanism to indicate features
Neal Norwitz <nnorwitz@gmail.com>
parents: 21145
diff changeset
69 extern DL_IMPORT(PyObject *) PyExc_PendingDeprecationWarning;
15589
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
70 extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning;
19433
5d81c6bff306 Introduce OverflowWarning -- to be issued when short int operations
Guido van Rossum <guido@python.org>
parents: 18915
diff changeset
71 extern DL_IMPORT(PyObject *) PyExc_OverflowWarning;
15589
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
72 extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning;
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
73
6191
3a6b7a377dc3 Added externs for three new exceptions PyExc_StandardError,
Barry Warsaw <barry@python.org>
parents: 6146
diff changeset
74
10
a71e896ed047 Made exception objects extern.
Guido van Rossum <guido@python.org>
parents: 6
diff changeset
75 /* Convenience functions */
a71e896ed047 Made exception objects extern.
Guido van Rossum <guido@python.org>
parents: 6
diff changeset
76
13435
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
77 extern DL_IMPORT(int) PyErr_BadArgument(void);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
78 extern DL_IMPORT(PyObject *) PyErr_NoMemory(void);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
79 extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
80 extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
20626
3d299b156511 Add function attributes that allow GCC to check the arguments of printf-like
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 20279
diff changeset
81 extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...)
3d299b156511 Add function attributes that allow GCC to check the arguments of printf-like
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 20279
diff changeset
82 __attribute__((format(printf, 2, 3)));
11799
3678dd685867 Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents: 11030
diff changeset
83 #ifdef MS_WINDOWS
3678dd685867 Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents: 11030
diff changeset
84 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
85 extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int);
3678dd685867 Declarations related to new WindowsError exception.
Guido van Rossum <guido@python.org>
parents: 11030
diff changeset
86 #endif
23
08562de01668 Added err_badcall() and planned new errors.
Guido van Rossum <guido@python.org>
parents: 10
diff changeset
87
14170
019265b3a856 Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents: 13435
diff changeset
88 /* Export the old function so that the existing API remains available: */
13435
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
89 extern DL_IMPORT(void) PyErr_BadInternalCall(void);
14170
019265b3a856 Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents: 13435
diff changeset
90 extern DL_IMPORT(void) _PyErr_BadInternalCall(char *filename, int lineno);
019265b3a856 Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents: 13435
diff changeset
91 /* Mask the old API with a call to the new API for code compiled under
019265b3a856 Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents: 13435
diff changeset
92 Python 2.0: */
019265b3a856 Improve the exceptions raised by PyErr_BadInternalCall(); adding the
Fred Drake <fdrake@acm.org>
parents: 13435
diff changeset
93 #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
1288
9fed5726a36d Several changes in one:
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
94
6324
20b5647a067e New API PyErr_NewException(name, base, dict) to create simple new exceptions.
Guido van Rossum <guido@python.org>
parents: 6323
diff changeset
95 /* Function to create a new exception */
13435
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
96 DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base,
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
97 PyObject *dict);
14330
6dee1985c681 refactor __del__ exception handler into PyErr_WriteUnraisable
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 14170
diff changeset
98 extern DL_IMPORT(void) PyErr_WriteUnraisable(PyObject *);
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
15589
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
100 /* Issue a warning or exception */
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
101 extern DL_IMPORT(int) PyErr_Warn(PyObject *, char *);
16849
a8771a52abb3 Add declaration for PyErr_WarnExplicit().
Guido van Rossum <guido@python.org>
parents: 16838
diff changeset
102 extern DL_IMPORT(int) PyErr_WarnExplicit(PyObject *, char *,
a8771a52abb3 Add declaration for PyErr_WarnExplicit().
Guido van Rossum <guido@python.org>
parents: 16838
diff changeset
103 char *, int, char *, PyObject *);
15589
857a5400be87 Add declarations for standard warning category classes (PyExc_Warning
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
104
4864
a53908d09a04 Added declaration for PyErr_SetInterrupt.
Barry Warsaw <barry@python.org>
parents: 4654
diff changeset
105 /* In sigcheck.c or signalmodule.c */
13435
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
106 extern DL_IMPORT(int) PyErr_CheckSignals(void);
7e3cd9480f66 ANSI-fication of the sources -- remove Py_PROTO!
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
107 extern DL_IMPORT(void) PyErr_SetInterrupt(void);
16838
09f6c1372056 Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15589
diff changeset
108
09f6c1372056 Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15589
diff changeset
109 /* Support for adding program text to SyntaxErrors */
09f6c1372056 Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15589
diff changeset
110 extern DL_IMPORT(void) PyErr_SyntaxLocation(char *, int);
09f6c1372056 Improve SyntaxErrors for bad future statements. Set file and location
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15589
diff changeset
111 extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int);
21070
ba67b9c97b69 Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents: 20626
diff changeset
112
18908
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
113 /* These APIs aren't really part of the error implementation, but
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
114 often needed to format error messages; the native C lib APIs are
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
115 not available on all platforms, which is why we provide emulations
21070
ba67b9c97b69 Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents: 20626
diff changeset
116 for those platforms in Python/mysnprintf.c,
ba67b9c97b69 Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents: 20626
diff changeset
117 WARNING: The return value of snprintf varies across platforms; do
ba67b9c97b69 Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents: 20626
diff changeset
118 not rely on any particular behavior; eventually the C99 defn may
ba67b9c97b69 Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents: 20626
diff changeset
119 be reliable.
ba67b9c97b69 Removed preprocessor gimmick trying to force use of snprintf emulation
Tim Peters <tim.peters@gmail.com>
parents: 20626
diff changeset
120 */
18908
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
121 #if defined(MS_WIN32) && !defined(HAVE_SNPRINTF)
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
122 # define HAVE_SNPRINTF
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
123 # define snprintf _snprintf
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
124 # define vsnprintf _vsnprintf
79c676f9b34a This patch turns the Python API mismatch notice into a standard
Marc-André Lemburg <mal@egenix.com>
parents: 17597
diff changeset
125 #endif
18915
510f7f6a877e Enable PyOS_snprintf() et al. during alpha phase of 2.2.0 and
Marc-André Lemburg <mal@egenix.com>
parents: 18909
diff changeset
126
18909
9753b0269f3a va_list is defined in stdarg.h.
Marc-André Lemburg <mal@egenix.com>
parents: 18908
diff changeset
127 #include <stdarg.h>
20626
3d299b156511 Add function attributes that allow GCC to check the arguments of printf-like
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 20279
diff changeset
128 extern DL_IMPORT(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
3d299b156511 Add function attributes that allow GCC to check the arguments of printf-like
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 20279
diff changeset
129 __attribute__((format(printf, 3, 4)));
3d299b156511 Add function attributes that allow GCC to check the arguments of printf-like
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 20279
diff changeset
130 extern DL_IMPORT(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
3d299b156511 Add function attributes that allow GCC to check the arguments of printf-like
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 20279
diff changeset
131 __attribute__((format(printf, 3, 0)));
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
132
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
133 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
134 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
135 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
136 #endif /* !Py_ERRORS_H */