Commits

ariovistus committed 55b521b

goodbye, old python deimos headers!

  • Participants
  • Parent commits 17bebb4

Comments (0)

Files changed (67)

File infrastructure/python/python2/abstract_.d

-module python2.abstract_;
-
-import util.conv;
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/abstract.h:
-
-// D translations of C macros:
-/// _
-int PyObject_DelAttrString()(PyObject* o, Char1 *a) {
-    return PyObject_SetAttrString(o, a, null);
-}
-/// _
-int PyObject_DelAttr()(PyObject* o, PyObject* a) {
-    return PyObject_SetAttr(o, a, null);
-}
-
-/// _
-int PyObject_Cmp(PyObject* o1, PyObject* o2, int *result);
-
-/////////////////////////////////////////////////////////////////////////////
-// CALLABLES
-/////////////////////////////////////////////////////////////////////////////
-int PyCallable_Check(PyObject* o);
-
-/// _
-PyObject* PyObject_Call(PyObject* callable_object, PyObject* args, PyObject* kw);
-/// _
-PyObject* PyObject_CallObject(PyObject* callable_object, PyObject* args);
-/// _
-PyObject* PyObject_CallFunction(PyObject* callable_object, char* format, ...);
-/// _
-PyObject* PyObject_CallMethod(PyObject* o, char* m, char* format, ...);
-/// _
-PyObject* PyObject_CallFunctionObjArgs(PyObject* callable, ...);
-/// _
-PyObject* PyObject_CallMethodObjArgs(PyObject* o,PyObject* m, ...);
-
-/////////////////////////////////////////////////////////////////////////////
-// GENERIC
-/////////////////////////////////////////////////////////////////////////////
-PyObject* PyObject_Type(PyObject* o);
-
-/////////////////////////////////////////////////////////////////////////////
-// CONTAINERS
-/////////////////////////////////////////////////////////////////////////////
-
-Py_ssize_t PyObject_Size(PyObject* o);
-//int PyObject_Length(PyObject* o);
-/// _
-alias PyObject_Size PyObject_Length;
-/// _
-version(Python_2_6_Or_Later){
-    Py_ssize_t _PyObject_LengthHint(PyObject*, Py_ssize_t);
-}else version(Python_2_5_Or_Later){
-    Py_ssize_t _PyObject_LengthHint(PyObject*);
-}
-
-/// _
-PyObject* PyObject_GetItem(PyObject* o, PyObject* key);
-/// _
-int PyObject_SetItem(PyObject* o, PyObject* key, PyObject* v);
-/// _
-int PyObject_DelItemString(PyObject* o, char* key);
-/// _
-int PyObject_DelItem(PyObject* o, PyObject* key);
-/// _
-
-int PyObject_AsCharBuffer(PyObject* obj, const(char)** buffer, 
-        Py_ssize_t* buffer_len);
-/// _
-int PyObject_CheckReadBuffer(PyObject* obj);
-/// _
-int PyObject_AsReadBuffer(PyObject* obj, void** buffer, Py_ssize_t* buffer_len);
-/// _
-int PyObject_AsWriteBuffer(PyObject* obj, void** buffer, Py_ssize_t* buffer_len);
-/// _
-
-version(Python_2_6_Or_Later){
-    /* new buffer API */
-
-    int PyObject_CheckBuffer()(PyObject* obj){
-        return (obj.ob_type.tp_as_buffer !is null) &&
-            PyType_HasFeature(obj.ob_type, Py_TPFLAGS_HAVE_NEWBUFFER) &&
-            (obj.ob_type.tp_as_buffer.bf_getbuffer !is null);
-    }
-
-    /* Return 1 if the getbuffer function is available, otherwise
-       return 0 */
-
-/// _
-    int PyObject_GetBuffer(PyObject* obj, Py_buffer* view,
-            int flags);
-
-    /* This is a C-API version of the getbuffer function call.  It checks
-       to make sure object has the required function pointer and issues the
-       call.  Returns -1 and raises an error on failure and returns 0 on
-       success
-     */
-
-
-/// _
-    void* PyBuffer_GetPointer(Py_buffer* view, Py_ssize_t* indices);
-
-    /* Get the memory area pointed to by the indices for the buffer given.
-       Note that view->ndim is the assumed size of indices
-     */
-
-/// _
-    int PyBuffer_SizeFromFormat(const(char) *);
-
-    /* Return the implied itemsize of the data-format area from a
-       struct-style description */
-
-
-
-/// _
-    int PyBuffer_ToContiguous(void* buf, Py_buffer* view,
-            Py_ssize_t len, char fort);
-
-/// _
-    int PyBuffer_FromContiguous(Py_buffer* view, void* buf,
-            Py_ssize_t len, char fort);
-
-
-    /* Copy len bytes of data from the contiguous chunk of memory
-       pointed to by buf into the buffer exported by obj.  Return
-       0 on success and return -1 and raise a PyBuffer_Error on
-       error (i.e. the object does not have a buffer interface or
-       it is not working).
-
-       If fort is 'F' and the object is multi-dimensional,
-       then the data will be copied into the array in
-       Fortran-style (first dimension varies the fastest).  If
-       fort is 'C', then the data will be copied into the array
-       in C-style (last dimension varies the fastest).  If fort
-       is 'A', then it does not matter and the copy will be made
-       in whatever way is more efficient.
-
-     */
-
-/// _
-    int PyObject_CopyData(PyObject* dest, PyObject* src);
-
-    /* Copy the data from the src buffer to the buffer of destination
-     */
-
-/// _
-    int PyBuffer_IsContiguous(Py_buffer* view, char fort);
-
-
-/// _
-    void PyBuffer_FillContiguousStrides(int ndims,
-            Py_ssize_t* shape,
-            Py_ssize_t* strides,
-            int itemsize,
-            char fort);
-
-    /*  Fill the strides array with byte-strides of a contiguous
-        (Fortran-style if fort is 'F' or C-style otherwise)
-        array of the given shape with the given number of bytes
-        per element.
-     */
-
-/// _
-    int PyBuffer_FillInfo(Py_buffer* view, PyObject* o, void* buf,
-            Py_ssize_t len, int readonly,
-            int flags);
-
-    /* Fills in a buffer-info structure correctly for an exporter
-       that can only share a contiguous chunk of memory of
-       "unsigned bytes" of the given length. Returns 0 on success
-       and -1 (with raising an error) on error.
-     */
-
-/// _
-    void PyBuffer_Release(Py_buffer* view);
-
-    /* Releases a Py_buffer obtained from getbuffer ParseTuple's s*.
-     */
-
-/// _
-    PyObject* PyObject_Format(PyObject* obj,
-            PyObject* format_spec);
-    /*
-       Takes an arbitrary object and returns the result of
-       calling obj.__format__(format_spec).
-     */
-
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// ITERATORS
-/////////////////////////////////////////////////////////////////////////////
-PyObject* PyObject_GetIter(PyObject*);
-
-// D translation of C macro:
-/// _
-int PyIter_Check()(PyObject* obj) {
-    return PyType_HasFeature(obj.ob_type, Py_TPFLAGS_HAVE_ITER)
-        && obj.ob_type.tp_iternext != null;
-}
-
-/// _
-PyObject* PyIter_Next(PyObject*);
-
-/////////////////////////////////////////////////////////////////////////////
-// NUMBERS
-/////////////////////////////////////////////////////////////////////////////
-
-int PyNumber_Check(PyObject* o);
-
-/// _
-PyObject* PyNumber_Add(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Subtract(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Multiply(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Divide(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_FloorDivide(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_TrueDivide(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Remainder(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Divmod(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Power(PyObject* o1, PyObject* o2, PyObject* o3);
-/// _
-PyObject* PyNumber_Negative(PyObject* o);
-/// _
-PyObject* PyNumber_Positive(PyObject* o);
-/// _
-PyObject* PyNumber_Absolute(PyObject* o);
-/// _
-PyObject* PyNumber_Invert(PyObject* o);
-/// _
-PyObject* PyNumber_Lshift(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Rshift(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_And(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Xor(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_Or(PyObject* o1, PyObject* o2);
-
-/// _
-version(Python_2_5_Or_Later){
-    int PyIndex_Check()(PyObject* obj) {
-        return obj.ob_type.tp_as_number !is null &&
-            PyType_HasFeature(obj.ob_type, Py_TPFLAGS_HAVE_INDEX) &&
-            obj.ob_type.tp_as_number.nb_index !is null;
-    }
-/// _
-    PyObject* PyNumber_Index(PyObject* o);
-/// _
-    Py_ssize_t PyNumber_AsSsize_t(PyObject* o, PyObject* exc);
-}
-version(Python_2_6_Or_Later){
-    /*
-       Returns the Integral instance converted to an int. The
-       instance is expected to be int or long or have an __int__
-       method. Steals integral's reference. error_format will be
-       used to create the TypeError if integral isn't actually an
-       Integral instance. error_format should be a format string
-       that can accept a char* naming integral's type.
-     */
-
-    PyObject*  _PyNumber_ConvertIntegralToInt(
-            PyObject* integral,
-            const(char)* error_format);
-}
-
-/// _
-PyObject* PyNumber_Int(PyObject* o);
-/// _
-PyObject* PyNumber_Long(PyObject* o);
-/// _
-PyObject* PyNumber_Float(PyObject* o);
-/// _
-PyObject* PyNumber_InPlaceAdd(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceSubtract(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceMultiply(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceDivide(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceFloorDivide(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceTrueDivide(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceRemainder(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlacePower(PyObject* o1, PyObject* o2, PyObject* o3);
-/// _
-PyObject* PyNumber_InPlaceLshift(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceRshift(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceAnd(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceXor(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PyNumber_InPlaceOr(PyObject* o1, PyObject* o2);
-/// _
-version(Python_2_6_Or_Later){
-    PyObject* PyNumber_ToBase(PyObject* n, int base);
-
-    /*
-       Returns the integer n converted to a string with a base, with a base
-       marker of 0b, 0o or 0x prefixed if applicable.
-       If n is not an int object, it is converted with PyNumber_Index first.
-     */
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// SEQUENCES
-/////////////////////////////////////////////////////////////////////////////
-
-int PySequence_Check(PyObject* o);
-/// _
-Py_ssize_t PySequence_Size(PyObject* o);
-/// _
-alias PySequence_Size PySequence_Length;
-/// _
-PyObject* PySequence_Concat(PyObject* o1, PyObject* o2);
-/// _
-PyObject* PySequence_Repeat(PyObject* o, Py_ssize_t count);
-/// _
-PyObject* PySequence_GetItem(PyObject* o, Py_ssize_t i);
-/// _
-PyObject* PySequence_GetSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2);
-/// _
-int PySequence_SetItem(PyObject* o, Py_ssize_t i, PyObject* v);
-/// _
-int PySequence_DelItem(PyObject* o, Py_ssize_t i);
-/// _
-int PySequence_SetSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2, PyObject* v);
-/// _
-int PySequence_DelSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2);
-/// _
-PyObject* PySequence_Tuple(PyObject* o);
-/// _
-PyObject* PySequence_List(PyObject* o);
-/// _
-PyObject* PySequence_Fast(PyObject* o,  const(char)* m);
-// D translations of C macros:
-/// _
-Py_ssize_t PySequence_Fast_GET_SIZE()(PyObject* o) {
-    return PyList_Check(o) ? cast(Py_ssize_t) PyList_GET_SIZE(o) :
-        cast(Py_ssize_t) PyTuple_GET_SIZE(o);
-}
-/// _
-PyObject* PySequence_Fast_GET_ITEM()(PyObject* o, Py_ssize_t i) {
-    return PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i);
-}
-/// _
-PyObject* PySequence_ITEM()(PyObject* o, Py_ssize_t i) {
-    return o.ob_type.tp_as_sequence.sq_item(o, i);
-}
-/// _
-PyObject** PySequence_Fast_ITEMS()(PyObject* sf) {
-    return
-        PyList_Check(sf) ?
-        (cast(PyListObject *)sf).ob_item
-        : (cast(PyTupleObject *)sf).ob_item
-        ;
-}
-/// _
-Py_ssize_t PySequence_Count(PyObject* o, PyObject* value);
-/// _
-enum PySequence_Contains(PyObject* seq, PyObject* ob);
-/// _
-enum PY_ITERSEARCH_COUNT    = 1;
-/// _
-enum PY_ITERSEARCH_INDEX    = 2;
-/// _
-enum PY_ITERSEARCH_CONTAINS = 3;
-/// _
-Py_ssize_t _PySequence_IterSearch(PyObject* seq, PyObject* obj, int operation);
-/// _
-alias PySequence_Contains PySequence_In;
-/// _
-Py_ssize_t PySequence_Index(PyObject* o, PyObject* value);
-/// _
-PyObject*  PySequence_InPlaceConcat(PyObject* o1, PyObject* o2);
-/// _
-PyObject*  PySequence_InPlaceRepeat(PyObject* o, Py_ssize_t count);
-
-/////////////////////////////////////////////////////////////////////////////
-// MAPPINGS
-/////////////////////////////////////////////////////////////////////////////
-int PyMapping_Check(PyObject* o);
-/// _
-Py_ssize_t PyMapping_Size(PyObject* o);
-/// _
-alias PyMapping_Size PyMapping_Length;
-
-// D translations of C macros:
-/// _
-int PyMapping_DelItemString()(PyObject* o, char* k) {
-    return PyObject_DelItemString(o, k);
-}
-/// _
-int PyMapping_DelItem()(PyObject* o, PyObject* k) {
-    return PyObject_DelItem(o, k);
-}
-/// _
-int PyMapping_HasKeyString(PyObject* o, char* key);
-/// _
-int PyMapping_HasKey(PyObject* o, PyObject* key);
-
-// D translations of C macros:
-/// _
-PyObject* PyMapping_Keys()(PyObject* o) {
-    return PyObject_CallMethod(o, zc("keys"), null);
-}
-/// _
-PyObject* PyMapping_Values()(PyObject* o) {
-    return PyObject_CallMethod(o, zc("values"), null);
-}
-/// _
-PyObject* PyMapping_Items()(PyObject* o) {
-    return PyObject_CallMethod(o, zc("items"), null);
-}
-/// _
-PyObject* PyMapping_GetItemString(PyObject* o, char* key);
-/// _
-int PyMapping_SetItemString(PyObject* o, char* key, PyObject* value);
-
-/////////////////////////////////////////////////////////////////////////////
-// GENERIC
-/////////////////////////////////////////////////////////////////////////////
-int PyObject_IsInstance(PyObject* object, PyObject* typeorclass);
-/// _
-int PyObject_IsSubclass(PyObject* object, PyObject* typeorclass);
-/// _
-version(Python_2_6_Or_Later){
-    int _PyObject_RealIsInstance(PyObject* inst, PyObject* cls);
-/// _
-    int _PyObject_RealIsSubclass(PyObject* derived, PyObject* cls);
-}
-
-

File infrastructure/python/python2/ast.d

-module python2.ast;
-
-import python2.compile;
-import python2.pyarena;
-
-extern(C): version(Python_2_5_Or_Later):
-
-alias _mod* mod_ty;
-
-version(Python_2_5_Or_Later){
-    mod_ty* PyAST_FromNode(const(node)*, PyCompilerFlags*, const(char)*, 
-            PyArena*);
-}

File infrastructure/python/python2/boolobject.d

-module python2.boolobject;
-
-import python2.types;
-import python2.object;
-import python2.intobject;
-
-extern(C):
-// Python-header-file: Include/boolobject.h:
-
-alias PyIntObject PyBoolObject;
-
-__gshared PyTypeObject PyBool_Type;
-
-// D translation of C macro:
-int PyBool_Check()(PyObject* x) {
-    return x.ob_type == &PyBool_Type;
-}
-
-__gshared PyIntObject _Py_ZeroStruct;
-__gshared PyIntObject _Py_TrueStruct;
-
-@property PyIntObject* Py_True()() {
-    return &_Py_TrueStruct;
-}
-@property PyIntObject* Py_False()() {
-    return &_Py_ZeroStruct;
-}
-
-PyObject* PyBool_FromLong(C_long);
-
-

File infrastructure/python/python2/bufferobject.d

-module python2.bufferobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/bufferobject.h:
-
-__gshared PyTypeObject PyBuffer_Type;
-
-// D translation of C macro:
-int PyBuffer_Check()(PyObject* op) {
-    return op.ob_type == &PyBuffer_Type;
-}
-
-enum Py_END_OF_BUFFER = -1;
-
-PyObject* PyBuffer_FromObject(PyObject* base, Py_ssize_t offset, Py_ssize_t size);
-PyObject* PyBuffer_FromReadWriteObject(PyObject* base, Py_ssize_t offset, Py_ssize_t size);
-
-PyObject* PyBuffer_FromMemory(void* ptr, Py_ssize_t size);
-PyObject* PyBuffer_FromReadWriteMemory(void* ptr, Py_ssize_t size);
-
-PyObject* PyBuffer_New(Py_ssize_t size);
-
-

File infrastructure/python/python2/bytearrayobject.d

-module python2.bytearrayobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/bytearrayobject.h:
-
-version(Python_2_6_Or_Later) {
-    struct PyByteArrayObject {
-        mixin PyObject_VAR_HEAD!();
-        int ob_exports;
-        Py_ssize_t ob_alloc;
-        char* ob_bytes;
-    }
-
-    /* Type object */
-    alias lazy_load!(builtins, m_PyBool_Type_p, "bytearray") PyByteArray_Type_p;
-    PyTypeObject PyByteArrayIter_Type;
-
-    /* Type check macros */
-    int PyByteArray_Check()(PyObject* self) {
-        return PyObject_TypeCheck(self, PyByteArray_Type_p);
-    }
-
-    int PyByteArray_CheckExact()(PyObject* self) {
-        return Py_TYPE(self) == PyByteArray_Type_p;
-    }
-
-    /* Direct API functions */
-    PyObject* PyByteArray_FromObject(PyObject*);
-    PyObject* PyByteArray_Concat(PyObject*, PyObject*);
-    PyObject* PyByteArray_FromStringAndSize(const char*, Py_ssize_t);
-    Py_ssize_t PyByteArray_Size(PyObject*);
-    char* PyByteArray_AsString(PyObject*);
-    int PyByteArray_Resize(PyObject*, Py_ssize_t);
-
-    char* PyByteArray_AS_STRING()(PyObject* self) {
-        assert(PyByteArray_Check(self));
-        if(Py_SIZE(self)) {
-            return (cast(PyByteArrayObject*) self).ob_bytes;
-        }else{
-            return "\0".ptr;
-        }
-    }
-
-    auto PyByteArray_GET_SIZE(PyObject* self) {
-        assert(PyByteArray_Check(self));
-        return Py_SIZE(self);
-    }
-
-
-
-}

File infrastructure/python/python2/cStringIO.d

-module python2.cStringIO;
-
-import util.conv;
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/cStringIO.h:
-
-PycStringIO_CAPI *PycStringIO = null;
-
-PycStringIO_CAPI *PycString_IMPORT()() {
-    if (PycStringIO == null) {
-        PycStringIO = cast(PycStringIO_CAPI *)
-            PyCObject_Import(zc("cStringIO"), zc("cStringIO_CAPI"));
-    }
-    return PycStringIO;
-}
-
-struct PycStringIO_CAPI {
-    int function(PyObject*, char**, Py_ssize_t) cread;
-    int function(PyObject*, char**) creadline;
-    int function(PyObject*, Char1*, Py_ssize_t) cwrite;
-    PyObject* function(PyObject*) cgetvalue;
-    PyObject* function(int) NewOutput;
-    PyObject* function(PyObject*) NewInput;
-    PyTypeObject* InputType;
-    PyTypeObject* OutputType;
-}
-
-// D translations of C macros:
-int PycStringIO_InputCheck()(PyObject* o) {
-    return Py_TYPE(o) == PycStringIO.InputType;
-}
-int PycStringIO_OutputCheck()(PyObject* o) {
-    return Py_TYPE(o) == PycStringIO.OutputType;
-}
-
-

File infrastructure/python/python2/cellobject.d

-module python2.cellobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-
-// Python-header-file: Include/cellobject.h:
-
-struct PyCellObject {
-    mixin PyObject_HEAD;
-
-    PyObject *ob_ref;
-}
-
-__gshared PyTypeObject PyCell_Type;
-
-// D translation of C macro:
-int PyCell_Check()(PyObject *op) {
-    return Py_TYPE(op) == &PyCell_Type;
-}
-
-PyObject* PyCell_New(PyObject*);
-PyObject* PyCell_Get(PyObject*);
-int PyCell_Set(PyObject*, PyObject*);
-
-int PyCell_GET()(PyObject* op) {
-    return (cast(PyCellObject*)op).ob_ref;
-}
-int PyCell_SET()(PyObject* op, PyObject* v) {
-    (cast(PyCellObject*)op).ob_ref = v;
-}
-

File infrastructure/python/python2/ceval.d

-module python2.ceval;
-
-import python2.types;
-import python2.object;
-import python2.frameobject;
-import python2.pystate;
-import python2.pythonrun;
-
-extern(C):
-// Python-header-file: Include/ceval.h:
-
-PyObject* PyEval_CallObjectWithKeywords(PyObject* , PyObject* , PyObject* );
-version(Python_2_5_Or_Later){
-    PyObject* PyEval_CallObject()(PyObject* func, PyObject* arg) {
-        return PyEval_CallObjectWithKeywords(func, arg, null);
-    }
-}else{
-    PyObject* PyEval_CallObject(PyObject* , PyObject* );
-}
-PyObject* PyEval_CallFunction(PyObject* obj, Char1* format, ...);
-PyObject* PyEval_CallMethod(PyObject* obj, Char1* methodname, Char1* format, ...);
-
-void PyEval_SetProfile(Py_tracefunc, PyObject*);
-void PyEval_SetTrace(Py_tracefunc, PyObject*);
-
-Borrowed!PyObject* PyEval_GetBuiltins();
-Borrowed!PyObject* PyEval_GetGlobals();
-Borrowed!PyObject* PyEval_GetLocals();
-Borrowed!PyFrameObject* PyEval_GetFrame();
-int PyEval_GetRestricted();
-
-int PyEval_MergeCompilerFlags(PyCompilerFlags* cf);
-int Py_FlushLine();
-int Py_AddPendingCall(int function(void*) func, void* arg);
-int Py_MakePendingCalls();
-
-void Py_SetRecursionLimit(int);
-int Py_GetRecursionLimit();
-
-// The following API members are undocumented, so they're omitted here:
-// Py_EnterRecursiveCall
-// Py_LeaveRecursiveCall
-// _Py_CheckRecursiveCall
-// _Py_CheckRecursionLimit
-// _Py_MakeRecCheck
-
-Char1* PyEval_GetFuncName(PyObject*);
-Char1* PyEval_GetFuncDesc(PyObject*);
-
-PyObject* PyEval_GetCallStats(PyObject*);
-PyObject* PyEval_EvalFrame(PyFrameObject*);
-version(Python_2_5_Or_Later){
-    PyObject* PyEval_EvalFrameEx(PyFrameObject*, int);
-}
-
-__gshared /*volatile*/ int _Py_Ticker;
-__gshared int _Py_CheckInterval;
-
-PyThreadState* PyEval_SaveThread();
-void PyEval_RestoreThread(PyThreadState*);
-

File infrastructure/python/python2/classobject.d

-module python2.classobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/classobject.h:
-
-struct PyClassObject {
-    mixin PyObject_HEAD;
-
-    PyObject*	cl_bases;	/* A tuple of class objects */
-    PyObject*	cl_dict;	/* A dictionary */
-    PyObject*	cl_name;	/* A string */
-    /* The following three are functions or null */
-    PyObject*	cl_getattr;
-    PyObject*	cl_setattr;
-    PyObject*	cl_delattr;
-}
-
-struct PyInstanceObject {
-    mixin PyObject_HEAD;
-
-    PyClassObject* in_class;
-    PyObject*	  in_dict;
-    PyObject*	  in_weakreflist;
-}
-
-struct PyMethodObject {
-    mixin PyObject_HEAD;
-
-    PyObject* im_func;
-    PyObject* im_self;
-    PyObject* im_class;
-    PyObject* im_weakreflist;
-}
-
-__gshared PyTypeObject PyClass_Type, PyInstance_Type, PyMethod_Type;
-
-// D translation of C macro:
-int PyClass_Check()(PyObject *op) {
-    return Py_TYPE(op) == &PyClass_Type;
-}
-
-// D translation of C macro:
-int PyInstance_Check()(PyObject *op) {
-    return Py_TYPE(op) == &PyInstance_Type;
-}
-
-// &PyMethod_Type is accessible via PyMethod_Type_p.
-// D translation of C macro:
-int PyMethod_Check()(PyObject *op) {
-    return Py_TYPE(op) == &PyMethod_Type;
-}
-
-PyObject* PyClass_New(PyObject*, PyObject*, PyObject*);
-PyObject* PyInstance_New(PyObject*, PyObject*, PyObject*);
-PyObject* PyInstance_NewRaw(PyObject*, PyObject*);
-PyObject* PyMethod_New(PyObject*, PyObject*, PyObject*);
-
-PyObject_BorrowedRef* PyMethod_Function(PyObject*);
-PyObject_BorrowedRef* PyMethod_Self(PyObject*);
-PyObject_BorrowedRef* PyMethod_Class(PyObject*);
-
-PyObject* _PyInstance_Lookup(PyObject* pinst, PyObject* name);
-
-PyObject_BorrowedRef* PyMethod_GET_FUNCTION()(PyObject* meth) {
-    return (cast(PyMethodObject*)meth).im_func;
-}
-PyObject_BorrowedRef* PyMethod_GET_SELF()(PyObject* meth) {
-    return (cast(PyMethodObject*)meth).im_self;
-}
-PyObject_BorrowedRef* PyMethod_GET_CLASS()(PyObject* meth) {
-    return borrowed((cast(PyMethodObject*)meth).im_class);
-}
-
-int PyClass_IsSubclass(PyObject*, PyObject*);
-
-version(Python_2_6_Or_Later){
-    int PyMethod_ClearFreeList();
-}
-
-

File infrastructure/python/python2/cobject.d

-module python2.cobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/cobject.h:
-
-// PyCObject_Type is a Python type for transporting an arbitrary C pointer
-// from the C level to Python and back (in essence, an opaque handle).
-
-__gshared PyTypeObject PyCObject_Type;
-
-// D translation of C macro:
-int PyCObject_Check()(PyObject *op) {
-    return Py_TYPE(op) == &PyCObject_Type;
-}
-
-PyObject* PyCObject_FromVoidPtr(void* cobj, void function(void*) destruct);
-PyObject* PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc,
-        void function(void*,void*) destruct);
-void* PyCObject_AsVoidPtr(PyObject*);
-void* PyCObject_GetDesc(PyObject*);
-void* PyCObject_Import(char* module_name, char* cobject_name);
-int PyCObject_SetVoidPtr(PyObject* self, void* cobj);
-
-version(Python_2_6_Or_Later){
-    struct PyCObject {
-        mixin PyObject_HEAD;
-        void* cobject;
-        void* desc;
-        void function(void*) destructor;
-    };
-}
-
-

File infrastructure/python/python2/code.d

-module python2.code;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/code.h:
-
-struct PyCodeObject { /* Bytecode object */
-    mixin PyObject_HEAD;
-
-    int co_argcount;
-    int co_nlocals;
-    int co_stacksize;
-    int co_flags;
-    PyObject* co_code;
-    PyObject* co_consts;
-    PyObject* co_names;
-    PyObject* co_varnames;
-    PyObject* co_freevars;
-    PyObject* co_cellvars;
-
-    PyObject* co_filename;
-    PyObject* co_name;
-    int co_firstlineno;
-    PyObject* co_lnotab;
-    version(Python_2_5_Or_Later) {
-        void *co_zombieframe;
-    }
-    version(Python_2_7_Or_Later) {
-        PyObject* co_weakreflist;
-    }
-
-}
-
-/* Masks for co_flags above */
-enum int CO_OPTIMIZED   = 0x0001;
-enum int CO_NEWLOCALS   = 0x0002;
-enum int CO_VARARGS     = 0x0004;
-enum int CO_VARKEYWORDS = 0x0008;
-enum int CO_NESTED      = 0x0010;
-enum int CO_GENERATOR   = 0x0020;
-enum int CO_NOFREE      = 0x0040;
-
-version(Python_2_5_Or_Later){
-    // Removed in 2.5
-}else{
-    enum int CO_GENERATOR_ALLOWED      = 0x1000;
-}
-enum int CO_FUTURE_DIVISION        = 0x2000;
-version(Python_2_5_Or_Later){
-    enum int CO_FUTURE_ABSOLUTE_IMPORT = 0x4000;
-    enum int CO_FUTURE_WITH_STATEMENT  = 0x8000;
-    enum int CO_FUTURE_PRINT_FUNCTION  = 0x10000;
-    enum int CO_FUTURE_UNICODE_LITERALS  = 0x20000;
-}
-
-enum int CO_MAXBLOCKS = 20;
-
-// &PyCode_Type is accessible via PyCode_Type_p.
-__gshared PyTypeObject PyCode_Type;
-
-// D translations of C macros:
-int PyCode_Check()(PyObject* op) {
-    return op.ob_type == &PyCode_Type;
-}
-size_t PyCode_GetNumFree()(PyObject* op) {
-    return PyObject_Length((cast(PyCodeObject *) op).co_freevars);
-}
-
-PyCodeObject* PyCode_New(
-        int, int, int, int, PyObject* , PyObject* , PyObject* , PyObject* ,
-        PyObject* , PyObject* , PyObject* , PyObject* , int, PyObject* );
-version(Python_2_7_Or_Later) {
-    PyCodeObject* PyCode_NewEmpty(const(char)* filename, 
-            const(char)* funcname, int firstlineno);
-}
-int PyCode_Addr2Line(PyCodeObject *, int);
-
-struct PyAddrPair {
-    int ap_lower;
-    int ap_upper;
-}
-
-int PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds);
-version(Python_2_6_Or_Later){
-    PyObject* PyCode_Optimize(PyObject* code, PyObject* consts,
-            PyObject* names, PyObject* lineno_obj);
-}
-

File infrastructure/python/python2/codecs.d

-module python2.codecs;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/codecs.h:
-
-int PyCodec_Register(PyObject* search_function);
-PyObject* _PyCodec_Lookup(const(char)* encoding);
-PyObject* PyCodec_Encode(PyObject* object, const(char)* encoding, const(char)* errors);
-PyObject* PyCodec_Decode(PyObject* object, const(char)* encoding, const(char)* errors);
-PyObject* PyCodec_Encoder(const(char)* encoding);
-PyObject* PyCodec_Decoder(const(char)* encoding);
-PyObject* PyCodec_StreamReader(const(char)* encoding, PyObject* stream, const(char)* errors);
-PyObject* PyCodec_StreamWriter(const(char)* encoding, PyObject* stream, const(char)* errors);
-
-/////////////////////////////////////////////////////////////////////////////
-// UNICODE ENCODING INTERFACE
-/////////////////////////////////////////////////////////////////////////////
-
-int PyCodec_RegisterError(const(char)* name, PyObject* error);
-PyObject* PyCodec_LookupError(const(char)* name);
-PyObject* PyCodec_StrictErrors(PyObject* exc);
-PyObject* PyCodec_IgnoreErrors(PyObject* exc);
-PyObject* PyCodec_ReplaceErrors(PyObject* exc);
-PyObject* PyCodec_XMLCharRefReplaceErrors(PyObject* exc);
-PyObject* PyCodec_BackslashReplaceErrors(PyObject* exc);
-
-

File infrastructure/python/python2/compile.d

-module python2.compile;
-
-import python2.code;
-import python2.node;
-import python2.pythonrun;
-
-extern(C):
-// Python-header-file: Include/compile.h:
-
-PyCodeObject* PyNode_Compile(node*, const(char)*);
-
-struct PyFutureFeatures {
-    version(Python_2_5_Or_Later){
-        int ff_features;
-        int ff_lineno;
-    }else{
-        int ff_found_docstring;
-        int ff_last_linno;
-        int ff_features;
-    }
-}
-
-version(Python_2_5_Or_Later){
-}else{
-    PyFutureFeatures *PyNode_Future(node*, const(char)*);
-    PyCodeObject *PyNode_CompileFlags(node*, const(char)*, PyCompilerFlags*);
-}
-
-enum FUTURE_NESTED_SCOPES = "nested_scopes";
-enum FUTURE_GENERATORS = "generators";
-enum FUTURE_DIVISION = "division";
-version(Python_2_5_Or_Later){
-    enum FUTURE_ABSOLUTE_IMPORT = "absolute_import";
-    enum FUTURE_WITH_STATEMENT = "with_statement";
-    version(Python_2_6_Or_Later){
-        enum FUTURE_PRINT_FUNCTION = "print_function";
-        enum FUTURE_UNICODE_LITERALS = "unicode_literals";
-    }
-
-    struct _mod; /* Declare the existence of this type */
-    PyCodeObject* PyAST_Compile(_mod*, const(char)*, PyCompilerFlags*, PyArena*);
-    PyFutureFeatures* PyFuture_FromAST(_mod*, const(char)*);
-}

File infrastructure/python/python2/complexobject.d

-module python2.complexobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/complexobject.h:
-
-struct Py_complex {
-    double real_; // real is the name of a D type, so must rename
-    double imag;
-}
-
-Py_complex c_sum(Py_complex, Py_complex);
-Py_complex c_diff(Py_complex, Py_complex);
-Py_complex c_neg(Py_complex);
-Py_complex c_prod(Py_complex, Py_complex);
-Py_complex c_quot(Py_complex, Py_complex);
-Py_complex c_pow(Py_complex, Py_complex);
-version(Python_2_6_Or_Later){
-    double c_abs(Py_complex);
-}
-
-struct PyComplexObject {
-    mixin PyObject_HEAD;
-
-    Py_complex cval;
-}
-
-__gshared PyTypeObject PyComplex_Type;
-
-// D translation of C macro:
-int PyComplex_Check()(PyObject *op) {
-    return PyObject_TypeCheck(op, &PyComplex_Type);
-}
-// D translation of C macro:
-int PyComplex_CheckExact()(PyObject *op) {
-    return Py_TYPE(op) == &PyComplex_Type;
-}
-
-PyObject* PyComplex_FromCComplex(Py_complex);
-PyObject* PyComplex_FromDoubles(double real_, double imag);
-
-double PyComplex_RealAsDouble(PyObject* op);
-double PyComplex_ImagAsDouble(PyObject* op);
-Py_complex PyComplex_AsCComplex(PyObject* op);
-
-

File infrastructure/python/python2/datetime.d

-module python2.datetime;
-import util.conv;
-import python2.object;
-import python2.types;
-
-extern(C):
-// Python-header-file: Include/datetime.h:
-
-enum _PyDateTime_DATE_DATASIZE = 4;
-enum _PyDateTime_TIME_DATASIZE = 6;
-enum _PyDateTime_DATETIME_DATASIZE = 10;
-
-struct PyDateTime_Delta {
-    mixin PyObject_HEAD;
-
-    C_long hashcode;
-    int days;
-    int seconds;
-    int microseconds;
-}
-
-struct PyDateTime_TZInfo {
-    mixin PyObject_HEAD;
-}
-
-template _PyTZINFO_HEAD() {
-    mixin PyObject_HEAD;
-    C_long hashcode;
-    ubyte hastzinfo;
-}
-
-struct _PyDateTime_BaseTZInfo {
-    mixin _PyTZINFO_HEAD;
-}
-
-template _PyDateTime_TIMEHEAD() {
-    mixin _PyTZINFO_HEAD;
-    ubyte data[_PyDateTime_TIME_DATASIZE];
-}
-
-struct _PyDateTime_BaseTime {
-    mixin _PyDateTime_TIMEHEAD;
-}
-
-struct PyDateTime_Time {
-    mixin _PyDateTime_TIMEHEAD;
-    PyObject* tzinfo;
-}
-
-struct PyDateTime_Date {
-    mixin _PyTZINFO_HEAD;
-    ubyte data[_PyDateTime_DATE_DATASIZE];
-}
-
-template _PyDateTime_DATETIMEHEAD() {
-    mixin _PyTZINFO_HEAD;
-    ubyte data[_PyDateTime_DATETIME_DATASIZE];
-}
-
-struct _PyDateTime_BaseDateTime {
-    mixin _PyDateTime_DATETIMEHEAD;
-}
-
-struct PyDateTime_DateTime {
-    mixin _PyDateTime_DATETIMEHEAD;
-    PyObject* tzinfo;
-}
-
-// D translations of C macros:
-int PyDateTime_GET_YEAR()(PyObject* o) {
-    PyDateTime_Date *ot = cast(PyDateTime_Date *) o;
-    return (ot.data[0] << 8) | ot.data[1];
-}
-int PyDateTime_GET_MONTH()(PyObject* o) {
-    PyDateTime_Date *ot = cast(PyDateTime_Date *) o;
-    return ot.data[2];
-}
-int PyDateTime_GET_DAY()(PyObject* o) {
-    PyDateTime_Date *ot = cast(PyDateTime_Date *) o;
-    return ot.data[3];
-}
-
-int PyDateTime_DATE_GET_HOUR()(PyObject* o) {
-    PyDateTime_DateTime *ot = cast(PyDateTime_DateTime *) o;
-    return ot.data[4];
-}
-int PyDateTime_DATE_GET_MINUTE()(PyObject* o) {
-    PyDateTime_DateTime *ot = cast(PyDateTime_DateTime *) o;
-    return ot.data[5];
-}
-int PyDateTime_DATE_GET_SECOND()(PyObject* o) {
-    PyDateTime_DateTime *ot = cast(PyDateTime_DateTime *) o;
-    return ot.data[6];
-}
-int PyDateTime_DATE_GET_MICROSECOND()(PyObject* o) {
-    PyDateTime_DateTime *ot = cast(PyDateTime_DateTime *) o;
-    return (ot.data[7] << 16) | (ot.data[8] << 8) | ot.data[9];
-}
-
-int PyDateTime_TIME_GET_HOUR()(PyObject* o) {
-    PyDateTime_Time *ot = cast(PyDateTime_Time *) o;
-    return ot.data[0];
-}
-int PyDateTime_TIME_GET_MINUTE()(PyObject* o) {
-    PyDateTime_Time *ot = cast(PyDateTime_Time *) o;
-    return ot.data[1];
-}
-int PyDateTime_TIME_GET_SECOND()(PyObject* o) {
-    PyDateTime_Time *ot = cast(PyDateTime_Time *) o;
-    return ot.data[2];
-}
-int PyDateTime_TIME_GET_MICROSECOND()(PyObject* o) {
-    PyDateTime_Time *ot = cast(PyDateTime_Time *) o;
-    return (ot.data[3] << 16) | (ot.data[4] << 8) | ot.data[5];
-}
-
-struct PyDateTime_CAPI {
-    PyTypeObject* DateType;
-    PyTypeObject* DateTimeType;
-    PyTypeObject* TimeType;
-    PyTypeObject* DeltaType;
-    PyTypeObject* TZInfoType;
-
-    PyObject* function(int, int, int, PyTypeObject*) Date_FromDate;
-    PyObject* function(int, int, int, int, int, int, int,
-            PyObject*, PyTypeObject*) DateTime_FromDateAndTime;
-    PyObject* function(int, int, int, int, PyObject*, PyTypeObject*) Time_FromTime;
-    PyObject* function(int, int, int, int, PyTypeObject*) Delta_FromDelta;
-
-    PyObject* function(PyObject*, PyObject*, PyObject*) DateTime_FromTimestamp;
-    PyObject* function(PyObject*, PyObject*) Date_FromTimestamp;
-}
-
-enum DATETIME_API_MAGIC = 0x414548d5;
-__gshared PyDateTime_CAPI *PyDateTimeAPI;
-
-PyDateTime_CAPI* PyDateTime_IMPORT()() {
-    if (PyDateTimeAPI == null) {
-        PyDateTimeAPI = cast(PyDateTime_CAPI *)
-            PyCObject_Import(zc("datetime"), zc("datetime_CAPI"));
-    }
-    return PyDateTimeAPI;
-}
-
-// D translations of C macros:
-int PyDate_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, PyDateTimeAPI.DateType);
-}
-int PyDate_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == PyDateTimeAPI.DateType;
-}
-int PyDateTime_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, PyDateTimeAPI.DateTimeType);
-}
-int PyDateTime_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == PyDateTimeAPI.DateTimeType;
-}
-int PyTime_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, PyDateTimeAPI.TimeType);
-}
-int PyTime_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == PyDateTimeAPI.TimeType;
-}
-int PyDelta_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, PyDateTimeAPI.DeltaType);
-}
-int PyDelta_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == PyDateTimeAPI.DeltaType;
-}
-int PyTZInfo_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, PyDateTimeAPI.TZInfoType);
-}
-int PyTZInfo_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == PyDateTimeAPI.TZInfoType;
-}
-
-PyObject* PyDate_FromDate()(int year, int month, int day) {
-    return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType);
-}
-PyObject* PyDateTime_FromDateAndTime()(int year, int month, int day, int hour, int min, int sec, int usec) {
-    return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour,
-            min, sec, usec, Py_None, PyDateTimeAPI.DateTimeType);
-}
-PyObject* PyTime_FromTime()(int hour, int minute, int second, int usecond) {
-    return PyDateTimeAPI.Time_FromTime(hour, minute, second, usecond,
-            Py_None, PyDateTimeAPI.TimeType);
-}
-PyObject* PyDelta_FromDSU()(int days, int seconds, int useconds) {
-    return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1,
-            PyDateTimeAPI.DeltaType);
-}
-PyObject* PyDateTime_FromTimestamp()(PyObject* args) {
-    return PyDateTimeAPI.DateTime_FromTimestamp(
-            cast(PyObject*) (PyDateTimeAPI.DateTimeType), args, null);
-}
-PyObject* PyDate_FromTimestamp()(PyObject* args) {
-    return PyDateTimeAPI.Date_FromTimestamp(
-            cast(PyObject*) (PyDateTimeAPI.DateType), args);
-}
-
-

File infrastructure/python/python2/descrobject.d

-module python2.descrobject;
-
-import python2.types;
-import python2.object;
-import python2.methodobject;
-import python2.structmember;
-
-extern(C):
-// Python-header-file: Include/descrobject.h:
-
-alias PyObject* function(PyObject*, void*) getter;
-alias int function(PyObject*, PyObject*, void*) setter;
-
-struct PyGetSetDef {
-    char* name;
-    getter get;
-    setter set;
-    char* doc;
-    void* closure;
-}
-
-alias PyObject* function(PyObject*, PyObject*, void*) wrapperfunc;
-alias PyObject* function(PyObject*, PyObject*, void*, PyObject*) wrapperfunc_kwds;
-
-struct wrapperbase {
-    char* name;
-    int offset;
-    void* function_;
-    wrapperfunc wrapper;
-    char* doc;
-    int flags;
-    PyObject* name_strobj;
-}
-
-enum PyWrapperFlag_KEYWORDS = 1;
-
-template PyDescr_COMMON() {
-    mixin PyObject_HEAD;
-    PyTypeObject* d_type;
-    PyObject* d_name;
-}
-
-struct PyDescrObject {
-    mixin PyDescr_COMMON;
-}
-
-struct PyMethodDescrObject {
-    mixin PyDescr_COMMON;
-    PyMethodDef* d_method;
-}
-
-struct PyMemberDescrObject {
-    mixin PyDescr_COMMON;
-    PyMemberDef* d_member;
-}
-
-struct PyGetSetDescrObject {
-    mixin PyDescr_COMMON;
-    PyGetSetDef* d_getset;
-}
-
-struct PyWrapperDescrObject {
-    mixin PyDescr_COMMON;
-    wrapperbase* d_base;
-    void* d_wrapped;
-}
-
-// PyWrapperDescr_Type is currently not accessible from D.
-__gshared PyTypeObject PyWrapperDescr_Type;
-version(Python_2_6_Or_Later){
-    __gshared PyTypeObject PyDictProxy_Type;
-    __gshared PyTypeObject PyGetSetDescr_Type;
-    __gshared PyTypeObject PyMemberDescr_Type;
-}
-
-PyObject* PyDescr_NewMethod(PyTypeObject*, PyMethodDef*);
-PyObject* PyDescr_NewClassMethod(PyTypeObject*, PyMethodDef*);
-PyObject* PyDescr_NewMember(PyTypeObject*, PyMemberDef*);
-PyObject* PyDescr_NewGetSet(PyTypeObject*, PyGetSetDef*);
-PyObject* PyDescr_NewWrapper(PyTypeObject*, wrapperbase*, void*);
-PyObject* PyDictProxy_New(PyObject*);
-PyObject* PyWrapper_New(PyObject*, PyObject*);
-
-__gshared PyTypeObject PyProperty_Type;
-
-

File infrastructure/python/python2/dictobject.d

-module python2.dictobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/dictobject.h:
-
-enum int PyDict_MINSIZE = 8;
-
-struct PyDictEntry {
-    version(Python_2_5_Or_Later){
-        Py_ssize_t me_hash;
-    }else{
-        C_long me_hash;
-    }
-    PyObject* me_key;
-    PyObject* me_value;
-}
-
-struct _dictobject {
-    mixin PyObject_HEAD;
-
-    Py_ssize_t ma_fill;
-    Py_ssize_t ma_used;
-    Py_ssize_t ma_mask;
-    PyDictEntry *ma_table;
-    PyDictEntry* function(PyDictObject *mp, PyObject* key, C_long hash) ma_lookup;
-    PyDictEntry ma_smalltable[PyDict_MINSIZE];
-}
-alias _dictobject PyDictObject;
-
-__gshared PyTypeObject PyDict_Type;
-version(Python_2_7_Or_Later) {
-    __gshared PyTypeObject PyDictIterKey_Type;
-    __gshared PyTypeObject PyDictIterValue_Type;
-    __gshared PyTypeObject PyDictIterItem_Type;
-    __gshared PyTypeObject PyDictKeys_Type;
-    __gshared PyTypeObject PyDictItems_Type;
-    __gshared PyTypeObject PyDictValues_Type;
-}
-
-// D translation of C macro:
-int PyDict_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, &PyDict_Type);
-}
-// D translation of C macro:
-int PyDict_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == &PyDict_Type;
-}
-
-version(Python_2_7_Or_Later) {
-    int PyDictKeys_Check()(PyObject* op) {
-        return Py_TYPE(op) == &PyDictKeys_Type;
-    }
-    int PyDictItems_Check()(PyObject* op) {
-        return Py_TYPE(op) == &PyDictItems_Type;
-    }
-    int PyDictValues_Check()(PyObject* op) {
-        return Py_TYPE(op) == &PyDictValues_Type;
-    }
-    int PyDictViewSet_Check()(PyObject* op) {
-        return PyDictKeys_Check(op) || PyDictItems_Check(op);
-    }
-}
-
-PyObject* PyDict_New();
-PyObject_BorrowedRef* PyDict_GetItem(PyObject* mp, PyObject* key);
-int PyDict_SetItem(PyObject* mp, PyObject* key, PyObject* item);
-int PyDict_DelItem(PyObject* mp, PyObject* key);
-void PyDict_Clear(PyObject* mp);
-int PyDict_Next(PyObject* mp, Py_ssize_t* pos, PyObject_BorrowedRef **key, PyObject_BorrowedRef **value);
-PyObject* PyDict_Keys(PyObject* mp);
-PyObject* PyDict_Values(PyObject* mp);
-PyObject* PyDict_Items(PyObject* mp);
-Py_ssize_t PyDict_Size(PyObject* mp);
-PyObject* PyDict_Copy(PyObject* mp);
-int PyDict_Contains(PyObject* mp, PyObject* key);
-
-int PyDict_Update(PyObject* mp, PyObject* other);
-int PyDict_Merge(PyObject* mp, PyObject* other, int override_);
-int PyDict_MergeFromSeq2(PyObject* d, PyObject* seq2, int override_);
-
-PyObject_BorrowedRef* PyDict_GetItemString(PyObject* dp, const(char)* key);
-int PyDict_SetItemString(PyObject* dp, const(char)* key, PyObject* item);
-int PyDict_DelItemString(PyObject* dp, const(char)* key);
-
-

File infrastructure/python/python2/enumobject.d

-module python2.enumobject;
-
-import python2.object;
-
-__gshared PyTypeObject PyEnum_Type;
-__gshared PyTypeObject PyReversed_Type;

File infrastructure/python/python2/errcode.d

-module python2.errcode;
-
-enum E_OK                   = 10;
-enum E_EOF                  = 11;
-enum E_INTR                 = 12;
-enum E_TOKEN                = 13;
-enum E_SYNTAX               = 14;
-enum E_NOMEM                = 15;
-enum E_DONE                 = 16;
-enum E_ERROR                = 17;
-enum E_TABSPACE             = 18;
-enum E_OVERFLOW             = 19;
-enum E_TOODEEP              = 20;
-enum E_DEDENT               = 21;
-enum E_DECODE               = 22;
-enum E_EOFS                 = 23;
-enum E_EOLS                 = 24;
-enum E_LINECONT             = 25;

File infrastructure/python/python2/eval.d

-module python2.eval;
-
-import python2.types;
-import python2.object;
-import python2.code;
-
-extern(C):
-// Python-header-file: Include/eval.h:
-PyObject* PyEval_EvalCode(PyCodeObject*, PyObject*, PyObject*);
-PyObject* PyEval_EvalCodeEx(
-        PyCodeObject* co,
-        PyObject* globals,
-        PyObject* locals,
-        PyObject** args, int argc,
-        PyObject** kwds, int kwdc,
-        PyObject** defs, int defc,
-        PyObject* closure
-);
-PyObject* _PyEval_CallTracing(PyObject* func, PyObject* args);
-

File infrastructure/python/python2/fileobject.d

-module python2.fileobject;
-
-import std.c.stdio;
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/fileobject.h:
-
-struct PyFileObject {
-    mixin PyObject_HEAD;
-
-    FILE* f_fp;
-    PyObject* f_name;
-    PyObject* f_mode;
-    int function(FILE*) f_close;
-    int f_softspace;
-    int f_binary;
-    char* f_buf;
-    char* f_bufend;
-    char* f_bufptr;
-    char* f_setbuf;
-    int f_univ_newline;
-    int f_newlinetypes;
-    int f_skipnextlf;
-    PyObject* f_encoding;
-    version(Python_2_6_Or_Later){
-        PyObject* f_errors;
-    }
-    PyObject* weakreflist;
-    version(Python_2_6_Or_Later){
-        int unlocked_count;         /* Num. currently running sections of code
-                                       using f_fp with the GIL released. */
-        int readable;
-        int writable;
-    }
-}
-
-__gshared PyTypeObject PyFile_Type;
-// D translation of C macro:
-int PyFile_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, &PyFile_Type);
-}
-// D translation of C macro:
-int PyFile_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == &PyFile_Type;
-}
-
-PyObject* PyFile_FromString(char*, char*);
-void PyFile_SetBufSize(PyObject*, int);
-int PyFile_SetEncoding(PyObject*, const(char)*);
-version(Python_2_6_Or_Later){
-    int PyFile_SetEncodingAndErrors(PyObject* , const(char)*, const(char)* errors);
-}
-PyObject* PyFile_FromFile(FILE*, char*, char*, int function(FILE*));
-FILE* PyFile_AsFile(PyObject*);
-version(Python_2_6_Or_Later){
-    void PyFile_IncUseCount(PyFileObject*);
-    void PyFile_DecUseCount(PyFileObject*);
-}
-PyObject_BorrowedRef* PyFile_Name(PyObject*);
-PyObject* PyFile_GetLine(PyObject* , int);
-int PyFile_WriteObject(PyObject*, PyObject*, int);
-int PyFile_SoftSpace(PyObject*, int);
-int PyFile_WriteString(const(char)*, PyObject*);
-int PyObject_AsFileDescriptor(PyObject*);
-
-// We deal with char *Py_FileSystemDefaultEncoding in the global variables
-// section toward the bottom of this file.
-
-enum PY_STDIOTEXTMODE = "b";
-
-char* Py_UniversalNewlineFgets(char*, int, FILE*, PyObject*);
-size_t Py_UniversalNewlineFread(char*, size_t, FILE*, PyObject*);
-
-

File infrastructure/python/python2/floatobject.d

-module python2.floatobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/floatobject.h:
-
-struct PyFloatObject {
-    mixin PyObject_HEAD;
-
-    double ob_fval;
-}
-
-__gshared PyTypeObject PyFloat_Type;
-
-// D translation of C macro:
-int PyFloat_Check()(PyObject *op) {
-    return PyObject_TypeCheck(op, &PyFloat_Type);
-}
-// D translation of C macro:
-int PyFloat_CheckExact()(PyObject *op) {
-    return Py_TYPE(op) == &PyFloat_Type;
-}
-
-version(Python_2_6_Or_Later){
-    double PyFloat_GetMax();
-    double PyFloat_GetMin();
-    PyObject* PyFloat_GetInfo();
-}
-
-PyObject* PyFloat_FromString(PyObject*, char** junk);
-PyObject* PyFloat_FromDouble(double);
-
-double PyFloat_AsDouble(PyObject*);
-void PyFloat_AsReprString(char*, PyFloatObject* v);
-void PyFloat_AsString(char*, PyFloatObject* v);
-
-version(Python_2_6_Or_Later){
-    // _PyFloat_Digits ??
-    // _PyFloat_DigitsInit ??
-    /* free list api */
-    int PyFloat_ClearFreeList();
-    // _PyFloat_FormatAdvanced ??
-}
-

File infrastructure/python/python2/frameobject.d

-module python2.frameobject;
-
-import python2.types;
-import python2.object;
-import python2.code;
-import python2.pystate;
-
-
-extern(C):
-// Python-header-file: Include/frameobject.h:
-
-struct PyTryBlock {
-    int b_type;
-    int b_handler;
-    int b_level;
-}
-
-struct PyFrameObject {
-    mixin PyObject_VAR_HEAD;
-
-    PyFrameObject* f_back;
-    PyCodeObject* f_code;
-    PyObject* f_builtins;
-    PyObject* f_globals;
-    PyObject* f_locals;
-    PyObject** f_valuestack;
-    PyObject** f_stacktop;
-    PyObject* f_trace;
-    PyObject* f_exc_type;
-    PyObject* f_exc_value;
-    PyObject* f_exc_traceback;
-    PyThreadState* f_tstate;
-    int f_lasti;
-    int f_lineno;
-    version(Python_2_5_Or_Later){
-    }else{
-        int f_restricted;
-    }
-    int f_iblock;
-    PyTryBlock f_blockstack[CO_MAXBLOCKS];
-    version(Python_2_5_Or_Later){
-    }else{
-        int f_nlocals;
-        int f_ncells;
-        int f_nfreevars;
-        int f_stacksize;
-    }
-    PyObject* _f_localsplus[1];
-    PyObject** f_localsplus()() {
-        return _f_localsplus.ptr;
-    }
-}
-
-__gshared PyTypeObject PyFrame_Type;
-
-// D translation of C macro:
-int PyFrame_Check()(PyObject* op) {
-    return Py_TYPE(op) == &PyFrame_Type;
-}
-version(Python_2_5_Or_Later){
-    int PyFrame_IsRestricted()(PyFrameObject* f) {
-        return f.f_builtins != f.f_tstate.interp.builtins;
-    }
-}
-
-PyFrameObject* PyFrame_New(PyThreadState*, PyCodeObject*,
-        PyObject*, PyObject*);
-
-void PyFrame_BlockSetup(PyFrameObject*, int, int, int);
-PyTryBlock* PyFrame_BlockPop(PyFrameObject*);
-PyObject** PyFrame_ExtendStack(PyFrameObject*, int, int);
-
-void PyFrame_LocalsToFast(PyFrameObject*, int);
-void PyFrame_FastToLocals(PyFrameObject*);
-version(Python_2_6_Or_Later) {
-    int PyFrame_ClearFreeList();
-}
-version(Python_2_7_Or_Later) {
-    int PyFrame_GetLineNumber(PyFrameObject*);
-}
-
-

File infrastructure/python/python2/funcobject.d

-module python2.funcobject;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/funcobject.h:
-
-struct PyFunctionObject {
-    mixin PyObject_HEAD;
-
-    PyObject* func_code;
-    PyObject* func_globals;
-    PyObject* func_defaults;
-    PyObject* func_closure;
-    PyObject* func_doc;
-    PyObject* func_name;
-    PyObject* func_dict;
-    PyObject* func_weakreflist;
-    PyObject* func_module;
-}
-
-__gshared PyTypeObject PyFunction_Type;
-
-// D translation of C macro:
-int PyFunction_Check()(PyObject* op) {
-    return op.ob_type == &PyFunction_Type;
-}
-
-PyObject* PyFunction_New(PyObject*, PyObject*);
-PyObject_BorrowedRef* PyFunction_GetCode(PyObject*);
-PyObject_BorrowedRef* PyFunction_GetGlobals(PyObject*);
-PyObject_BorrowedRef* PyFunction_GetModule(PyObject*);
-PyObject_BorrowedRef* PyFunction_GetDefaults(PyObject*);
-int PyFunction_SetDefaults(PyObject*, PyObject*);
-PyObject_BorrowedRef* PyFunction_GetClosure(PyObject*);
-int PyFunction_SetClosure(PyObject*, PyObject*);
-
-PyObject* PyFunction_GET_CODE()(PyObject* func) {
-    return (cast(PyFunctionObject*)func).func_code;
-}
-PyObject* PyFunction_GET_GLOBALS()(PyObject* func) {
-    return (cast(PyFunctionObject*)func).func_globals;
-}
-PyObject* PyFunction_GET_MODULE()(PyObject* func) {
-    return (cast(PyFunctionObject*)func).func_module;
-}
-PyObject* PyFunction_GET_DEFAULTS()(PyObject* func) {
-    return (cast(PyFunctionObject*)func).func_defaults;
-}
-PyObject* PyFunction_GET_CLOSURE()(PyObject* func) {
-    return (cast(PyFunctionObject*)func).func_closure;
-}
-
-__gshared PyTypeObject PyClassMethod_Type;
-__gshared PyTypeObject PyStaticMethod_Type;
-
-PyObject* PyClassMethod_New(PyObject*);
-PyObject* PyStaticMethod_New(PyObject*);
-
-

