be parsed or compiled.
-.. c:function:: PyObject* PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
+.. c:function:: PyObject* PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just
the code object, and the dictionaries of global and local variables.
The other arguments are set to *NULL*.
-.. c:function:: PyObject* PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure)
+.. c:function:: PyObject* PyEval_EvalCodeEx(PyObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure)
Evaluate a precompiled code object, given a particular environment for its
evaluation. This environment consists of dictionaries of global and local
if (ps1 == prompt || /* ">>> " or */
'\n' == code[i + j - 1]) /* "... " and double '\n' */
{ /* so execute it */
- dum = PyEval_EvalCode ((PyCodeObject *)src, glb, loc);
+ dum = PyEval_EvalCode (src, glb, loc);
Py_XDECREF (dum);
Py_XDECREF (src);
free (code);
This article explains the new features in Python 3.2, compared to 3.1.
+PEP 382: Defining a Stable ABI
+==============================
+
+In the past, extension modules built for one Python version were often
+not usable with other Python versions. Particularly on Windows, every
+feature release of Python required rebuilding all extension modules that
+one wanted to use. This requirement was the result of the free access to
+Python interpreter internals that extension modules could use.
+
+With Python 3.2, an alternative approach becomes available: extension
+modules with restrict themselves to a limited API (by defining
+Py_LIMITED_API) cannot use many of the internals, but are constrained
+to a set of API functions that are promised to be stable for several
+releases. As a consequence, extension modules built for 3.2 in that
+mode will also work with 3.3, 3.4, and so on. Extension modules that
+make use of details of memory structures can still be built, but will
+need to be recompiled for every feature release.
+
PEP 391: Dictionary Based Configuration for Logging
====================================================
#include "object.h"
#include "objimpl.h"
+#include "typeslots.h"
#include "pydebug.h"
#include "weakrefobject.h"
#include "structseq.h"
+
#include "codecs.h"
#include "pyerrors.h"
#endif
/* _Py_Mangle is defined in compile.c */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
+#endif
#ifdef __cplusplus
}
PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o);
#define PyObject_Length PyObject_Size
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyObject_LengthHint(PyObject *o, Py_ssize_t);
+#endif
/*
Guess the size of object o using len(o) or o.__length_hint__().
that can accept a char* naming integral's type.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyNumber_ConvertIntegralToInt(
PyObject *integral,
const char* error_format);
+#endif
/*
Returns the object converted to Py_ssize_t by going through
Use __contains__ if possible, else _PySequence_IterSearch().
*/
+#ifndef Py_LIMITED_API
#define PY_ITERSEARCH_COUNT 1
#define PY_ITERSEARCH_INDEX 2
#define PY_ITERSEARCH_CONTAINS 3
PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
PyObject *obj, int operation);
+#endif
/*
Iterate over seq. Result depends on the operation:
PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
/* issubclass(object, typeorclass) */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self);
PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]);
+#endif
/* For internal use by buffer API functions */
PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
*/
/* Object layout */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
/* XXX(nnorwitz): should ob_exports be Py_ssize_t? */
Py_ssize_t ob_alloc; /* How many bytes allocated */
char *ob_bytes;
} PyByteArrayObject;
+#endif
/* Type object */
PyAPI_DATA(PyTypeObject) PyByteArray_Type;
PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
/* Macros, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyByteArray_AS_STRING(self) \
(assert(PyByteArray_Check(self)), \
Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string)
#define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self))
PyAPI_DATA(char) _PyByteArray_empty_string[];
+#endif
#ifdef __cplusplus
}
+#ifndef Py_LIMITED_API
#ifndef Py_BYTES_CTYPE_H
#define Py_BYTES_CTYPE_H
#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str)
#endif /* !Py_BYTES_CTYPE_H */
+#endif /* !Py_LIMITED_API */
/* Caching the hash (ob_shash) saves recalculation of a string's hash value.
This significantly speeds up dict lookups. */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
Py_hash_t ob_shash;
* ob_shash is the hash of the string or -1 if not computed yet.
*/
} PyBytesObject;
+#endif
PyAPI_DATA(PyTypeObject) PyBytes_Type;
PyAPI_DATA(PyTypeObject) PyBytesIter_Type;
PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int);
PyAPI_FUNC(void) PyBytes_Concat(PyObject **, PyObject *);
PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
PyAPI_FUNC(PyObject *) _PyBytes_FormatLong(PyObject*, int, int,
int, char**, int*);
+#endif
PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t,
const char *, Py_ssize_t,
const char *);
/* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyBytes_AS_STRING(op) (assert(PyBytes_Check(op)), \
(((PyBytesObject *)(op))->ob_sval))
#define PyBytes_GET_SIZE(op) (assert(PyBytes_Check(op)),Py_SIZE(op))
+#endif
/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
x must be an iterable object. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x);
+#endif
/* Provides access to the internal data buffer and size of a string
object or the default encoded version of an Unicode object. Passing
/* Using the current locale, insert the thousands grouping
into the string pointed to by buffer. For the argument descriptions,
see Objects/stringlib/localeutil.h */
-
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGroupingLocale(char *buffer,
Py_ssize_t n_buffer,
char *digits,
Py_ssize_t min_width,
const char *grouping,
const char *thousands_sep);
+#endif
/* Flags used by string formatting */
#define F_LJUST (1<<0)
/* Cell object interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_TUPLEOBJECT_H */
+#endif /* Py_LIMITED_API */
const char *methodname,
const char *format, ...);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
+#endif
struct _frame; /* Avoid including frameobject.h */
/* 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
flag was set, else return 0. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
+#endif
PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
PyAPI_FUNC(int) Py_MakePendingCalls(void);
PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
PyAPI_FUNC(void) PyEval_ReInitThreads(void);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds);
PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void);
+#endif
#define Py_BEGIN_ALLOW_THREADS { \
PyThreadState *_save; \
#endif /* !WITH_THREAD */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
PyAPI_FUNC(void) _PyEval_SignalAsyncExc(void);
+#endif
#ifdef __cplusplus
/* Revealing some structures (not for general use) */
+#ifndef Py_LIMITED_API
#ifndef Py_CLASSOBJECT_H
#define Py_CLASSOBJECT_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_CLASSOBJECT_H */
+#endif /* Py_LIMITED_API */
/* Definitions for bytecode */
+#ifndef Py_LIMITED_API
#ifndef Py_CODE_H
#define Py_CODE_H
#ifdef __cplusplus
/* Update *bounds to describe the first and one-past-the-last instructions in the
same line as lasti. Return the number of that line.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co,
int lasti, PyAddrPair *bounds);
+#endif
PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
PyObject *names, PyObject *lineno_obj);
}
#endif
#endif /* !Py_CODE_H */
+#endif /* Py_LIMITED_API */
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyCodec_Lookup(
const char *encoding
);
+#endif
/* Codec registry encoding check API.
-
+#ifndef Py_LIMITED_API
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
}
#endif
#endif /* !Py_COMPILE_H */
+#endif /* !Py_LIMITED_API */
extern "C" {
#endif
+#ifndef Py_LIMITED_API
typedef struct {
double real;
double imag;
PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex);
PyAPI_FUNC(double) c_abs(Py_complex);
-
+#endif
/* Complex object interface */
PyComplexObject represents a complex number with double-precision
real and imaginary parts.
*/
-
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
Py_complex cval;
-} PyComplexObject;
+} PyComplexObject;
+#endif
PyAPI_DATA(PyTypeObject) PyComplex_Type;
#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
#define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type)
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
+#endif
PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
+#endif
/* Format the object based on the format_spec, as defined in PEP 3101
(Advanced String Formatting). */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif
#ifdef __cplusplus
}
/* datetime.h
*/
-
+#ifndef Py_LIMITED_API
#ifndef DATETIME_H
#define DATETIME_H
#ifdef __cplusplus
}
#endif
#endif
+#endif /* !Py_LIMITED_API */
void *closure;
} PyGetSetDef;
+#ifndef Py_LIMITED_API
typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
void *wrapped);
struct wrapperbase *d_base;
void *d_wrapped; /* This can be any function pointer */
} PyWrapperDescrObject;
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
+struct PyMemberDef; /* forward declaration for following prototype */
PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *,
struct PyMemberDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
struct PyGetSetDef *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *);
#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
+#endif
PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
* majority of dicts (consisting mostly of usually-small instance dicts and
* usually-small dicts created to pass keyword arguments).
*/
+#ifndef Py_LIMITED_API
#define PyDict_MINSIZE 8
typedef struct {
PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash);
PyDictEntry ma_smalltable[PyDict_MINSIZE];
};
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PyDict_Type;
PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
PyAPI_FUNC(int) PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);
+#endif
PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash);
PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp);
+#endif
/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);
+#ifndef Py_LIMITED_API
#ifndef PY_NO_SHORT_FLOAT_REPR
#ifdef __cplusplus
extern "C" {
}
#endif
#endif
+#endif
extern "C" {
#endif
-PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
-PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co,
+PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
PyObject *globals,
PyObject *locals,
PyObject **args, int argc,
PyObject **defs, int defc,
PyObject *kwdefs, PyObject *closure);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);
+#endif
#ifdef __cplusplus
}
PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
+#endif
/* The default encoding used by the platform file system APIs
If non-NULL, this is different than the default encoding for strings
The std printer acts as a preliminary sys.stderr until the new io
infrastructure is in place. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
#else
#define _PyVerify_fd(A) (1) /* dummy */
#endif
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
extern "C" {
#endif
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
double ob_fval;
} PyFloatObject;
+#endif
PyAPI_DATA(PyTypeObject) PyFloat_Type;
/* Extract C double from Python float. The macro version trades safety for
speed. */
PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
+#ifndef Py_LIMITED_API
#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
+#endif
+#ifndef Py_LIMITED_API
/* _PyFloat_{Pack,Unpack}{4,8}
*
* The struct and pickle (at least) modules need an efficient platform-
PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
/* Frame object interface */
+#ifndef Py_LIMITED_API
#ifndef Py_FRAMEOBJECT_H
#define Py_FRAMEOBJECT_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_FRAMEOBJECT_H */
+#endif /* Py_LIMITED_API */
/* Function object interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_FUNCOBJECT_H
#define Py_FUNCOBJECT_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_FUNCOBJECT_H */
+#endif /* Py_LIMITED_API */
/* Generator object interface */
+#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_GENOBJECT_H */
+#endif /* Py_LIMITED_API */
PyAPI_FUNC(void) PyImport_Cleanup(void);
PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *);
+#ifndef Py_LIMITED_API
#ifdef WITH_THREAD
PyAPI_FUNC(void) _PyImport_AcquireLock(void);
PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
char *name;
PyObject* (*initfunc)(void);
};
+PyAPI_DATA(struct _inittab *) PyImport_Inittab;
+PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
-PyAPI_DATA(struct _inittab *) PyImport_Inittab;
PyAPI_FUNC(int) PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void));
-PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
+#ifndef Py_LIMITED_API
struct _frozen {
char *name;
unsigned char *code;
collection of frozen modules: */
PyAPI_DATA(struct _frozen *) PyImport_FrozenModules;
+#endif
#ifdef __cplusplus
}
extern "C" {
#endif
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
/* Vector of pointers to list elements. list[0] is ob_item[0], etc. */
*/
Py_ssize_t allocated;
} PyListObject;
+#endif
PyAPI_DATA(PyTypeObject) PyList_Type;
PyAPI_DATA(PyTypeObject) PyListIter_Type;
PyAPI_FUNC(int) PyList_Sort(PyObject *);
PyAPI_FUNC(int) PyList_Reverse(PyObject *);
PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);
+#endif
/* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
#define PyList_GET_SIZE(op) Py_SIZE(op)
+#endif
#ifdef __cplusplus
}
+#ifndef Py_LIMITED_API
#ifndef Py_LONGINTREPR_H
#define Py_LONGINTREPR_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_LONGINTREPR_H */
+#endif /* Py_LIMITED_API */
#endif /* SIZEOF_PID_T */
/* Used by Python/mystrtoul.c. */
+#ifndef Py_LIMITED_API
PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
+#endif
/* _PyLong_Frexp returns a double x and an exponent e such that the
true value is approximately equal to x * 2**e. e is >= 0. x is
zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is
possible if the number of bits doesn't fit into a Py_ssize_t, sets
OverflowError and returns -1.0 for x, 0 for e. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
+#endif
PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
#endif /* HAVE_LONG_LONG */
PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
+#endif
+#ifndef Py_LIMITED_API
/* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
v must not be NULL, and must be a normalized long.
There are no error cases.
PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif /* Py_LIMITED_API */
/* These aren't really part of the long object, but they're handy. The
functions are in Python/mystrtoul.c.
PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);
PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *);
PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
+#endif
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
#ifdef __cplusplus
#define PyMemoryView_Check(op) (Py_TYPE(op) == &PyMemoryView_Type)
+#ifndef Py_LIMITED_API
/* Get a pointer to the underlying Py_buffer of a memoryview object. */
#define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view)
/* Get a pointer to the PyObject from which originates a memoryview object. */
#define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj)
+#endif
PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base,
/* The struct is declared here so that macros can work, but it shouldn't
be considered public. Don't access those fields directly, use the macros
and functions instead! */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
Py_buffer view;
} PyMemoryViewObject;
-
+#endif
#ifdef __cplusplus
}
/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
+#ifndef Py_LIMITED_API
#define PyCFunction_GET_FUNCTION(func) \
(((PyCFunctionObject *)func) -> m_ml -> ml_meth)
#define PyCFunction_GET_SELF(func) \
(((PyCFunctionObject *)func) -> m_self)
#define PyCFunction_GET_FLAGS(func) \
(((PyCFunctionObject *)func) -> m_ml -> ml_flags)
+#endif
PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
struct PyMethodDef {
#define METH_COEXIST 0x0040
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
PyMethodDef *m_ml; /* Description of the C function to call */
PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
PyObject *m_module; /* The __module__ attribute, can be anything */
} PyCFunctionObject;
+#endif
PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
+#endif
PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
9-Jan-1995 GvR Initial version (incompatible with older API)
*/
+/* The PYTHON_ABI_VERSION is introduced in PEP 384. For the lifetime of
+ Python 3, it will stay at the value of 3; changes to the limited API
+ must be performed in a strictly backwards-compatible manner. */
+#define PYTHON_ABI_VERSION 3
+#define PYTHON_ABI_STRING "3"
+
#ifdef Py_TRACE_REFS
/* When we are tracing reference counts, rename PyModule_Create2 so
modules compiled with incompatible settings will generate a
PyAPI_FUNC(PyObject *) PyModule_Create2(struct PyModuleDef*,
int apiver);
+#ifdef Py_LIMITED_API
+#define PyModule_Create(module) \
+ PyModule_Create2(module, PYTHON_ABI_VERSION)
+#else
#define PyModule_Create(module) \
PyModule_Create2(module, PYTHON_API_VERSION)
+#endif
+#ifndef Py_LIMITED_API
PyAPI_DATA(char *) _Py_PackageContext;
+#endif
#ifdef __cplusplus
}
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
+#endif
PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
#define Py_REF_DEBUG
#endif
+#if defined(Py_LIMITED_API) && defined(Py_REF_DEBUG)
+#error Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and Py_REF_DEBUG
+#endif
+
#ifdef Py_TRACE_REFS
/* Define pointers to support a doubly-linked list of all live heap objects. */
#define _PyObject_HEAD_EXTRA \
typedef int (*visitproc)(PyObject *, void *);
typedef int (*traverseproc)(PyObject *, visitproc, void *);
+#ifndef Py_LIMITED_API
typedef struct {
/* Number implementations must check *both*
arguments for proper type and implement the necessary conversions
getbufferproc bf_getbuffer;
releasebufferproc bf_releasebuffer;
} PyBufferProcs;
+#endif /* Py_LIMITED_API */
typedef void (*freefunc)(void *);
typedef void (*destructor)(PyObject *);
+#ifndef Py_LIMITED_API
+/* We can't provide a full compile-time check that limited-API
+ users won't implement tp_print. However, not defining printfunc
+ and making tp_print of a different function pointer type
+ should at least cause a warning in most cases. */
typedef int (*printfunc)(PyObject *, FILE *, int);
+#endif
typedef PyObject *(*getattrfunc)(PyObject *, char *);
typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *);
typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t);
+#ifdef Py_LIMITED_API
+typedef struct _typeobject PyTypeObject; /* opaque */
+#else
typedef struct _typeobject {
PyObject_VAR_HEAD
const char *tp_name; /* For printing, in format "<module>.<name>" */
struct _typeobject *tp_next;
#endif
} PyTypeObject;
+#endif
+typedef struct{
+ int slot; /* slot id, see below */
+ void *pfunc; /* function pointer */
+} PyType_Slot;
+typedef struct{
+ const char* name;
+ const char* doc;
+ int basicsize;
+ int itemsize;
+ int flags;
+ PyType_Slot *slots; /* terminated by slot==0. */
+} PyType_Spec;
+
+PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*);
+
+#ifndef Py_LIMITED_API
/* The *real* layout of a type object when allocated on the heap */
typedef struct _heaptypeobject {
/* Note: there's a dependency on the order of these members
/* access macro to the members which are floating "behind" the object */
#define PyHeapType_GET_MEMBERS(etype) \
((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize))
-
+#endif
/* Generic type check */
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);
PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *,
PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **);
+#endif
PyAPI_FUNC(unsigned int) PyType_ClearCache(void);
PyAPI_FUNC(void) PyType_Modified(PyTypeObject *);
/* Generic operations on objects */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
PyAPI_FUNC(void) _Py_BreakPoint(void);
PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
+#endif
PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
+#endif
PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
+#endif
PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *,
PyObject *, PyObject *);
PyAPI_FUNC(void) Py_ReprLeave(PyObject *);
/* Helpers for hash functions */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
+#endif
/* Helper for passing objects to printf and the like */
#define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
#define _Py_ForgetReference(op) _Py_INC_TPFREES(op)
+#ifdef Py_LIMITED_API
+PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
+#else
#define _Py_Dealloc(op) ( \
_Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA \
(*Py_TYPE(op)->tp_dealloc)((PyObject *)(op)))
+#endif
#endif /* !Py_TRACE_REFS */
#define Py_INCREF(op) ( \
#define _PyObject_GC_Del PyObject_GC_Del
/* GC information is stored BEFORE the object structure. */
+#ifndef Py_LIMITED_API
typedef union _gc_head {
struct {
union _gc_head *gc_next;
#define _PyObject_GC_MAY_BE_TRACKED(obj) \
(PyObject_IS_GC(obj) && \
(!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj)))
-
+#endif /* Py_LIMITED_API */
PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t);
PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *);
/* Parser-tokenizer link interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_PARSETOK_H
#define Py_PARSETOK_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_PARSETOK_H */
+#endif /* !Py_LIMITED_API */
/* An arena-like memory interface for the compiler.
*/
+#ifndef Py_LIMITED_API
#ifndef Py_PYARENA_H
#define Py_PYARENA_H
#endif
#endif /* !Py_PYARENA_H */
+#endif /* Py_LIMITED_API */
+#ifndef Py_LIMITED_API
#ifndef Py_ATOMIC_H
#define Py_ATOMIC_H
/* XXX: When compilers start offering a stdatomic.h with lock-free
#endif
#endif /* Py_ATOMIC_H */
+#endif /* Py_LIMITED_API */
+#ifndef Py_LIMITED_API
#ifndef PYCTYPE_H
#define PYCTYPE_H
#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])
#endif /* !PYCTYPE_H */
+#endif /* !Py_LIMITED_API */
-
+#ifndef Py_LIMITED_API
#ifndef Py_PYDEBUG_H
#define Py_PYDEBUG_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_PYDEBUG_H */
+#endif /* Py_LIMITED_API */
/* Error objects */
+#ifndef Py_LIMITED_API
/* PyException_HEAD defines the initial segment of every exception class. */
#define PyException_HEAD PyObject_HEAD PyObject *dict;\
PyObject *args; PyObject *traceback;\
PyObject *winerror;
} PyWindowsErrorObject;
#endif
+#endif
/* Error handling definitions */
PyAPI_FUNC(void) PyErr_Clear(void);
PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
+PyAPI_FUNC(void) Py_FatalError(const char *message);
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
#define _PyErr_OCCURRED() PyErr_Occurred()
#else
#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type)
PyObject *exc,
const char *filename /* decoded from the filesystem encoding */
);
-#ifdef MS_WINDOWS
+#if defined(MS_WINDOWS) && !defined(Py_LIMITED_API)
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, const Py_UNICODE *);
#endif /* MS_WINDOWS */
int, const char *);
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
int, const char *);
+#ifndef Py_LIMITED_API
+/* XXX redeclare to use WSTRING */
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
int, const Py_UNICODE *);
+#endif
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
PyObject *,int, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
PyObject *,int, const char *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *,int, const Py_UNICODE *);
+#endif
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif /* MS_WINDOWS */
PyAPI_FUNC(void) PyErr_SetInterrupt(void);
/* In signalmodule.c */
+#ifndef Py_LIMITED_API
int PySignal_SetWakeupFd(int fd);
+#endif
/* Support for adding program text to SyntaxErrors */
PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
/* create a UnicodeEncodeError object */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+#endif
/* create a UnicodeTranslateError object */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+#endif
/* get the encoding attribute */
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *);
extern "C" {
#endif
+#ifndef Py_LIMITED_API
PyAPI_DATA(int) _PyOS_opterr;
PyAPI_DATA(int) _PyOS_optind;
PyAPI_DATA(wchar_t *) _PyOS_optarg;
+#endif
PyAPI_FUNC(int) _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring);
nothing. */
/* we take double rounding as evidence of x87 usage */
+#ifndef Py_LIMITED_API
#ifndef Py_FORCE_DOUBLE
# ifdef X87_DOUBLE_ROUNDING
PyAPI_FUNC(double) _Py_force_double(double);
# define Py_FORCE_DOUBLE(X) (X)
# endif
#endif
+#endif
+#ifndef Py_LIMITED_API
#ifdef HAVE_GCC_ASM_FOR_X87
PyAPI_FUNC(unsigned short) _Py_get_387controlword(void);
PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);
#endif
+#endif
/* Py_IS_NAN(X)
* Return 1 if float or double arg is a NaN, else 0.
struct _ts; /* Forward */
struct _is; /* Forward */
+#ifdef Py_LIMITED_API
+typedef struct _is PyInterpreterState;
+#else
typedef struct _is {
struct _is *next;
#endif
} PyInterpreterState;
+#endif
/* State unique per thread */
struct _frame; /* Avoid including frameobject.h */
+#ifndef Py_LIMITED_API
/* Py_tracefunc return -1 when raising an exception, or 0 for success. */
typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
#define PyTrace_C_CALL 4
#define PyTrace_C_EXCEPTION 5
#define PyTrace_C_RETURN 6
+#endif
+#ifdef Py_LIMITED_API
+typedef struct _ts PyThreadState;
+#else
typedef struct _ts {
/* See Python/ceval.c for comments explaining most fields */
/* XXX signal handlers should also be here */
} PyThreadState;
+#endif
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
/* Assuming the current thread holds the GIL, this is the
PyThreadState for the current thread. */
+#ifndef Py_LIMITED_API
PyAPI_DATA(_Py_atomic_address) _PyThreadState_Current;
+#endif
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
#define PyThreadState_GET() PyThreadState_Get()
#else
#define PyThreadState_GET() \
/* The implementation of sys._current_frames() Returns a dict mapping
thread id to that thread's current frame.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
+#endif
/* Routines for advanced debuggers, requested by David Beazley.
Don't use unless you know what you are doing! */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_);
+#endif
/* hook for PyEval_GetFrame(), requested for Psyco */
+#ifndef Py_LIMITED_API
PyAPI_DATA(PyThreadFrameGetter) _PyThreadState_GetFrame;
+#endif
#ifdef __cplusplus
}
int flags,
int *type);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
+#endif
/* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
#define PyCF_ONLY_AST 0x0400
#define PyCF_IGNORE_COOKIE 0x0800
+#ifndef Py_LIMITED_API
typedef struct {
int cf_flags; /* bitmask of CO_xxx flags relevant to future */
} PyCompilerFlags;
+#endif
PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);
PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *);
PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *);
char *, char *,
PyCompilerFlags *, int *,
PyArena *);
+#endif
+
+#ifndef PyParser_SimpleParseString
#define PyParser_SimpleParseString(S, B) \
PyParser_SimpleParseStringFlags(S, B, 0)
#define PyParser_SimpleParseFile(FP, S, B) \
PyParser_SimpleParseFileFlags(FP, S, B, 0)
+#endif
PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,
int);
PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
int, int);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
PyObject *, PyCompilerFlags *);
PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int,
PyObject *, PyObject *, int,
PyCompilerFlags *);
+#endif
+#ifdef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int);
+#else
#define Py_CompileString(str, p, s) Py_CompileStringFlags(str, p, s, NULL)
PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int,
PyCompilerFlags *);
+#endif
PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int);
PyAPI_FUNC(void) PyErr_Print(void);
/* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
* exit functions.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(void));
+#endif
PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
PyAPI_FUNC(void) Py_Exit(int);
/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _Py_RestoreSignals(void);
PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
+#endif
/* Bootstrap */
PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
+#ifndef Py_LIMITED_API
/* Use macros for a bunch of old variants */
#define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL)
#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL)
PyRun_FileExFlags(fp, p, s, g, l, c, NULL)
#define PyRun_FileFlags(fp, p, s, g, l, flags) \
PyRun_FileExFlags(fp, p, s, g, l, 0, flags)
+#endif
/* In getpath.c */
PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
PyAPI_FUNC(wchar_t *) Py_GetPath(void);
PyAPI_FUNC(void) Py_SetPath(const wchar_t *);
+#ifdef MS_WINDOWS
+int _Py_CheckPython3();
+#endif
/* In their own files */
PyAPI_FUNC(const char *) Py_GetVersion(void);
PyAPI_FUNC(const char *) Py_GetCopyright(void);
PyAPI_FUNC(const char *) Py_GetCompiler(void);
PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(const char *) _Py_svnversion(void);
PyAPI_FUNC(const char *) Py_SubversionRevision(void);
PyAPI_FUNC(const char *) Py_SubversionShortBranch(void);
+#endif
/* Internal -- various one-time initializations */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void);
PyAPI_FUNC(PyObject *) _PySys_Init(void);
PyAPI_FUNC(void) _PyImport_Init(void);
PyAPI_FUNC(int) _PyFrame_Init(void);
PyAPI_FUNC(void) _PyFloat_Init(void);
PyAPI_FUNC(int) PyByteArray_Init(void);
+#endif
/* Various internal finalizers */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyExc_Fini(void);
PyAPI_FUNC(void) _PyImport_Fini(void);
PyAPI_FUNC(void) PyMethod_Fini(void);
PyAPI_FUNC(void) PyFloat_Fini(void);
PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
PyAPI_FUNC(void) _PyGC_Fini(void);
+#endif
/* Stuff with no proper home (yet) */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);
+#endif
PyAPI_DATA(int) (*PyOS_InputHook)(void);
PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
+#ifndef Py_LIMITED_API
PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
+#endif
/* Stack size, in "pointers" (so we get extra safety margins
on 64-bit platforms). On a 32-bit platform, this translates
+#ifndef Py_LIMITED_API
#ifndef Py_PYTIME_H
#define Py_PYTIME_H
#endif
#endif /* Py_PYTIME_H */
+#endif /* Py_LIMITED_API */
hold a search finger. The hash field of Unused or Dummy slots has
no meaning otherwise.
*/
-
+#ifndef Py_LIMITED_API
#define PySet_MINSIZE 8
typedef struct {
Py_hash_t hash; /* only used by frozenset objects */
PyObject *weakreflist; /* List of weak references */
};
+#endif /* Py_LIMITED_API */
PyAPI_DATA(PyTypeObject) PySet_Type;
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
+#ifndef Py_LIMITED_API
#define PySet_GET_SIZE(so) (((PySetObject *)(so))->used)
+#endif
PyAPI_FUNC(int) PySet_Clear(PyObject *set);
PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
+#endif
PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
+#endif
#ifdef __cplusplus
}
names are from range). After much talk with Guido, it was decided to
let these be any arbitrary python type. Py_None stands for omitted values.
*/
-
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
PyObject *start, *stop, *step; /* not NULL */
} PySliceObject;
+#endif
PyAPI_DATA(PyTypeObject) PySlice_Type;
PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* step);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
-PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
+#endif
+PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
-PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
+PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t *step, Py_ssize_t *slicelength);
extern char* PyStructSequence_UnnamedField;
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc);
+#endif
+PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
+#ifndef Py_LIMITED_API
typedef PyTupleObject PyStructSequence;
/* Macro, *only* to be used to fill in brand new objects */
#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
#define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
+#endif
+PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
+PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
#ifdef __cplusplus
}
+#ifndef Py_LIMITED_API
#ifndef Py_SYMTABLE_H
#define Py_SYMTABLE_H
}
#endif
#endif /* !Py_SYMTABLE_H */
+#endif /* Py_LIMITED_API */
PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
+#ifndef Py_LIMITED_API
PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
+#endif
PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);
* to fit in a time_t. ValueError is set on return iff the return
* value is (time_t)-1 and PyErr_Occurred().
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x);
+#endif
#ifdef __cplusplus
/* Token types */
-
+#ifndef Py_LIMITED_API
#ifndef Py_TOKEN_H
#define Py_TOKEN_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_TOKEN_H */
+#endif /* Py_LIMITED_API */
struct _frame;
/* Traceback interface */
-
+#ifndef Py_LIMITED_API
typedef struct _traceback {
PyObject_HEAD
struct _traceback *tb_next;
int tb_lasti;
int tb_lineno;
} PyTracebackObject;
+#endif
PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *);
PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int);
+#endif
/* Reveal traceback type so we can typecheck traceback objects */
PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
returned item's reference count.
*/
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_VAR_HEAD
PyObject *ob_item[1];
* the tuple is not yet visible outside the function that builds it.
*/
} PyTupleObject;
+#endif
PyAPI_DATA(PyTypeObject) PyTuple_Type;
PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t);
PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t);
+#endif
PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
+#endif
/* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
#define PyTuple_GET_SIZE(op) Py_SIZE(op)
/* Macro, *only* to be used to fill in brand new tuples */
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
+#endif
PyAPI_FUNC(int) PyTuple_ClearFreeList(void);
--- /dev/null
+#define Py_bf_getbuffer 1
+#define Py_bf_releasebuffer 2
+#define Py_mp_ass_subscript 3
+#define Py_mp_length 4
+#define Py_mp_subscript 5
+#define Py_nb_absolute 6
+#define Py_nb_add 7
+#define Py_nb_and 8
+#define Py_nb_bool 9
+#define Py_nb_divmod 10
+#define Py_nb_float 11
+#define Py_nb_floor_divide 12
+#define Py_nb_index 13
+#define Py_nb_inplace_add 14
+#define Py_nb_inplace_and 15
+#define Py_nb_inplace_floor_divide 16
+#define Py_nb_inplace_lshift 17
+#define Py_nb_inplace_multiply 18
+#define Py_nb_inplace_or 19
+#define Py_nb_inplace_power 20
+#define Py_nb_inplace_remainder 21
+#define Py_nb_inplace_rshift 22
+#define Py_nb_inplace_subtract 23
+#define Py_nb_inplace_true_divide 24
+#define Py_nb_inplace_xor 25
+#define Py_nb_int 26
+#define Py_nb_invert 27
+#define Py_nb_lshift 28
+#define Py_nb_multiply 29
+#define Py_nb_negative 30
+#define Py_nb_or 31
+#define Py_nb_positive 32
+#define Py_nb_power 33
+#define Py_nb_remainder 34
+#define Py_nb_rshift 35
+#define Py_nb_subtract 36
+#define Py_nb_true_divide 37
+#define Py_nb_xor 38
+#define Py_sq_ass_item 39
+#define Py_sq_concat 40
+#define Py_sq_contains 41
+#define Py_sq_inplace_concat 42
+#define Py_sq_inplace_repeat 43
+#define Py_sq_item 44
+#define Py_sq_length 45
+#define Py_sq_repeat 46
+#define Py_tp_alloc 47
+#define Py_tp_base 48
+#define Py_tp_bases 49
+#define Py_tp_call 50
+#define Py_tp_clear 51
+#define Py_tp_dealloc 52
+#define Py_tp_del 53
+#define Py_tp_descr_get 54
+#define Py_tp_descr_set 55
+#define Py_tp_doc 56
+#define Py_tp_getattr 57
+#define Py_tp_getattro 58
+#define Py_tp_hash 59
+#define Py_tp_init 60
+#define Py_tp_is_gc 61
+#define Py_tp_iter 62
+#define Py_tp_iternext 63
+#define Py_tp_methods 64
+#define Py_tp_new 65
+#define Py_tp_repr 66
+#define Py_tp_richcompare 67
+#define Py_tp_setattr 68
+#define Py_tp_setattro 69
+#define Py_tp_str 70
+#define Py_tp_traverse 71
/* Unicode name database interface */
-
+#ifndef Py_LIMITED_API
#ifndef Py_UCNHASH_H
#define Py_UCNHASH_H
#ifdef __cplusplus
}
#endif
#endif /* !Py_UCNHASH_H */
+#endif /* !Py_LIMITED_API */
Python and represents a single Unicode element in the Unicode
type. */
+#ifndef Py_LIMITED_API
typedef PY_UNICODE_TYPE Py_UNICODE;
+#endif
/* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */
_Py_ascii_whitespace (see below) with an inlined check.
*/
+#ifndef Py_LIMITED_API
#define Py_UNICODE_ISSPACE(ch) \
((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
((*((string)->str + (offset)) == *((substring)->str)) && \
((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \
!memcmp((string)->str + (offset), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
extern "C" {
/* --- Unicode Type ------------------------------------------------------- */
+#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
Py_ssize_t length; /* Length of raw Unicode data in buffer */
string, or NULL; this is used for
implementing the buffer protocol */
} PyUnicodeObject;
+#endif
PyAPI_DATA(PyTypeObject) PyUnicode_Type;
PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
#define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type)
/* Fast access macros */
+#ifndef Py_LIMITED_API
#define PyUnicode_GET_SIZE(op) \
(assert(PyUnicode_Check(op)),(((PyUnicodeObject *)(op))->length))
#define PyUnicode_GET_DATA_SIZE(op) \
(assert(PyUnicode_Check(op)),(((PyUnicodeObject *)(op))->str))
#define PyUnicode_AS_DATA(op) \
(assert(PyUnicode_Check(op)),((const char *)((PyUnicodeObject *)(op))->str))
+#endif
/* --- Constants ---------------------------------------------------------- */
The buffer is copied into the new object. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
const Py_UNICODE *u, /* Unicode buffer */
Py_ssize_t size /* size of buffer */
);
+#endif
/* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize(
/* Return a read-only pointer to the Unicode object's internal
Py_UNICODE buffer. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
PyObject *unicode /* Unicode object */
);
+#endif
/* Get the length of the Unicode object. */
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
/* Get the maximum ordinal for a Unicode character. */
PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
+#endif
/* Resize an already allocated Unicode object to the new size length.
...
);
+#ifndef Py_LIMITED_API
/* Format the object based on the format_spec, as defined in PEP 3101
(Advanced String Formatting). */
PyAPI_FUNC(PyObject *) _PyUnicode_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
+#endif
PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **);
PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(const char *);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void);
+#endif
/* Use only if you know it's a string */
#define PyUnicode_CHECK_INTERNED(op) (((PyUnicodeObject *)(op))->state)
error. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
- PyUnicodeObject *unicode, /* Unicode object */
+ PyObject *unicode, /* Unicode object */
register wchar_t *w, /* wchar_t buffer */
Py_ssize_t size /* size of buffer */
);
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
PyObject *unicode,
const char *errors);
+#endif
/* Returns a pointer to the default encoding (UTF-8) of the
Unicode object unicode and the size of the encoded representation
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
PyObject *unicode,
Py_ssize_t *size);
+#endif
/* Returns a pointer to the default encoding (UTF-8) of the
Unicode object unicode.
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(char *) _PyUnicode_AsString(PyObject *unicode);
+#endif
/* Returns "utf-8". */
/* Encodes a Py_UNICODE buffer of the given size and returns a
Python string object. */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_Encode(
const Py_UNICODE *s, /* Unicode char buffer */
Py_ssize_t size, /* number of Py_UNICODE chars to encode */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
+#endif
/* Encodes a Unicode object and returns the result as Python
object. */
Py_ssize_t *consumed /* bytes consumed */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */
const char *errors /* error handling */
);
+#endif
/* --- UTF-8 Codecs ------------------------------------------------------- */
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
/* --- UTF-32 Codecs ------------------------------------------------------ */
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
);
+#endif
/* --- UTF-16 Codecs ------------------------------------------------------ */
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
);
+#endif
/* --- Unicode-Escape Codecs ---------------------------------------------- */
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length /* Number of Py_UNICODE chars to encode */
);
+#endif
/* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length /* Number of Py_UNICODE chars to encode */
);
+#endif
/* --- Unicode Internal Codec ---------------------------------------------
Only for internal use in _codecsmodule.c */
+#ifndef Py_LIMITED_API
PyObject *_PyUnicode_DecodeUnicodeInternal(
const char *string,
Py_ssize_t length,
const char *errors
);
+#endif
/* --- Latin-1 Codecs -----------------------------------------------------
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
/* --- ASCII Codecs -------------------------------------------------------
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
/* --- Character Map Codecs -----------------------------------------------
(unicode ordinal -> char ordinal) */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
(unicode ordinal -> char ordinal) */
const char *errors /* error handling */
);
+#endif
/* Translate a Py_UNICODE buffer of the given length by applying a
character mapping table to it and return the resulting Unicode
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
PyObject *table, /* Translate table */
const char *errors /* error handling */
);
+#endif
#ifdef MS_WIN32
PyObject *unicode /* Unicode object */
);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
);
+#endif
#endif /* MS_WIN32 */
*/
+#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
Py_UNICODE *s, /* Unicode buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
char *output, /* Output buffer; must have size >= length */
const char *errors /* error handling */
);
+#endif
/* --- File system encoding ---------------------------------------------- */
PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
+#ifndef Py_LIMITED_API
/* Externally visible for str.strip(unicode) */
PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
PyUnicodeObject *self,
int striptype,
PyObject *sepobj
);
+#endif
/* Using the current locale, insert the thousands grouping
into the string pointed to by buffer. For the argument descriptions,
see Objects/stringlib/localeutil.h */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGroupingLocale(Py_UNICODE *buffer,
Py_ssize_t n_buffer,
Py_UNICODE *digits,
Py_ssize_t n_digits,
Py_ssize_t min_width);
+#endif
/* Using explicit passed-in values, insert the thousands grouping
into the string pointed to by buffer. For the argument descriptions,
see Objects/stringlib/localeutil.h */
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(Py_UNICODE *buffer,
Py_ssize_t n_buffer,
Py_UNICODE *digits,
Py_ssize_t min_width,
const char *grouping,
const char *thousands_sep);
+#endif
/* === Characters Type APIs =============================================== */
/* Helper array used by Py_UNICODE_ISSPACE(). */
+#ifndef Py_LIMITED_API
PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
/* These should not be used directly. Use the Py_UNICODE_IS* and
PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
PyObject *unicode
);
+#endif /* Py_LIMITED_API */
#ifdef __cplusplus
}
extern "C" {
#endif
+#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
+#endif
PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t);
PyAPI_FUNC(int) PyErr_WarnFormat(PyObject *, Py_ssize_t, const char *, ...);
const char *, PyObject *);
/* DEPRECATED: Use PyErr_WarnEx() instead. */
+#ifndef Py_LIMITED_API
#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
+#endif
#ifdef __cplusplus
}
/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
* and CallableProxyType.
*/
+#ifndef Py_LIMITED_API
struct _PyWeakReference {
PyObject_HEAD
PyWeakReference *wr_prev;
PyWeakReference *wr_next;
};
+#endif
PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
PyObject *callback);
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
+#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
+#endif
#define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object)
$(BYTESTR_DEPS) \
$(srcdir)/Objects/stringlib/formatter.h
+Objects/typeobject.o: $(srcdir)/Objects/typeslots.inc
+$(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py
+ $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc
############################################################################
# Header files
Core and Builtins
-----------------
+- PEP 384 (Defining a Stable ABI) is implemented.
+
- Issue #2690: Range objects support negative indices and slicing
- Issue #9915: Speed up sorting with a key.
result = -1;
goto done;
}
- result = PyUnicode_AsWideChar((PyUnicodeObject *)value,
+ result = PyUnicode_AsWideChar(value,
(wchar_t *)self->b_ptr,
self->b_size/sizeof(wchar_t));
if (result >= 0 && (size_t)result < self->b_size/sizeof(wchar_t))
PyObject *np;
Py_ssize_t start, stop, step, slicelen, cur, i;
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->b_length, &start, &stop,
&step, &slicelen) < 0) {
return NULL;
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelen, otherlen, i, cur;
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->b_length, &start, &stop,
&step, &slicelen) < 0) {
return -1;
} else
Py_INCREF(value);
- len = PyUnicode_AsWideChar((PyUnicodeObject *)value, chars, 2);
+ len = PyUnicode_AsWideChar(value, chars, 2);
if (len != 1) {
Py_DECREF(value);
PyErr_SetString(PyExc_TypeError,
} else if (size < length-1)
/* copy terminating NUL character if there is space */
size += 1;
- PyUnicode_AsWideChar((PyUnicodeObject *)value, (wchar_t *)ptr, size);
+ PyUnicode_AsWideChar(value, (wchar_t *)ptr, size);
return value;
}
if (!self->extra)
return PyList_New(0);
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->extra->length,
&start, &stop, &step, &slicelen) < 0) {
return NULL;
if (!self->extra)
element_new_extra(self, NULL);
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->extra->length,
&start, &stop, &step, &slicelen) < 0) {
return -1;
if (buffer == NULL)
return PyErr_NoMemory();
- size = PyUnicode_AsWideChar((PyUnicodeObject*)unicode, buffer, buflen);
+ size = PyUnicode_AsWideChar(unicode, buffer, buflen);
if (size == -1) {
PyMem_Free(buffer);
return NULL;
arrayobject* ar;
int itemsize = self->ob_descr->itemsize;
- if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
+ if (PySlice_GetIndicesEx(item, Py_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
return (*self->ob_descr->setitem)(self, i, value);
}
else if (PySlice_Check(item)) {
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
Py_SIZE(self), &start, &stop,
&step, &slicelength) < 0) {
return -1;
decoded = PyUnicode_DecodeUTF8(buf, n, "surrogateescape");
if (decoded != NULL) {
Py_ssize_t k;
- k = PyUnicode_AsWideChar((PyUnicodeObject*)decoded,
+ k = PyUnicode_AsWideChar(decoded,
rel_builddir_path, MAXPATHLEN);
Py_DECREF(decoded);
if (k >= 0) {
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelen;
- if (PySlice_GetIndicesEx((PySliceObject *)item, self->size,
+ if (PySlice_GetIndicesEx(item, self->size,
&start, &stop, &step, &slicelen) < 0) {
return NULL;
}
Py_ssize_t start, stop, step, slicelen;
Py_buffer vbuf;
- if (PySlice_GetIndicesEx((PySliceObject *)item,
+ if (PySlice_GetIndicesEx(item,
self->size, &start, &stop,
&step, &slicelen) < 0) {
return -1;
--- /dev/null
+
+/* Use this file as a template to start implementing a module that
+ also declares object types. All occurrences of 'Xxo' should be changed
+ to something reasonable for your objects. After that, all other
+ occurrences of 'xx' should be changed to something reasonable for your
+ module. If your module is named foo your sourcefile should be named
+ foomodule.c.
+
+ You will probably want to delete all references to 'x_attr' and add
+ your own types of attributes instead. Maybe you want to name your
+ local variables other than 'self'. If your object type is needed in
+ other files, you'll have to create a file "foobarobject.h"; see
+ floatobject.h for an example. */
+
+/* Xxo objects */
+
+#include "Python.h"
+
+static PyObject *ErrorObject;
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *x_attr; /* Attributes dictionary */
+} XxoObject;
+
+static PyObject *Xxo_Type;
+
+#define XxoObject_Check(v) (Py_TYPE(v) == Xxo_Type)
+
+static XxoObject *
+newXxoObject(PyObject *arg)
+{
+ XxoObject *self;
+ self = PyObject_New(XxoObject, (PyTypeObject*)Xxo_Type);
+ if (self == NULL)
+ return NULL;
+ self->x_attr = NULL;
+ return self;
+}
+
+/* Xxo methods */
+
+static void
+Xxo_dealloc(XxoObject *self)
+{
+ Py_XDECREF(self->x_attr);
+ PyObject_Del(self);
+}
+
+static PyObject *
+Xxo_demo(XxoObject *self, PyObject *args)
+{
+ if (!PyArg_ParseTuple(args, ":demo"))
+ return NULL;
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyMethodDef Xxo_methods[] = {
+ {"demo", (PyCFunction)Xxo_demo, METH_VARARGS,
+ PyDoc_STR("demo() -> None")},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+Xxo_getattro(XxoObject *self, PyObject *name)
+{
+ if (self->x_attr != NULL) {
+ PyObject *v = PyDict_GetItem(self->x_attr, name);
+ if (v != NULL) {
+ Py_INCREF(v);
+ return v;
+ }
+ }
+ return PyObject_GenericGetAttr((PyObject *)self, name);
+}
+
+static int
+Xxo_setattr(XxoObject *self, char *name, PyObject *v)
+{
+ if (self->x_attr == NULL) {
+ self->x_attr = PyDict_New();
+ if (self->x_attr == NULL)
+ return -1;
+ }
+ if (v == NULL) {
+ int rv = PyDict_DelItemString(self->x_attr, name);
+ if (rv < 0)
+ PyErr_SetString(PyExc_AttributeError,
+ "delete non-existing Xxo attribute");
+ return rv;
+ }
+ else
+ return PyDict_SetItemString(self->x_attr, name, v);
+}
+
+static PyType_Slot Xxo_Type_slots[] = {
+ {Py_tp_dealloc, Xxo_dealloc},
+ {Py_tp_getattro, Xxo_getattro},
+ {Py_tp_setattr, Xxo_setattr},
+ {Py_tp_methods, Xxo_methods},
+ {0, 0},
+};
+
+static PyType_Spec Xxo_Type_spec = {
+ "xxmodule.Xxo",
+ NULL,
+ sizeof(XxoObject),
+ 0,
+ Py_TPFLAGS_DEFAULT,
+ Xxo_Type_slots
+};
+
+/* --------------------------------------------------------------------- */
+
+/* Function of two integers returning integer */
+
+PyDoc_STRVAR(xx_foo_doc,
+"foo(i,j)\n\
+\n\
+Return the sum of i and j.");
+
+static PyObject *
+xx_foo(PyObject *self, PyObject *args)
+{
+ long i, j;
+ long res;
+ if (!PyArg_ParseTuple(args, "ll:foo", &i, &j))
+ return NULL;
+ res = i+j; /* XXX Do something here */
+ return PyLong_FromLong(res);
+}
+
+
+/* Function of no arguments returning new Xxo object */
+
+static PyObject *
+xx_new(PyObject *self, PyObject *args)
+{
+ XxoObject *rv;
+
+ if (!PyArg_ParseTuple(args, ":new"))
+ return NULL;
+ rv = newXxoObject(args);
+ if (rv == NULL)
+ return NULL;
+ return (PyObject *)rv;
+}
+
+/* Test bad format character */
+
+static PyObject *
+xx_roj(PyObject *self, PyObject *args)
+{
+ PyObject *a;
+ long b;
+ if (!PyArg_ParseTuple(args, "O#:roj", &a, &b))
+ return NULL;
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+/* ---------- */
+
+static PyType_Slot Str_Type_slots[] = {
+ {Py_tp_base, NULL}, /* filled out in module init function */
+ {0, 0},
+};
+
+static PyType_Spec Str_Type_spec = {
+ "xxlimited.Str",
+ 0,
+ 0,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ Str_Type_slots
+};
+
+/* ---------- */
+
+static PyObject *
+null_richcompare(PyObject *self, PyObject *other, int op)
+{
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+}
+
+static PyType_Slot Null_Type_slots[] = {
+ {Py_tp_base, NULL}, /* filled out in module init */
+ {Py_tp_new, NULL},
+ {Py_tp_richcompare, null_richcompare},
+ {0, 0}
+};
+
+static PyType_Spec Null_Type_spec = {
+ "xxlimited.Null",
+ NULL, /* doc */
+ 0, /* basicsize */
+ 0, /* itemsize */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ Null_Type_slots
+};
+
+/* ---------- */
+
+/* List of functions defined in the module */
+
+static PyMethodDef xx_methods[] = {
+ {"roj", xx_roj, METH_VARARGS,
+ PyDoc_STR("roj(a,b) -> None")},
+ {"foo", xx_foo, METH_VARARGS,
+ xx_foo_doc},
+ {"new", xx_new, METH_VARARGS,
+ PyDoc_STR("new() -> new Xx object")},
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(module_doc,
+"This is a template module just for instruction.");
+
+/* Initialization function for the module (*must* be called PyInit_xx) */
+
+
+static struct PyModuleDef xxmodule = {
+ PyModuleDef_HEAD_INIT,
+ "xx",
+ module_doc,
+ -1,
+ xx_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit_xxlimited(void)
+{
+ PyObject *m = NULL;
+ PyObject *o;
+
+ /* Due to cross platform compiler issues the slots must be filled
+ * here. It's required for portability to Windows without requiring
+ * C++. */
+ Null_Type_slots[0].pfunc = &PyBaseObject_Type;
+ Null_Type_slots[1].pfunc = PyType_GenericNew;
+ Str_Type_slots[0].pfunc = &PyUnicode_Type;
+
+ Xxo_Type = PyType_FromSpec(&Xxo_Type_spec);
+ if (Xxo_Type == NULL)
+ goto fail;
+
+ /* Create the module and add the functions */
+ m = PyModule_Create(&xxmodule);
+ if (m == NULL)
+ goto fail;
+
+ /* Add some symbolic constants to the module */
+ if (ErrorObject == NULL) {
+ ErrorObject = PyErr_NewException("xx.error", NULL, NULL);
+ if (ErrorObject == NULL)
+ goto fail;
+ }
+ Py_INCREF(ErrorObject);
+ PyModule_AddObject(m, "error", ErrorObject);
+
+ /* Add Str */
+ o = PyType_FromSpec(&Str_Type_spec);
+ if (o == NULL)
+ goto fail;
+ PyModule_AddObject(m, "Str", o);
+
+ /* Add Null */
+ o = PyType_FromSpec(&Null_Type_spec);
+ if (o == NULL)
+ goto fail;
+ PyModule_AddObject(m, "Null", o);
+ return m;
+ fail:
+ Py_XDECREF(m);
+ return NULL;
+}
}
else if (PySlice_Check(index)) {
Py_ssize_t start, stop, step, slicelength, cur, i;
- if (PySlice_GetIndicesEx((PySliceObject *)index,
+ if (PySlice_GetIndicesEx(index,
PyByteArray_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
}
else if (PySlice_Check(index)) {
- if (PySlice_GetIndicesEx((PySliceObject *)index,
+ if (PySlice_GetIndicesEx(index,
PyByteArray_GET_SIZE(self),
&start, &stop, &step, &slicelen) < 0) {
return -1;
char* result_buf;
PyObject* result;
- if (PySlice_GetIndicesEx((PySliceObject*)item,
+ if (PySlice_GetIndicesEx(item,
PyBytes_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
result = PyEval_EvalCodeEx(
- (PyCodeObject *)PyFunction_GET_CODE(func),
+ PyFunction_GET_CODE(func),
PyFunction_GET_GLOBALS(func), (PyObject *)NULL,
&PyTuple_GET_ITEM(arg, 0), PyTuple_GET_SIZE(arg),
k, nk, d, nd,
PyObject* it;
PyObject **src, **dest;
- if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
+ if (PySlice_GetIndicesEx(item, Py_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
else if (PySlice_Check(item)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)item, Py_SIZE(self),
+ if (PySlice_GetIndicesEx(item, Py_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return -1;
}
else if (PySlice_Check(key)) {
Py_ssize_t start, stop, step, slicelength;
- if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view),
+ if (PySlice_GetIndicesEx(key, get_shape0(view),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
else if (PySlice_Check(key)) {
Py_ssize_t stop, step;
- if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view),
+ if (PySlice_GetIndicesEx(key, get_shape0(view),
&start, &stop, &step, &len) < 0) {
return -1;
}
module->m_base.m_index = max_module_number;
}
name = module->m_name;
- if (module_api_version != PYTHON_API_VERSION) {
+ if (module_api_version != PYTHON_API_VERSION && module_api_version != PYTHON_ABI_VERSION) {
int err;
err = PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"Python C API version mismatch for module %.100s: "
#endif
-
/* Hack to force loading of pycapsule.o */
PyTypeObject *_PyCapsule_hack = &PyCapsule_Type;
}
}
+#ifndef Py_TRACE_REFS
+/* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc.
+ Define this here, so we can undefine the macro. */
+#undef _Py_Dealloc
+PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
+void
+_Py_Dealloc(PyObject *op)
+{
+ _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA
+ (*Py_TYPE(op)->tp_dealloc)(op);
+}
+#endif
+
#ifdef __cplusplus
}
#endif
return range_item(self, i);
}
if (PySlice_Check(item)) {
- PySliceObject *slice = (PySliceObject*)item;
Py_ssize_t start, stop, step, len, rlen;
rangeobject *result;
PyObject *substart = NULL, *substep = NULL, *substop = NULL;
return NULL;
}
- if (PySlice_GetIndicesEx(slice, rlen,
+ if (PySlice_GetIndicesEx(item, rlen,
&start, &stop, &step, &len) < 0) {
return NULL;
}
Py_INCREF(substep);
} else {
/* NB: slice step != Py_None here */
- substep = PyNumber_Multiply(self->step, slice->step);
+ substep = PyNumber_Multiply(self->step, ((PySliceObject*)item)->step);
if (substep == NULL)
goto fail;
}
}
int
-PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
+PySlice_GetIndices(PyObject *_r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
{
+ PySliceObject *r = (PySliceObject*)_r;
/* XXX support long ints */
if (r->step == Py_None) {
*step = 1;
}
int
-PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
+PySlice_GetIndicesEx(PyObject *_r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
Py_ssize_t *slicelength)
{
+ PySliceObject *r = (PySliceObject*)_r;
/* this is harder to get right than you might think */
Py_ssize_t defstart, defstop;
return NULL;
}
- if (PySlice_GetIndicesEx(self, ilen, &start, &stop,
+ if (PySlice_GetIndicesEx((PyObject*)self, ilen, &start, &stop,
&step, &slicelength) < 0) {
return NULL;
}
return (PyObject*)obj;
}
+void
+PyStructSequence_SetItem(PyObject* op, Py_ssize_t i, PyObject* v)
+{
+ PyStructSequence_SET_ITEM(op, i, v);
+}
+
+PyObject*
+PyStructSequence_GetItem(PyObject* op, Py_ssize_t i)
+{
+ return PyStructSequence_GET_ITEM(op, i);
+}
+
static void
structseq_dealloc(PyStructSequence *obj)
{
SET_DICT_FROM_INT(real_length_key, n_members);
SET_DICT_FROM_INT(unnamed_fields_key, n_unnamed_members);
}
+
+PyTypeObject*
+PyStructSequence_NewType(PyStructSequence_Desc *desc)
+{
+ PyTypeObject *result = (PyTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
+ PyStructSequence_InitType(result, desc);
+ return result;
+}
PyObject* it;
PyObject **src, **dest;
- if (PySlice_GetIndicesEx((PySliceObject*)item,
+ if (PySlice_GetIndicesEx(item,
PyTuple_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
return (PyObject *)type;
}
+static short slotoffsets[] = {
+ -1, /* invalid slot */
+#include "typeslots.inc"
+};
+
+PyObject* PyType_FromSpec(PyType_Spec *spec)
+{
+ PyHeapTypeObject *res = (PyHeapTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
+ char *res_start = (char*)res;
+ PyType_Slot *slot;
+
+ res->ht_name = PyUnicode_FromString(spec->name);
+ if (!res->ht_name)
+ goto fail;
+ res->ht_type.tp_name = _PyUnicode_AsString(res->ht_name);
+ if (!res->ht_type.tp_name)
+ goto fail;
+
+ res->ht_type.tp_basicsize = spec->basicsize;
+ res->ht_type.tp_itemsize = spec->itemsize;
+ res->ht_type.tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE;
+
+ for (slot = spec->slots; slot->slot; slot++) {
+ if (slot->slot >= sizeof(slotoffsets)/sizeof(slotoffsets[0])) {
+ PyErr_SetString(PyExc_RuntimeError, "invalid slot offset");
+ goto fail;
+ }
+ *(void**)(res_start + slotoffsets[slot->slot]) = slot->pfunc;
+ }
+
+ return (PyObject*)res;
+
+ fail:
+ Py_DECREF(res);
+ return NULL;
+}
+
+
/* Internal API to look for a name through the MRO.
This returns a borrowed reference, and doesn't set an exception! */
PyObject *
--- /dev/null
+offsetof(PyHeapTypeObject, as_buffer.bf_getbuffer),
+offsetof(PyHeapTypeObject, as_buffer.bf_releasebuffer),
+offsetof(PyHeapTypeObject, as_mapping.mp_ass_subscript),
+offsetof(PyHeapTypeObject, as_mapping.mp_length),
+offsetof(PyHeapTypeObject, as_mapping.mp_subscript),
+offsetof(PyHeapTypeObject, as_number.nb_absolute),
+offsetof(PyHeapTypeObject, as_number.nb_add),
+offsetof(PyHeapTypeObject, as_number.nb_and),
+offsetof(PyHeapTypeObject, as_number.nb_bool),
+offsetof(PyHeapTypeObject, as_number.nb_divmod),
+offsetof(PyHeapTypeObject, as_number.nb_float),
+offsetof(PyHeapTypeObject, as_number.nb_floor_divide),
+offsetof(PyHeapTypeObject, as_number.nb_index),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_add),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_and),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_floor_divide),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_lshift),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_multiply),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_or),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_power),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_remainder),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_rshift),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_subtract),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_true_divide),
+offsetof(PyHeapTypeObject, as_number.nb_inplace_xor),
+offsetof(PyHeapTypeObject, as_number.nb_int),
+offsetof(PyHeapTypeObject, as_number.nb_invert),
+offsetof(PyHeapTypeObject, as_number.nb_lshift),
+offsetof(PyHeapTypeObject, as_number.nb_multiply),
+offsetof(PyHeapTypeObject, as_number.nb_negative),
+offsetof(PyHeapTypeObject, as_number.nb_or),
+offsetof(PyHeapTypeObject, as_number.nb_positive),
+offsetof(PyHeapTypeObject, as_number.nb_power),
+offsetof(PyHeapTypeObject, as_number.nb_remainder),
+offsetof(PyHeapTypeObject, as_number.nb_rshift),
+offsetof(PyHeapTypeObject, as_number.nb_subtract),
+offsetof(PyHeapTypeObject, as_number.nb_true_divide),
+offsetof(PyHeapTypeObject, as_number.nb_xor),
+offsetof(PyHeapTypeObject, as_sequence.sq_ass_item),
+offsetof(PyHeapTypeObject, as_sequence.sq_concat),
+offsetof(PyHeapTypeObject, as_sequence.sq_contains),
+offsetof(PyHeapTypeObject, as_sequence.sq_inplace_concat),
+offsetof(PyHeapTypeObject, as_sequence.sq_inplace_repeat),
+offsetof(PyHeapTypeObject, as_sequence.sq_item),
+offsetof(PyHeapTypeObject, as_sequence.sq_length),
+offsetof(PyHeapTypeObject, as_sequence.sq_repeat),
+offsetof(PyHeapTypeObject, ht_type.tp_alloc),
+offsetof(PyHeapTypeObject, ht_type.tp_base),
+offsetof(PyHeapTypeObject, ht_type.tp_bases),
+offsetof(PyHeapTypeObject, ht_type.tp_call),
+offsetof(PyHeapTypeObject, ht_type.tp_clear),
+offsetof(PyHeapTypeObject, ht_type.tp_dealloc),
+offsetof(PyHeapTypeObject, ht_type.tp_del),
+offsetof(PyHeapTypeObject, ht_type.tp_descr_get),
+offsetof(PyHeapTypeObject, ht_type.tp_descr_set),
+offsetof(PyHeapTypeObject, ht_type.tp_doc),
+offsetof(PyHeapTypeObject, ht_type.tp_getattr),
+offsetof(PyHeapTypeObject, ht_type.tp_getattro),
+offsetof(PyHeapTypeObject, ht_type.tp_hash),
+offsetof(PyHeapTypeObject, ht_type.tp_init),
+offsetof(PyHeapTypeObject, ht_type.tp_is_gc),
+offsetof(PyHeapTypeObject, ht_type.tp_iter),
+offsetof(PyHeapTypeObject, ht_type.tp_iternext),
+offsetof(PyHeapTypeObject, ht_type.tp_methods),
+offsetof(PyHeapTypeObject, ht_type.tp_new),
+offsetof(PyHeapTypeObject, ht_type.tp_repr),
+offsetof(PyHeapTypeObject, ht_type.tp_richcompare),
+offsetof(PyHeapTypeObject, ht_type.tp_setattr),
+offsetof(PyHeapTypeObject, ht_type.tp_setattro),
+offsetof(PyHeapTypeObject, ht_type.tp_str),
+offsetof(PyHeapTypeObject, ht_type.tp_traverse),
--- /dev/null
+#!/usr/bin/python
+# Usage: typeslots.py < Include/typeslots.h > typeslots.inc
+
+import sys, re
+
+res = {}
+for line in sys.stdin:
+ m = re.match("#define Py_([a-z_]+) ([0-9]+)", line)
+ member = m.group(1)
+ if member.startswith("tp_"):
+ member = "ht_type."+member
+ elif member.startswith("nb_"):
+ member = "as_number."+member
+ elif member.startswith("mp_"):
+ member = "as_mapping."+member
+ elif member.startswith("sq_"):
+ member = "as_sequence."+member
+ elif member.startswith("bf_"):
+ member = "as_buffer."+member
+ res[int(m.group(2))] = member
+
+M = max(res.keys())+1
+for i in range(1,M):
+ print "offsetof(PyHeapTypeObject, %s)," % res[i]
}
Py_ssize_t
-PyUnicode_AsWideChar(PyUnicodeObject *unicode,
+PyUnicode_AsWideChar(PyObject *unicode,
wchar_t *w,
Py_ssize_t size)
{
PyErr_BadInternalCall();
return -1;
}
- return unicode_aswidechar(unicode, w, size);
+ return unicode_aswidechar((PyUnicodeObject*)unicode, w, size);
}
wchar_t*
Py_UNICODE* result_buf;
PyObject* result;
- if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self),
+ if (PySlice_GetIndicesEx(item, PyUnicode_GET_SIZE(self),
&start, &stop, &step, &slicelength) < 0) {
return NULL;
}
calculate_path();
return progpath;
}
+
+/* Load python3.dll before loading any extension module that might refer
+ to it. That way, we can be sure that always the python3.dll corresponding
+ to this python DLL is loaded, not a python3.dll that might be on the path
+ by chance.
+ Return whether the DLL was found.
+*/
+static int python3_checked = 0;
+static HANDLE hPython3;
+int
+_Py_CheckPython3()
+{
+ wchar_t py3path[MAXPATHLEN+1];
+ wchar_t *s;
+ if (python3_checked)
+ return hPython3 != NULL;
+ python3_checked = 1;
+
+ /* If there is a python3.dll next to the python3y.dll,
+ assume this is a build tree; use that DLL */
+ wcscpy(py3path, dllpath);
+ s = wcsrchr(py3path, L'\\');
+ if (!s)
+ s = py3path;
+ wcscpy(s, L"\\python3.dll");
+ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (hPython3 != NULL)
+ return 1;
+
+ /* Check sys.prefix\DLLs\python3.dll */
+ wcscpy(py3path, Py_GetPrefix());
+ wcscat(py3path, L"\\DLLs\\python3.dll");
+ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ return hPython3 != NULL;
+}
/* So MSVC users need not specify the .lib file in
their Makefile (other compilers are generally
taken care of by distutils.) */
-# ifdef _DEBUG
+# if defined(_DEBUG)
# pragma comment(lib,"python32_d.lib")
+# elif defined(Py_LIMITED_API)
+# pragma comment(lib,"python3.lib")
# else
# pragma comment(lib,"python32.lib")
# endif /* _DEBUG */
--- /dev/null
+LIBRARY "python3"\r
+EXPORTS\r
+ PyArg_Parse=python32.PyArg_Parse\r
+ PyArg_ParseTuple=python32.PyArg_ParseTuple\r
+ PyArg_ParseTupleAndKeywords=python32.PyArg_ParseTupleAndKeywords\r
+ PyArg_UnpackTuple=python32.PyArg_UnpackTuple\r
+ PyArg_VaParse=python32.PyArg_VaParse\r
+ PyArg_VaParseTupleAndKeywords=python32.PyArg_VaParseTupleAndKeywords\r
+ PyArg_ValidateKeywordArguments=python32.PyArg_ValidateKeywordArguments\r
+ PyBaseObject_Type=python32.PyBaseObject_Type DATA\r
+ PyBool_FromLong=python32.PyBool_FromLong\r
+ PyBool_Type=python32.PyBool_Type DATA\r
+ PyBuffer_FillContiguousStrides=python32.PyBuffer_FillContiguousStrides\r
+ PyBuffer_FillInfo=python32.PyBuffer_FillInfo\r
+ PyBuffer_FromContiguous=python32.PyBuffer_FromContiguous\r
+ PyBuffer_GetPointer=python32.PyBuffer_GetPointer\r
+ PyBuffer_IsContiguous=python32.PyBuffer_IsContiguous\r
+ PyBuffer_Release=python32.PyBuffer_Release\r
+ PyBuffer_ToContiguous=python32.PyBuffer_ToContiguous\r
+ PyByteArrayIter_Type=python32.PyByteArrayIter_Type DATA\r
+ PyByteArray_AsString=python32.PyByteArray_AsString\r
+ PyByteArray_Concat=python32.PyByteArray_Concat\r
+ PyByteArray_FromObject=python32.PyByteArray_FromObject\r
+ PyByteArray_FromStringAndSize=python32.PyByteArray_FromStringAndSize\r
+ PyByteArray_Resize=python32.PyByteArray_Resize\r
+ PyByteArray_Size=python32.PyByteArray_Size\r
+ PyByteArray_Type=python32.PyByteArray_Type DATA\r
+ PyBytesIter_Type=python32.PyBytesIter_Type DATA\r
+ PyBytes_AsString=python32.PyBytes_AsString\r
+ PyBytes_AsStringAndSize=python32.PyBytes_AsStringAndSize\r
+ PyBytes_Concat=python32.PyBytes_Concat\r
+ PyBytes_ConcatAndDel=python32.PyBytes_ConcatAndDel\r
+ PyBytes_DecodeEscape=python32.PyBytes_DecodeEscape\r
+ PyBytes_FromFormat=python32.PyBytes_FromFormat\r
+ PyBytes_FromFormatV=python32.PyBytes_FromFormatV\r
+ PyBytes_FromObject=python32.PyBytes_FromObject\r
+ PyBytes_FromString=python32.PyBytes_FromString\r
+ PyBytes_FromStringAndSize=python32.PyBytes_FromStringAndSize\r
+ PyBytes_Repr=python32.PyBytes_Repr\r
+ PyBytes_Size=python32.PyBytes_Size\r
+ PyBytes_Type=python32.PyBytes_Type DATA\r
+ PyCFunction_Call=python32.PyCFunction_Call\r
+ PyCFunction_ClearFreeList=python32.PyCFunction_ClearFreeList\r
+ PyCFunction_GetFlags=python32.PyCFunction_GetFlags\r
+ PyCFunction_GetFunction=python32.PyCFunction_GetFunction\r
+ PyCFunction_GetSelf=python32.PyCFunction_GetSelf\r
+ PyCFunction_NewEx=python32.PyCFunction_NewEx\r
+ PyCFunction_Type=python32.PyCFunction_Type DATA\r
+ PyCallIter_New=python32.PyCallIter_New\r
+ PyCallIter_Type=python32.PyCallIter_Type DATA\r
+ PyCallable_Check=python32.PyCallable_Check\r
+ PyCapsule_GetContext=python32.PyCapsule_GetContext\r
+ PyCapsule_GetDestructor=python32.PyCapsule_GetDestructor\r
+ PyCapsule_GetName=python32.PyCapsule_GetName\r
+ PyCapsule_GetPointer=python32.PyCapsule_GetPointer\r
+ PyCapsule_Import=python32.PyCapsule_Import\r
+ PyCapsule_IsValid=python32.PyCapsule_IsValid\r
+ PyCapsule_New=python32.PyCapsule_New\r
+ PyCapsule_SetContext=python32.PyCapsule_SetContext\r
+ PyCapsule_SetDestructor=python32.PyCapsule_SetDestructor\r
+ PyCapsule_SetName=python32.PyCapsule_SetName\r
+ PyCapsule_SetPointer=python32.PyCapsule_SetPointer\r
+ PyCapsule_Type=python32.PyCapsule_Type DATA\r
+ PyClassMethodDescr_Type=python32.PyClassMethodDescr_Type DATA\r
+ PyCodec_BackslashReplaceErrors=python32.PyCodec_BackslashReplaceErrors\r
+ PyCodec_Decode=python32.PyCodec_Decode\r
+ PyCodec_Decoder=python32.PyCodec_Decoder\r
+ PyCodec_Encode=python32.PyCodec_Encode\r
+ PyCodec_Encoder=python32.PyCodec_Encoder\r
+ PyCodec_IgnoreErrors=python32.PyCodec_IgnoreErrors\r
+ PyCodec_IncrementalDecoder=python32.PyCodec_IncrementalDecoder\r
+ PyCodec_IncrementalEncoder=python32.PyCodec_IncrementalEncoder\r
+ PyCodec_KnownEncoding=python32.PyCodec_KnownEncoding\r
+ PyCodec_LookupError=python32.PyCodec_LookupError\r
+ PyCodec_Register=python32.PyCodec_Register\r
+ PyCodec_RegisterError=python32.PyCodec_RegisterError\r
+ PyCodec_ReplaceErrors=python32.PyCodec_ReplaceErrors\r
+ PyCodec_StreamReader=python32.PyCodec_StreamReader\r
+ PyCodec_StreamWriter=python32.PyCodec_StreamWriter\r
+ PyCodec_StrictErrors=python32.PyCodec_StrictErrors\r
+ PyCodec_XMLCharRefReplaceErrors=python32.PyCodec_XMLCharRefReplaceErrors\r
+ PyComplex_FromDoubles=python32.PyComplex_FromDoubles\r
+ PyComplex_ImagAsDouble=python32.PyComplex_ImagAsDouble\r
+ PyComplex_RealAsDouble=python32.PyComplex_RealAsDouble\r
+ PyComplex_Type=python32.PyComplex_Type DATA\r
+ PyDescr_NewClassMethod=python32.PyDescr_NewClassMethod\r
+ PyDescr_NewGetSet=python32.PyDescr_NewGetSet\r
+ PyDescr_NewMember=python32.PyDescr_NewMember\r
+ PyDescr_NewMethod=python32.PyDescr_NewMethod\r
+ PyDictItems_Type=python32.PyDictItems_Type DATA\r
+ PyDictIterItem_Type=python32.PyDictIterItem_Type DATA\r
+ PyDictIterKey_Type=python32.PyDictIterKey_Type DATA\r
+ PyDictIterValue_Type=python32.PyDictIterValue_Type DATA\r
+ PyDictKeys_Type=python32.PyDictKeys_Type DATA\r
+ PyDictProxy_New=python32.PyDictProxy_New\r
+ PyDictProxy_Type=python32.PyDictProxy_Type DATA\r
+ PyDictValues_Type=python32.PyDictValues_Type DATA\r
+ PyDict_Clear=python32.PyDict_Clear\r
+ PyDict_Contains=python32.PyDict_Contains\r
+ PyDict_Copy=python32.PyDict_Copy\r
+ PyDict_DelItem=python32.PyDict_DelItem\r
+ PyDict_DelItemString=python32.PyDict_DelItemString\r
+ PyDict_GetItem=python32.PyDict_GetItem\r
+ PyDict_GetItemString=python32.PyDict_GetItemString\r
+ PyDict_GetItemWithError=python32.PyDict_GetItemWithError\r
+ PyDict_Items=python32.PyDict_Items\r
+ PyDict_Keys=python32.PyDict_Keys\r
+ PyDict_Merge=python32.PyDict_Merge\r
+ PyDict_MergeFromSeq2=python32.PyDict_MergeFromSeq2\r
+ PyDict_New=python32.PyDict_New\r
+ PyDict_Next=python32.PyDict_Next\r
+ PyDict_SetItem=python32.PyDict_SetItem\r
+ PyDict_SetItemString=python32.PyDict_SetItemString\r
+ PyDict_Size=python32.PyDict_Size\r
+ PyDict_Type=python32.PyDict_Type DATA\r
+ PyDict_Update=python32.PyDict_Update\r
+ PyDict_Values=python32.PyDict_Values\r
+ PyEllipsis_Type=python32.PyEllipsis_Type DATA\r
+ PyEnum_Type=python32.PyEnum_Type DATA\r
+ PyErr_BadArgument=python32.PyErr_BadArgument\r
+ PyErr_BadInternalCall=python32.PyErr_BadInternalCall\r
+ PyErr_CheckSignals=python32.PyErr_CheckSignals\r
+ PyErr_Clear=python32.PyErr_Clear\r
+ PyErr_Display=python32.PyErr_Display\r
+ PyErr_ExceptionMatches=python32.PyErr_ExceptionMatches\r
+ PyErr_Fetch=python32.PyErr_Fetch\r
+ PyErr_Format=python32.PyErr_Format\r
+ PyErr_GivenExceptionMatches=python32.PyErr_GivenExceptionMatches\r
+ PyErr_NewException=python32.PyErr_NewException\r
+ PyErr_NewExceptionWithDoc=python32.PyErr_NewExceptionWithDoc\r
+ PyErr_NoMemory=python32.PyErr_NoMemory\r
+ PyErr_NormalizeException=python32.PyErr_NormalizeException\r
+ PyErr_Occurred=python32.PyErr_Occurred\r
+ PyErr_Print=python32.PyErr_Print\r
+ PyErr_PrintEx=python32.PyErr_PrintEx\r
+ PyErr_ProgramText=python32.PyErr_ProgramText\r
+ PyErr_Restore=python32.PyErr_Restore\r
+ PyErr_SetFromErrno=python32.PyErr_SetFromErrno\r
+ PyErr_SetFromErrnoWithFilename=python32.PyErr_SetFromErrnoWithFilename\r
+ PyErr_SetFromErrnoWithFilenameObject=python32.PyErr_SetFromErrnoWithFilenameObject\r
+ PyErr_SetInterrupt=python32.PyErr_SetInterrupt\r
+ PyErr_SetNone=python32.PyErr_SetNone\r
+ PyErr_SetObject=python32.PyErr_SetObject\r
+ PyErr_SetString=python32.PyErr_SetString\r
+ PyErr_SyntaxLocation=python32.PyErr_SyntaxLocation\r
+ PyErr_WarnEx=python32.PyErr_WarnEx\r
+ PyErr_WarnExplicit=python32.PyErr_WarnExplicit\r
+ PyErr_WarnFormat=python32.PyErr_WarnFormat\r
+ PyErr_WriteUnraisable=python32.PyErr_WriteUnraisable\r
+ PyEval_AcquireLock=python32.PyEval_AcquireLock\r
+ PyEval_AcquireThread=python32.PyEval_AcquireThread\r
+ PyEval_CallFunction=python32.PyEval_CallFunction\r
+ PyEval_CallMethod=python32.PyEval_CallMethod\r
+ PyEval_CallObjectWithKeywords=python32.PyEval_CallObjectWithKeywords\r
+ PyEval_EvalCode=python32.PyEval_EvalCode\r
+ PyEval_EvalCodeEx=python32.PyEval_EvalCodeEx\r
+ PyEval_EvalFrame=python32.PyEval_EvalFrame\r
+ PyEval_EvalFrameEx=python32.PyEval_EvalFrameEx\r
+ PyEval_GetBuiltins=python32.PyEval_GetBuiltins\r
+ PyEval_GetCallStats=python32.PyEval_GetCallStats\r
+ PyEval_GetFrame=python32.PyEval_GetFrame\r
+ PyEval_GetFuncDesc=python32.PyEval_GetFuncDesc\r
+ PyEval_GetFuncName=python32.PyEval_GetFuncName\r
+ PyEval_GetGlobals=python32.PyEval_GetGlobals\r
+ PyEval_GetLocals=python32.PyEval_GetLocals\r
+ PyEval_InitThreads=python32.PyEval_InitThreads\r
+ PyEval_ReInitThreads=python32.PyEval_ReInitThreads\r
+ PyEval_ReleaseLock=python32.PyEval_ReleaseLock\r
+ PyEval_ReleaseThread=python32.PyEval_ReleaseThread\r
+ PyEval_RestoreThread=python32.PyEval_RestoreThread\r
+ PyEval_SaveThread=python32.PyEval_SaveThread\r
+ PyEval_ThreadsInitialized=python32.PyEval_ThreadsInitialized\r
+ PyExc_ArithmeticError=python32.PyExc_ArithmeticError DATA\r
+ PyExc_AssertionError=python32.PyExc_AssertionError DATA\r
+ PyExc_AttributeError=python32.PyExc_AttributeError DATA\r
+ PyExc_BaseException=python32.PyExc_BaseException DATA\r
+ PyExc_BufferError=python32.PyExc_BufferError DATA\r
+ PyExc_BytesWarning=python32.PyExc_BytesWarning DATA\r
+ PyExc_DeprecationWarning=python32.PyExc_DeprecationWarning DATA\r
+ PyExc_EOFError=python32.PyExc_EOFError DATA\r
+ PyExc_EnvironmentError=python32.PyExc_EnvironmentError DATA\r
+ PyExc_Exception=python32.PyExc_Exception DATA\r
+ PyExc_FloatingPointError=python32.PyExc_FloatingPointError DATA\r
+ PyExc_FutureWarning=python32.PyExc_FutureWarning DATA\r
+ PyExc_GeneratorExit=python32.PyExc_GeneratorExit DATA\r
+ PyExc_IOError=python32.PyExc_IOError DATA\r
+ PyExc_ImportError=python32.PyExc_ImportError DATA\r
+ PyExc_ImportWarning=python32.PyExc_ImportWarning DATA\r
+ PyExc_IndentationError=python32.PyExc_IndentationError DATA\r
+ PyExc_IndexError=python32.PyExc_IndexError DATA\r
+ PyExc_KeyError=python32.PyExc_KeyError DATA\r
+ PyExc_KeyboardInterrupt=python32.PyExc_KeyboardInterrupt DATA\r
+ PyExc_LookupError=python32.PyExc_LookupError DATA\r
+ PyExc_MemoryError=python32.PyExc_MemoryError DATA\r
+ PyExc_MemoryErrorInst=python32.PyExc_MemoryErrorInst DATA\r
+ PyExc_NameError=python32.PyExc_NameError DATA\r
+ PyExc_NotImplementedError=python32.PyExc_NotImplementedError DATA\r
+ PyExc_OSError=python32.PyExc_OSError DATA\r
+ PyExc_OverflowError=python32.PyExc_OverflowError DATA\r
+ PyExc_PendingDeprecationWarning=python32.PyExc_PendingDeprecationWarning DATA\r
+ PyExc_RecursionErrorInst=python32.PyExc_RecursionErrorInst DATA\r
+ PyExc_ReferenceError=python32.PyExc_ReferenceError DATA\r
+ PyExc_RuntimeError=python32.PyExc_RuntimeError DATA\r
+ PyExc_RuntimeWarning=python32.PyExc_RuntimeWarning DATA\r
+ PyExc_StopIteration=python32.PyExc_StopIteration DATA\r
+ PyExc_SyntaxError=python32.PyExc_SyntaxError DATA\r
+ PyExc_SyntaxWarning=python32.PyExc_SyntaxWarning DATA\r
+ PyExc_SystemError=python32.PyExc_SystemError DATA\r
+ PyExc_SystemExit=python32.PyExc_SystemExit DATA\r
+ PyExc_TabError=python32.PyExc_TabError DATA\r
+ PyExc_TypeError=python32.PyExc_TypeError DATA\r
+ PyExc_UnboundLocalError=python32.PyExc_UnboundLocalError DATA\r
+ PyExc_UnicodeDecodeError=python32.PyExc_UnicodeDecodeError DATA\r
+ PyExc_UnicodeEncodeError=python32.PyExc_UnicodeEncodeError DATA\r
+ PyExc_UnicodeError=python32.PyExc_UnicodeError DATA\r
+ PyExc_UnicodeTranslateError=python32.PyExc_UnicodeTranslateError DATA\r
+ PyExc_UnicodeWarning=python32.PyExc_UnicodeWarning DATA\r
+ PyExc_UserWarning=python32.PyExc_UserWarning DATA\r
+ PyExc_ValueError=python32.PyExc_ValueError DATA\r
+ PyExc_Warning=python32.PyExc_Warning DATA\r
+ PyExc_ZeroDivisionError=python32.PyExc_ZeroDivisionError DATA\r
+ PyException_GetCause=python32.PyException_GetCause\r
+ PyException_GetContext=python32.PyException_GetContext\r
+ PyException_GetTraceback=python32.PyException_GetTraceback\r
+ PyException_SetCause=python32.PyException_SetCause\r
+ PyException_SetContext=python32.PyException_SetContext\r
+ PyException_SetTraceback=python32.PyException_SetTraceback\r
+ PyFile_FromFd=python32.PyFile_FromFd\r
+ PyFile_GetLine=python32.PyFile_GetLine\r
+ PyFile_WriteObject=python32.PyFile_WriteObject\r
+ PyFile_WriteString=python32.PyFile_WriteString\r
+ PyFilter_Type=python32.PyFilter_Type DATA\r
+ PyFloat_AsDouble=python32.PyFloat_AsDouble\r
+ PyFloat_FromDouble=python32.PyFloat_FromDouble\r
+ PyFloat_FromString=python32.PyFloat_FromString\r
+ PyFloat_GetInfo=python32.PyFloat_GetInfo\r
+ PyFloat_GetMax=python32.PyFloat_GetMax\r
+ PyFloat_GetMin=python32.PyFloat_GetMin\r
+ PyFloat_Type=python32.PyFloat_Type DATA\r
+ PyFrozenSet_New=python32.PyFrozenSet_New\r
+ PyFrozenSet_Type=python32.PyFrozenSet_Type DATA\r
+ PyGC_Collect=python32.PyGC_Collect\r
+ PyGILState_Ensure=python32.PyGILState_Ensure\r
+ PyGILState_GetThisThreadState=python32.PyGILState_GetThisThreadState\r
+ PyGILState_Release=python32.PyGILState_Release\r
+ PyGetSetDescr_Type=python32.PyGetSetDescr_Type DATA\r
+ PyImport_AddModule=python32.PyImport_AddModule\r
+ PyImport_AppendInittab=python32.PyImport_AppendInittab\r
+ PyImport_Cleanup=python32.PyImport_Cleanup\r
+ PyImport_ExecCodeModule=python32.PyImport_ExecCodeModule\r
+ PyImport_ExecCodeModuleEx=python32.PyImport_ExecCodeModuleEx\r
+ PyImport_ExecCodeModuleWithPathnames=python32.PyImport_ExecCodeModuleWithPathnames\r
+ PyImport_GetImporter=python32.PyImport_GetImporter\r
+ PyImport_GetMagicNumber=python32.PyImport_GetMagicNumber\r
+ PyImport_GetMagicTag=python32.PyImport_GetMagicTag\r
+ PyImport_GetModuleDict=python32.PyImport_GetModuleDict\r
+ PyImport_Import=python32.PyImport_Import\r
+ PyImport_ImportFrozenModule=python32.PyImport_ImportFrozenModule\r
+ PyImport_ImportModule=python32.PyImport_ImportModule\r
+ PyImport_ImportModuleLevel=python32.PyImport_ImportModuleLevel\r
+ PyImport_ImportModuleNoBlock=python32.PyImport_ImportModuleNoBlock\r
+ PyImport_ReloadModule=python32.PyImport_ReloadModule\r
+ PyInterpreterState_Clear=python32.PyInterpreterState_Clear\r
+ PyInterpreterState_Delete=python32.PyInterpreterState_Delete\r
+ PyInterpreterState_New=python32.PyInterpreterState_New\r
+ PyIter_Next=python32.PyIter_Next\r
+ PyListIter_Type=python32.PyListIter_Type DATA\r
+ PyListRevIter_Type=python32.PyListRevIter_Type DATA\r
+ PyList_Append=python32.PyList_Append\r
+ PyList_AsTuple=python32.PyList_AsTuple\r
+ PyList_GetItem=python32.PyList_GetItem\r
+ PyList_GetSlice=python32.PyList_GetSlice\r
+ PyList_Insert=python32.PyList_Insert\r
+ PyList_New=python32.PyList_New\r
+ PyList_Reverse=python32.PyList_Reverse\r
+ PyList_SetItem=python32.PyList_SetItem\r
+ PyList_SetSlice=python32.PyList_SetSlice\r
+ PyList_Size=python32.PyList_Size\r
+ PyList_Sort=python32.PyList_Sort\r
+ PyList_Type=python32.PyList_Type DATA\r
+ PyLongRangeIter_Type=python32.PyLongRangeIter_Type DATA\r
+ PyLong_AsDouble=python32.PyLong_AsDouble\r
+ PyLong_AsLong=python32.PyLong_AsLong\r
+ PyLong_AsLongAndOverflow=python32.PyLong_AsLongAndOverflow\r
+ PyLong_AsLongLong=python32.PyLong_AsLongLong\r
+ PyLong_AsLongLongAndOverflow=python32.PyLong_AsLongLongAndOverflow\r
+ PyLong_AsSize_t=python32.PyLong_AsSize_t\r
+ PyLong_AsSsize_t=python32.PyLong_AsSsize_t\r
+ PyLong_AsUnsignedLong=python32.PyLong_AsUnsignedLong\r
+ PyLong_AsUnsignedLongLong=python32.PyLong_AsUnsignedLongLong\r
+ PyLong_AsUnsignedLongLongMask=python32.PyLong_AsUnsignedLongLongMask\r
+ PyLong_AsUnsignedLongMask=python32.PyLong_AsUnsignedLongMask\r
+ PyLong_AsVoidPtr=python32.PyLong_AsVoidPtr\r
+ PyLong_FromDouble=python32.PyLong_FromDouble\r
+ PyLong_FromLong=python32.PyLong_FromLong\r
+ PyLong_FromLongLong=python32.PyLong_FromLongLong\r
+ PyLong_FromSize_t=python32.PyLong_FromSize_t\r
+ PyLong_FromSsize_t=python32.PyLong_FromSsize_t\r
+ PyLong_FromString=python32.PyLong_FromString\r
+ PyLong_FromUnsignedLong=python32.PyLong_FromUnsignedLong\r
+ PyLong_FromUnsignedLongLong=python32.PyLong_FromUnsignedLongLong\r
+ PyLong_FromVoidPtr=python32.PyLong_FromVoidPtr\r
+ PyLong_GetInfo=python32.PyLong_GetInfo\r
+ PyLong_Type=python32.PyLong_Type DATA\r
+ PyMap_Type=python32.PyMap_Type DATA\r
+ PyMapping_Check=python32.PyMapping_Check\r
+ PyMapping_GetItemString=python32.PyMapping_GetItemString\r
+ PyMapping_HasKey=python32.PyMapping_HasKey\r
+ PyMapping_HasKeyString=python32.PyMapping_HasKeyString\r
+ PyMapping_Items=python32.PyMapping_Items\r
+ PyMapping_Keys=python32.PyMapping_Keys\r
+ PyMapping_Length=python32.PyMapping_Length\r
+ PyMapping_SetItemString=python32.PyMapping_SetItemString\r
+ PyMapping_Size=python32.PyMapping_Size\r
+ PyMapping_Values=python32.PyMapping_Values\r
+ PyMem_Free=python32.PyMem_Free\r
+ PyMem_Malloc=python32.PyMem_Malloc\r
+ PyMem_Realloc=python32.PyMem_Realloc\r
+ PyMemberDescr_Type=python32.PyMemberDescr_Type DATA\r
+ PyMemoryView_FromBuffer=python32.PyMemoryView_FromBuffer\r
+ PyMemoryView_FromObject=python32.PyMemoryView_FromObject\r
+ PyMemoryView_GetContiguous=python32.PyMemoryView_GetContiguous\r
+ PyMemoryView_Type=python32.PyMemoryView_Type DATA\r
+ PyMethodDescr_Type=python32.PyMethodDescr_Type DATA\r
+ PyModule_AddIntConstant=python32.PyModule_AddIntConstant\r
+ PyModule_AddObject=python32.PyModule_AddObject\r
+ PyModule_AddStringConstant=python32.PyModule_AddStringConstant\r
+ PyModule_Create2=python32.PyModule_Create2\r
+ PyModule_GetDef=python32.PyModule_GetDef\r
+ PyModule_GetDict=python32.PyModule_GetDict\r
+ PyModule_GetFilename=python32.PyModule_GetFilename\r
+ PyModule_GetFilenameObject=python32.PyModule_GetFilenameObject\r
+ PyModule_GetName=python32.PyModule_GetName\r
+ PyModule_GetState=python32.PyModule_GetState\r
+ PyModule_New=python32.PyModule_New\r
+ PyModule_Type=python32.PyModule_Type DATA\r
+ PyNullImporter_Type=python32.PyNullImporter_Type DATA\r
+ PyNumber_Absolute=python32.PyNumber_Absolute\r
+ PyNumber_Add=python32.PyNumber_Add\r
+ PyNumber_And=python32.PyNumber_And\r
+ PyNumber_AsSsize_t=python32.PyNumber_AsSsize_t\r
+ PyNumber_Check=python32.PyNumber_Check\r
+ PyNumber_Divmod=python32.PyNumber_Divmod\r
+ PyNumber_Float=python32.PyNumber_Float\r
+ PyNumber_FloorDivide=python32.PyNumber_FloorDivide\r
+ PyNumber_InPlaceAdd=python32.PyNumber_InPlaceAdd\r
+ PyNumber_InPlaceAnd=python32.PyNumber_InPlaceAnd\r
+ PyNumber_InPlaceFloorDivide=python32.PyNumber_InPlaceFloorDivide\r
+ PyNumber_InPlaceLshift=python32.PyNumber_InPlaceLshift\r
+ PyNumber_InPlaceMultiply=python32.PyNumber_InPlaceMultiply\r
+ PyNumber_InPlaceOr=python32.PyNumber_InPlaceOr\r
+ PyNumber_InPlacePower=python32.PyNumber_InPlacePower\r
+ PyNumber_InPlaceRemainder=python32.PyNumber_InPlaceRemainder\r
+ PyNumber_InPlaceRshift=python32.PyNumber_InPlaceRshift\r
+ PyNumber_InPlaceSubtract=python32.PyNumber_InPlaceSubtract\r
+ PyNumber_InPlaceTrueDivide=python32.PyNumber_InPlaceTrueDivide\r
+ PyNumber_InPlaceXor=python32.PyNumber_InPlaceXor\r
+ PyNumber_Index=python32.PyNumber_Index\r
+ PyNumber_Invert=python32.PyNumber_Invert\r
+ PyNumber_Long=python32.PyNumber_Long\r
+ PyNumber_Lshift=python32.PyNumber_Lshift\r
+ PyNumber_Multiply=python32.PyNumber_Multiply\r
+ PyNumber_Negative=python32.PyNumber_Negative\r
+ PyNumber_Or=python32.PyNumber_Or\r
+ PyNumber_Positive=python32.PyNumber_Positive\r
+ PyNumber_Power=python32.PyNumber_Power\r
+ PyNumber_Remainder=python32.PyNumber_Remainder\r
+ PyNumber_Rshift=python32.PyNumber_Rshift\r
+ PyNumber_Subtract=python32.PyNumber_Subtract\r
+ PyNumber_ToBase=python32.PyNumber_ToBase\r
+ PyNumber_TrueDivide=python32.PyNumber_TrueDivide\r
+ PyNumber_Xor=python32.PyNumber_Xor\r
+ PyOS_AfterFork=python32.PyOS_AfterFork\r
+ PyOS_InitInterrupts=python32.PyOS_InitInterrupts\r
+ PyOS_InputHook=python32.PyOS_InputHook DATA\r
+ PyOS_InterruptOccurred=python32.PyOS_InterruptOccurred\r
+ PyOS_ReadlineFunctionPointer=python32.PyOS_ReadlineFunctionPointer DATA\r
+ PyOS_double_to_string=python32.PyOS_double_to_string\r
+ PyOS_getsig=python32.PyOS_getsig\r
+ PyOS_mystricmp=python32.PyOS_mystricmp\r
+ PyOS_mystrnicmp=python32.PyOS_mystrnicmp\r
+ PyOS_setsig=python32.PyOS_setsig\r
+ PyOS_snprintf=python32.PyOS_snprintf\r
+ PyOS_string_to_double=python32.PyOS_string_to_double\r
+ PyOS_strtol=python32.PyOS_strtol\r
+ PyOS_strtoul=python32.PyOS_strtoul\r
+ PyOS_vsnprintf=python32.PyOS_vsnprintf\r
+ PyObject_ASCII=python32.PyObject_ASCII\r
+ PyObject_AsCharBuffer=python32.PyObject_AsCharBuffer\r
+ PyObject_AsFileDescriptor=python32.PyObject_AsFileDescriptor\r
+ PyObject_AsReadBuffer=python32.PyObject_AsReadBuffer\r
+ PyObject_AsWriteBuffer=python32.PyObject_AsWriteBuffer\r
+ PyObject_Bytes=python32.PyObject_Bytes\r
+ PyObject_Call=python32.PyObject_Call\r
+ PyObject_CallFunction=python32.PyObject_CallFunction\r
+ PyObject_CallFunctionObjArgs=python32.PyObject_CallFunctionObjArgs\r
+ PyObject_CallMethod=python32.PyObject_CallMethod\r
+ PyObject_CallMethodObjArgs=python32.PyObject_CallMethodObjArgs\r
+ PyObject_CallObject=python32.PyObject_CallObject\r
+ PyObject_CheckReadBuffer=python32.PyObject_CheckReadBuffer\r
+ PyObject_ClearWeakRefs=python32.PyObject_ClearWeakRefs\r
+ PyObject_CopyData=python32.PyObject_CopyData\r
+ PyObject_DelItem=python32.PyObject_DelItem\r
+ PyObject_DelItemString=python32.PyObject_DelItemString\r
+ PyObject_Dir=python32.PyObject_Dir\r
+ PyObject_Format=python32.PyObject_Format\r
+ PyObject_Free=python32.PyObject_Free\r
+ PyObject_GC_Del=python32.PyObject_GC_Del\r
+ PyObject_GC_Track=python32.PyObject_GC_Track\r
+ PyObject_GC_UnTrack=python32.PyObject_GC_UnTrack\r
+ PyObject_GenericGetAttr=python32.PyObject_GenericGetAttr\r
+ PyObject_GenericSetAttr=python32.PyObject_GenericSetAttr\r
+ PyObject_GetAttr=python32.PyObject_GetAttr\r
+ PyObject_GetAttrString=python32.PyObject_GetAttrString\r
+ PyObject_GetBuffer=python32.PyObject_GetBuffer\r
+ PyObject_GetItem=python32.PyObject_GetItem\r
+ PyObject_GetIter=python32.PyObject_GetIter\r
+ PyObject_HasAttr=python32.PyObject_HasAttr\r
+ PyObject_HasAttrString=python32.PyObject_HasAttrString\r
+ PyObject_Hash=python32.PyObject_Hash\r
+ PyObject_HashNotImplemented=python32.PyObject_HashNotImplemented\r
+ PyObject_Init=python32.PyObject_Init\r
+ PyObject_InitVar=python32.PyObject_InitVar\r
+ PyObject_IsInstance=python32.PyObject_IsInstance\r
+ PyObject_IsSubclass=python32.PyObject_IsSubclass\r
+ PyObject_IsTrue=python32.PyObject_IsTrue\r
+ PyObject_Length=python32.PyObject_Length\r
+ PyObject_Malloc=python32.PyObject_Malloc\r
+ PyObject_Not=python32.PyObject_Not\r
+ PyObject_Realloc=python32.PyObject_Realloc\r
+ PyObject_Repr=python32.PyObject_Repr\r
+ PyObject_RichCompare=python32.PyObject_RichCompare\r
+ PyObject_RichCompareBool=python32.PyObject_RichCompareBool\r
+ PyObject_SelfIter=python32.PyObject_SelfIter\r
+ PyObject_SetAttr=python32.PyObject_SetAttr\r
+ PyObject_SetAttrString=python32.PyObject_SetAttrString\r
+ PyObject_SetItem=python32.PyObject_SetItem\r
+ PyObject_Size=python32.PyObject_Size\r
+ PyObject_Str=python32.PyObject_Str\r
+ PyObject_Type=python32.PyObject_Type DATA\r
+ PyParser_SimpleParseFileFlags=python32.PyParser_SimpleParseFileFlags\r
+ PyParser_SimpleParseStringFlags=python32.PyParser_SimpleParseStringFlags\r
+ PyProperty_Type=python32.PyProperty_Type DATA\r
+ PyRangeIter_Type=python32.PyRangeIter_Type DATA\r
+ PyRange_Type=python32.PyRange_Type DATA\r
+ PyReversed_Type=python32.PyReversed_Type DATA\r
+ PySeqIter_New=python32.PySeqIter_New\r
+ PySeqIter_Type=python32.PySeqIter_Type DATA\r
+ PySequence_Check=python32.PySequence_Check\r
+ PySequence_Concat=python32.PySequence_Concat\r
+ PySequence_Contains=python32.PySequence_Contains\r
+ PySequence_Count=python32.PySequence_Count\r
+ PySequence_DelItem=python32.PySequence_DelItem\r
+ PySequence_DelSlice=python32.PySequence_DelSlice\r
+ PySequence_Fast=python32.PySequence_Fast\r
+ PySequence_GetItem=python32.PySequence_GetItem\r
+ PySequence_GetSlice=python32.PySequence_GetSlice\r
+ PySequence_In=python32.PySequence_In\r
+ PySequence_InPlaceConcat=python32.PySequence_InPlaceConcat\r
+ PySequence_InPlaceRepeat=python32.PySequence_InPlaceRepeat\r
+ PySequence_Index=python32.PySequence_Index\r
+ PySequence_Length=python32.PySequence_Length\r
+ PySequence_List=python32.PySequence_List\r
+ PySequence_Repeat=python32.PySequence_Repeat\r
+ PySequence_SetItem=python32.PySequence_SetItem\r
+ PySequence_SetSlice=python32.PySequence_SetSlice\r
+ PySequence_Size=python32.PySequence_Size\r
+ PySequence_Tuple=python32.PySequence_Tuple\r
+ PySetIter_Type=python32.PySetIter_Type DATA\r
+ PySet_Add=python32.PySet_Add\r
+ PySet_Clear=python32.PySet_Clear\r
+ PySet_Contains=python32.PySet_Contains\r
+ PySet_Discard=python32.PySet_Discard\r
+ PySet_New=python32.PySet_New\r
+ PySet_Pop=python32.PySet_Pop\r
+ PySet_Size=python32.PySet_Size\r
+ PySet_Type=python32.PySet_Type DATA\r
+ PySlice_GetIndices=python32.PySlice_GetIndices\r
+ PySlice_GetIndicesEx=python32.PySlice_GetIndicesEx\r
+ PySlice_New=python32.PySlice_New\r
+ PySlice_Type=python32.PySlice_Type DATA\r
+ PySortWrapper_Type=python32.PySortWrapper_Type DATA\r
+ PyState_FindModule=python32.PyState_FindModule\r
+ PyStructSequence_GetItem=python32.PyStructSequence_GetItem\r
+ PyStructSequence_New=python32.PyStructSequence_New\r
+ PyStructSequence_NewType=python32.PyStructSequence_NewType\r
+ PyStructSequence_SetItem=python32.PyStructSequence_SetItem\r
+ PySuper_Type=python32.PySuper_Type DATA\r
+ PySys_AddWarnOption=python32.PySys_AddWarnOption\r
+ PySys_AddWarnOptionUnicode=python32.PySys_AddWarnOptionUnicode\r
+ PySys_FormatStderr=python32.PySys_FormatStderr\r
+ PySys_FormatStdout=python32.PySys_FormatStdout\r
+ PySys_GetObject=python32.PySys_GetObject\r
+ PySys_HasWarnOptions=python32.PySys_HasWarnOptions\r
+ PySys_ResetWarnOptions=python32.PySys_ResetWarnOptions\r
+ PySys_SetArgv=python32.PySys_SetArgv\r
+ PySys_SetArgvEx=python32.PySys_SetArgvEx\r
+ PySys_SetObject=python32.PySys_SetObject\r
+ PySys_SetPath=python32.PySys_SetPath\r
+ PySys_WriteStderr=python32.PySys_WriteStderr\r
+ PySys_WriteStdout=python32.PySys_WriteStdout\r
+ PyThreadState_Clear=python32.PyThreadState_Clear\r
+ PyThreadState_Delete=python32.PyThreadState_Delete\r
+ PyThreadState_DeleteCurrent=python32.PyThreadState_DeleteCurrent\r
+ PyThreadState_Get=python32.PyThreadState_Get\r
+ PyThreadState_GetDict=python32.PyThreadState_GetDict\r
+ PyThreadState_New=python32.PyThreadState_New\r
+ PyThreadState_SetAsyncExc=python32.PyThreadState_SetAsyncExc\r
+ PyThreadState_Swap=python32.PyThreadState_Swap\r
+ PyTraceBack_Here=python32.PyTraceBack_Here\r
+ PyTraceBack_Print=python32.PyTraceBack_Print\r
+ PyTraceBack_Type=python32.PyTraceBack_Type DATA\r
+ PyTupleIter_Type=python32.PyTupleIter_Type DATA\r
+ PyTuple_ClearFreeList=python32.PyTuple_ClearFreeList\r
+ PyTuple_GetItem=python32.PyTuple_GetItem\r
+ PyTuple_GetSlice=python32.PyTuple_GetSlice\r
+ PyTuple_New=python32.PyTuple_New\r
+ PyTuple_Pack=python32.PyTuple_Pack\r
+ PyTuple_SetItem=python32.PyTuple_SetItem\r
+ PyTuple_Size=python32.PyTuple_Size\r
+ PyTuple_Type=python32.PyTuple_Type DATA\r
+ PyType_ClearCache=python32.PyType_ClearCache\r
+ PyType_FromSpec=python32.PyType_FromSpec\r
+ PyType_GenericAlloc=python32.PyType_GenericAlloc\r
+ PyType_GenericNew=python32.PyType_GenericNew\r
+ PyType_IsSubtype=python32.PyType_IsSubtype\r
+ PyType_Modified=python32.PyType_Modified\r
+ PyType_Ready=python32.PyType_Ready\r
+ PyType_Type=python32.PyType_Type DATA\r
+ PyUnicodeDecodeError_Create=python32.PyUnicodeDecodeError_Create\r
+ PyUnicodeDecodeError_GetEncoding=python32.PyUnicodeDecodeError_GetEncoding\r
+ PyUnicodeDecodeError_GetEnd=python32.PyUnicodeDecodeError_GetEnd\r
+ PyUnicodeDecodeError_GetObject=python32.PyUnicodeDecodeError_GetObject\r
+ PyUnicodeDecodeError_GetReason=python32.PyUnicodeDecodeError_GetReason\r
+ PyUnicodeDecodeError_GetStart=python32.PyUnicodeDecodeError_GetStart\r
+ PyUnicodeDecodeError_SetEnd=python32.PyUnicodeDecodeError_SetEnd\r
+ PyUnicodeDecodeError_SetReason=python32.PyUnicodeDecodeError_SetReason\r
+ PyUnicodeDecodeError_SetStart=python32.PyUnicodeDecodeError_SetStart\r
+ PyUnicodeEncodeError_GetEncoding=python32.PyUnicodeEncodeError_GetEncoding\r
+ PyUnicodeEncodeError_GetEnd=python32.PyUnicodeEncodeError_GetEnd\r
+ PyUnicodeEncodeError_GetObject=python32.PyUnicodeEncodeError_GetObject\r
+ PyUnicodeEncodeError_GetReason=python32.PyUnicodeEncodeError_GetReason\r
+ PyUnicodeEncodeError_GetStart=python32.PyUnicodeEncodeError_GetStart\r
+ PyUnicodeEncodeError_SetEnd=python32.PyUnicodeEncodeError_SetEnd\r
+ PyUnicodeEncodeError_SetReason=python32.PyUnicodeEncodeError_SetReason\r
+ PyUnicodeEncodeError_SetStart=python32.PyUnicodeEncodeError_SetStart\r
+ PyUnicodeIter_Type=python32.PyUnicodeIter_Type DATA\r
+ PyUnicodeTranslateError_GetEnd=python32.PyUnicodeTranslateError_GetEnd\r
+ PyUnicodeTranslateError_GetObject=python32.PyUnicodeTranslateError_GetObject\r
+ PyUnicodeTranslateError_GetReason=python32.PyUnicodeTranslateError_GetReason\r
+ PyUnicodeTranslateError_GetStart=python32.PyUnicodeTranslateError_GetStart\r
+ PyUnicodeTranslateError_SetEnd=python32.PyUnicodeTranslateError_SetEnd\r
+ PyUnicodeTranslateError_SetReason=python32.PyUnicodeTranslateError_SetReason\r
+ PyUnicodeTranslateError_SetStart=python32.PyUnicodeTranslateError_SetStart\r
+ PyUnicode_Append=python32.PyUnicodeUCS2_Append\r
+ PyUnicode_AppendAndDel=python32.PyUnicodeUCS2_AppendAndDel\r
+ PyUnicode_AsASCIIString=python32.PyUnicodeUCS2_AsASCIIString\r
+ PyUnicode_AsCharmapString=python32.PyUnicodeUCS2_AsCharmapString\r
+ PyUnicode_AsDecodedObject=python32.PyUnicodeUCS2_AsDecodedObject\r
+ PyUnicode_AsDecodedUnicode=python32.PyUnicodeUCS2_AsDecodedUnicode\r
+ PyUnicode_AsEncodedObject=python32.PyUnicodeUCS2_AsEncodedObject\r
+ PyUnicode_AsEncodedString=python32.PyUnicodeUCS2_AsEncodedString\r
+ PyUnicode_AsEncodedUnicode=python32.PyUnicodeUCS2_AsEncodedUnicode\r
+ PyUnicode_AsLatin1String=python32.PyUnicodeUCS2_AsLatin1String\r
+ PyUnicode_AsRawUnicodeEscapeString=python32.PyUnicodeUCS2_AsRawUnicodeEscapeString\r
+ PyUnicode_AsUTF16String=python32.PyUnicodeUCS2_AsUTF16String\r
+ PyUnicode_AsUTF32String=python32.PyUnicodeUCS2_AsUTF32String\r
+ PyUnicode_AsUTF8String=python32.PyUnicodeUCS2_AsUTF8String\r
+ PyUnicode_AsUnicodeEscapeString=python32.PyUnicodeUCS2_AsUnicodeEscapeString\r
+ PyUnicode_AsWideChar=python32.PyUnicodeUCS2_AsWideChar\r
+ PyUnicode_ClearFreelist=python32.PyUnicodeUCS2_ClearFreelist\r
+ PyUnicode_Compare=python32.PyUnicodeUCS2_Compare\r
+ PyUnicode_Concat=python32.PyUnicodeUCS2_Concat\r
+ PyUnicode_Contains=python32.PyUnicodeUCS2_Contains\r
+ PyUnicode_Count=python32.PyUnicodeUCS2_Count\r
+ PyUnicode_Decode=python32.PyUnicodeUCS2_Decode\r
+ PyUnicode_DecodeASCII=python32.PyUnicodeUCS2_DecodeASCII\r
+ PyUnicode_DecodeCharmap=python32.PyUnicodeUCS2_DecodeCharmap\r
+ PyUnicode_DecodeFSDefault=python32.PyUnicodeUCS2_DecodeFSDefault\r
+ PyUnicode_DecodeFSDefaultAndSize=python32.PyUnicodeUCS2_DecodeFSDefaultAndSize\r
+ PyUnicode_DecodeLatin1=python32.PyUnicodeUCS2_DecodeLatin1\r
+ PyUnicode_DecodeRawUnicodeEscape=python32.PyUnicodeUCS2_DecodeRawUnicodeEscape\r
+ PyUnicode_DecodeUTF16=python32.PyUnicodeUCS2_DecodeUTF16\r
+ PyUnicode_DecodeUTF16Stateful=python32.PyUnicodeUCS2_DecodeUTF16Stateful\r
+ PyUnicode_DecodeUTF32=python32.PyUnicodeUCS2_DecodeUTF32\r
+ PyUnicode_DecodeUTF32Stateful=python32.PyUnicodeUCS2_DecodeUTF32Stateful\r
+ PyUnicode_DecodeUTF8=python32.PyUnicodeUCS2_DecodeUTF8\r
+ PyUnicode_DecodeUTF8Stateful=python32.PyUnicodeUCS2_DecodeUTF8Stateful\r
+ PyUnicode_DecodeUnicodeEscape=python32.PyUnicodeUCS2_DecodeUnicodeEscape\r
+ PyUnicode_FSConverter=python32.PyUnicodeUCS2_FSConverter\r
+ PyUnicode_FSDecoder=python32.PyUnicodeUCS2_FSDecoder\r
+ PyUnicode_Find=python32.PyUnicodeUCS2_Find\r
+ PyUnicode_Format=python32.PyUnicodeUCS2_Format\r
+ PyUnicode_FromEncodedObject=python32.PyUnicodeUCS2_FromEncodedObject\r
+ PyUnicode_FromFormat=python32.PyUnicodeUCS2_FromFormat\r
+ PyUnicode_FromFormatV=python32.PyUnicodeUCS2_FromFormatV\r
+ PyUnicode_FromObject=python32.PyUnicodeUCS2_FromObject\r
+ PyUnicode_FromOrdinal=python32.PyUnicodeUCS2_FromOrdinal\r
+ PyUnicode_FromString=python32.PyUnicodeUCS2_FromString\r
+ PyUnicode_FromStringAndSize=python32.PyUnicodeUCS2_FromStringAndSize\r
+ PyUnicode_FromWideChar=python32.PyUnicodeUCS2_FromWideChar\r
+ PyUnicode_GetDefaultEncoding=python32.PyUnicodeUCS2_GetDefaultEncoding\r
+ PyUnicode_GetSize=python32.PyUnicodeUCS2_GetSize\r
+ PyUnicode_IsIdentifier=python32.PyUnicodeUCS2_IsIdentifier\r
+ PyUnicode_Join=python32.PyUnicodeUCS2_Join\r
+ PyUnicode_Partition=python32.PyUnicodeUCS2_Partition\r
+ PyUnicode_RPartition=python32.PyUnicodeUCS2_RPartition\r
+ PyUnicode_RSplit=python32.PyUnicodeUCS2_RSplit\r
+ PyUnicode_Replace=python32.PyUnicodeUCS2_Replace\r
+ PyUnicode_Resize=python32.PyUnicodeUCS2_Resize\r
+ PyUnicode_RichCompare=python32.PyUnicodeUCS2_RichCompare\r
+ PyUnicode_SetDefaultEncoding=python32.PyUnicodeUCS2_SetDefaultEncoding\r
+ PyUnicode_Split=python32.PyUnicodeUCS2_Split\r
+ PyUnicode_Splitlines=python32.PyUnicodeUCS2_Splitlines\r
+ PyUnicode_Tailmatch=python32.PyUnicodeUCS2_Tailmatch\r
+ PyUnicode_Translate=python32.PyUnicodeUCS2_Translate\r
+ PyUnicode_BuildEncodingMap=python32.PyUnicode_BuildEncodingMap\r
+ PyUnicode_CompareWithASCIIString=python32.PyUnicode_CompareWithASCIIString\r
+ PyUnicode_DecodeUTF7=python32.PyUnicode_DecodeUTF7\r
+ PyUnicode_DecodeUTF7Stateful=python32.PyUnicode_DecodeUTF7Stateful\r
+ PyUnicode_EncodeFSDefault=python32.PyUnicode_EncodeFSDefault\r
+ PyUnicode_InternFromString=python32.PyUnicode_InternFromString\r
+ PyUnicode_InternImmortal=python32.PyUnicode_InternImmortal\r
+ PyUnicode_InternInPlace=python32.PyUnicode_InternInPlace\r
+ PyUnicode_Type=python32.PyUnicode_Type DATA\r
+ PyWeakref_GetObject=python32.PyWeakref_GetObject DATA\r
+ PyWeakref_NewProxy=python32.PyWeakref_NewProxy\r
+ PyWeakref_NewRef=python32.PyWeakref_NewRef\r
+ PyWrapperDescr_Type=python32.PyWrapperDescr_Type DATA\r
+ PyWrapper_New=python32.PyWrapper_New\r
+ PyZip_Type=python32.PyZip_Type DATA\r
+ Py_AddPendingCall=python32.Py_AddPendingCall\r
+ Py_AtExit=python32.Py_AtExit\r
+ Py_BuildValue=python32.Py_BuildValue\r
+ Py_CompileStringFlags=python32.Py_CompileStringFlags\r
+ Py_DecRef=python32.Py_DecRef\r
+ Py_EndInterpreter=python32.Py_EndInterpreter\r
+ Py_Exit=python32.Py_Exit\r
+ Py_FatalError=python32.Py_FatalError\r
+ Py_FileSystemDefaultEncoding=python32.Py_FileSystemDefaultEncoding DATA\r
+ Py_Finalize=python32.Py_Finalize\r
+ Py_GetBuildInfo=python32.Py_GetBuildInfo\r
+ Py_GetCompiler=python32.Py_GetCompiler\r
+ Py_GetCopyright=python32.Py_GetCopyright\r
+ Py_GetExecPrefix=python32.Py_GetExecPrefix\r
+ Py_GetPath=python32.Py_GetPath\r
+ Py_GetPlatform=python32.Py_GetPlatform\r
+ Py_GetPrefix=python32.Py_GetPrefix\r
+ Py_GetProgramFullPath=python32.Py_GetProgramFullPath\r
+ Py_GetProgramName=python32.Py_GetProgramName\r
+ Py_GetPythonHome=python32.Py_GetPythonHome\r
+ Py_GetRecursionLimit=python32.Py_GetRecursionLimit\r
+ Py_GetVersion=python32.Py_GetVersion\r
+ Py_HasFileSystemDefaultEncoding=python32.Py_HasFileSystemDefaultEncoding DATA\r
+ Py_IncRef=python32.Py_IncRef\r
+ Py_Initialize=python32.Py_Initialize\r
+ Py_InitializeEx=python32.Py_InitializeEx\r
+ Py_IsInitialized=python32.Py_IsInitialized\r
+ Py_Main=python32.Py_Main\r
+ Py_MakePendingCalls=python32.Py_MakePendingCalls\r
+ Py_NewInterpreter=python32.Py_NewInterpreter\r
+ Py_ReprEnter=python32.Py_ReprEnter\r
+ Py_ReprLeave=python32.Py_ReprLeave\r
+ Py_SetProgramName=python32.Py_SetProgramName\r
+ Py_SetPythonHome=python32.Py_SetPythonHome\r
+ Py_SetRecursionLimit=python32.Py_SetRecursionLimit\r
+ Py_SymtableString=python32.Py_SymtableString\r
+ Py_VaBuildValue=python32.Py_VaBuildValue\r
+ _PyErr_BadInternalCall=python32._PyErr_BadInternalCall\r
+ _PyObject_CallFunction_SizeT=python32._PyObject_CallFunction_SizeT\r
+ _PyObject_CallMethod_SizeT=python32._PyObject_CallMethod_SizeT\r
+ _PyObject_GC_Malloc=python32._PyObject_GC_Malloc\r
+ _PyObject_GC_New=python32._PyObject_GC_New\r
+ _PyObject_GC_NewVar=python32._PyObject_GC_NewVar\r
+ _PyObject_GC_Resize=python32._PyObject_GC_Resize\r
+ _PyObject_New=python32._PyObject_New\r
+ _PyObject_NewVar=python32._PyObject_NewVar\r
+ _PyState_AddModule=python32._PyState_AddModule\r
+ _PyThreadState_Init=python32._PyThreadState_Init\r
+ _PyThreadState_Prealloc=python32._PyThreadState_Prealloc\r
+ _PyTrash_delete_later=python32._PyTrash_delete_later DATA\r
+ _PyTrash_delete_nesting=python32._PyTrash_delete_nesting DATA\r
+ _PyTrash_deposit_object=python32._PyTrash_deposit_object\r
+ _PyTrash_destroy_chain=python32._PyTrash_destroy_chain\r
+ _PyWeakref_CallableProxyType=python32._PyWeakref_CallableProxyType DATA\r
+ _PyWeakref_ProxyType=python32._PyWeakref_ProxyType DATA\r
+ _PyWeakref_RefType=python32._PyWeakref_RefType DATA\r
+ _Py_BuildValue_SizeT=python32._Py_BuildValue_SizeT\r
+ _Py_CheckRecursionLimit=python32._Py_CheckRecursionLimit DATA\r
+ _Py_CheckRecursiveCall=python32._Py_CheckRecursiveCall\r
+ _Py_Dealloc=python32._Py_Dealloc\r
+ _Py_EllipsisObject=python32._Py_EllipsisObject DATA\r
+ _Py_FalseStruct=python32._Py_FalseStruct DATA\r
+ _Py_NoneStruct=python32.Py_GetCopyright\r
+ _Py_NotImplementedStruct=python32._Py_NotImplementedStruct DATA\r
+ _Py_SwappedOp=python32._Py_SwappedOp DATA\r
+ _Py_TrueStruct=python32._Py_TrueStruct DATA\r
+ _Py_VaBuildValue_SizeT=python32._Py_VaBuildValue_SizeT\r
--- /dev/null
+#include <windows.h>\r
+\r
+BOOL WINAPI\r
+DllMain(HINSTANCE hInstDLL,\r
+ DWORD fdwReason,\r
+ LPVOID lpReserved)\r
+{\r
+ return TRUE;\r
+}
\ No newline at end of file
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kill_python", "kill_python.vcproj", "{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"\r
EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}"\r
+ ProjectSection(ProjectDependencies) = postProject\r
+ {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}\r
+ EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xxlimited", "xxlimited.vcproj", "{F749B822-B489-4CA5-A3AD-CE078F5F338A}"\r
+EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
Debug|Win32 = Debug|Win32\r
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|Win32.Build.0 = Release|Win32\r
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.ActiveCfg = Release|x64\r
{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.Build.0 = Release|x64\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Debug|Win32.ActiveCfg = PGUpdate|Win32\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Debug|x64.ActiveCfg = PGUpdate|x64\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGInstrument|Win32.Build.0 = PGInstrument|Win32\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGInstrument|x64.ActiveCfg = PGInstrument|x64\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGUpdate|Win32.Build.0 = PGUpdate|Win32\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.PGUpdate|x64.ActiveCfg = PGUpdate|x64\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|Win32.ActiveCfg = Release|Win32\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|Win32.Build.0 = Release|Win32\r
+ {885D4898-D08D-4091-9C40-C700CFE3FC5A}.Release|x64.ActiveCfg = Release|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|Win32.ActiveCfg = PGUpdate|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|x64.ActiveCfg = PGUpdate|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Debug|x64.Build.0 = PGUpdate|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|Win32.Build.0 = PGInstrument|Win32\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|x64.ActiveCfg = PGInstrument|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGInstrument|x64.Build.0 = PGInstrument|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|Win32.Build.0 = PGUpdate|Win32\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|x64.ActiveCfg = PGUpdate|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.PGUpdate|x64.Build.0 = PGUpdate|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|Win32.ActiveCfg = Release|Win32\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|Win32.Build.0 = Release|Win32\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|x64.ActiveCfg = Release|x64\r
+ {F749B822-B489-4CA5-A3AD-CE078F5F338A}.Release|x64.Build.0 = Release|x64\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9,00"\r
+ Name="python3dll"\r
+ ProjectGUID="{885D4898-D08D-4091-9C40-C700CFE3FC5A}"\r
+ RootNamespace="python3dll"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ <Platform\r
+ Name="x64"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON3DLL_EXPORTS"\r
+ RuntimeLibrary="2"\r
+ BufferSecurityCheck="false"\r
+ EnableFunctionLevelLinking="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="..\PC\python32.lib"\r
+ OutputFile="$(OutDir)\python3.dll"\r
+ LinkIncremental="1"\r
+ IgnoreAllDefaultLibraries="true"\r
+ ModuleDefinitionFile="..\PC\python3.def"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="2"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ EntryPointSymbol="DllMain"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="$(OutDir)\python3.dll"\r
+ ModuleDefinitionFile="..\PC\python3.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGInstrument|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pginstrument.vsprops"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="python32.lib"\r
+ OutputFile="$(OutDir)\python3.dll"\r
+ ModuleDefinitionFile="..\PC\python3.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGInstrument|x64"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pginstrument.vsprops"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="$(OutDir)\python3.dll"\r
+ ModuleDefinitionFile="..\PC\python3.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGUpdate|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyproject.vsprops;.\release.vsprops;.\pgupdate.vsprops"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="python32.lib"\r
+ OutputFile="$(OutDir)\python3.dll"\r
+ ModuleDefinitionFile="..\PC\python3.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGUpdate|x64"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops;.\pgupdate.vsprops"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="$(OutDir)\python3.dll"\r
+ ModuleDefinitionFile="..\PC\python3.def"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath="..\PC\python3.def"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath="..\PC\python3dll.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+ >\r
+ <File\r
+ RelativePath="..\PC\python_nt.rc"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9,00"\r
+ Name="xxlimited"\r
+ ProjectGUID="{F749B822-B489-4CA5-A3AD-CE078F5F338A}"\r
+ RootNamespace="xxlimited"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ <Platform\r
+ Name="x64"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyd.vsprops"\r
+ CharacterSet="0"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="NDEBUG;_WIN32;_WINDLL;Py_LIMITED_API;$(NOINHERIT)"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="wsock32.lib"\r
+ IgnoreDefaultLibraryNames="libc"\r
+ BaseAddress="0x1D110000"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops"\r
+ CharacterSet="0"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="wsock32.lib"\r
+ IgnoreDefaultLibraryNames="libc"\r
+ BaseAddress="0x1D110000"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGInstrument|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyd.vsprops;.\pginstrument.vsprops"\r
+ CharacterSet="0"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="Py_LIMITED_API"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="wsock32.lib"\r
+ IgnoreDefaultLibraryNames="libc"\r
+ BaseAddress="0x1D110000"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGInstrument|x64"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"\r
+ CharacterSet="0"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="wsock32.lib"\r
+ IgnoreDefaultLibraryNames="libc"\r
+ BaseAddress="0x1D110000"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGUpdate|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyd.vsprops;.\pgupdate.vsprops"\r
+ CharacterSet="0"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="Py_LIMITED_API"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="wsock32.lib"\r
+ IgnoreDefaultLibraryNames="libc"\r
+ BaseAddress="0x1D110000"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="PGUpdate|x64"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets=".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"\r
+ CharacterSet="0"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ AdditionalDependencies="wsock32.lib"\r
+ IgnoreDefaultLibraryNames="libc"\r
+ BaseAddress="0x1D110000"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ >\r
+ <File\r
+ RelativePath="..\Modules\xxlimited.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
"code object passed to eval() may not contain free variables");
return NULL;
}
- return PyEval_EvalCode((PyCodeObject *) cmd, globals, locals);
+ return PyEval_EvalCode(cmd, globals, locals);
}
cf.cf_flags = PyCF_SOURCE_IS_UTF8;
"contain free variables");
return NULL;
}
- v = PyEval_EvalCode((PyCodeObject *) prog, globals, locals);
+ v = PyEval_EvalCode(prog, globals, locals);
}
else {
char *str;
PyObject *
-PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
+PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
{
return PyEval_EvalCodeEx(co,
globals, locals,
the test in the if statements in Misc/gdbinit (pystack and pystackv). */
PyObject *
-PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
+PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
PyObject **args, int argcount, PyObject **kws, int kwcount,
PyObject **defs, int defcount, PyObject *kwdefs, PyObject *closure)
{
+ PyCodeObject* co = (PyCodeObject*)_co;
register PyFrameObject *f;
register PyObject *retval = NULL;
register PyObject **fastlocals, **freevars;
d = &PyTuple_GET_ITEM(argdefs, 0);
nd = Py_SIZE(argdefs);
}
- return PyEval_EvalCodeEx(co, globals,
+ return PyEval_EvalCodeEx((PyObject*)co, globals,
(PyObject *)NULL, (*pp_stack)-n, na,
(*pp_stack)-2*nk, nk, d, nd, kwdefs,
PyFunction_GET_CLOSURE(func));
#else /* !__VMS */
{"." SOABI ".so", "rb", C_EXTENSION},
{"module." SOABI ".so", "rb", C_EXTENSION},
+ {".abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
+ {"module.abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
{".so", "rb", C_EXTENSION},
{"module.so", "rb", C_EXTENSION},
#endif /* __VMS */
!strncmp(import_name,"python",6)) {
char *pch;
+#ifndef _DEBUG
+ /* In a release version, don't claim that python3.dll is
+ a Python DLL. */
+ if (strcmp(import_name, "python3.dll") == 0) {
+ import_data += 20;
+ continue;
+ }
+#endif
+
/* Ensure python prefix is followed only
by numbers to the end of the basename */
pch = import_name + 6;
return NULL;
}
-
dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
const char *pathname, FILE *fp)
{
dl_funcptr p;
char funcname[258], *import_python;
+#ifndef _DEBUG
+ _Py_CheckPython3();
+#endif
+
PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname);
{
PyErr_Clear(); /* Not important enough to report */
Py_DECREF(v);
- v = PyEval_EvalCode((PyCodeObject *)co, d, d);
+ v = PyEval_EvalCode(co, d, d);
if (v == NULL)
goto error;
Py_DECREF(v);
co = PyAST_Compile(mod, filename, flags, arena);
if (co == NULL)
return NULL;
- v = PyEval_EvalCode(co, globals, locals);
+ v = PyEval_EvalCode((PyObject*)co, globals, locals);
Py_DECREF(co);
return v;
}
return NULL;
}
co = (PyCodeObject *)v;
- v = PyEval_EvalCode(co, globals, locals);
+ v = PyEval_EvalCode((PyObject*)co, globals, locals);
if (v && flags)
flags->cf_flags |= (co->co_flags & PyCF_MASK);
Py_DECREF(co);
return (PyObject *)co;
}
+/* For use in Py_LIMITED_API */
+#undef Py_CompileString
+PyObject *
+PyCompileString(const char *str, const char *filename, int start)
+{
+ return Py_CompileStringFlags(str, filename, start, NULL);
+}
+
struct symtable *
Py_SymtableString(const char *str, const char *filename, int start)
{
--- /dev/null
+# This script converts a C file to use the PEP 384 type definition API
+# Usage: abitype.py < old_code > new_code
+import re, sys
+
+############ Simplistic C scanner ##################################
+tokenizer = re.compile(
+ r"(?P<preproc>#.*\n)"
+ r"|(?P<comment>/\*.*?\*/)"
+ r"|(?P<ident>[a-zA-Z_][a-zA-Z0-9_]*)"
+ r"|(?P<ws>[ \t\n]+)"
+ r"|(?P<other>.)",
+ re.MULTILINE)
+
+tokens = []
+source = sys.stdin.read()
+pos = 0
+while pos != len(source):
+ m = tokenizer.match(source, pos)
+ tokens.append([m.lastgroup, m.group()])
+ pos += len(tokens[-1][1])
+ if tokens[-1][0] == 'preproc':
+ # continuation lines are considered
+ # only in preprocess statements
+ while tokens[-1][1].endswith('\\\n'):
+ nl = source.find('\n', pos)
+ if nl == -1:
+ line = source[pos:]
+ else:
+ line = source[pos:nl+1]
+ tokens[-1][1] += line
+ pos += len(line)
+
+###### Replacement of PyTypeObject static instances ##############
+
+# classify each token, giving it a one-letter code:
+# S: static
+# T: PyTypeObject
+# I: ident
+# W: whitespace
+# =, {, }, ; : themselves
+def classify():
+ res = []
+ for t,v in tokens:
+ if t == 'other' and v in "={};":
+ res.append(v)
+ elif t == 'ident':
+ if v == 'PyTypeObject':
+ res.append('T')
+ elif v == 'static':
+ res.append('S')
+ else:
+ res.append('I')
+ elif t == 'ws':
+ res.append('W')
+ else:
+ res.append('.')
+ return ''.join(res)
+
+# Obtain a list of fields of a PyTypeObject, in declaration order,
+# skipping ob_base
+# All comments are dropped from the variable (which are typically
+# just the slot names, anyway), and information is discarded whether
+# the original type was static.
+def get_fields(start, real_end):
+ pos = start
+ # static?
+ if tokens[pos][1] == 'static':
+ pos += 2
+ # PyTypeObject
+ pos += 2
+ # name
+ name = tokens[pos][1]
+ pos += 1
+ while tokens[pos][1] != '{':
+ pos += 1
+ pos += 1
+ # PyVarObject_HEAD_INIT
+ while tokens[pos][0] in ('ws', 'comment'):
+ pos += 1
+ if tokens[pos][1] != 'PyVarObject_HEAD_INIT':
+ raise Exception, '%s has no PyVarObject_HEAD_INIT' % name
+ while tokens[pos][1] != ')':
+ pos += 1
+ pos += 1
+ # field definitions: various tokens, comma-separated
+ fields = []
+ while True:
+ while tokens[pos][0] in ('ws', 'comment'):
+ pos += 1
+ end = pos
+ while tokens[end][1] not in ',}':
+ if tokens[end][1] == '(':
+ nesting = 1
+ while nesting:
+ end += 1
+ if tokens[end][1] == '(': nesting+=1
+ if tokens[end][1] == ')': nesting-=1
+ end += 1
+ assert end < real_end
+ # join field, excluding separator and trailing ws
+ end1 = end-1
+ while tokens[end1][0] in ('ws', 'comment'):
+ end1 -= 1
+ fields.append(''.join(t[1] for t in tokens[pos:end1+1]))
+ if tokens[end][1] == '}':
+ break
+ pos = end+1
+ return name, fields
+
+# List of type slots as of Python 3.2, omitting ob_base
+typeslots = [
+ 'tp_name',
+ 'tp_basicsize',
+ 'tp_itemsize',
+ 'tp_dealloc',
+ 'tp_print',
+ 'tp_getattr',
+ 'tp_setattr',
+ 'tp_reserved',
+ 'tp_repr',
+ 'tp_as_number',
+ 'tp_as_sequence',
+ 'tp_as_mapping',
+ 'tp_hash',
+ 'tp_call',
+ 'tp_str',
+ 'tp_getattro',
+ 'tp_setattro',
+ 'tp_as_buffer',
+ 'tp_flags',
+ 'tp_doc',
+ 'tp_traverse',
+ 'tp_clear',
+ 'tp_richcompare',
+ 'tp_weaklistoffset',
+ 'tp_iter',
+ 'iternextfunc',
+ 'tp_methods',
+ 'tp_members',
+ 'tp_getset',
+ 'tp_base',
+ 'tp_dict',
+ 'tp_descr_get',
+ 'tp_descr_set',
+ 'tp_dictoffset',
+ 'tp_init',
+ 'tp_alloc',
+ 'tp_new',
+ 'tp_free',
+ 'tp_is_gc',
+ 'tp_bases',
+ 'tp_mro',
+ 'tp_cache',
+ 'tp_subclasses',
+ 'tp_weaklist',
+ 'tp_del'
+ 'tp_version_tag'
+]
+
+# Generate a PyType_Spec definition
+def make_slots(name, fields):
+ res = []
+ res.append('static PyType_Slot %s_slots[] = {' % name)
+ # defaults for spec
+ spec = { 'tp_doc':'NULL', 'tp_itemsize':'0' }
+ for i, val in enumerate(fields):
+ if val.endswith('0'):
+ continue
+ if typeslots[i] in ('tp_name', 'tp_doc', 'tp_basicsize',
+ 'tp_itemsize', 'tp_flags'):
+ spec[typeslots[i]] = val
+ continue
+ res.append(' {Py_%s, %s},' % (typeslots[i], val))
+ res.append('};')
+ res.append('static PyType_Spec %s_spec = {' % name)
+ res.append(' %s,' % spec['tp_name'])
+ res.append(' %s,' % spec['tp_doc'])
+ res.append(' %s,' % spec['tp_basicsize'])
+ res.append(' %s,' % spec['tp_itemsize'])
+ res.append(' %s,' % spec['tp_flags'])
+ res.append(' %s_slots,' % name)
+ res.append('};\n')
+ return '\n'.join(res)
+
+
+# Main loop: replace all static PyTypeObjects until
+# there are none left.
+while 1:
+ c = classify()
+ m = re.search('(SW)?TWIW?=W?{.*?};', c)
+ if not m:
+ break
+ start = m.start()
+ end = m.end()
+ name, fields = get_fields(start, m)
+ tokens[start:end] = [('',make_slots(name, fields))]
+
+# Output result to stdout
+for t, v in tokens:
+ sys.stdout.write(v)
## # Uncomment these lines if you want to play with xxmodule.c
## ext = Extension('xx', ['xxmodule.c'])
## self.extensions.append(ext)
+ ext = Extension('xxlimited', ['xxlimited.c'],
+ define_macros=[('Py_LIMITED_API', 1)])
+ self.extensions.append(ext)
# XXX handle these, but how to detect?
# *** Uncomment and edit for PIL (TkImaging) extension only: