1993-07-28 17:05:47 +08:00
|
|
|
#ifndef Py_ERRORS_H
|
|
|
|
#define Py_ERRORS_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1991-02-19 20:39:46 +08:00
|
|
|
|
1990-10-14 20:07:46 +08:00
|
|
|
/* Error handling definitions */
|
|
|
|
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(void) PyErr_SetNone(PyObject *);
|
|
|
|
PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *);
|
|
|
|
PyAPI_FUNC(void) PyErr_SetString(PyObject *, const char *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_Occurred(void);
|
|
|
|
PyAPI_FUNC(void) PyErr_Clear(void);
|
|
|
|
PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
|
|
|
|
PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
|
1990-10-14 20:07:46 +08:00
|
|
|
|
2005-08-07 02:31:24 +08:00
|
|
|
#ifdef Py_DEBUG
|
|
|
|
#define _PyErr_OCCURRED() PyErr_Occurred()
|
|
|
|
#else
|
|
|
|
#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type)
|
|
|
|
#endif
|
|
|
|
|
Three new C API functions:
- int PyErr_GivenExceptionMatches(obj1, obj2)
Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
instance of type obj2, or of a class derived from obj2
- int PyErr_ExceptionMatches(obj)
Higher level wrapper around PyErr_GivenExceptionMatches() which uses
PyErr_Occurred() as obj1. This will be the more commonly called
function.
- void PyErr_NormalizeException(typeptr, valptr, tbptr)
Normalizes exceptions, and places the normalized values in the
arguments. If type is not a class, this does nothing. If type is a
class, then it makes sure that value is an instance of the class by:
1. if instance is of the type, or a class derived from type, it does
nothing.
2. otherwise it instantiates the class, using the value as an
argument. If value is None, it uses an empty arg tuple, and if
the value is a tuple, it uses just that.
1997-08-23 05:22:58 +08:00
|
|
|
/* Error testing and normalization */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
|
|
|
|
PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *);
|
|
|
|
PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
|
Three new C API functions:
- int PyErr_GivenExceptionMatches(obj1, obj2)
Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
instance of type obj2, or of a class derived from obj2
- int PyErr_ExceptionMatches(obj)
Higher level wrapper around PyErr_GivenExceptionMatches() which uses
PyErr_Occurred() as obj1. This will be the more commonly called
function.
- void PyErr_NormalizeException(typeptr, valptr, tbptr)
Normalizes exceptions, and places the normalized values in the
arguments. If type is not a class, this does nothing. If type is a
class, then it makes sure that value is an instance of the class by:
1. if instance is of the type, or a class derived from type, it does
nothing.
2. otherwise it instantiates the class, using the value as an
argument. If value is None, it uses an empty arg tuple, and if
the value is a tuple, it uses just that.
1997-08-23 05:22:58 +08:00
|
|
|
|
2006-03-01 12:25:17 +08:00
|
|
|
/* */
|
Three new C API functions:
- int PyErr_GivenExceptionMatches(obj1, obj2)
Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
instance of type obj2, or of a class derived from obj2
- int PyErr_ExceptionMatches(obj)
Higher level wrapper around PyErr_GivenExceptionMatches() which uses
PyErr_Occurred() as obj1. This will be the more commonly called
function.
- void PyErr_NormalizeException(typeptr, valptr, tbptr)
Normalizes exceptions, and places the normalized values in the
arguments. If type is not a class, this does nothing. If type is a
class, then it makes sure that value is an instance of the class by:
1. if instance is of the type, or a class derived from type, it does
nothing.
2. otherwise it instantiates the class, using the value as an
argument. If value is None, it uses an empty arg tuple, and if
the value is a tuple, it uses just that.
1997-08-23 05:22:58 +08:00
|
|
|
|
2006-03-15 12:58:47 +08:00
|
|
|
#define PyExceptionClass_Check(x) \
|
|
|
|
(PyType_Check((x)) && PyType_IsSubtype( \
|
|
|
|
(PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException))
|
2006-03-01 12:25:17 +08:00
|
|
|
|
|
|
|
|
2006-03-15 12:58:47 +08:00
|
|
|
#define PyExceptionInstance_Check(x) \
|
|
|
|
(PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException))
|
2006-03-01 12:25:17 +08:00
|
|
|
|
2006-03-15 12:58:47 +08:00
|
|
|
#define PyExceptionClass_Name(x) \
|
|
|
|
((char *)(((PyTypeObject*)(x))->tp_name))
|
2006-03-01 12:25:17 +08:00
|
|
|
|
2006-03-15 12:58:47 +08:00
|
|
|
#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
|
2006-03-01 12:25:17 +08:00
|
|
|
|
|
|
|
|
1990-12-20 23:06:42 +08:00
|
|
|
/* Predefined exceptions */
|
1990-10-15 04:00:25 +08:00
|
|
|
|
2006-03-01 12:25:17 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_BaseException;
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_Exception;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_StopIteration;
|
2005-08-02 08:46:46 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_GeneratorExit;
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_StandardError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_ArithmeticError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_LookupError;
|
|
|
|
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_AssertionError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_AttributeError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_EOFError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_FloatingPointError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_EnvironmentError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_IOError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_OSError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_ImportError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_IndexError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_KeyError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_MemoryError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_NameError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_OverflowError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_RuntimeError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_NotImplementedError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_SyntaxError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_IndentationError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_TabError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_ReferenceError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_SystemError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_SystemExit;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_TypeError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_UnboundLocalError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_UnicodeError;
|
2002-09-02 21:14:32 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_UnicodeEncodeError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_UnicodeDecodeError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError;
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_ValueError;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError;
|
2000-02-17 23:17:18 +08:00
|
|
|
#ifdef MS_WINDOWS
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_WindowsError;
|
2000-02-17 23:17:18 +08:00
|
|
|
#endif
|
2002-12-06 20:48:53 +08:00
|
|
|
#ifdef __VMS
|
2003-07-02 04:15:21 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_VMSError;
|
2002-12-06 20:48:53 +08:00
|
|
|
#endif
|
1990-10-22 06:09:30 +08:00
|
|
|
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_MemoryErrorInst;
|
1997-08-30 05:56:07 +08:00
|
|
|
|
2000-12-16 05:57:34 +08:00
|
|
|
/* Predefined warning categories */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_Warning;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_UserWarning;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_DeprecationWarning;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_SyntaxWarning;
|
2004-08-25 10:14:08 +08:00
|
|
|
/* PyExc_OverflowWarning will go away for Python 2.5 */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_OverflowWarning;
|
|
|
|
PyAPI_DATA(PyObject *) PyExc_RuntimeWarning;
|
2002-08-14 23:51:29 +08:00
|
|
|
PyAPI_DATA(PyObject *) PyExc_FutureWarning;
|
2000-12-16 05:57:34 +08:00
|
|
|
|
1997-08-30 05:56:07 +08:00
|
|
|
|
1990-10-15 04:00:25 +08:00
|
|
|
/* Convenience functions */
|
|
|
|
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(int) PyErr_BadArgument(void);
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
|
2002-10-03 13:10:39 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
|
|
|
|
PyObject *, PyObject *);
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
|
2002-10-03 13:10:39 +08:00
|
|
|
#ifdef Py_WIN_WIDE_FILENAMES
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
|
|
|
|
PyObject *, Py_UNICODE *);
|
|
|
|
#endif /* Py_WIN_WIDE_FILENAMES */
|
|
|
|
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
|
2002-09-15 22:09:54 +08:00
|
|
|
Py_GCC_ATTRIBUTE((format(printf, 2, 3)));
|
2002-10-03 13:10:39 +08:00
|
|
|
|
2000-02-17 23:17:18 +08:00
|
|
|
#ifdef MS_WINDOWS
|
2002-10-03 13:10:39 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
|
|
|
|
int, const char *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
|
|
|
|
int, const char *);
|
|
|
|
#ifdef Py_WIN_WIDE_FILENAMES
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
|
|
|
|
int, const Py_UNICODE *);
|
|
|
|
#endif /* Py_WIN_WIDE_FILENAMES */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
|
2002-10-03 13:10:39 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
|
|
|
|
PyObject *,int, PyObject *);
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
|
2002-07-29 22:27:41 +08:00
|
|
|
PyObject *,int, const char *);
|
2002-10-03 13:10:39 +08:00
|
|
|
#ifdef Py_WIN_WIDE_FILENAMES
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
|
|
|
|
PyObject *,int, const Py_UNICODE *);
|
|
|
|
#endif /* Py_WIN_WIDE_FILENAMES */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
|
2002-10-03 13:10:39 +08:00
|
|
|
#endif /* MS_WINDOWS */
|
1990-10-22 06:09:30 +08:00
|
|
|
|
2000-08-25 06:38:39 +08:00
|
|
|
/* Export the old function so that the existing API remains available: */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(void) PyErr_BadInternalCall(void);
|
|
|
|
PyAPI_FUNC(void) _PyErr_BadInternalCall(char *filename, int lineno);
|
2000-08-25 06:38:39 +08:00
|
|
|
/* Mask the old API with a call to the new API for code compiled under
|
|
|
|
Python 2.0: */
|
|
|
|
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
|
1993-05-19 22:50:45 +08:00
|
|
|
|
1997-09-17 05:50:37 +08:00
|
|
|
/* Function to create a new exception */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base,
|
2000-07-09 01:25:55 +08:00
|
|
|
PyObject *dict);
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
|
1997-09-17 05:50:37 +08:00
|
|
|
|
2000-12-16 05:57:34 +08:00
|
|
|
/* Issue a warning or exception */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(int) PyErr_Warn(PyObject *, char *);
|
2002-12-11 22:04:59 +08:00
|
|
|
PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *,
|
|
|
|
const char *, int,
|
|
|
|
const char *, PyObject *);
|
2000-12-16 05:57:34 +08:00
|
|
|
|
1997-01-03 08:15:03 +08:00
|
|
|
/* In sigcheck.c or signalmodule.c */
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(int) PyErr_CheckSignals(void);
|
|
|
|
PyAPI_FUNC(void) PyErr_SetInterrupt(void);
|
2001-03-01 01:47:12 +08:00
|
|
|
|
|
|
|
/* Support for adding program text to SyntaxErrors */
|
2002-12-11 22:04:59 +08:00
|
|
|
PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
|
|
|
|
PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int);
|
2001-11-29 00:51:49 +08:00
|
|
|
|
2002-11-22 04:08:33 +08:00
|
|
|
#ifdef Py_USING_UNICODE
|
2002-09-02 21:14:32 +08:00
|
|
|
/* The following functions are used to create and modify unicode
|
|
|
|
exceptions from C */
|
2002-11-22 04:08:33 +08:00
|
|
|
|
2002-09-02 21:14:32 +08:00
|
|
|
/* create a UnicodeDecodeError object */
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create(
|
2006-02-16 01:27:45 +08:00
|
|
|
const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
/* create a UnicodeEncodeError object */
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
|
2006-02-16 01:27:45 +08:00
|
|
|
const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
/* create a UnicodeTranslateError object */
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
|
2006-02-16 01:27:45 +08:00
|
|
|
const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
/* get the encoding attribute */
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetEncoding(PyObject *);
|
|
|
|
|
|
|
|
/* get the object attribute */
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetObject(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetObject(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetObject(PyObject *);
|
|
|
|
|
|
|
|
/* get the value of the start attribute (the int * may not be NULL)
|
|
|
|
return 0 on success, -1 on failure */
|
2006-02-16 01:27:45 +08:00
|
|
|
PyAPI_FUNC(int) PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *);
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
/* assign a new value to the start attribute
|
|
|
|
return 0 on success, -1 on failure */
|
2006-02-16 01:27:45 +08:00
|
|
|
PyAPI_FUNC(int) PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t);
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
/* get the value of the end attribute (the int *may not be NULL)
|
|
|
|
return 0 on success, -1 on failure */
|
2006-02-16 01:27:45 +08:00
|
|
|
PyAPI_FUNC(int) PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *);
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
/* assign a new value to the end attribute
|
|
|
|
return 0 on success, -1 on failure */
|
2006-02-16 01:27:45 +08:00
|
|
|
PyAPI_FUNC(int) PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t);
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
/* get the value of the reason attribute */
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetReason(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetReason(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetReason(PyObject *);
|
|
|
|
|
|
|
|
/* assign a new value to the reason attribute
|
|
|
|
return 0 on success, -1 on failure */
|
|
|
|
PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason(
|
|
|
|
PyObject *, const char *);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason(
|
|
|
|
PyObject *, const char *);
|
|
|
|
PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
|
|
|
|
PyObject *, const char *);
|
2002-11-22 04:08:33 +08:00
|
|
|
#endif
|
2002-09-02 21:14:32 +08:00
|
|
|
|
|
|
|
|
2001-07-31 21:24:44 +08:00
|
|
|
/* These APIs aren't really part of the error implementation, but
|
|
|
|
often needed to format error messages; the native C lib APIs are
|
|
|
|
not available on all platforms, which is why we provide emulations
|
2001-11-29 00:51:49 +08:00
|
|
|
for those platforms in Python/mysnprintf.c,
|
|
|
|
WARNING: The return value of snprintf varies across platforms; do
|
|
|
|
not rely on any particular behavior; eventually the C99 defn may
|
|
|
|
be reliable.
|
|
|
|
*/
|
2001-07-31 21:24:44 +08:00
|
|
|
#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF)
|
|
|
|
# define HAVE_SNPRINTF
|
|
|
|
# define snprintf _snprintf
|
|
|
|
# define vsnprintf _vsnprintf
|
|
|
|
#endif
|
2001-08-01 02:05:33 +08:00
|
|
|
|
2001-07-31 22:23:52 +08:00
|
|
|
#include <stdarg.h>
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
|
2002-09-15 22:09:54 +08:00
|
|
|
Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
|
2002-08-12 15:21:58 +08:00
|
|
|
PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
|
2002-09-15 22:09:54 +08:00
|
|
|
Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
|
1994-08-01 19:34:53 +08:00
|
|
|
|
1993-07-28 17:05:47 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_ERRORS_H */
|