Commit 91a681de authored by Mark Hammond's avatar Mark Hammond

Excise DL_EXPORT from Include.

Thanks to Skip Montanaro and Kalle Svensson for the patches.
parent 44121a6b
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
#include "abstract.h" #include "abstract.h"
/* _Py_Mangle is defined in compile.c */ /* _Py_Mangle is defined in compile.c */
extern DL_IMPORT(int) _Py_Mangle(char *p, char *name, \ PyAPI_FUNC(int) _Py_Mangle(char *p, char *name, \
char *buffer, size_t maxlen); char *buffer, size_t maxlen);
/* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */ /* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */
......
This diff is collapsed.
...@@ -9,7 +9,7 @@ extern "C" { ...@@ -9,7 +9,7 @@ extern "C" {
typedef PyIntObject PyBoolObject; typedef PyIntObject PyBoolObject;
extern DL_IMPORT(PyTypeObject) PyBool_Type; PyAPI_DATA(PyTypeObject) PyBool_Type;
#define PyBool_Check(x) ((x)->ob_type == &PyBool_Type) #define PyBool_Check(x) ((x)->ob_type == &PyBool_Type)
...@@ -17,14 +17,14 @@ extern DL_IMPORT(PyTypeObject) PyBool_Type; ...@@ -17,14 +17,14 @@ extern DL_IMPORT(PyTypeObject) PyBool_Type;
Don't forget to apply Py_INCREF() when returning either!!! */ Don't forget to apply Py_INCREF() when returning either!!! */
/* Don't use these directly */ /* Don't use these directly */
extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; PyAPI_DATA(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct;
/* Use these macros */ /* Use these macros */
#define Py_False ((PyObject *) &_Py_ZeroStruct) #define Py_False ((PyObject *) &_Py_ZeroStruct)
#define Py_True ((PyObject *) &_Py_TrueStruct) #define Py_True ((PyObject *) &_Py_TrueStruct)
/* Function to return a bool from a C long */ /* Function to return a bool from a C long */
extern DL_IMPORT(PyObject *) PyBool_FromLong(long); PyAPI_FUNC(PyObject *) PyBool_FromLong(long);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -10,22 +10,22 @@ extern "C" { ...@@ -10,22 +10,22 @@ extern "C" {
#endif #endif
extern DL_IMPORT(PyTypeObject) PyBuffer_Type; PyAPI_DATA(PyTypeObject) PyBuffer_Type;
#define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type) #define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type)
#define Py_END_OF_BUFFER (-1) #define Py_END_OF_BUFFER (-1)
extern DL_IMPORT(PyObject *) PyBuffer_FromObject(PyObject *base, PyAPI_FUNC(PyObject *) PyBuffer_FromObject(PyObject *base,
int offset, int size); int offset, int size);
extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base,
int offset, int offset,
int size); int size);
extern DL_IMPORT(PyObject *) PyBuffer_FromMemory(void *ptr, int size); PyAPI_FUNC(PyObject *) PyBuffer_FromMemory(void *ptr, int size);
extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size); PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size);
extern DL_IMPORT(PyObject *) PyBuffer_New(int size); PyAPI_FUNC(PyObject *) PyBuffer_New(int size);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -11,13 +11,13 @@ typedef struct { ...@@ -11,13 +11,13 @@ typedef struct {
PyObject *ob_ref; PyObject *ob_ref;
} PyCellObject; } PyCellObject;
extern DL_IMPORT(PyTypeObject) PyCell_Type; PyAPI_DATA(PyTypeObject) PyCell_Type;
#define PyCell_Check(op) ((op)->ob_type == &PyCell_Type) #define PyCell_Check(op) ((op)->ob_type == &PyCell_Type)
extern DL_IMPORT(PyObject *) PyCell_New(PyObject *); PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
extern DL_IMPORT(PyObject *) PyCell_Get(PyObject *); PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
extern DL_IMPORT(int) PyCell_Set(PyObject *, PyObject *); PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
#define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v)
......
...@@ -7,46 +7,46 @@ extern "C" { ...@@ -7,46 +7,46 @@ extern "C" {
/* Interface to random parts in ceval.c */ /* Interface to random parts in ceval.c */
DL_IMPORT(PyObject *) PyEval_CallObjectWithKeywords PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
(PyObject *, PyObject *, PyObject *); PyObject *, PyObject *, PyObject *);
/* DLL-level Backwards compatibility: */ /* DLL-level Backwards compatibility: */
#undef PyEval_CallObject #undef PyEval_CallObject
DL_IMPORT(PyObject *) PyEval_CallObject(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyEval_CallObject(PyObject *, PyObject *);
/* Inline this */ /* Inline this */
#define PyEval_CallObject(func,arg) \ #define PyEval_CallObject(func,arg) \
PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL) PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
DL_IMPORT(PyObject *) PyEval_CallFunction(PyObject *obj, char *format, ...); PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj, char *format, ...);
DL_IMPORT(PyObject *) PyEval_CallMethod(PyObject *obj, PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
char *methodname, char *format, ...); char *methodname, char *format, ...);
DL_IMPORT(void) PyEval_SetProfile(Py_tracefunc, PyObject *); PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
DL_IMPORT(void) PyEval_SetTrace(Py_tracefunc, PyObject *); PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
DL_IMPORT(PyObject *) PyEval_GetBuiltins(void); PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void);
DL_IMPORT(PyObject *) PyEval_GetGlobals(void); PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void);
DL_IMPORT(PyObject *) PyEval_GetLocals(void); PyAPI_FUNC(PyObject *) PyEval_GetLocals(void);
DL_IMPORT(PyObject *) PyEval_GetOwner(void); PyAPI_FUNC(PyObject *) PyEval_GetOwner(void);
DL_IMPORT(PyObject *) PyEval_GetFrame(void); PyAPI_FUNC(PyObject *) PyEval_GetFrame(void);
DL_IMPORT(int) PyEval_GetRestricted(void); PyAPI_FUNC(int) PyEval_GetRestricted(void);
/* Look at the current frame's (if any) code's co_flags, and turn on /* Look at the current frame's (if any) code's co_flags, and turn on
the corresponding compiler flags in cf->cf_flags. Return 1 if any the corresponding compiler flags in cf->cf_flags. Return 1 if any
flag was set, else return 0. */ flag was set, else return 0. */
DL_IMPORT(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
DL_IMPORT(int) Py_FlushLine(void); PyAPI_FUNC(int) Py_FlushLine(void);
DL_IMPORT(int) Py_AddPendingCall(int (*func)(void *), void *arg); PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
DL_IMPORT(int) Py_MakePendingCalls(void); PyAPI_FUNC(int) Py_MakePendingCalls(void);
DL_IMPORT(void) Py_SetRecursionLimit(int); PyAPI_FUNC(void) Py_SetRecursionLimit(int);
DL_IMPORT(int) Py_GetRecursionLimit(void); PyAPI_FUNC(int) Py_GetRecursionLimit(void);
DL_IMPORT(char *) PyEval_GetFuncName(PyObject *); PyAPI_FUNC(char *) PyEval_GetFuncName(PyObject *);
DL_IMPORT(char *) PyEval_GetFuncDesc(PyObject *); PyAPI_FUNC(char *) PyEval_GetFuncDesc(PyObject *);
/* Interface for threads. /* Interface for threads.
...@@ -93,17 +93,17 @@ DL_IMPORT(char *) PyEval_GetFuncDesc(PyObject *); ...@@ -93,17 +93,17 @@ DL_IMPORT(char *) PyEval_GetFuncDesc(PyObject *);
mechanism! mechanism!
*/ */
extern DL_IMPORT(PyThreadState *) PyEval_SaveThread(void); PyAPI_FUNC(PyThreadState *) PyEval_SaveThread(void);
extern DL_IMPORT(void) PyEval_RestoreThread(PyThreadState *); PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
#ifdef WITH_THREAD #ifdef WITH_THREAD
extern DL_IMPORT(void) PyEval_InitThreads(void); PyAPI_FUNC(void) PyEval_InitThreads(void);
extern DL_IMPORT(void) PyEval_AcquireLock(void); PyAPI_FUNC(void) PyEval_AcquireLock(void);
extern DL_IMPORT(void) PyEval_ReleaseLock(void); PyAPI_FUNC(void) PyEval_ReleaseLock(void);
extern DL_IMPORT(void) PyEval_AcquireThread(PyThreadState *tstate); PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate);
extern DL_IMPORT(void) PyEval_ReleaseThread(PyThreadState *tstate); PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
extern DL_IMPORT(void) PyEval_ReInitThreads(void); PyAPI_FUNC(void) PyEval_ReInitThreads(void);
#define Py_BEGIN_ALLOW_THREADS { \ #define Py_BEGIN_ALLOW_THREADS { \
PyThreadState *_save; \ PyThreadState *_save; \
...@@ -122,7 +122,7 @@ extern DL_IMPORT(void) PyEval_ReInitThreads(void); ...@@ -122,7 +122,7 @@ extern DL_IMPORT(void) PyEval_ReInitThreads(void);
#endif /* !WITH_THREAD */ #endif /* !WITH_THREAD */
extern DL_IMPORT(int) _PyEval_SliceIndex(PyObject *, int *); PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, int *);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -35,21 +35,21 @@ typedef struct { ...@@ -35,21 +35,21 @@ typedef struct {
PyObject *im_weakreflist; /* List of weak references */ PyObject *im_weakreflist; /* List of weak references */
} PyMethodObject; } PyMethodObject;
extern DL_IMPORT(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type; PyAPI_DATA(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type;
#define PyClass_Check(op) ((op)->ob_type == &PyClass_Type) #define PyClass_Check(op) ((op)->ob_type == &PyClass_Type)
#define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type) #define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type)
#define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type) #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
extern DL_IMPORT(PyObject *) PyClass_New(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyClass_New(PyObject *, PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) PyInstance_New(PyObject *, PyObject *, PyAPI_FUNC(PyObject *) PyInstance_New(PyObject *, PyObject *,
PyObject *); PyObject *);
extern DL_IMPORT(PyObject *) PyInstance_NewRaw(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyInstance_NewRaw(PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) PyMethod_New(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) PyMethod_Function(PyObject *); PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
extern DL_IMPORT(PyObject *) PyMethod_Self(PyObject *); PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
extern DL_IMPORT(PyObject *) PyMethod_Class(PyObject *); PyAPI_FUNC(PyObject *) PyMethod_Class(PyObject *);
/* Macros for direct access to these values. Type checks are *not* /* Macros for direct access to these values. Type checks are *not*
done, so use with care. */ done, so use with care. */
...@@ -60,7 +60,7 @@ extern DL_IMPORT(PyObject *) PyMethod_Class(PyObject *); ...@@ -60,7 +60,7 @@ extern DL_IMPORT(PyObject *) PyMethod_Class(PyObject *);
#define PyMethod_GET_CLASS(meth) \ #define PyMethod_GET_CLASS(meth) \
(((PyMethodObject *)meth) -> im_class) (((PyMethodObject *)meth) -> im_class)
extern DL_IMPORT(int) PyClass_IsSubclass(PyObject *, PyObject *); PyAPI_FUNC(int) PyClass_IsSubclass(PyObject *, PyObject *);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
extern "C" { extern "C" {
#endif #endif
extern DL_IMPORT(PyTypeObject) PyCObject_Type; PyAPI_DATA(PyTypeObject) PyCObject_Type;
#define PyCObject_Check(op) ((op)->ob_type == &PyCObject_Type) #define PyCObject_Check(op) ((op)->ob_type == &PyCObject_Type)
...@@ -24,8 +24,8 @@ extern DL_IMPORT(PyTypeObject) PyCObject_Type; ...@@ -24,8 +24,8 @@ extern DL_IMPORT(PyTypeObject) PyCObject_Type;
destroyed. destroyed.
*/ */
extern DL_IMPORT(PyObject *) PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtr(
PyCObject_FromVoidPtr(void *cobj, void (*destruct)(void*)); void *cobj, void (*destruct)(void*));
/* Create a PyCObject from a pointer to a C object, a description object, /* Create a PyCObject from a pointer to a C object, a description object,
...@@ -33,21 +33,17 @@ PyCObject_FromVoidPtr(void *cobj, void (*destruct)(void*)); ...@@ -33,21 +33,17 @@ PyCObject_FromVoidPtr(void *cobj, void (*destruct)(void*));
then it will be called with the first and second arguments if and when then it will be called with the first and second arguments if and when
the PyCObject is destroyed. the PyCObject is destroyed.
*/ */
extern DL_IMPORT(PyObject *) PyAPI_FUNC(PyObject *) PyCObject_FromVoidPtrAndDesc(
PyCObject_FromVoidPtrAndDesc(void *cobj, void *desc, void *cobj, void *desc, void (*destruct)(void*,void*));
void (*destruct)(void*,void*));
/* Retrieve a pointer to a C object from a PyCObject. */ /* Retrieve a pointer to a C object from a PyCObject. */
extern DL_IMPORT(void *) PyAPI_FUNC(void *) PyCObject_AsVoidPtr(PyObject *);
PyCObject_AsVoidPtr(PyObject *);
/* Retrieve a pointer to a description object from a PyCObject. */ /* Retrieve a pointer to a description object from a PyCObject. */
extern DL_IMPORT(void *) PyAPI_FUNC(void *) PyCObject_GetDesc(PyObject *);
PyCObject_GetDesc(PyObject *);
/* Import a pointer to a C object from a module using a PyCObject. */ /* Import a pointer to a C object from a module using a PyCObject. */
extern DL_IMPORT(void *) PyAPI_FUNC(void *) PyCObject_Import(char *module_name, char *cobject_name);
PyCObject_Import(char *module_name, char *cobject_name);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -23,7 +23,7 @@ Copyright (c) Corporation for National Research Initiatives. ...@@ -23,7 +23,7 @@ Copyright (c) Corporation for National Research Initiatives.
The search_function's refcount is incremented by this function. */ The search_function's refcount is incremented by this function. */
extern DL_IMPORT(int) PyCodec_Register( PyAPI_FUNC(int) PyCodec_Register(
PyObject *search_function PyObject *search_function
); );
...@@ -45,7 +45,7 @@ extern DL_IMPORT(int) PyCodec_Register( ...@@ -45,7 +45,7 @@ extern DL_IMPORT(int) PyCodec_Register(
*/ */
extern DL_IMPORT(PyObject *) _PyCodec_Lookup( PyAPI_FUNC(PyObject *) _PyCodec_Lookup(
const char *encoding const char *encoding
); );
...@@ -59,7 +59,7 @@ extern DL_IMPORT(PyObject *) _PyCodec_Lookup( ...@@ -59,7 +59,7 @@ extern DL_IMPORT(PyObject *) _PyCodec_Lookup(
*/ */
extern DL_IMPORT(PyObject *) PyCodec_Encode( PyAPI_FUNC(PyObject *) PyCodec_Encode(
PyObject *object, PyObject *object,
const char *encoding, const char *encoding,
const char *errors const char *errors
...@@ -75,7 +75,7 @@ extern DL_IMPORT(PyObject *) PyCodec_Encode( ...@@ -75,7 +75,7 @@ extern DL_IMPORT(PyObject *) PyCodec_Encode(
*/ */
extern DL_IMPORT(PyObject *) PyCodec_Decode( PyAPI_FUNC(PyObject *) PyCodec_Decode(
PyObject *object, PyObject *object,
const char *encoding, const char *encoding,
const char *errors const char *errors
...@@ -91,19 +91,19 @@ extern DL_IMPORT(PyObject *) PyCodec_Decode( ...@@ -91,19 +91,19 @@ extern DL_IMPORT(PyObject *) PyCodec_Decode(
/* Get an encoder function for the given encoding. */ /* Get an encoder function for the given encoding. */
extern DL_IMPORT(PyObject *) PyCodec_Encoder( PyAPI_FUNC(PyObject *) PyCodec_Encoder(
const char *encoding const char *encoding
); );
/* Get a decoder function for the given encoding. */ /* Get a decoder function for the given encoding. */
extern DL_IMPORT(PyObject *) PyCodec_Decoder( PyAPI_FUNC(PyObject *) PyCodec_Decoder(
const char *encoding const char *encoding
); );
/* Get a StreamReader factory function for the given encoding. */ /* Get a StreamReader factory function for the given encoding. */
extern DL_IMPORT(PyObject *) PyCodec_StreamReader( PyAPI_FUNC(PyObject *) PyCodec_StreamReader(
const char *encoding, const char *encoding,
PyObject *stream, PyObject *stream,
const char *errors const char *errors
...@@ -111,7 +111,7 @@ extern DL_IMPORT(PyObject *) PyCodec_StreamReader( ...@@ -111,7 +111,7 @@ extern DL_IMPORT(PyObject *) PyCodec_StreamReader(
/* Get a StreamWriter factory function for the given encoding. */ /* Get a StreamWriter factory function for the given encoding. */
extern DL_IMPORT(PyObject *) PyCodec_StreamWriter( PyAPI_FUNC(PyObject *) PyCodec_StreamWriter(
const char *encoding, const char *encoding,
PyObject *stream, PyObject *stream,
const char *errors const char *errors
......
...@@ -43,7 +43,7 @@ typedef struct { ...@@ -43,7 +43,7 @@ typedef struct {
#define CO_GENERATOR_ALLOWED 0x1000 /* no longer used in an essential way */ #define CO_GENERATOR_ALLOWED 0x1000 /* no longer used in an essential way */
#define CO_FUTURE_DIVISION 0x2000 #define CO_FUTURE_DIVISION 0x2000
extern DL_IMPORT(PyTypeObject) PyCode_Type; PyAPI_DATA(PyTypeObject) PyCode_Type;
#define PyCode_Check(op) ((op)->ob_type == &PyCode_Type) #define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars)) #define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
...@@ -52,12 +52,12 @@ extern DL_IMPORT(PyTypeObject) PyCode_Type; ...@@ -52,12 +52,12 @@ extern DL_IMPORT(PyTypeObject) PyCode_Type;
/* Public interface */ /* Public interface */
struct _node; /* Declare the existence of this type */ struct _node; /* Declare the existence of this type */
DL_IMPORT(PyCodeObject *) PyNode_Compile(struct _node *, char *); PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, char *);
DL_IMPORT(PyCodeObject *) PyCode_New( PyAPI_FUNC(PyCodeObject *) PyCode_New(
int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *, int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *);
/* same as struct above */ /* same as struct above */
DL_IMPORT(int) PyCode_Addr2Line(PyCodeObject *, int); PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
/* Future feature support */ /* Future feature support */
...@@ -67,8 +67,8 @@ typedef struct { ...@@ -67,8 +67,8 @@ typedef struct {
int ff_features; int ff_features;
} PyFutureFeatures; } PyFutureFeatures;
DL_IMPORT(PyFutureFeatures *) PyNode_Future(struct _node *, char *); PyAPI_FUNC(PyFutureFeatures *) PyNode_Future(struct _node *, char *);
DL_IMPORT(PyCodeObject *) PyNode_CompileFlags(struct _node *, char *, PyAPI_FUNC(PyCodeObject *) PyNode_CompileFlags(struct _node *, char *,
PyCompilerFlags *); PyCompilerFlags *);
#define FUTURE_NESTED_SCOPES "nested_scopes" #define FUTURE_NESTED_SCOPES "nested_scopes"
......
...@@ -20,12 +20,12 @@ typedef struct { ...@@ -20,12 +20,12 @@ typedef struct {
#define c_quot _Py_c_quot #define c_quot _Py_c_quot
#define c_pow _Py_c_pow #define c_pow _Py_c_pow
extern DL_IMPORT(Py_complex) c_sum(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) c_sum(Py_complex, Py_complex);
extern DL_IMPORT(Py_complex) c_diff(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) c_diff(Py_complex, Py_complex);
extern DL_IMPORT(Py_complex) c_neg(Py_complex); PyAPI_FUNC(Py_complex) c_neg(Py_complex);
extern DL_IMPORT(Py_complex) c_prod(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex);
extern DL_IMPORT(Py_complex) c_quot(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex);
extern DL_IMPORT(Py_complex) c_pow(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex);
/* Complex object interface */ /* Complex object interface */
...@@ -40,17 +40,17 @@ typedef struct { ...@@ -40,17 +40,17 @@ typedef struct {
Py_complex cval; Py_complex cval;
} PyComplexObject; } PyComplexObject;
extern DL_IMPORT(PyTypeObject) PyComplex_Type; PyAPI_DATA(PyTypeObject) PyComplex_Type;
#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type) #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
#define PyComplex_CheckExact(op) ((op)->ob_type == &PyComplex_Type) #define PyComplex_CheckExact(op) ((op)->ob_type == &PyComplex_Type)
extern DL_IMPORT(PyObject *) PyComplex_FromCComplex(Py_complex); PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
extern DL_IMPORT(PyObject *) PyComplex_FromDoubles(double real, double imag); PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
extern DL_IMPORT(double) PyComplex_RealAsDouble(PyObject *op); PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
extern DL_IMPORT(double) PyComplex_ImagAsDouble(PyObject *op); PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
extern DL_IMPORT(Py_complex) PyComplex_AsCComplex(PyObject *op); PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -67,22 +67,22 @@ typedef struct { ...@@ -67,22 +67,22 @@ typedef struct {
void *d_wrapped; /* This can be any function pointer */ void *d_wrapped; /* This can be any function pointer */
} PyWrapperDescrObject; } PyWrapperDescrObject;
extern DL_IMPORT(PyTypeObject) PyWrapperDescr_Type; PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
extern DL_IMPORT(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
extern DL_IMPORT(PyObject *) PyDescr_NewMember(PyTypeObject *, PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *,
struct PyMemberDef *); struct PyMemberDef *);
extern DL_IMPORT(PyObject *) PyDescr_NewGetSet(PyTypeObject *, PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
struct PyGetSetDef *); struct PyGetSetDef *);
extern DL_IMPORT(PyObject *) PyDescr_NewWrapper(PyTypeObject *, PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *); struct wrapperbase *, void *);
extern DL_IMPORT(int) PyDescr_IsData(PyObject *); PyAPI_FUNC(int) PyDescr_IsData(PyObject *);
extern DL_IMPORT(PyObject *) PyDictProxy_New(PyObject *); PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
extern DL_IMPORT(PyObject *) PyWrapper_New(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
extern DL_IMPORT(PyTypeObject) PyProperty_Type; PyAPI_DATA(PyTypeObject) PyProperty_Type;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -78,32 +78,32 @@ struct _dictobject { ...@@ -78,32 +78,32 @@ struct _dictobject {
PyDictEntry ma_smalltable[PyDict_MINSIZE]; PyDictEntry ma_smalltable[PyDict_MINSIZE];
}; };
extern DL_IMPORT(PyTypeObject) PyDict_Type; PyAPI_DATA(PyTypeObject) PyDict_Type;
#define PyDict_Check(op) PyObject_TypeCheck(op, &PyDict_Type) #define PyDict_Check(op) PyObject_TypeCheck(op, &PyDict_Type)
extern DL_IMPORT(PyObject *) PyDict_New(void); PyAPI_FUNC(PyObject *) PyDict_New(void);
extern DL_IMPORT(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
extern DL_IMPORT(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
extern DL_IMPORT(int) PyDict_DelItem(PyObject *mp, PyObject *key); PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key);
extern DL_IMPORT(void) PyDict_Clear(PyObject *mp); PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
extern DL_IMPORT(int) PyDict_Next PyAPI_FUNC(int) PyDict_Next(
(PyObject *mp, int *pos, PyObject **key, PyObject **value); PyObject *mp, int *pos, PyObject **key, PyObject **value);
extern DL_IMPORT(PyObject *) PyDict_Keys(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
extern DL_IMPORT(PyObject *) PyDict_Values(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
extern DL_IMPORT(PyObject *) PyDict_Items(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
extern DL_IMPORT(int) PyDict_Size(PyObject *mp); PyAPI_FUNC(int) PyDict_Size(PyObject *mp);
extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */ /* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
extern DL_IMPORT(int) PyDict_Update(PyObject *mp, PyObject *other); PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);
/* PyDict_Merge updates/merges from a mapping object (an object that /* PyDict_Merge updates/merges from a mapping object (an object that
supports PyMapping_Keys() and PyObject_GetItem()). If override is true, supports PyMapping_Keys() and PyObject_GetItem()). If override is true,
the last occurrence of a key wins, else the first. The Python the last occurrence of a key wins, else the first. The Python
dict.update(other) is equivalent to PyDict_Merge(dict, other, 1). dict.update(other) is equivalent to PyDict_Merge(dict, other, 1).
*/ */
extern DL_IMPORT(int) PyDict_Merge(PyObject *mp, PyAPI_FUNC(int) PyDict_Merge(PyObject *mp,
PyObject *other, PyObject *other,
int override); int override);
...@@ -112,13 +112,13 @@ extern DL_IMPORT(int) PyDict_Merge(PyObject *mp, ...@@ -112,13 +112,13 @@ extern DL_IMPORT(int) PyDict_Merge(PyObject *mp,
of a key wins, else the first. The Python dict constructor dict(seq2) of a key wins, else the first. The Python dict constructor dict(seq2)
is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1). is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1).
*/ */
extern DL_IMPORT(int) PyDict_MergeFromSeq2(PyObject *d, PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d,
PyObject *seq2, PyObject *seq2,
int override); int override);
extern DL_IMPORT(PyObject *) PyDict_GetItemString(PyObject *dp, char *key); PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, char *key);
extern DL_IMPORT(int) PyDict_SetItemString(PyObject *dp, char *key, PyObject *item); PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, char *key, PyObject *item);
extern DL_IMPORT(int) PyDict_DelItemString(PyObject *dp, char *key); PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, char *key);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
extern "C" { extern "C" {
#endif #endif
extern DL_IMPORT(PyTypeObject) PyEnum_Type; PyAPI_DATA(PyTypeObject) PyEnum_Type;
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
extern "C" { extern "C" {
#endif #endif
DL_IMPORT(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *);
DL_IMPORT(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co, PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co,
PyObject *globals, PyObject *globals,
PyObject *locals, PyObject *locals,
PyObject **args, int argc, PyObject **args, int argc,
......
...@@ -26,27 +26,27 @@ typedef struct { ...@@ -26,27 +26,27 @@ typedef struct {
#endif #endif
} PyFileObject; } PyFileObject;
extern DL_IMPORT(PyTypeObject) PyFile_Type; PyAPI_DATA(PyTypeObject) PyFile_Type;
#define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type) #define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type)
#define PyFile_CheckExact(op) ((op)->ob_type == &PyFile_Type) #define PyFile_CheckExact(op) ((op)->ob_type == &PyFile_Type)
extern DL_IMPORT(PyObject *) PyFile_FromString(char *, char *); PyAPI_FUNC(PyObject *) PyFile_FromString(char *, char *);
extern DL_IMPORT(void) PyFile_SetBufSize(PyObject *, int); PyAPI_FUNC(void) PyFile_SetBufSize(PyObject *, int);
extern DL_IMPORT(PyObject *) PyFile_FromFile(FILE *, char *, char *, PyAPI_FUNC(PyObject *) PyFile_FromFile(FILE *, char *, char *,
int (*)(FILE *)); int (*)(FILE *));
extern DL_IMPORT(FILE *) PyFile_AsFile(PyObject *); PyAPI_FUNC(FILE *) PyFile_AsFile(PyObject *);
extern DL_IMPORT(PyObject *) PyFile_Name(PyObject *); PyAPI_FUNC(PyObject *) PyFile_Name(PyObject *);
extern DL_IMPORT(PyObject *) PyFile_GetLine(PyObject *, int); PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
extern DL_IMPORT(int) PyFile_WriteObject(PyObject *, PyObject *, int); PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
extern DL_IMPORT(int) PyFile_SoftSpace(PyObject *, int); PyAPI_FUNC(int) PyFile_SoftSpace(PyObject *, int);
extern DL_IMPORT(int) PyFile_WriteString(const char *, PyObject *); PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
extern DL_IMPORT(int) PyObject_AsFileDescriptor(PyObject *); PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
/* The default encoding used by the platform file system APIs /* The default encoding used by the platform file system APIs
If non-NULL, this is different than the default encoding for strings If non-NULL, this is different than the default encoding for strings
*/ */
extern DL_IMPORT(const char *) Py_FileSystemDefaultEncoding; PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
#ifdef WITH_UNIVERSAL_NEWLINES #ifdef WITH_UNIVERSAL_NEWLINES
/* Routines to replace fread() and fgets() which accept any of \r, \n /* Routines to replace fread() and fgets() which accept any of \r, \n
......
...@@ -16,7 +16,7 @@ typedef struct { ...@@ -16,7 +16,7 @@ typedef struct {
double ob_fval; double ob_fval;
} PyFloatObject; } PyFloatObject;
extern DL_IMPORT(PyTypeObject) PyFloat_Type; PyAPI_DATA(PyTypeObject) PyFloat_Type;
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type) #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
#define PyFloat_CheckExact(op) ((op)->ob_type == &PyFloat_Type) #define PyFloat_CheckExact(op) ((op)->ob_type == &PyFloat_Type)
...@@ -24,28 +24,28 @@ extern DL_IMPORT(PyTypeObject) PyFloat_Type; ...@@ -24,28 +24,28 @@ extern DL_IMPORT(PyTypeObject) PyFloat_Type;
/* Return Python float from string PyObject. Second argument ignored on /* Return Python float from string PyObject. Second argument ignored on
input, and, if non-NULL, NULL is stored into *junk (this tried to serve a input, and, if non-NULL, NULL is stored into *junk (this tried to serve a
purpose once but can't be made to work as intended). */ purpose once but can't be made to work as intended). */
extern DL_IMPORT(PyObject *) PyFloat_FromString(PyObject*, char** junk); PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*, char** junk);
/* Return Python float from C double. */ /* Return Python float from C double. */
extern DL_IMPORT(PyObject *) PyFloat_FromDouble(double); PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double);
/* Extract C double from Python float. The macro version trades safety for /* Extract C double from Python float. The macro version trades safety for
speed. */ speed. */
extern DL_IMPORT(double) PyFloat_AsDouble(PyObject *); PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval) #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
/* Write repr(v) into the char buffer argument, followed by null byte. The /* Write repr(v) into the char buffer argument, followed by null byte. The
buffer must be "big enough"; >= 100 is very safe. buffer must be "big enough"; >= 100 is very safe.
PyFloat_AsReprString(buf, x) strives to print enough digits so that PyFloat_AsReprString(buf, x) strives to print enough digits so that
PyFloat_FromString(buf) then reproduces x exactly. */ PyFloat_FromString(buf) then reproduces x exactly. */
extern DL_IMPORT(void) PyFloat_AsReprString(char*, PyFloatObject *v); PyAPI_FUNC(void) PyFloat_AsReprString(char*, PyFloatObject *v);
/* Write str(v) into the char buffer argument, followed by null byte. The /* Write str(v) into the char buffer argument, followed by null byte. The
buffer must be "big enough"; >= 100 is very safe. Note that it's buffer must be "big enough"; >= 100 is very safe. Note that it's
unusual to be able to get back the float you started with from unusual to be able to get back the float you started with from
PyFloat_AsString's result -- use PyFloat_AsReprString() if you want to PyFloat_AsString's result -- use PyFloat_AsReprString() if you want to
preserve precision across conversions. */ preserve precision across conversions. */
extern DL_IMPORT(void) PyFloat_AsString(char*, PyFloatObject *v); PyAPI_FUNC(void) PyFloat_AsString(char*, PyFloatObject *v);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -44,11 +44,11 @@ typedef struct _frame { ...@@ -44,11 +44,11 @@ typedef struct _frame {
/* Standard object interface */ /* Standard object interface */
extern DL_IMPORT(PyTypeObject) PyFrame_Type; PyAPI_DATA(PyTypeObject) PyFrame_Type;
#define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type) #define PyFrame_Check(op) ((op)->ob_type == &PyFrame_Type)
DL_IMPORT(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
PyObject *, PyObject *); PyObject *, PyObject *);
...@@ -56,17 +56,17 @@ DL_IMPORT(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, ...@@ -56,17 +56,17 @@ DL_IMPORT(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
/* Block management functions */ /* Block management functions */
DL_IMPORT(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int); PyAPI_FUNC(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int);
DL_IMPORT(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *); PyAPI_FUNC(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *);
/* Extend the value stack */ /* Extend the value stack */
DL_IMPORT(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int); PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int);
/* Conversions between "fast locals" and locals in dictionary */ /* Conversions between "fast locals" and locals in dictionary */
DL_IMPORT(void) PyFrame_LocalsToFast(PyFrameObject *, int); PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int);
DL_IMPORT(void) PyFrame_FastToLocals(PyFrameObject *); PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -19,17 +19,17 @@ typedef struct { ...@@ -19,17 +19,17 @@ typedef struct {
PyObject *func_weakreflist; PyObject *func_weakreflist;
} PyFunctionObject; } PyFunctionObject;
extern DL_IMPORT(PyTypeObject) PyFunction_Type; PyAPI_DATA(PyTypeObject) PyFunction_Type;
#define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type) #define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type)
extern DL_IMPORT(PyObject *) PyFunction_New(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) PyFunction_GetCode(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *);
extern DL_IMPORT(PyObject *) PyFunction_GetGlobals(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *);
extern DL_IMPORT(PyObject *) PyFunction_GetDefaults(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *);
extern DL_IMPORT(int) PyFunction_SetDefaults(PyObject *, PyObject *); PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) PyFunction_GetClosure(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
extern DL_IMPORT(int) PyFunction_SetClosure(PyObject *, PyObject *); PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
/* Macros for direct access to these values. Type checks are *not* /* Macros for direct access to these values. Type checks are *not*
done, so use with care. */ done, so use with care. */
...@@ -43,11 +43,11 @@ extern DL_IMPORT(int) PyFunction_SetClosure(PyObject *, PyObject *); ...@@ -43,11 +43,11 @@ extern DL_IMPORT(int) PyFunction_SetClosure(PyObject *, PyObject *);
(((PyFunctionObject *)func) -> func_closure) (((PyFunctionObject *)func) -> func_closure)
/* The classmethod and staticmethod types lives here, too */ /* The classmethod and staticmethod types lives here, too */
extern DL_IMPORT(PyTypeObject) PyClassMethod_Type; PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
extern DL_IMPORT(PyTypeObject) PyStaticMethod_Type; PyAPI_DATA(PyTypeObject) PyStaticMethod_Type;
extern DL_IMPORT(PyObject *) PyClassMethod_New(PyObject *); PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *);
extern DL_IMPORT(PyObject *) PyStaticMethod_New(PyObject *); PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -25,30 +25,30 @@ typedef struct { ...@@ -25,30 +25,30 @@ typedef struct {
long ob_ival; long ob_ival;
} PyIntObject; } PyIntObject;
extern DL_IMPORT(PyTypeObject) PyInt_Type; PyAPI_DATA(PyTypeObject) PyInt_Type;
#define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type) #define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type)
#define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type) #define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type)
extern DL_IMPORT(PyObject *) PyInt_FromString(char*, char**, int); PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
#ifdef Py_USING_UNICODE #ifdef Py_USING_UNICODE
extern DL_IMPORT(PyObject *) PyInt_FromUnicode(Py_UNICODE*, int, int); PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, int, int);
#endif #endif
extern DL_IMPORT(PyObject *) PyInt_FromLong(long); PyAPI_FUNC(PyObject *) PyInt_FromLong(long);
extern DL_IMPORT(long) PyInt_AsLong(PyObject *); PyAPI_FUNC(long) PyInt_AsLong(PyObject *);
extern DL_IMPORT(long) PyInt_GetMax(void); PyAPI_FUNC(long) PyInt_GetMax(void);
/* Macro, trading safety for speed */ /* Macro, trading safety for speed */
#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival) #define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival)
/* These aren't really part of the Int object, but they're handy; the protos /* These aren't really part of the Int object, but they're handy; the protos
* are necessary for systems that need the magic of DL_IMPORT and that want * are necessary for systems that need the magic of PyAPI_FUNC and that want
* to have stropmodule as a dynamically loaded module instead of building it * to have stropmodule as a dynamically loaded module instead of building it
* into the main Python shared library/DLL. Guido thinks I'm weird for * into the main Python shared library/DLL. Guido thinks I'm weird for
* building it this way. :-) [cjh] * building it this way. :-) [cjh]
*/ */
extern DL_IMPORT(unsigned long) PyOS_strtoul(char *, char **, int); PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
extern DL_IMPORT(long) PyOS_strtol(char *, char **, int); PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
extern "C" { extern "C" {
#endif #endif
extern DL_IMPORT(int) PyOS_InterruptOccurred(void); PyAPI_FUNC(int) PyOS_InterruptOccurred(void);
extern DL_IMPORT(void) PyOS_InitInterrupts(void); PyAPI_FUNC(void) PyOS_InitInterrupts(void);
DL_IMPORT(void) PyOS_AfterFork(void); PyAPI_FUNC(void) PyOS_AfterFork(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -5,17 +5,17 @@ ...@@ -5,17 +5,17 @@
extern "C" { extern "C" {
#endif #endif
extern DL_IMPORT(PyTypeObject) PySeqIter_Type; PyAPI_DATA(PyTypeObject) PySeqIter_Type;
#define PySeqIter_Check(op) ((op)->ob_type == &PySeqIter_Type) #define PySeqIter_Check(op) ((op)->ob_type == &PySeqIter_Type)
extern DL_IMPORT(PyObject *) PySeqIter_New(PyObject *); PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *);
extern DL_IMPORT(PyTypeObject) PyCallIter_Type; PyAPI_DATA(PyTypeObject) PyCallIter_Type;
#define PyCallIter_Check(op) ((op)->ob_type == &PyCallIter_Type) #define PyCallIter_Check(op) ((op)->ob_type == &PyCallIter_Type)
extern DL_IMPORT(PyObject *) PyCallIter_New(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -24,22 +24,22 @@ typedef struct { ...@@ -24,22 +24,22 @@ typedef struct {
PyObject **ob_item; PyObject **ob_item;
} PyListObject; } PyListObject;
extern DL_IMPORT(PyTypeObject) PyList_Type; PyAPI_DATA(PyTypeObject) PyList_Type;
#define PyList_Check(op) PyObject_TypeCheck(op, &PyList_Type) #define PyList_Check(op) PyObject_TypeCheck(op, &PyList_Type)
#define PyList_CheckExact(op) ((op)->ob_type == &PyList_Type) #define PyList_CheckExact(op) ((op)->ob_type == &PyList_Type)
extern DL_IMPORT(PyObject *) PyList_New(int size); PyAPI_FUNC(PyObject *) PyList_New(int size);
extern DL_IMPORT(int) PyList_Size(PyObject *); PyAPI_FUNC(int) PyList_Size(PyObject *);
extern DL_IMPORT(PyObject *) PyList_GetItem(PyObject *, int); PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, int);
extern DL_IMPORT(int) PyList_SetItem(PyObject *, int, PyObject *); PyAPI_FUNC(int) PyList_SetItem(PyObject *, int, PyObject *);
extern DL_IMPORT(int) PyList_Insert(PyObject *, int, PyObject *); PyAPI_FUNC(int) PyList_Insert(PyObject *, int, PyObject *);
extern DL_IMPORT(int) PyList_Append(PyObject *, PyObject *); PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) PyList_GetSlice(PyObject *, int, int); PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, int, int);
extern DL_IMPORT(int) PyList_SetSlice(PyObject *, int, int, PyObject *); PyAPI_FUNC(int) PyList_SetSlice(PyObject *, int, int, PyObject *);
extern DL_IMPORT(int) PyList_Sort(PyObject *); PyAPI_FUNC(int) PyList_Sort(PyObject *);
extern DL_IMPORT(int) PyList_Reverse(PyObject *); PyAPI_FUNC(int) PyList_Reverse(PyObject *);
extern DL_IMPORT(PyObject *) PyList_AsTuple(PyObject *); PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);
/* Macro, trading safety for speed */ /* Macro, trading safety for speed */
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i]) #define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
......
...@@ -47,10 +47,10 @@ struct _longobject { ...@@ -47,10 +47,10 @@ struct _longobject {
digit ob_digit[1]; digit ob_digit[1];
}; };
DL_IMPORT(PyLongObject *) _PyLong_New(int); PyAPI_FUNC(PyLongObject *) _PyLong_New(int);
/* Return a copy of src. */ /* Return a copy of src. */
DL_IMPORT(PyObject *) _PyLong_Copy(PyLongObject *src); PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -9,16 +9,16 @@ extern "C" { ...@@ -9,16 +9,16 @@ extern "C" {
typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */ typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */
extern DL_IMPORT(PyTypeObject) PyLong_Type; PyAPI_DATA(PyTypeObject) PyLong_Type;
#define PyLong_Check(op) PyObject_TypeCheck(op, &PyLong_Type) #define PyLong_Check(op) PyObject_TypeCheck(op, &PyLong_Type)
#define PyLong_CheckExact(op) ((op)->ob_type == &PyLong_Type) #define PyLong_CheckExact(op) ((op)->ob_type == &PyLong_Type)
extern DL_IMPORT(PyObject *) PyLong_FromLong(long); PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
extern DL_IMPORT(PyObject *) PyLong_FromUnsignedLong(unsigned long); PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
extern DL_IMPORT(PyObject *) PyLong_FromDouble(double); PyAPI_FUNC(PyObject *) PyLong_FromDouble(double);
extern DL_IMPORT(long) PyLong_AsLong(PyObject *); PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
extern DL_IMPORT(unsigned long) PyLong_AsUnsignedLong(PyObject *); PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
/* _PyLong_AsScaledDouble returns a double x and an exponent e such that /* _PyLong_AsScaledDouble returns a double x and an exponent e such that
the true value is approximately equal to x * 2**(SHIFT*e). e is >= 0. the true value is approximately equal to x * 2**(SHIFT*e). e is >= 0.
...@@ -26,22 +26,22 @@ extern DL_IMPORT(unsigned long) PyLong_AsUnsignedLong(PyObject *); ...@@ -26,22 +26,22 @@ extern DL_IMPORT(unsigned long) PyLong_AsUnsignedLong(PyObject *);
zeroes). Overflow is impossible. Note that the exponent returned must zeroes). Overflow is impossible. Note that the exponent returned must
be multiplied by SHIFT! There may not be enough room in an int to store be multiplied by SHIFT! There may not be enough room in an int to store
e*SHIFT directly. */ e*SHIFT directly. */
extern DL_IMPORT(double) _PyLong_AsScaledDouble(PyObject *vv, int *e); PyAPI_FUNC(double) _PyLong_AsScaledDouble(PyObject *vv, int *e);
extern DL_IMPORT(double) PyLong_AsDouble(PyObject *); PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
extern DL_IMPORT(PyObject *) PyLong_FromVoidPtr(void *); PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
extern DL_IMPORT(void *) PyLong_AsVoidPtr(PyObject *); PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *);
#ifdef HAVE_LONG_LONG #ifdef HAVE_LONG_LONG
extern DL_IMPORT(PyObject *) PyLong_FromLongLong(LONG_LONG); PyAPI_FUNC(PyObject *) PyLong_FromLongLong(LONG_LONG);
extern DL_IMPORT(PyObject *) PyLong_FromUnsignedLongLong(unsigned LONG_LONG); PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned LONG_LONG);
extern DL_IMPORT(LONG_LONG) PyLong_AsLongLong(PyObject *); PyAPI_FUNC(LONG_LONG) PyLong_AsLongLong(PyObject *);
extern DL_IMPORT(unsigned LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *); PyAPI_FUNC(unsigned LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
#endif /* HAVE_LONG_LONG */ #endif /* HAVE_LONG_LONG */
DL_IMPORT(PyObject *) PyLong_FromString(char *, char **, int); PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int);
#ifdef Py_USING_UNICODE #ifdef Py_USING_UNICODE
DL_IMPORT(PyObject *) PyLong_FromUnicode(Py_UNICODE*, int, int); PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, int, int);
#endif #endif
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in /* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
...@@ -57,7 +57,7 @@ DL_IMPORT(PyObject *) PyLong_FromUnicode(Py_UNICODE*, int, int); ...@@ -57,7 +57,7 @@ DL_IMPORT(PyObject *) PyLong_FromUnicode(Py_UNICODE*, int, int);
+ Return NULL with the appropriate exception set if there's not + Return NULL with the appropriate exception set if there's not
enough memory to create the Python long. enough memory to create the Python long.
*/ */
extern DL_IMPORT(PyObject *) _PyLong_FromByteArray( PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
const unsigned char* bytes, size_t n, const unsigned char* bytes, size_t n,
int little_endian, int is_signed); int little_endian, int is_signed);
...@@ -80,7 +80,7 @@ extern DL_IMPORT(PyObject *) _PyLong_FromByteArray( ...@@ -80,7 +80,7 @@ extern DL_IMPORT(PyObject *) _PyLong_FromByteArray(
being large enough to hold a sign bit. OverflowError is set in this being large enough to hold a sign bit. OverflowError is set in this
case, but bytes holds the least-signficant n bytes of the true value. case, but bytes holds the least-signficant n bytes of the true value.
*/ */
extern DL_IMPORT(int) _PyLong_AsByteArray(PyLongObject* v, PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
unsigned char* bytes, size_t n, unsigned char* bytes, size_t n,
int little_endian, int is_signed); int little_endian, int is_signed);
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
extern "C" { extern "C" {
#endif #endif
DL_IMPORT(void) PyMarshal_WriteLongToFile(long, FILE *); PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *);
DL_IMPORT(void) PyMarshal_WriteShortToFile(int, FILE *); PyAPI_FUNC(void) PyMarshal_WriteShortToFile(int, FILE *);
DL_IMPORT(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *); PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *);
DL_IMPORT(PyObject *) PyMarshal_WriteObjectToString(PyObject *); PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *);
DL_IMPORT(long) PyMarshal_ReadLongFromFile(FILE *); PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *);
DL_IMPORT(int) PyMarshal_ReadShortFromFile(FILE *); PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
DL_IMPORT(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
DL_IMPORT(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
DL_IMPORT(PyObject *) PyMarshal_ReadObjectFromString(char *, int); PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, int);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
extern "C" { extern "C" {
#endif #endif
extern DL_IMPORT(PyTypeObject) PyCFunction_Type; PyAPI_DATA(PyTypeObject) PyCFunction_Type;
#define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type) #define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type)
...@@ -16,9 +16,9 @@ typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *, ...@@ -16,9 +16,9 @@ typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
PyObject *); PyObject *);
typedef PyObject *(*PyNoArgsFunction)(PyObject *); typedef PyObject *(*PyNoArgsFunction)(PyObject *);
extern DL_IMPORT(PyCFunction) PyCFunction_GetFunction(PyObject *); PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *);
extern DL_IMPORT(PyObject *) PyCFunction_GetSelf(PyObject *); PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *);
extern DL_IMPORT(int) PyCFunction_GetFlags(PyObject *); PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *);
/* Macros for direct access to these values. Type checks are *not* /* Macros for direct access to these values. Type checks are *not*
done, so use with care. */ done, so use with care. */
...@@ -28,7 +28,7 @@ extern DL_IMPORT(int) PyCFunction_GetFlags(PyObject *); ...@@ -28,7 +28,7 @@ extern DL_IMPORT(int) PyCFunction_GetFlags(PyObject *);
(((PyCFunctionObject *)func) -> m_self) (((PyCFunctionObject *)func) -> m_self)
#define PyCFunction_GET_FLAGS(func) \ #define PyCFunction_GET_FLAGS(func) \
(((PyCFunctionObject *)func) -> m_ml -> ml_flags) (((PyCFunctionObject *)func) -> m_ml -> ml_flags)
extern DL_IMPORT(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
struct PyMethodDef { struct PyMethodDef {
char *ml_name; char *ml_name;
...@@ -38,9 +38,9 @@ struct PyMethodDef { ...@@ -38,9 +38,9 @@ struct PyMethodDef {
}; };
typedef struct PyMethodDef PyMethodDef; typedef struct PyMethodDef PyMethodDef;
extern DL_IMPORT(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, char *); PyAPI_FUNC(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, char *);
extern DL_IMPORT(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *); PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);
/* Flag passed to newmethodobject */ /* Flag passed to newmethodobject */
#define METH_OLDARGS 0x0000 #define METH_OLDARGS 0x0000
...@@ -61,7 +61,7 @@ typedef struct PyMethodChain { ...@@ -61,7 +61,7 @@ typedef struct PyMethodChain {
struct PyMethodChain *link; /* NULL or base type */ struct PyMethodChain *link; /* NULL or base type */
} PyMethodChain; } PyMethodChain;
extern DL_IMPORT(PyObject *) Py_FindMethodInChain(PyMethodChain *, PyObject *, PyAPI_FUNC(PyObject *) Py_FindMethodInChain(PyMethodChain *, PyObject *,
char *); char *);
typedef struct { typedef struct {
......
...@@ -9,19 +9,19 @@ extern "C" { ...@@ -9,19 +9,19 @@ extern "C" {
#include <stdarg.h> #include <stdarg.h>
extern DL_IMPORT(int) PyArg_Parse(PyObject *, char *, ...); PyAPI_FUNC(int) PyArg_Parse(PyObject *, char *, ...);
extern DL_IMPORT(int) PyArg_ParseTuple(PyObject *, char *, ...); PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, char *, ...);
extern DL_IMPORT(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
char *, char **, ...); char *, char **, ...);
extern DL_IMPORT(int) PyArg_UnpackTuple(PyObject *, char *, int, int, ...); PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, char *, int, int, ...);
extern DL_IMPORT(PyObject *) Py_BuildValue(char *, ...); PyAPI_FUNC(PyObject *) Py_BuildValue(char *, ...);
extern DL_IMPORT(int) PyArg_VaParse(PyObject *, char *, va_list); PyAPI_FUNC(int) PyArg_VaParse(PyObject *, char *, va_list);
extern DL_IMPORT(PyObject *) Py_VaBuildValue(char *, va_list); PyAPI_FUNC(PyObject *) Py_VaBuildValue(char *, va_list);
extern DL_IMPORT(int) PyModule_AddObject(PyObject *, char *, PyObject *); PyAPI_FUNC(int) PyModule_AddObject(PyObject *, char *, PyObject *);
extern DL_IMPORT(int) PyModule_AddIntConstant(PyObject *, char *, long); PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, char *, long);
extern DL_IMPORT(int) PyModule_AddStringConstant(PyObject *, char *, char *); PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, char *, char *);
#define PYTHON_API_VERSION 1011 #define PYTHON_API_VERSION 1011
#define PYTHON_API_STRING "1011" #define PYTHON_API_STRING "1011"
...@@ -78,7 +78,7 @@ extern DL_IMPORT(int) PyModule_AddStringConstant(PyObject *, char *, char *); ...@@ -78,7 +78,7 @@ extern DL_IMPORT(int) PyModule_AddStringConstant(PyObject *, char *, char *);
#define Py_InitModule4 Py_InitModule4TraceRefs #define Py_InitModule4 Py_InitModule4TraceRefs
#endif #endif
extern DL_IMPORT(PyObject *) Py_InitModule4(char *name, PyMethodDef *methods, PyAPI_FUNC(PyObject *) Py_InitModule4(char *name, PyMethodDef *methods,
char *doc, PyObject *self, char *doc, PyObject *self,
int apiver); int apiver);
...@@ -90,7 +90,7 @@ extern DL_IMPORT(PyObject *) Py_InitModule4(char *name, PyMethodDef *methods, ...@@ -90,7 +90,7 @@ extern DL_IMPORT(PyObject *) Py_InitModule4(char *name, PyMethodDef *methods,
Py_InitModule4(name, methods, doc, (PyObject *)NULL, \ Py_InitModule4(name, methods, doc, (PyObject *)NULL, \
PYTHON_API_VERSION) PYTHON_API_VERSION)
extern DL_IMPORT(char *) _Py_PackageContext; PyAPI_DATA(char *) _Py_PackageContext;
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
extern "C" { extern "C" {
#endif #endif
extern DL_IMPORT(PyTypeObject) PyModule_Type; PyAPI_DATA(PyTypeObject) PyModule_Type;
#define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type) #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type)
#define PyModule_CheckExact(op) ((op)->ob_type == &PyModule_Type) #define PyModule_CheckExact(op) ((op)->ob_type == &PyModule_Type)
extern DL_IMPORT(PyObject *) PyModule_New(char *); PyAPI_FUNC(PyObject *) PyModule_New(char *);
extern DL_IMPORT(PyObject *) PyModule_GetDict(PyObject *); PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
extern DL_IMPORT(char *) PyModule_GetName(PyObject *); PyAPI_FUNC(char *) PyModule_GetName(PyObject *);
extern DL_IMPORT(char *) PyModule_GetFilename(PyObject *); PyAPI_FUNC(char *) PyModule_GetFilename(PyObject *);
extern DL_IMPORT(void) _PyModule_Clear(PyObject *); PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -15,10 +15,10 @@ typedef struct _node { ...@@ -15,10 +15,10 @@ typedef struct _node {
struct _node *n_child; struct _node *n_child;
} node; } node;
extern DL_IMPORT(node *) PyNode_New(int type); PyAPI_FUNC(node *) PyNode_New(int type);
extern DL_IMPORT(int) PyNode_AddChild(node *n, int type, PyAPI_FUNC(int) PyNode_AddChild(node *n, int type,
char *str, int lineno); char *str, int lineno);
extern DL_IMPORT(void) PyNode_Free(node *n); PyAPI_FUNC(void) PyNode_Free(node *n);
/* Node access functions */ /* Node access functions */
#define NCH(n) ((n)->n_nchildren) #define NCH(n) ((n)->n_nchildren)
...@@ -29,7 +29,7 @@ extern DL_IMPORT(void) PyNode_Free(node *n); ...@@ -29,7 +29,7 @@ extern DL_IMPORT(void) PyNode_Free(node *n);
/* Assert that the type of a node is what we expect */ /* Assert that the type of a node is what we expect */
#define REQ(n, type) assert(TYPE(n) == (type)) #define REQ(n, type) assert(TYPE(n) == (type))
extern DL_IMPORT(void) PyNode_ListTree(node *); PyAPI_FUNC(void) PyNode_ListTree(node *);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -94,20 +94,20 @@ PyObject_{New, NewVar, Del}. ...@@ -94,20 +94,20 @@ PyObject_{New, NewVar, Del}.
the object gets initialized via PyObject_{Init, InitVar} after obtaining the object gets initialized via PyObject_{Init, InitVar} after obtaining
the raw memory. the raw memory.
*/ */
extern DL_IMPORT(void *) PyObject_Malloc(size_t); PyAPI_FUNC(void *) PyObject_Malloc(size_t);
extern DL_IMPORT(void *) PyObject_Realloc(void *, size_t); PyAPI_FUNC(void *) PyObject_Realloc(void *, size_t);
extern DL_IMPORT(void) PyObject_Free(void *); PyAPI_FUNC(void) PyObject_Free(void *);
/* Macros */ /* Macros */
#ifdef WITH_PYMALLOC #ifdef WITH_PYMALLOC
#ifdef PYMALLOC_DEBUG #ifdef PYMALLOC_DEBUG
DL_IMPORT(void *) _PyObject_DebugMalloc(size_t nbytes); PyAPI_FUNC(void *) _PyObject_DebugMalloc(size_t nbytes);
DL_IMPORT(void *) _PyObject_DebugRealloc(void *p, size_t nbytes); PyAPI_FUNC(void *) _PyObject_DebugRealloc(void *p, size_t nbytes);
DL_IMPORT(void) _PyObject_DebugFree(void *p); PyAPI_FUNC(void) _PyObject_DebugFree(void *p);
DL_IMPORT(void) _PyObject_DebugDumpAddress(const void *p); PyAPI_FUNC(void) _PyObject_DebugDumpAddress(const void *p);
DL_IMPORT(void) _PyObject_DebugCheckAddress(const void *p); PyAPI_FUNC(void) _PyObject_DebugCheckAddress(const void *p);
DL_IMPORT(void) _PyObject_DebugMallocStats(void); PyAPI_FUNC(void) _PyObject_DebugMallocStats(void);
#define PyObject_MALLOC _PyObject_DebugMalloc #define PyObject_MALLOC _PyObject_DebugMalloc
#define PyObject_Malloc _PyObject_DebugMalloc #define PyObject_Malloc _PyObject_DebugMalloc
#define PyObject_REALLOC _PyObject_DebugRealloc #define PyObject_REALLOC _PyObject_DebugRealloc
...@@ -144,11 +144,11 @@ DL_IMPORT(void) _PyObject_DebugMallocStats(void); ...@@ -144,11 +144,11 @@ DL_IMPORT(void) _PyObject_DebugMallocStats(void);
*/ */
/* Functions */ /* Functions */
extern DL_IMPORT(PyObject *) PyObject_Init(PyObject *, PyTypeObject *); PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
extern DL_IMPORT(PyVarObject *) PyObject_InitVar(PyVarObject *, PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *,
PyTypeObject *, int); PyTypeObject *, int);
extern DL_IMPORT(PyObject *) _PyObject_New(PyTypeObject *); PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *);
extern DL_IMPORT(PyVarObject *) _PyObject_NewVar(PyTypeObject *, int); PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, int);
#define PyObject_New(type, typeobj) \ #define PyObject_New(type, typeobj) \
( (type *) _PyObject_New(typeobj) ) ( (type *) _PyObject_New(typeobj) )
...@@ -235,7 +235,7 @@ extern DL_IMPORT(PyVarObject *) _PyObject_NewVar(PyTypeObject *, int); ...@@ -235,7 +235,7 @@ extern DL_IMPORT(PyVarObject *) _PyObject_NewVar(PyTypeObject *, int);
#define PyObject_IS_GC(o) (PyType_IS_GC((o)->ob_type) && \ #define PyObject_IS_GC(o) (PyType_IS_GC((o)->ob_type) && \
((o)->ob_type->tp_is_gc == NULL || (o)->ob_type->tp_is_gc(o))) ((o)->ob_type->tp_is_gc == NULL || (o)->ob_type->tp_is_gc(o)))
extern DL_IMPORT(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, int); PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, int);
#define PyObject_GC_Resize(type, op, n) \ #define PyObject_GC_Resize(type, op, n) \
( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) ) ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) )
...@@ -286,12 +286,12 @@ extern PyGC_Head *_PyGC_generation0; ...@@ -286,12 +286,12 @@ extern PyGC_Head *_PyGC_generation0;
g->gc.gc_next = NULL; \ g->gc.gc_next = NULL; \
} while (0); } while (0);
extern DL_IMPORT(PyObject *) _PyObject_GC_Malloc(size_t); PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t);
extern DL_IMPORT(PyObject *) _PyObject_GC_New(PyTypeObject *); PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *);
extern DL_IMPORT(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, int); PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, int);
extern DL_IMPORT(void) PyObject_GC_Track(void *); PyAPI_FUNC(void) PyObject_GC_Track(void *);
extern DL_IMPORT(void) PyObject_GC_UnTrack(void *); PyAPI_FUNC(void) PyObject_GC_UnTrack(void *);
extern DL_IMPORT(void) PyObject_GC_Del(void *); PyAPI_FUNC(void) PyObject_GC_Del(void *);
#define PyObject_GC_New(type, typeobj) \ #define PyObject_GC_New(type, typeobj) \
( (type *) _PyObject_GC_New(typeobj) ) ( (type *) _PyObject_GC_New(typeobj) )
......
...@@ -21,18 +21,18 @@ typedef struct { ...@@ -21,18 +21,18 @@ typedef struct {
#define PyPARSE_YIELD_IS_KEYWORD 0x0001 #define PyPARSE_YIELD_IS_KEYWORD 0x0001
#endif #endif
extern DL_IMPORT(node *) PyParser_ParseString(char *, grammar *, int, PyAPI_FUNC(node *) PyParser_ParseString(char *, grammar *, int,
perrdetail *); perrdetail *);
extern DL_IMPORT(node *) PyParser_ParseFile (FILE *, char *, grammar *, int, PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, char *, grammar *, int,
char *, char *, perrdetail *); char *, char *, perrdetail *);
extern DL_IMPORT(node *) PyParser_ParseStringFlags(char *, grammar *, int, PyAPI_FUNC(node *) PyParser_ParseStringFlags(char *, grammar *, int,
perrdetail *, int); perrdetail *, int);
extern DL_IMPORT(node *) PyParser_ParseFileFlags(FILE *, char *, grammar *, PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, char *, grammar *,
int, char *, char *, int, char *, char *,
perrdetail *, int); perrdetail *, int);
extern DL_IMPORT(node *) PyParser_ParseStringFlagsFilename(char *, PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(char *,
char *, char *,
grammar *, int, grammar *, int,
perrdetail *, int); perrdetail *, int);
......
...@@ -9,9 +9,9 @@ extern "C" { ...@@ -9,9 +9,9 @@ extern "C" {
#include "Python.h" #include "Python.h"
DL_IMPORT(void) PySys_WriteStdout(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
__attribute__((format(printf, 1, 2))); __attribute__((format(printf, 1, 2)));
DL_IMPORT(void) PySys_WriteStderr(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
__attribute__((format(printf, 1, 2))); __attribute__((format(printf, 1, 2)));
#define addarc _Py_addarc #define addarc _Py_addarc
......
...@@ -7,111 +7,111 @@ extern "C" { ...@@ -7,111 +7,111 @@ extern "C" {
/* Error handling definitions */ /* Error handling definitions */
DL_IMPORT(void) PyErr_SetNone(PyObject *); PyAPI_FUNC(void) PyErr_SetNone(PyObject *);
DL_IMPORT(void) PyErr_SetObject(PyObject *, PyObject *); PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *);
DL_IMPORT(void) PyErr_SetString(PyObject *, const char *); PyAPI_FUNC(void) PyErr_SetString(PyObject *, const char *);
DL_IMPORT(PyObject *) PyErr_Occurred(void); PyAPI_FUNC(PyObject *) PyErr_Occurred(void);
DL_IMPORT(void) PyErr_Clear(void); PyAPI_FUNC(void) PyErr_Clear(void);
DL_IMPORT(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
DL_IMPORT(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
/* Error testing and normalization */ /* Error testing and normalization */
DL_IMPORT(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
DL_IMPORT(int) PyErr_ExceptionMatches(PyObject *); PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *);
DL_IMPORT(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
/* Predefined exceptions */ /* Predefined exceptions */
extern DL_IMPORT(PyObject *) PyExc_Exception; PyAPI_DATA(PyObject *) PyExc_Exception;
extern DL_IMPORT(PyObject *) PyExc_StopIteration; PyAPI_DATA(PyObject *) PyExc_StopIteration;
extern DL_IMPORT(PyObject *) PyExc_StandardError; PyAPI_DATA(PyObject *) PyExc_StandardError;
extern DL_IMPORT(PyObject *) PyExc_ArithmeticError; PyAPI_DATA(PyObject *) PyExc_ArithmeticError;
extern DL_IMPORT(PyObject *) PyExc_LookupError; PyAPI_DATA(PyObject *) PyExc_LookupError;
extern DL_IMPORT(PyObject *) PyExc_AssertionError; PyAPI_DATA(PyObject *) PyExc_AssertionError;
extern DL_IMPORT(PyObject *) PyExc_AttributeError; PyAPI_DATA(PyObject *) PyExc_AttributeError;
extern DL_IMPORT(PyObject *) PyExc_EOFError; PyAPI_DATA(PyObject *) PyExc_EOFError;
extern DL_IMPORT(PyObject *) PyExc_FloatingPointError; PyAPI_DATA(PyObject *) PyExc_FloatingPointError;
extern DL_IMPORT(PyObject *) PyExc_EnvironmentError; PyAPI_DATA(PyObject *) PyExc_EnvironmentError;
extern DL_IMPORT(PyObject *) PyExc_IOError; PyAPI_DATA(PyObject *) PyExc_IOError;
extern DL_IMPORT(PyObject *) PyExc_OSError; PyAPI_DATA(PyObject *) PyExc_OSError;
extern DL_IMPORT(PyObject *) PyExc_ImportError; PyAPI_DATA(PyObject *) PyExc_ImportError;
extern DL_IMPORT(PyObject *) PyExc_IndexError; PyAPI_DATA(PyObject *) PyExc_IndexError;
extern DL_IMPORT(PyObject *) PyExc_KeyError; PyAPI_DATA(PyObject *) PyExc_KeyError;
extern DL_IMPORT(PyObject *) PyExc_KeyboardInterrupt; PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt;
extern DL_IMPORT(PyObject *) PyExc_MemoryError; PyAPI_DATA(PyObject *) PyExc_MemoryError;
extern DL_IMPORT(PyObject *) PyExc_NameError; PyAPI_DATA(PyObject *) PyExc_NameError;
extern DL_IMPORT(PyObject *) PyExc_OverflowError; PyAPI_DATA(PyObject *) PyExc_OverflowError;
extern DL_IMPORT(PyObject *) PyExc_RuntimeError; PyAPI_DATA(PyObject *) PyExc_RuntimeError;
extern DL_IMPORT(PyObject *) PyExc_NotImplementedError; PyAPI_DATA(PyObject *) PyExc_NotImplementedError;
extern DL_IMPORT(PyObject *) PyExc_SyntaxError; PyAPI_DATA(PyObject *) PyExc_SyntaxError;
extern DL_IMPORT(PyObject *) PyExc_IndentationError; PyAPI_DATA(PyObject *) PyExc_IndentationError;
extern DL_IMPORT(PyObject *) PyExc_TabError; PyAPI_DATA(PyObject *) PyExc_TabError;
extern DL_IMPORT(PyObject *) PyExc_ReferenceError; PyAPI_DATA(PyObject *) PyExc_ReferenceError;
extern DL_IMPORT(PyObject *) PyExc_SystemError; PyAPI_DATA(PyObject *) PyExc_SystemError;
extern DL_IMPORT(PyObject *) PyExc_SystemExit; PyAPI_DATA(PyObject *) PyExc_SystemExit;
extern DL_IMPORT(PyObject *) PyExc_TypeError; PyAPI_DATA(PyObject *) PyExc_TypeError;
extern DL_IMPORT(PyObject *) PyExc_UnboundLocalError; PyAPI_DATA(PyObject *) PyExc_UnboundLocalError;
extern DL_IMPORT(PyObject *) PyExc_UnicodeError; PyAPI_DATA(PyObject *) PyExc_UnicodeError;
extern DL_IMPORT(PyObject *) PyExc_ValueError; PyAPI_DATA(PyObject *) PyExc_ValueError;
extern DL_IMPORT(PyObject *) PyExc_ZeroDivisionError; PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError;
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
extern DL_IMPORT(PyObject *) PyExc_WindowsError; PyAPI_DATA(PyObject *) PyExc_WindowsError;
#endif #endif
extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst; PyAPI_DATA(PyObject *) PyExc_MemoryErrorInst;
/* Predefined warning categories */ /* Predefined warning categories */
extern DL_IMPORT(PyObject *) PyExc_Warning; PyAPI_DATA(PyObject *) PyExc_Warning;
extern DL_IMPORT(PyObject *) PyExc_UserWarning; PyAPI_DATA(PyObject *) PyExc_UserWarning;
extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning; PyAPI_DATA(PyObject *) PyExc_DeprecationWarning;
extern DL_IMPORT(PyObject *) PyExc_PendingDeprecationWarning; PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning;
extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning; PyAPI_DATA(PyObject *) PyExc_SyntaxWarning;
extern DL_IMPORT(PyObject *) PyExc_OverflowWarning; PyAPI_DATA(PyObject *) PyExc_OverflowWarning;
extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning; PyAPI_DATA(PyObject *) PyExc_RuntimeWarning;
/* Convenience functions */ /* Convenience functions */
extern DL_IMPORT(int) PyErr_BadArgument(void); PyAPI_FUNC(int) PyErr_BadArgument(void);
extern DL_IMPORT(PyObject *) PyErr_NoMemory(void); PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
extern DL_IMPORT(PyObject *) PyErr_SetFromErrno(PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
extern DL_IMPORT(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
extern DL_IMPORT(PyObject *) PyErr_Format(PyObject *, const char *, ...) PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
__attribute__((format(printf, 2, 3))); __attribute__((format(printf, 2, 3)));
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *);
extern DL_IMPORT(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
extern DL_IMPORT(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
PyObject *,int, const char *); PyObject *,int, const char *);
extern DL_IMPORT(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif #endif
/* Export the old function so that the existing API remains available: */ /* Export the old function so that the existing API remains available: */
extern DL_IMPORT(void) PyErr_BadInternalCall(void); PyAPI_FUNC(void) PyErr_BadInternalCall(void);
extern DL_IMPORT(void) _PyErr_BadInternalCall(char *filename, int lineno); PyAPI_FUNC(void) _PyErr_BadInternalCall(char *filename, int lineno);
/* Mask the old API with a call to the new API for code compiled under /* Mask the old API with a call to the new API for code compiled under
Python 2.0: */ Python 2.0: */
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
/* Function to create a new exception */ /* Function to create a new exception */
DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base, PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base,
PyObject *dict); PyObject *dict);
extern DL_IMPORT(void) PyErr_WriteUnraisable(PyObject *); PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
/* Issue a warning or exception */ /* Issue a warning or exception */
extern DL_IMPORT(int) PyErr_Warn(PyObject *, char *); PyAPI_FUNC(int) PyErr_Warn(PyObject *, char *);
extern DL_IMPORT(int) PyErr_WarnExplicit(PyObject *, char *, PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, char *,
char *, int, char *, PyObject *); char *, int, char *, PyObject *);
/* In sigcheck.c or signalmodule.c */ /* In sigcheck.c or signalmodule.c */
extern DL_IMPORT(int) PyErr_CheckSignals(void); PyAPI_FUNC(int) PyErr_CheckSignals(void);
extern DL_IMPORT(void) PyErr_SetInterrupt(void); PyAPI_FUNC(void) PyErr_SetInterrupt(void);
/* Support for adding program text to SyntaxErrors */ /* Support for adding program text to SyntaxErrors */
extern DL_IMPORT(void) PyErr_SyntaxLocation(char *, int); PyAPI_FUNC(void) PyErr_SyntaxLocation(char *, int);
extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int); PyAPI_FUNC(PyObject *) PyErr_ProgramText(char *, int);
/* These APIs aren't really part of the error implementation, but /* These APIs aren't really part of the error implementation, but
often needed to format error messages; the native C lib APIs are often needed to format error messages; the native C lib APIs are
...@@ -128,9 +128,9 @@ extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int); ...@@ -128,9 +128,9 @@ extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int);
#endif #endif
#include <stdarg.h> #include <stdarg.h>
extern DL_IMPORT(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
__attribute__((format(printf, 3, 4))); __attribute__((format(printf, 3, 4)));
extern DL_IMPORT(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
__attribute__((format(printf, 3, 0))); __attribute__((format(printf, 3, 0)));
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
extern "C" { extern "C" {
#endif #endif
extern DL_IMPORT(int) _PyOS_opterr; PyAPI_DATA(int) _PyOS_opterr;
extern DL_IMPORT(int) _PyOS_optind; PyAPI_DATA(int) _PyOS_optind;
extern DL_IMPORT(char *) _PyOS_optarg; PyAPI_DATA(char *) _PyOS_optarg;
DL_IMPORT(int) _PyOS_GetOpt(int argc, char **argv, char *optstring); PyAPI_FUNC(int) _PyOS_GetOpt(int argc, char **argv, char *optstring);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -47,9 +47,9 @@ extern "C" { ...@@ -47,9 +47,9 @@ extern "C" {
performed on failure (no exception is set, no warning is printed, etc). performed on failure (no exception is set, no warning is printed, etc).
*/ */
extern DL_IMPORT(void *) PyMem_Malloc(size_t); PyAPI_FUNC(void *) PyMem_Malloc(size_t);
extern DL_IMPORT(void *) PyMem_Realloc(void *, size_t); PyAPI_FUNC(void *) PyMem_Realloc(void *, size_t);
extern DL_IMPORT(void) PyMem_Free(void *); PyAPI_FUNC(void) PyMem_Free(void *);
/* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are /* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are
no longer supported. They used to call PyErr_NoMemory() on failure. */ no longer supported. They used to call PyErr_NoMemory() on failure. */
......
...@@ -74,25 +74,25 @@ typedef struct _ts { ...@@ -74,25 +74,25 @@ typedef struct _ts {
} PyThreadState; } PyThreadState;
DL_IMPORT(PyInterpreterState *) PyInterpreterState_New(void); PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
DL_IMPORT(void) PyInterpreterState_Clear(PyInterpreterState *); PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);
DL_IMPORT(void) PyInterpreterState_Delete(PyInterpreterState *); PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);
DL_IMPORT(PyThreadState *) PyThreadState_New(PyInterpreterState *); PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *);
DL_IMPORT(void) PyThreadState_Clear(PyThreadState *); PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);
DL_IMPORT(void) PyThreadState_Delete(PyThreadState *); PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);
#ifdef WITH_THREAD #ifdef WITH_THREAD
DL_IMPORT(void) PyThreadState_DeleteCurrent(void); PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);
#endif #endif
DL_IMPORT(PyThreadState *) PyThreadState_Get(void); PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);
DL_IMPORT(PyThreadState *) PyThreadState_Swap(PyThreadState *); PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *);
DL_IMPORT(PyObject *) PyThreadState_GetDict(void); PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void);
/* Variable and macro for in-line access to current thread state */ /* Variable and macro for in-line access to current thread state */
extern DL_IMPORT(PyThreadState *) _PyThreadState_Current; PyAPI_DATA(PyThreadState *) _PyThreadState_Current;
#ifdef Py_DEBUG #ifdef Py_DEBUG
#define PyThreadState_GET() PyThreadState_Get() #define PyThreadState_GET() PyThreadState_Get()
...@@ -102,10 +102,10 @@ extern DL_IMPORT(PyThreadState *) _PyThreadState_Current; ...@@ -102,10 +102,10 @@ extern DL_IMPORT(PyThreadState *) _PyThreadState_Current;
/* Routines for advanced debuggers, requested by David Beazley. /* Routines for advanced debuggers, requested by David Beazley.
Don't use unless you know what you are doing! */ Don't use unless you know what you are doing! */
DL_IMPORT(PyInterpreterState *) PyInterpreterState_Head(void); PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
DL_IMPORT(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *); PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
DL_IMPORT(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
DL_IMPORT(PyThreadState *) PyThreadState_Next(PyThreadState *); PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -14,69 +14,69 @@ typedef struct { ...@@ -14,69 +14,69 @@ typedef struct {
int cf_flags; /* bitmask of CO_xxx flags relevant to future */ int cf_flags; /* bitmask of CO_xxx flags relevant to future */
} PyCompilerFlags; } PyCompilerFlags;
DL_IMPORT(void) Py_SetProgramName(char *); PyAPI_FUNC(void) Py_SetProgramName(char *);
DL_IMPORT(char *) Py_GetProgramName(void); PyAPI_FUNC(char *) Py_GetProgramName(void);
DL_IMPORT(void) Py_SetPythonHome(char *); PyAPI_FUNC(void) Py_SetPythonHome(char *);
DL_IMPORT(char *) Py_GetPythonHome(void); PyAPI_FUNC(char *) Py_GetPythonHome(void);
DL_IMPORT(void) Py_Initialize(void); PyAPI_FUNC(void) Py_Initialize(void);
DL_IMPORT(void) Py_Finalize(void); PyAPI_FUNC(void) Py_Finalize(void);
DL_IMPORT(int) Py_IsInitialized(void); PyAPI_FUNC(int) Py_IsInitialized(void);
DL_IMPORT(PyThreadState *) Py_NewInterpreter(void); PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
DL_IMPORT(void) Py_EndInterpreter(PyThreadState *); PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
DL_IMPORT(int) PyRun_AnyFile(FILE *, char *); PyAPI_FUNC(int) PyRun_AnyFile(FILE *, char *);
DL_IMPORT(int) PyRun_AnyFileEx(FILE *, char *, int); PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *, char *, int);
DL_IMPORT(int) PyRun_AnyFileFlags(FILE *, char *, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, char *, PyCompilerFlags *);
DL_IMPORT(int) PyRun_AnyFileExFlags(FILE *, char *, int, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, char *, int, PyCompilerFlags *);
DL_IMPORT(int) PyRun_SimpleString(char *); PyAPI_FUNC(int) PyRun_SimpleString(char *);
DL_IMPORT(int) PyRun_SimpleStringFlags(char *, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_SimpleStringFlags(char *, PyCompilerFlags *);
DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *); PyAPI_FUNC(int) PyRun_SimpleFile(FILE *, char *);
DL_IMPORT(int) PyRun_SimpleFileEx(FILE *, char *, int); PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *, char *, int);
DL_IMPORT(int) PyRun_SimpleFileExFlags(FILE *, char *, int, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, char *, int, PyCompilerFlags *);
DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *); PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *, char *);
DL_IMPORT(int) PyRun_InteractiveOneFlags(FILE *, char *, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, char *, PyCompilerFlags *);
DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *); PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *, char *);
DL_IMPORT(int) PyRun_InteractiveLoopFlags(FILE *, char *, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, char *, PyCompilerFlags *);
DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int); PyAPI_FUNC(struct _node *) PyParser_SimpleParseString(char *, int);
DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int); PyAPI_FUNC(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
DL_IMPORT(struct _node *) PyParser_SimpleParseStringFlags(char *, int, int); PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(char *, int, int);
DL_IMPORT(struct _node *) PyParser_SimpleParseStringFlagsFilename(char *, PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(char *,
char *, char *,
int, int,
int); int);
DL_IMPORT(struct _node *) PyParser_SimpleParseFileFlags(FILE *, char *, PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, char *,
int, int); int, int);
DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);
DL_IMPORT(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *);
DL_IMPORT(PyObject *) PyRun_FileEx(FILE *, char *, int, PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *, char *, int,
PyObject *, PyObject *, int); PyObject *, PyObject *, int);
DL_IMPORT(PyObject *) PyRun_StringFlags(char *, int, PyObject *, PyObject *, PyAPI_FUNC(PyObject *) PyRun_StringFlags(char *, int, PyObject *, PyObject *,
PyCompilerFlags *); PyCompilerFlags *);
DL_IMPORT(PyObject *) PyRun_FileFlags(FILE *, char *, int, PyObject *, PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *, char *, int, PyObject *,
PyObject *, PyCompilerFlags *); PyObject *, PyCompilerFlags *);
DL_IMPORT(PyObject *) PyRun_FileExFlags(FILE *, char *, int, PyObject *, PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, char *, int, PyObject *,
PyObject *, int, PyCompilerFlags *); PyObject *, int, PyCompilerFlags *);
DL_IMPORT(PyObject *) Py_CompileString(char *, char *, int); PyAPI_FUNC(PyObject *) Py_CompileString(char *, char *, int);
DL_IMPORT(PyObject *) Py_CompileStringFlags(char *, char *, int, PyAPI_FUNC(PyObject *) Py_CompileStringFlags(char *, char *, int,
PyCompilerFlags *); PyCompilerFlags *);
DL_IMPORT(struct symtable *) Py_SymtableString(char *, char *, int); PyAPI_FUNC(struct symtable *) Py_SymtableString(char *, char *, int);
DL_IMPORT(void) PyErr_Print(void); PyAPI_FUNC(void) PyErr_Print(void);
DL_IMPORT(void) PyErr_PrintEx(int); PyAPI_FUNC(void) PyErr_PrintEx(int);
DL_IMPORT(void) PyErr_Display(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
DL_IMPORT(int) Py_AtExit(void (*func)(void)); PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
DL_IMPORT(void) Py_Exit(int); PyAPI_FUNC(void) Py_Exit(int);
DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *); PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, char *);
/* Bootstrap */ /* Bootstrap */
PyAPI_FUNC(int) Py_Main(int argc, char **argv); PyAPI_FUNC(int) Py_Main(int argc, char **argv);
...@@ -95,9 +95,9 @@ PyAPI_FUNC(const char *) Py_GetCompiler(void); ...@@ -95,9 +95,9 @@ PyAPI_FUNC(const char *) Py_GetCompiler(void);
PyAPI_FUNC(const char *) Py_GetBuildInfo(void); PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
/* Internal -- various one-time initializations */ /* Internal -- various one-time initializations */
DL_IMPORT(PyObject *) _PyBuiltin_Init(void); PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void);
DL_IMPORT(PyObject *) _PySys_Init(void); PyAPI_FUNC(PyObject *) _PySys_Init(void);
DL_IMPORT(void) _PyImport_Init(void); PyAPI_FUNC(void) _PyImport_Init(void);
PyAPI_FUNC(void) _PyExc_Init(void); PyAPI_FUNC(void) _PyExc_Init(void);
/* Various internal finalizers */ /* Various internal finalizers */
...@@ -113,9 +113,9 @@ PyAPI_FUNC(void) PyFloat_Fini(void); ...@@ -113,9 +113,9 @@ PyAPI_FUNC(void) PyFloat_Fini(void);
PyAPI_FUNC(void) PyOS_FiniInterrupts(void); PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
/* Stuff with no proper home (yet) */ /* Stuff with no proper home (yet) */
DL_IMPORT(char *) PyOS_Readline(char *); PyAPI_FUNC(char *) PyOS_Readline(char *);
extern DL_IMPORT(int) (*PyOS_InputHook)(void); PyAPI_FUNC(int) (*PyOS_InputHook)(void);
extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *); PyAPI_FUNC(char) *(*PyOS_ReadlineFunctionPointer)(char *);
/* Stack size, in "pointers" (so we get extra safety margins /* Stack size, in "pointers" (so we get extra safety margins
on 64-bit platforms). On a 32-bit platform, this translates on 64-bit platforms). On a 32-bit platform, this translates
...@@ -129,13 +129,13 @@ extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *); ...@@ -129,13 +129,13 @@ extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *);
#ifdef USE_STACKCHECK #ifdef USE_STACKCHECK
/* Check that we aren't overflowing our stack */ /* Check that we aren't overflowing our stack */
DL_IMPORT(int) PyOS_CheckStack(void); PyAPI_FUNC(int) PyOS_CheckStack(void);
#endif #endif
/* Signals */ /* Signals */
typedef void (*PyOS_sighandler_t)(int); typedef void (*PyOS_sighandler_t)(int);
DL_IMPORT(PyOS_sighandler_t) PyOS_getsig(int); PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
DL_IMPORT(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t); PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -12,28 +12,28 @@ typedef void *PyThread_type_sema; ...@@ -12,28 +12,28 @@ typedef void *PyThread_type_sema;
extern "C" { extern "C" {
#endif #endif
DL_IMPORT(void) PyThread_init_thread(void); PyAPI_FUNC(void) PyThread_init_thread(void);
DL_IMPORT(long) PyThread_start_new_thread(void (*)(void *), void *); PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *);
DL_IMPORT(void) PyThread_exit_thread(void); PyAPI_FUNC(void) PyThread_exit_thread(void);
DL_IMPORT(void) PyThread__PyThread_exit_thread(void); PyAPI_FUNC(void) PyThread__PyThread_exit_thread(void);
DL_IMPORT(long) PyThread_get_thread_ident(void); PyAPI_FUNC(long) PyThread_get_thread_ident(void);
DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock(void); PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
DL_IMPORT(void) PyThread_free_lock(PyThread_type_lock); PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock);
DL_IMPORT(int) PyThread_acquire_lock(PyThread_type_lock, int); PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int);
#define WAIT_LOCK 1 #define WAIT_LOCK 1
#define NOWAIT_LOCK 0 #define NOWAIT_LOCK 0
DL_IMPORT(void) PyThread_release_lock(PyThread_type_lock); PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
#ifndef NO_EXIT_PROG #ifndef NO_EXIT_PROG
DL_IMPORT(void) PyThread_exit_prog(int); PyAPI_FUNC(void) PyThread_exit_prog(int);
DL_IMPORT(void) PyThread__PyThread_exit_prog(int); PyAPI_FUNC(void) PyThread__PyThread_exit_prog(int);
#endif #endif
DL_IMPORT(int) PyThread_create_key(void); PyAPI_FUNC(int) PyThread_create_key(void);
DL_IMPORT(void) PyThread_delete_key(int); PyAPI_FUNC(void) PyThread_delete_key(int);
DL_IMPORT(int) PyThread_set_key_value(int, void *); PyAPI_FUNC(int) PyThread_set_key_value(int, void *);
DL_IMPORT(void *) PyThread_get_key_value(int); PyAPI_FUNC(void *) PyThread_get_key_value(int);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -15,11 +15,11 @@ Range objects behave like the corresponding tuple objects except that ...@@ -15,11 +15,11 @@ Range objects behave like the corresponding tuple objects except that
they are represented by a start, stop, and step datamembers. they are represented by a start, stop, and step datamembers.
*/ */
extern DL_IMPORT(PyTypeObject) PyRange_Type; PyAPI_DATA(PyTypeObject) PyRange_Type;
#define PyRange_Check(op) ((op)->ob_type == &PyRange_Type) #define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)
extern DL_IMPORT(PyObject *) PyRange_New(long, long, long, int); PyAPI_FUNC(PyObject *) PyRange_New(long, long, long, int);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -6,7 +6,7 @@ extern "C" { ...@@ -6,7 +6,7 @@ extern "C" {
/* The unique ellipsis object "..." */ /* The unique ellipsis object "..." */
extern DL_IMPORT(PyObject) _Py_EllipsisObject; /* Don't use this directly */ PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
#define Py_Ellipsis (&_Py_EllipsisObject) #define Py_Ellipsis (&_Py_EllipsisObject)
...@@ -24,15 +24,15 @@ typedef struct { ...@@ -24,15 +24,15 @@ typedef struct {
PyObject *start, *stop, *step; PyObject *start, *stop, *step;
} PySliceObject; } PySliceObject;
extern DL_IMPORT(PyTypeObject) PySlice_Type; PyAPI_DATA(PyTypeObject) PySlice_Type;
#define PySlice_Check(op) ((op)->ob_type == &PySlice_Type) #define PySlice_Check(op) ((op)->ob_type == &PySlice_Type)
DL_IMPORT(PyObject *) PySlice_New(PyObject* start, PyObject* stop, PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* step); PyObject* step);
DL_IMPORT(int) PySlice_GetIndices(PySliceObject *r, int length, PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, int length,
int *start, int *stop, int *step); int *start, int *stop, int *step);
DL_IMPORT(int) PySlice_GetIndicesEx(PySliceObject *r, int length, PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, int length,
int *start, int *stop, int *start, int *stop,
int *step, int *slicelength); int *step, int *slicelength);
......
...@@ -39,31 +39,31 @@ typedef struct { ...@@ -39,31 +39,31 @@ typedef struct {
char ob_sval[1]; char ob_sval[1];
} PyStringObject; } PyStringObject;
extern DL_IMPORT(PyTypeObject) PyBaseString_Type; PyAPI_DATA(PyTypeObject) PyBaseString_Type;
extern DL_IMPORT(PyTypeObject) PyString_Type; PyAPI_DATA(PyTypeObject) PyString_Type;
#define PyString_Check(op) PyObject_TypeCheck(op, &PyString_Type) #define PyString_Check(op) PyObject_TypeCheck(op, &PyString_Type)
#define PyString_CheckExact(op) ((op)->ob_type == &PyString_Type) #define PyString_CheckExact(op) ((op)->ob_type == &PyString_Type)
extern DL_IMPORT(PyObject *) PyString_FromStringAndSize(const char *, int); PyAPI_FUNC(PyObject *) PyString_FromStringAndSize(const char *, int);
extern DL_IMPORT(PyObject *) PyString_FromString(const char *); PyAPI_FUNC(PyObject *) PyString_FromString(const char *);
extern DL_IMPORT(PyObject *) PyString_FromFormatV(const char*, va_list) PyAPI_FUNC(PyObject *) PyString_FromFormatV(const char*, va_list)
__attribute__((format(printf, 1, 0))); __attribute__((format(printf, 1, 0)));
extern DL_IMPORT(PyObject *) PyString_FromFormat(const char*, ...) PyAPI_FUNC(PyObject *) PyString_FromFormat(const char*, ...)
__attribute__((format(printf, 1, 2))); __attribute__((format(printf, 1, 2)));
extern DL_IMPORT(int) PyString_Size(PyObject *); PyAPI_FUNC(int) PyString_Size(PyObject *);
extern DL_IMPORT(char *) PyString_AsString(PyObject *); PyAPI_FUNC(char *) PyString_AsString(PyObject *);
extern DL_IMPORT(void) PyString_Concat(PyObject **, PyObject *); PyAPI_FUNC(void) PyString_Concat(PyObject **, PyObject *);
extern DL_IMPORT(void) PyString_ConcatAndDel(PyObject **, PyObject *); PyAPI_FUNC(void) PyString_ConcatAndDel(PyObject **, PyObject *);
extern DL_IMPORT(int) _PyString_Resize(PyObject **, int); PyAPI_FUNC(int) _PyString_Resize(PyObject **, int);
extern DL_IMPORT(int) _PyString_Eq(PyObject *, PyObject*); PyAPI_FUNC(int) _PyString_Eq(PyObject *, PyObject*);
extern DL_IMPORT(PyObject *) PyString_Format(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyString_Format(PyObject *, PyObject *);
extern DL_IMPORT(PyObject *) _PyString_FormatLong(PyObject*, int, int, PyAPI_FUNC(PyObject *) _PyString_FormatLong(PyObject*, int, int,
int, char**, int*); int, char**, int*);
extern DL_IMPORT(void) PyString_InternInPlace(PyObject **); PyAPI_FUNC(void) PyString_InternInPlace(PyObject **);
extern DL_IMPORT(PyObject *) PyString_InternFromString(const char *); PyAPI_FUNC(PyObject *) PyString_InternFromString(const char *);
extern DL_IMPORT(void) _Py_ReleaseInternedStrings(void); PyAPI_FUNC(void) _Py_ReleaseInternedStrings(void);
/* Macro, trading safety for speed */ /* Macro, trading safety for speed */
#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval) #define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval)
...@@ -71,14 +71,14 @@ extern DL_IMPORT(void) _Py_ReleaseInternedStrings(void); ...@@ -71,14 +71,14 @@ extern DL_IMPORT(void) _Py_ReleaseInternedStrings(void);
/* _PyString_Join(sep, x) is like sep.join(x). sep must be PyStringObject*, /* _PyString_Join(sep, x) is like sep.join(x). sep must be PyStringObject*,
x must be an iterable object. */ x must be an iterable object. */
extern DL_IMPORT(PyObject *) _PyString_Join(PyObject *sep, PyObject *x); PyAPI_FUNC(PyObject *) _PyString_Join(PyObject *sep, PyObject *x);
/* --- Generic Codecs ----------------------------------------------------- */ /* --- Generic Codecs ----------------------------------------------------- */
/* Create an object by decoding the encoded string s of the /* Create an object by decoding the encoded string s of the
given size. */ given size. */
extern DL_IMPORT(PyObject*) PyString_Decode( PyAPI_FUNC(PyObject*) PyString_Decode(
const char *s, /* encoded string */ const char *s, /* encoded string */
int size, /* size of buffer */ int size, /* size of buffer */
const char *encoding, /* encoding */ const char *encoding, /* encoding */
...@@ -88,7 +88,7 @@ extern DL_IMPORT(PyObject*) PyString_Decode( ...@@ -88,7 +88,7 @@ extern DL_IMPORT(PyObject*) PyString_Decode(
/* Encodes a char buffer of the given size and returns a /* Encodes a char buffer of the given size and returns a
Python object. */ Python object. */
extern DL_IMPORT(PyObject*) PyString_Encode( PyAPI_FUNC(PyObject*) PyString_Encode(
const char *s, /* string char buffer */ const char *s, /* string char buffer */
int size, /* number of chars to encode */ int size, /* number of chars to encode */
const char *encoding, /* encoding */ const char *encoding, /* encoding */
...@@ -98,7 +98,7 @@ extern DL_IMPORT(PyObject*) PyString_Encode( ...@@ -98,7 +98,7 @@ extern DL_IMPORT(PyObject*) PyString_Encode(
/* Encodes a string object and returns the result as Python /* Encodes a string object and returns the result as Python
object. */ object. */
extern DL_IMPORT(PyObject*) PyString_AsEncodedObject( PyAPI_FUNC(PyObject*) PyString_AsEncodedObject(
PyObject *str, /* string object */ PyObject *str, /* string object */
const char *encoding, /* encoding */ const char *encoding, /* encoding */
const char *errors /* error handling */ const char *errors /* error handling */
...@@ -112,7 +112,7 @@ extern DL_IMPORT(PyObject*) PyString_AsEncodedObject( ...@@ -112,7 +112,7 @@ extern DL_IMPORT(PyObject*) PyString_AsEncodedObject(
DEPRECATED - use PyString_AsEncodedObject() instead. */ DEPRECATED - use PyString_AsEncodedObject() instead. */
extern DL_IMPORT(PyObject*) PyString_AsEncodedString( PyAPI_FUNC(PyObject*) PyString_AsEncodedString(
PyObject *str, /* string object */ PyObject *str, /* string object */
const char *encoding, /* encoding */ const char *encoding, /* encoding */
const char *errors /* error handling */ const char *errors /* error handling */
...@@ -121,7 +121,7 @@ extern DL_IMPORT(PyObject*) PyString_AsEncodedString( ...@@ -121,7 +121,7 @@ extern DL_IMPORT(PyObject*) PyString_AsEncodedString(
/* Decodes a string object and returns the result as Python /* Decodes a string object and returns the result as Python
object. */ object. */
extern DL_IMPORT(PyObject*) PyString_AsDecodedObject( PyAPI_FUNC(PyObject*) PyString_AsDecodedObject(
PyObject *str, /* string object */ PyObject *str, /* string object */
const char *encoding, /* encoding */ const char *encoding, /* encoding */
const char *errors /* error handling */ const char *errors /* error handling */
...@@ -135,7 +135,7 @@ extern DL_IMPORT(PyObject*) PyString_AsDecodedObject( ...@@ -135,7 +135,7 @@ extern DL_IMPORT(PyObject*) PyString_AsDecodedObject(
DEPRECATED - use PyString_AsDecodedObject() instead. */ DEPRECATED - use PyString_AsDecodedObject() instead. */
extern DL_IMPORT(PyObject*) PyString_AsDecodedString( PyAPI_FUNC(PyObject*) PyString_AsDecodedString(
PyObject *str, /* string object */ PyObject *str, /* string object */
const char *encoding, /* encoding */ const char *encoding, /* encoding */
const char *errors /* error handling */ const char *errors /* error handling */
...@@ -147,7 +147,7 @@ extern DL_IMPORT(PyObject*) PyString_AsDecodedString( ...@@ -147,7 +147,7 @@ extern DL_IMPORT(PyObject*) PyString_AsDecodedString(
0-terminated (passing a string with embedded NULL characters will 0-terminated (passing a string with embedded NULL characters will
cause an exception). */ cause an exception). */
extern DL_IMPORT(int) PyString_AsStringAndSize( PyAPI_FUNC(int) PyString_AsStringAndSize(
register PyObject *obj, /* string or Unicode object */ register PyObject *obj, /* string or Unicode object */
register char **s, /* pointer to buffer variable */ register char **s, /* pointer to buffer variable */
register int *len /* pointer to length variable or NULL register int *len /* pointer to length variable or NULL
......
...@@ -81,12 +81,12 @@ typedef struct PyMemberDef { ...@@ -81,12 +81,12 @@ typedef struct PyMemberDef {
/* Obsolete API, for binary backwards compatibility */ /* Obsolete API, for binary backwards compatibility */
DL_IMPORT(PyObject *) PyMember_Get(char *, struct memberlist *, char *); PyAPI_FUNC(PyObject *) PyMember_Get(char *, struct memberlist *, char *);
DL_IMPORT(int) PyMember_Set(char *, struct memberlist *, char *, PyObject *); PyAPI_FUNC(int) PyMember_Set(char *, struct memberlist *, char *, PyObject *);
/* Current API, use this */ /* Current API, use this */
DL_IMPORT(PyObject *) PyMember_GetOne(char *, struct PyMemberDef *); PyAPI_FUNC(PyObject *) PyMember_GetOne(char *, struct PyMemberDef *);
DL_IMPORT(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -19,10 +19,10 @@ typedef struct PyStructSequence_Desc { ...@@ -19,10 +19,10 @@ typedef struct PyStructSequence_Desc {
int n_in_sequence; int n_in_sequence;
} PyStructSequence_Desc; } PyStructSequence_Desc;
extern DL_IMPORT(void) PyStructSequence_InitType(PyTypeObject *type, PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc); PyStructSequence_Desc *desc);
extern DL_IMPORT(PyObject *) PyStructSequence_New(PyTypeObject* type); PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
typedef struct { typedef struct {
PyObject_VAR_HEAD PyObject_VAR_HEAD
......
...@@ -50,15 +50,15 @@ typedef struct _symtable_entry { ...@@ -50,15 +50,15 @@ typedef struct _symtable_entry {
struct symtable *ste_table; struct symtable *ste_table;
} PySymtableEntryObject; } PySymtableEntryObject;
extern DL_IMPORT(PyTypeObject) PySymtableEntry_Type; PyAPI_DATA(PyTypeObject) PySymtableEntry_Type;
#define PySymtableEntry_Check(op) ((op)->ob_type == &PySymtableEntry_Type) #define PySymtableEntry_Check(op) ((op)->ob_type == &PySymtableEntry_Type)
extern DL_IMPORT(PyObject *) PySymtableEntry_New(struct symtable *, PyAPI_FUNC(PyObject *) PySymtableEntry_New(struct symtable *,
char *, int, int); char *, int, int);
DL_IMPORT(struct symtable *) PyNode_CompileSymtable(struct _node *, char *); PyAPI_FUNC(struct symtable *) PyNode_CompileSymtable(struct _node *, char *);
DL_IMPORT(void) PySymtable_Free(struct symtable *); PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
#define TOP "global" #define TOP "global"
......
...@@ -7,22 +7,22 @@ ...@@ -7,22 +7,22 @@
extern "C" { extern "C" {
#endif #endif
DL_IMPORT(PyObject *) PySys_GetObject(char *); PyAPI_FUNC(PyObject *) PySys_GetObject(char *);
DL_IMPORT(int) PySys_SetObject(char *, PyObject *); PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *);
DL_IMPORT(FILE *) PySys_GetFile(char *, FILE *); PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *);
DL_IMPORT(void) PySys_SetArgv(int, char **); PyAPI_FUNC(void) PySys_SetArgv(int, char **);
DL_IMPORT(void) PySys_SetPath(char *); PyAPI_FUNC(void) PySys_SetPath(char *);
DL_IMPORT(void) PySys_WriteStdout(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
__attribute__((format(printf, 1, 2))); __attribute__((format(printf, 1, 2)));
DL_IMPORT(void) PySys_WriteStderr(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
__attribute__((format(printf, 1, 2))); __attribute__((format(printf, 1, 2)));
extern DL_IMPORT(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc; PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
extern DL_IMPORT(int) _PySys_CheckInterval; PyAPI_DATA(int) _PySys_CheckInterval;
DL_IMPORT(void) PySys_ResetWarnOptions(void); PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
DL_IMPORT(void) PySys_AddWarnOption(char *); PyAPI_FUNC(void) PySys_AddWarnOption(char *);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -71,10 +71,10 @@ extern "C" { ...@@ -71,10 +71,10 @@ extern "C" {
#define ISEOF(x) ((x) == ENDMARKER) #define ISEOF(x) ((x) == ENDMARKER)
extern DL_IMPORT(char *) _PyParser_TokenNames[]; /* Token names */ PyAPI_DATA(char *) _PyParser_TokenNames[]; /* Token names */
extern DL_IMPORT(int) PyToken_OneChar(int); PyAPI_FUNC(int) PyToken_OneChar(int);
extern DL_IMPORT(int) PyToken_TwoChars(int, int); PyAPI_FUNC(int) PyToken_TwoChars(int, int);
extern DL_IMPORT(int) PyToken_ThreeChars(int, int, int); PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -9,11 +9,11 @@ extern "C" { ...@@ -9,11 +9,11 @@ extern "C" {
struct _frame; struct _frame;
DL_IMPORT(int) PyTraceBack_Here(struct _frame *); PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *);
DL_IMPORT(int) PyTraceBack_Print(PyObject *, PyObject *); PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *);
/* Reveal traceback type so we can typecheck traceback objects */ /* Reveal traceback type so we can typecheck traceback objects */
extern DL_IMPORT(PyTypeObject) PyTraceBack_Type; PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
#define PyTraceBack_Check(v) ((v)->ob_type == &PyTraceBack_Type) #define PyTraceBack_Check(v) ((v)->ob_type == &PyTraceBack_Type)
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -24,17 +24,17 @@ typedef struct { ...@@ -24,17 +24,17 @@ typedef struct {
PyObject *ob_item[1]; PyObject *ob_item[1];
} PyTupleObject; } PyTupleObject;
extern DL_IMPORT(PyTypeObject) PyTuple_Type; PyAPI_DATA(PyTypeObject) PyTuple_Type;
#define PyTuple_Check(op) PyObject_TypeCheck(op, &PyTuple_Type) #define PyTuple_Check(op) PyObject_TypeCheck(op, &PyTuple_Type)
#define PyTuple_CheckExact(op) ((op)->ob_type == &PyTuple_Type) #define PyTuple_CheckExact(op) ((op)->ob_type == &PyTuple_Type)
extern DL_IMPORT(PyObject *) PyTuple_New(int size); PyAPI_FUNC(PyObject *) PyTuple_New(int size);
extern DL_IMPORT(int) PyTuple_Size(PyObject *); PyAPI_FUNC(int) PyTuple_Size(PyObject *);
extern DL_IMPORT(PyObject *) PyTuple_GetItem(PyObject *, int); PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, int);
extern DL_IMPORT(int) PyTuple_SetItem(PyObject *, int, PyObject *); PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, int, PyObject *);
extern DL_IMPORT(PyObject *) PyTuple_GetSlice(PyObject *, int, int); PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int); PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, int);
/* Macro, trading safety for speed */ /* Macro, trading safety for speed */
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i]) #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
......
This diff is collapsed.
...@@ -18,9 +18,9 @@ struct _PyWeakReference { ...@@ -18,9 +18,9 @@ struct _PyWeakReference {
PyWeakReference *wr_next; PyWeakReference *wr_next;
}; };
extern DL_IMPORT(PyTypeObject) _PyWeakref_RefType; PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
extern DL_IMPORT(PyTypeObject) _PyWeakref_ProxyType; PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
extern DL_IMPORT(PyTypeObject) _PyWeakref_CallableProxyType; PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType;
#define PyWeakref_CheckRef(op) \ #define PyWeakref_CheckRef(op) \
((op)->ob_type == &_PyWeakref_RefType) ((op)->ob_type == &_PyWeakref_RefType)
...@@ -31,13 +31,13 @@ extern DL_IMPORT(PyTypeObject) _PyWeakref_CallableProxyType; ...@@ -31,13 +31,13 @@ extern DL_IMPORT(PyTypeObject) _PyWeakref_CallableProxyType;
(PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op)) (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
extern DL_IMPORT(PyObject *) PyWeakref_NewRef(PyObject *ob, PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
PyObject *callback); PyObject *callback);
extern DL_IMPORT(PyObject *) PyWeakref_NewProxy(PyObject *ob, PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
PyObject *callback); PyObject *callback);
extern DL_IMPORT(PyObject *) PyWeakref_GetObject(PyObject *ref); PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
extern DL_IMPORT(long) _PyWeakref_GetWeakrefCount(PyWeakReference *head); PyAPI_FUNC(long) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
#define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object) #define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment