blob: f87b059d7af05396f6677a7b91f5f9c9cb435e18 [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
Thomas Wouters477c8d52006-05-27 19:21:47 +00007/* Error objects */
8
Collin Winter828f04a2007-08-31 00:04:24 +00009/* PyException_HEAD defines the initial segment of every exception class. */
Collin Winter231ff0e2007-08-31 00:59:38 +000010#define PyException_HEAD PyObject_HEAD PyObject *dict;\
Collin Winter828f04a2007-08-31 00:04:24 +000011 PyObject *args; PyObject *traceback;\
12 PyObject *context; PyObject *cause;
13
Thomas Wouters477c8d52006-05-27 19:21:47 +000014typedef struct {
Collin Winter828f04a2007-08-31 00:04:24 +000015 PyException_HEAD
Thomas Wouters477c8d52006-05-27 19:21:47 +000016} PyBaseExceptionObject;
17
18typedef struct {
Collin Winter828f04a2007-08-31 00:04:24 +000019 PyException_HEAD
Thomas Wouters477c8d52006-05-27 19:21:47 +000020 PyObject *msg;
21 PyObject *filename;
22 PyObject *lineno;
23 PyObject *offset;
24 PyObject *text;
25 PyObject *print_file_and_line;
26} PySyntaxErrorObject;
27
Thomas Wouters477c8d52006-05-27 19:21:47 +000028typedef struct {
Collin Winter828f04a2007-08-31 00:04:24 +000029 PyException_HEAD
Thomas Wouters477c8d52006-05-27 19:21:47 +000030 PyObject *encoding;
31 PyObject *object;
Guido van Rossum7eaf8222007-06-18 17:58:50 +000032 Py_ssize_t start;
33 Py_ssize_t end;
Thomas Wouters477c8d52006-05-27 19:21:47 +000034 PyObject *reason;
35} PyUnicodeErrorObject;
Thomas Wouters477c8d52006-05-27 19:21:47 +000036
37typedef struct {
Collin Winter828f04a2007-08-31 00:04:24 +000038 PyException_HEAD
Thomas Wouters477c8d52006-05-27 19:21:47 +000039 PyObject *code;
40} PySystemExitObject;
41
42typedef struct {
Collin Winter828f04a2007-08-31 00:04:24 +000043 PyException_HEAD
Thomas Wouters477c8d52006-05-27 19:21:47 +000044 PyObject *myerrno;
45 PyObject *strerror;
46 PyObject *filename;
47} PyEnvironmentErrorObject;
48
49#ifdef MS_WINDOWS
50typedef struct {
Collin Winter828f04a2007-08-31 00:04:24 +000051 PyException_HEAD
Thomas Wouters477c8d52006-05-27 19:21:47 +000052 PyObject *myerrno;
53 PyObject *strerror;
54 PyObject *filename;
55 PyObject *winerror;
56} PyWindowsErrorObject;
57#endif
Guido van Rossumf70e43a1991-02-19 12:39:46 +000058
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000059/* Error handling definitions */
60
Mark Hammond91a681d2002-08-12 07:21:58 +000061PyAPI_FUNC(void) PyErr_SetNone(PyObject *);
62PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *);
63PyAPI_FUNC(void) PyErr_SetString(PyObject *, const char *);
64PyAPI_FUNC(PyObject *) PyErr_Occurred(void);
65PyAPI_FUNC(void) PyErr_Clear(void);
66PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
67PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000068
Raymond Hettinger5ba0cbe2005-08-06 18:31:24 +000069#ifdef Py_DEBUG
70#define _PyErr_OCCURRED() PyErr_Occurred()
71#else
72#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type)
73#endif
74
Barry Warsawc0dc92a1997-08-22 21:22:58 +000075/* Error testing and normalization */
Mark Hammond91a681d2002-08-12 07:21:58 +000076PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
77PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *);
78PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
Barry Warsawc0dc92a1997-08-22 21:22:58 +000079
Collin Winter828f04a2007-08-31 00:04:24 +000080/* Traceback manipulation (PEP 3134) */
81PyAPI_FUNC(int) PyException_SetTraceback(PyObject *, PyObject *);
82PyAPI_FUNC(PyObject *) PyException_GetTraceback(PyObject *);
83
84/* Cause manipulation (PEP 3134) */
85PyAPI_FUNC(PyObject *) PyException_GetCause(PyObject *);
86PyAPI_FUNC(void) PyException_SetCause(PyObject *, PyObject *);
87
88/* Context manipulation (PEP 3134) */
89PyAPI_FUNC(PyObject *) PyException_GetContext(PyObject *);
90PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *);
91
92
Brett Cannonbf364092006-03-01 04:25:17 +000093/* */
Barry Warsawc0dc92a1997-08-22 21:22:58 +000094
Thomas Wouters27d517b2007-02-25 20:39:11 +000095#define PyExceptionClass_Check(x) \
96 (PyType_Check((x)) && \
97 PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))
Brett Cannonbf364092006-03-01 04:25:17 +000098
Thomas Wouters27d517b2007-02-25 20:39:11 +000099#define PyExceptionInstance_Check(x) \
100 PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)
Brett Cannonbf364092006-03-01 04:25:17 +0000101
Guido van Rossum45aecf42006-03-15 04:58:47 +0000102#define PyExceptionClass_Name(x) \
103 ((char *)(((PyTypeObject*)(x))->tp_name))
Brett Cannonbf364092006-03-01 04:25:17 +0000104
Guido van Rossum45aecf42006-03-15 04:58:47 +0000105#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
Brett Cannonbf364092006-03-01 04:25:17 +0000106
Collin Winter828f04a2007-08-31 00:04:24 +0000107
Guido van Rossum3f5da241990-12-20 15:06:42 +0000108/* Predefined exceptions */
Guido van Rossum5c600e11990-10-14 20:00:25 +0000109
Brett Cannonbf364092006-03-01 04:25:17 +0000110PyAPI_DATA(PyObject *) PyExc_BaseException;
Mark Hammond91a681d2002-08-12 07:21:58 +0000111PyAPI_DATA(PyObject *) PyExc_Exception;
112PyAPI_DATA(PyObject *) PyExc_StopIteration;
Phillip J. Eby0d6615f2005-08-02 00:46:46 +0000113PyAPI_DATA(PyObject *) PyExc_GeneratorExit;
Mark Hammond91a681d2002-08-12 07:21:58 +0000114PyAPI_DATA(PyObject *) PyExc_ArithmeticError;
115PyAPI_DATA(PyObject *) PyExc_LookupError;
Barry Warsaw392d8271997-08-29 21:56:07 +0000116
Mark Hammond91a681d2002-08-12 07:21:58 +0000117PyAPI_DATA(PyObject *) PyExc_AssertionError;
118PyAPI_DATA(PyObject *) PyExc_AttributeError;
119PyAPI_DATA(PyObject *) PyExc_EOFError;
120PyAPI_DATA(PyObject *) PyExc_FloatingPointError;
121PyAPI_DATA(PyObject *) PyExc_EnvironmentError;
122PyAPI_DATA(PyObject *) PyExc_IOError;
123PyAPI_DATA(PyObject *) PyExc_OSError;
124PyAPI_DATA(PyObject *) PyExc_ImportError;
125PyAPI_DATA(PyObject *) PyExc_IndexError;
126PyAPI_DATA(PyObject *) PyExc_KeyError;
127PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt;
128PyAPI_DATA(PyObject *) PyExc_MemoryError;
129PyAPI_DATA(PyObject *) PyExc_NameError;
130PyAPI_DATA(PyObject *) PyExc_OverflowError;
131PyAPI_DATA(PyObject *) PyExc_RuntimeError;
132PyAPI_DATA(PyObject *) PyExc_NotImplementedError;
133PyAPI_DATA(PyObject *) PyExc_SyntaxError;
134PyAPI_DATA(PyObject *) PyExc_IndentationError;
135PyAPI_DATA(PyObject *) PyExc_TabError;
136PyAPI_DATA(PyObject *) PyExc_ReferenceError;
137PyAPI_DATA(PyObject *) PyExc_SystemError;
138PyAPI_DATA(PyObject *) PyExc_SystemExit;
139PyAPI_DATA(PyObject *) PyExc_TypeError;
140PyAPI_DATA(PyObject *) PyExc_UnboundLocalError;
141PyAPI_DATA(PyObject *) PyExc_UnicodeError;
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000142PyAPI_DATA(PyObject *) PyExc_UnicodeEncodeError;
143PyAPI_DATA(PyObject *) PyExc_UnicodeDecodeError;
144PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError;
Mark Hammond91a681d2002-08-12 07:21:58 +0000145PyAPI_DATA(PyObject *) PyExc_ValueError;
146PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError;
Guido van Rossumdb0c9f72000-02-17 15:17:18 +0000147#ifdef MS_WINDOWS
Mark Hammond91a681d2002-08-12 07:21:58 +0000148PyAPI_DATA(PyObject *) PyExc_WindowsError;
Guido van Rossumdb0c9f72000-02-17 15:17:18 +0000149#endif
Martin v. Löwis79acb9e2002-12-06 12:48:53 +0000150#ifdef __VMS
Neal Norwitz21d896c2003-07-01 20:15:21 +0000151PyAPI_DATA(PyObject *) PyExc_VMSError;
Martin v. Löwis79acb9e2002-12-06 12:48:53 +0000152#endif
Guido van Rossum3e55cb61990-10-21 22:09:30 +0000153
Christian Heimesb186d002008-03-18 15:15:01 +0000154PyAPI_DATA(PyObject *) PyExc_BufferError;
155
Mark Hammond91a681d2002-08-12 07:21:58 +0000156PyAPI_DATA(PyObject *) PyExc_MemoryErrorInst;
Thomas Wouters89d996e2007-09-08 17:39:28 +0000157PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst;
Barry Warsaw392d8271997-08-29 21:56:07 +0000158
Guido van Rossum3fc30372000-12-15 21:57:34 +0000159/* Predefined warning categories */
Mark Hammond91a681d2002-08-12 07:21:58 +0000160PyAPI_DATA(PyObject *) PyExc_Warning;
161PyAPI_DATA(PyObject *) PyExc_UserWarning;
162PyAPI_DATA(PyObject *) PyExc_DeprecationWarning;
163PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning;
164PyAPI_DATA(PyObject *) PyExc_SyntaxWarning;
Mark Hammond91a681d2002-08-12 07:21:58 +0000165PyAPI_DATA(PyObject *) PyExc_RuntimeWarning;
Barry Warsaw9f007392002-08-14 15:51:29 +0000166PyAPI_DATA(PyObject *) PyExc_FutureWarning;
Thomas Wouters477c8d52006-05-27 19:21:47 +0000167PyAPI_DATA(PyObject *) PyExc_ImportWarning;
Thomas Wouters00ee7ba2006-08-21 19:07:27 +0000168PyAPI_DATA(PyObject *) PyExc_UnicodeWarning;
Guido van Rossum98297ee2007-11-06 21:34:58 +0000169PyAPI_DATA(PyObject *) PyExc_BytesWarning;
Guido van Rossum3fc30372000-12-15 21:57:34 +0000170
Barry Warsaw392d8271997-08-29 21:56:07 +0000171
Guido van Rossum5c600e11990-10-14 20:00:25 +0000172/* Convenience functions */
173
Mark Hammond91a681d2002-08-12 07:21:58 +0000174PyAPI_FUNC(int) PyErr_BadArgument(void);
175PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
176PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000177PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
178 PyObject *, PyObject *);
Neal Norwitzb382b842007-08-24 20:00:37 +0000179PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *);
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000180#ifdef Py_WIN_WIDE_FILENAMES
181PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
Neal Norwitzb382b842007-08-24 20:00:37 +0000182 PyObject *, const Py_UNICODE *);
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000183#endif /* Py_WIN_WIDE_FILENAMES */
184
Walter Dörwald573c08c2007-05-25 15:46:59 +0000185PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...);
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000186
Guido van Rossumdb0c9f72000-02-17 15:17:18 +0000187#ifdef MS_WINDOWS
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000188PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
189 int, const char *);
190PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
191 int, const char *);
192#ifdef Py_WIN_WIDE_FILENAMES
193PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
194 int, const Py_UNICODE *);
195#endif /* Py_WIN_WIDE_FILENAMES */
Mark Hammond91a681d2002-08-12 07:21:58 +0000196PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000197PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
198 PyObject *,int, PyObject *);
Mark Hammond91a681d2002-08-12 07:21:58 +0000199PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
Thomas Heller085358a2002-07-29 14:27:41 +0000200 PyObject *,int, const char *);
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000201#ifdef Py_WIN_WIDE_FILENAMES
202PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
203 PyObject *,int, const Py_UNICODE *);
204#endif /* Py_WIN_WIDE_FILENAMES */
Mark Hammond91a681d2002-08-12 07:21:58 +0000205PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
Mark Hammondc2e85bd2002-10-03 05:10:39 +0000206#endif /* MS_WINDOWS */
Guido van Rossum3e55cb61990-10-21 22:09:30 +0000207
Fred Drake6d63adf2000-08-24 22:38:39 +0000208/* Export the old function so that the existing API remains available: */
Mark Hammond91a681d2002-08-12 07:21:58 +0000209PyAPI_FUNC(void) PyErr_BadInternalCall(void);
Neal Norwitzb382b842007-08-24 20:00:37 +0000210PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno);
Fred Drake6d63adf2000-08-24 22:38:39 +0000211/* Mask the old API with a call to the new API for code compiled under
212 Python 2.0: */
213#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
Guido van Rossum25831651993-05-19 14:50:45 +0000214
Guido van Rossum2d2c3441997-09-16 21:50:37 +0000215/* Function to create a new exception */
Neal Norwitzb382b842007-08-24 20:00:37 +0000216PyAPI_FUNC(PyObject *) PyErr_NewException(const char *name, PyObject *base,
Fred Draked5c84ed2000-07-08 17:25:55 +0000217 PyObject *dict);
Mark Hammond91a681d2002-08-12 07:21:58 +0000218PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
Guido van Rossum2d2c3441997-09-16 21:50:37 +0000219
Barry Warsawf3f41a91997-01-03 00:15:03 +0000220/* In sigcheck.c or signalmodule.c */
Mark Hammond91a681d2002-08-12 07:21:58 +0000221PyAPI_FUNC(int) PyErr_CheckSignals(void);
222PyAPI_FUNC(void) PyErr_SetInterrupt(void);
Jeremy Hyltonad3d3f22001-02-28 17:47:12 +0000223
Christian Heimes5fb7c2a2007-12-24 08:52:31 +0000224/* In signalmodule.c */
225int PySignal_SetWakeupFd(int fd);
226
Jeremy Hyltonad3d3f22001-02-28 17:47:12 +0000227/* Support for adding program text to SyntaxErrors */
Martin v. Löwis95292d62002-12-11 14:04:59 +0000228PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
229PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int);
Tim Petersa437d452001-11-28 16:51:49 +0000230
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000231/* The following functions are used to create and modify unicode
232 exceptions from C */
Walter Dörwaldbf73db82002-11-21 20:08:33 +0000233
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000234/* create a UnicodeDecodeError object */
235PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create(
Martin v. Löwis18e16552006-02-15 17:27:45 +0000236 const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000237
238/* create a UnicodeEncodeError object */
239PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
Martin v. Löwis18e16552006-02-15 17:27:45 +0000240 const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000241
242/* create a UnicodeTranslateError object */
243PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
Martin v. Löwis18e16552006-02-15 17:27:45 +0000244 const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000245
246/* get the encoding attribute */
247PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *);
248PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetEncoding(PyObject *);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000249
250/* get the object attribute */
251PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetObject(PyObject *);
252PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetObject(PyObject *);
253PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetObject(PyObject *);
254
255/* get the value of the start attribute (the int * may not be NULL)
256 return 0 on success, -1 on failure */
Martin v. Löwis18e16552006-02-15 17:27:45 +0000257PyAPI_FUNC(int) PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *);
258PyAPI_FUNC(int) PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *);
259PyAPI_FUNC(int) PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000260
261/* assign a new value to the start attribute
262 return 0 on success, -1 on failure */
Martin v. Löwis18e16552006-02-15 17:27:45 +0000263PyAPI_FUNC(int) PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t);
264PyAPI_FUNC(int) PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t);
265PyAPI_FUNC(int) PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000266
267/* get the value of the end attribute (the int *may not be NULL)
268 return 0 on success, -1 on failure */
Martin v. Löwis18e16552006-02-15 17:27:45 +0000269PyAPI_FUNC(int) PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *);
270PyAPI_FUNC(int) PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *);
271PyAPI_FUNC(int) PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000272
273/* assign a new value to the end attribute
274 return 0 on success, -1 on failure */
Martin v. Löwis18e16552006-02-15 17:27:45 +0000275PyAPI_FUNC(int) PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t);
276PyAPI_FUNC(int) PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t);
277PyAPI_FUNC(int) PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t);
Walter Dörwald3aeb6322002-09-02 13:14:32 +0000278
279/* get the value of the reason attribute */
280PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetReason(PyObject *);
281PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetReason(PyObject *);
282PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetReason(PyObject *);
283
284/* assign a new value to the reason attribute
285 return 0 on success, -1 on failure */
286PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason(
287 PyObject *, const char *);
288PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason(
289 PyObject *, const char *);
290PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
291 PyObject *, const char *);
292
293
Marc-André Lemburge5006eb2001-07-31 13:24:44 +0000294/* These APIs aren't really part of the error implementation, but
295 often needed to format error messages; the native C lib APIs are
296 not available on all platforms, which is why we provide emulations
Tim Petersa437d452001-11-28 16:51:49 +0000297 for those platforms in Python/mysnprintf.c,
298 WARNING: The return value of snprintf varies across platforms; do
299 not rely on any particular behavior; eventually the C99 defn may
300 be reliable.
301*/
Marc-André Lemburge5006eb2001-07-31 13:24:44 +0000302#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF)
303# define HAVE_SNPRINTF
304# define snprintf _snprintf
305# define vsnprintf _vsnprintf
306#endif
Marc-André Lemburg03d1b182001-07-31 18:05:33 +0000307
Marc-André Lemburgcecd9e02001-07-31 14:23:52 +0000308#include <stdarg.h>
Mark Hammond91a681d2002-08-12 07:21:58 +0000309PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
Neil Schemenauer96aa0ac2002-09-15 14:09:54 +0000310 Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
Mark Hammond91a681d2002-08-12 07:21:58 +0000311PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
Neil Schemenauer96aa0ac2002-09-15 14:09:54 +0000312 Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
Guido van Rossumb6775db1994-08-01 11:34:53 +0000313
Guido van Rossuma3309961993-07-28 09:05:47 +0000314#ifdef __cplusplus
315}
316#endif
317#endif /* !Py_ERRORS_H */