~ubuntu-branches/ubuntu/natty/python3.1/natty-security

« back to all changes in this revision

Viewing changes to Include/pyerrors.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-07-06 16:52:42 UTC
  • mfrom: (1.2.1 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100706165242-2xv4i019r3et6c0j
Tags: 3.1.2+20100706-1ubuntu1
* Merge with Debian; remaining changes:
  - Regenerate the control file.
  - Add debian/patches/overwrite-semaphore-check for Lucid buildds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
/* PyException_HEAD defines the initial segment of every exception class. */
10
10
#define PyException_HEAD PyObject_HEAD PyObject *dict;\
11
 
                         PyObject *args; PyObject *traceback;\
12
 
                         PyObject *context; PyObject *cause;
 
11
             PyObject *args; PyObject *traceback;\
 
12
             PyObject *context; PyObject *cause;
13
13
 
14
14
typedef struct {
15
15
    PyException_HEAD
92
92
 
93
93
/* */
94
94
 
95
 
#define PyExceptionClass_Check(x)                                       \
96
 
        (PyType_Check((x)) &&                                           \
97
 
         PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))
 
95
#define PyExceptionClass_Check(x)                                       \
 
96
    (PyType_Check((x)) &&                                               \
 
97
     PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))
98
98
 
99
 
#define PyExceptionInstance_Check(x)                    \
100
 
        PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)
 
99
#define PyExceptionInstance_Check(x)                    \
 
100
    PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)
101
101
 
102
102
#define PyExceptionClass_Name(x) \
103
 
         ((char *)(((PyTypeObject*)(x))->tp_name))
 
103
     ((char *)(((PyTypeObject*)(x))->tp_name))
104
104
 
105
105
#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
106
106
 
175
175
PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
176
176
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
177
177
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
178
 
        PyObject *, PyObject *);
 
178
    PyObject *, PyObject *);
179
179
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *);
180
180
#ifdef MS_WINDOWS
181
181
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
182
 
        PyObject *, const Py_UNICODE *);
 
182
    PyObject *, const Py_UNICODE *);
183
183
#endif /* MS_WINDOWS */
184
184
 
185
185
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...);
186
186
 
187
187
#ifdef MS_WINDOWS
188
188
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
189
 
        int, const char *);
 
189
    int, const char *);
190
190
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
191
 
        int, const char *);
 
191
    int, const char *);
192
192
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
193
 
        int, const Py_UNICODE *);
 
193
    int, const Py_UNICODE *);
194
194
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
195
195
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
196
 
        PyObject *,int, PyObject *);
 
196
    PyObject *,int, PyObject *);
197
197
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
198
 
        PyObject *,int, const char *);
 
198
    PyObject *,int, const char *);
199
199
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
200
 
        PyObject *,int, const Py_UNICODE *);
 
200
    PyObject *,int, const Py_UNICODE *);
201
201
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
202
202
#endif /* MS_WINDOWS */
203
203
 
229
229
 
230
230
/* create a UnicodeDecodeError object */
231
231
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create(
232
 
        const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
 
232
    const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
233
233
 
234
234
/* create a UnicodeEncodeError object */
235
235
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
236
 
        const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
 
236
    const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
237
237
 
238
238
/* create a UnicodeTranslateError object */
239
239
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
240
 
        const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
 
240
    const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
241
241
 
242
242
/* get the encoding attribute */
243
243
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *);
280
280
/* assign a new value to the reason attribute
281
281
   return 0 on success, -1 on failure */
282
282
PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason(
283
 
        PyObject *, const char *);
 
283
    PyObject *, const char *);
284
284
PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason(
285
 
        PyObject *, const char *);
 
285
    PyObject *, const char *);
286
286
PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
287
 
        PyObject *, const char *);
 
287
    PyObject *, const char *);
288
288
 
289
289
 
290
290
/* These APIs aren't really part of the error implementation, but
303
303
 
304
304
#include <stdarg.h>
305
305
PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char  *format, ...)
306
 
                        Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
 
306
                        Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
307
307
PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char  *format, va_list va)
308
 
                        Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
 
308
                        Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
309
309
 
310
310
#ifdef __cplusplus
311
311
}