File infrastructure/python/python2/genobject.d

-module python2.genobject;
-
-import python2.types;
-import python2.object;
-import python2.frameobject;
-
-extern(C):
-// Python-header-file: Include/genobject.h:
-
-struct PyGenObject {
-    mixin PyObject_HEAD;
-    PyFrameObject* gi_frame;
-    int gi_running;
-    version(Python_2_6_Or_Later){
-        /* The code object backing the generator */
-        PyObject* gi_code;
-    }
-    PyObject* gi_weakreflist;
-}
-
-__gshared PyTypeObject PyGen_Type;
-
-// D translations of C macros:
-int PyGen_Check()(PyObject* op) {
-    return PyObject_TypeCheck(op, &PyGen_Type);
-}
-int PyGen_CheckExact()(PyObject* op) {
-    return Py_TYPE(op) == &PyGen_Type;
-}
-
-PyObject* PyGen_New(PyFrameObject*);
-int PyGen_NeedsFinalizing(PyGenObject*);
-

File infrastructure/python/python2/grammar.d

-module python2.grammar;
-
-import std.c.stdio;
-
-extern(C):
-// Python-header-file: Include/object.h:
-
-/* A label of an arc */
-
-struct label{
-    int		 lb_type;
-    char*	lb_str;
-}
-
-enum EMPTY = 0;		/* Label number 0 is by definition the empty label */
-
-/* A list of labels */
-
-struct labellist{
-    int		 ll_nlabels;
-    label*	ll_label;
-}
-
-/* An arc from one state to another */
-
-struct arc{
-    short	a_lbl;		/* Label of this arc */
-    short	a_arrow;	/* State where this arc goes to */
-}
-
-/* A state in a DFA */
-
-struct state{
-    int		 s_narcs;
-    arc*	 s_arc;		/* Array of arcs */
-	
-    /* Optional accelerators */
-    int		 s_lower;	/* Lowest label index */
-    int		 s_upper;	/* Highest label index */
-    int*	 s_accel;	/* Accelerator */
-    int		 s_accept;	/* Nonzero for accepting state */
-}
-
-/* A DFA */
-
-struct dfa{
-    int		 d_type;	/* Non-terminal this represents */
-    char*	 d_name;	/* For printing */
-    int		 d_initial;	/* Initial state */
-    int		 d_nstates;
-    state*	 d_state;	/* Array of states */
-    void*/*bitset*/	 d_first;
-} 
-
-/* A grammar */
-
-struct grammar{
-    int		 g_ndfas;
-    dfa*	 g_dfa;		/* Array of DFAs */
-    labellist	 g_ll;
-    int		 g_start;	/* Start symbol of the grammar */
-    int		 g_accel;	/* Set if accelerators present */
-} 
-
-/* FUNCTIONS */
-
-grammar* newgrammar(int start);
-dfa* adddfa(grammar* g, int type, char* name);
-int addstate(dfa* d);
-void addarc(dfa* d, int from, int to, int lbl);
-dfa *PyGrammar_FindDFA(grammar* g, int type);
-
-int addlabel(labellist* ll, int type, char* str);
-int findlabel(labellist* ll, int type, char* str);
-char* PyGrammar_LabelRepr(label* lb);
-void translatelabels(grammar* g);
-
-void addfirstsets(grammar* g);
-
-void PyGrammar_AddAccelerators(grammar* g);
-void PyGrammar_RemoveAccelerators(grammar*);
-
-void printgrammar(grammar* g, FILE* fp);
-void printnonterminals(grammar* g, FILE* fp);
-

File infrastructure/python/python2/import_.d

-module python2.import_;
-
-import python2.types;
-import python2.object;
-
-extern(C):
-// Python-header-file: Include/import.h:
-
-C_long PyImport_GetMagicNumber();
-PyObject* PyImport_ExecCodeModule(char* name, PyObject* co);
-PyObject* PyImport_ExecCodeModuleEx(char* name, PyObject* co, char* pathname);
-PyObject* PyImport_GetModuleDict();
-PyObject* PyImport_AddModule(Char1* name);
<