]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Include/object.h
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Include / object.h
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Include/object.h b/AppPkg/Applications/Python/Python-2.7.10/Include/object.h
deleted file mode 100644 (file)
index bb5fa3c..0000000
+++ /dev/null
@@ -1,1013 +0,0 @@
-#ifndef Py_OBJECT_H\r
-#define Py_OBJECT_H\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-\r
-/* Object and type object interface */\r
-\r
-/*\r
-Objects are structures allocated on the heap.  Special rules apply to\r
-the use of objects to ensure they are properly garbage-collected.\r
-Objects are never allocated statically or on the stack; they must be\r
-accessed through special macros and functions only.  (Type objects are\r
-exceptions to the first rule; the standard types are represented by\r
-statically initialized type objects, although work on type/class unification\r
-for Python 2.2 made it possible to have heap-allocated type objects too).\r
-\r
-An object has a 'reference count' that is increased or decreased when a\r
-pointer to the object is copied or deleted; when the reference count\r
-reaches zero there are no references to the object left and it can be\r
-removed from the heap.\r
-\r
-An object has a 'type' that determines what it represents and what kind\r
-of data it contains.  An object's type is fixed when it is created.\r
-Types themselves are represented as objects; an object contains a\r
-pointer to the corresponding type object.  The type itself has a type\r
-pointer pointing to the object representing the type 'type', which\r
-contains a pointer to itself!).\r
-\r
-Objects do not float around in memory; once allocated an object keeps\r
-the same size and address.  Objects that must hold variable-size data\r
-can contain pointers to variable-size parts of the object.  Not all\r
-objects of the same type have the same size; but the size cannot change\r
-after allocation.  (These restrictions are made so a reference to an\r
-object can be simply a pointer -- moving an object would require\r
-updating all the pointers, and changing an object's size would require\r
-moving it if there was another object right next to it.)\r
-\r
-Objects are always accessed through pointers of the type 'PyObject *'.\r
-The type 'PyObject' is a structure that only contains the reference count\r
-and the type pointer.  The actual memory allocated for an object\r
-contains other data that can only be accessed after casting the pointer\r
-to a pointer to a longer structure type.  This longer type must start\r
-with the reference count and type fields; the macro PyObject_HEAD should be\r
-used for this (to accommodate for future changes).  The implementation\r
-of a particular object type can cast the object pointer to the proper\r
-type and back.\r
-\r
-A standard interface exists for objects that contain an array of items\r
-whose size is determined when the object is allocated.\r
-*/\r
-\r
-/* Py_DEBUG implies Py_TRACE_REFS. */\r
-#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)\r
-#define Py_TRACE_REFS\r
-#endif\r
-\r
-/* Py_TRACE_REFS implies Py_REF_DEBUG. */\r
-#if defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG)\r
-#define Py_REF_DEBUG\r
-#endif\r
-\r
-#ifdef Py_TRACE_REFS\r
-/* Define pointers to support a doubly-linked list of all live heap objects. */\r
-#define _PyObject_HEAD_EXTRA            \\r
-    struct _object *_ob_next;           \\r
-    struct _object *_ob_prev;\r
-\r
-#define _PyObject_EXTRA_INIT 0, 0,\r
-\r
-#else\r
-#define _PyObject_HEAD_EXTRA\r
-#define _PyObject_EXTRA_INIT\r
-#endif\r
-\r
-/* PyObject_HEAD defines the initial segment of every PyObject. */\r
-#define PyObject_HEAD                   \\r
-    _PyObject_HEAD_EXTRA                \\r
-    Py_ssize_t ob_refcnt;               \\r
-    struct _typeobject *ob_type;\r
-\r
-#define PyObject_HEAD_INIT(type)        \\r
-    _PyObject_EXTRA_INIT                \\r
-    1, type,\r
-\r
-#define PyVarObject_HEAD_INIT(type, size)       \\r
-    PyObject_HEAD_INIT(type) size,\r
-\r
-/* PyObject_VAR_HEAD defines the initial segment of all variable-size\r
- * container objects.  These end with a declaration of an array with 1\r
- * element, but enough space is malloc'ed so that the array actually\r
- * has room for ob_size elements.  Note that ob_size is an element count,\r
- * not necessarily a byte count.\r
- */\r
-#define PyObject_VAR_HEAD               \\r
-    PyObject_HEAD                       \\r
-    Py_ssize_t ob_size; /* Number of items in variable part */\r
-#define Py_INVALID_SIZE (Py_ssize_t)-1\r
-\r
-/* Nothing is actually declared to be a PyObject, but every pointer to\r
- * a Python object can be cast to a PyObject*.  This is inheritance built\r
- * by hand.  Similarly every pointer to a variable-size Python object can,\r
- * in addition, be cast to PyVarObject*.\r
- */\r
-typedef struct _object {\r
-    PyObject_HEAD\r
-} PyObject;\r
-\r
-typedef struct {\r
-    PyObject_VAR_HEAD\r
-} PyVarObject;\r
-\r
-#define Py_REFCNT(ob)           (((PyObject*)(ob))->ob_refcnt)\r
-#define Py_TYPE(ob)             (((PyObject*)(ob))->ob_type)\r
-#define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)\r
-\r
-/*\r
-Type objects contain a string containing the type name (to help somewhat\r
-in debugging), the allocation parameters (see PyObject_New() and\r
-PyObject_NewVar()),\r
-and methods for accessing objects of the type.  Methods are optional, a\r
-nil pointer meaning that particular kind of access is not available for\r
-this type.  The Py_DECREF() macro uses the tp_dealloc method without\r
-checking for a nil pointer; it should always be implemented except if\r
-the implementation can guarantee that the reference count will never\r
-reach zero (e.g., for statically allocated type objects).\r
-\r
-NB: the methods for certain type groups are now contained in separate\r
-method blocks.\r
-*/\r
-\r
-typedef PyObject * (*unaryfunc)(PyObject *);\r
-typedef PyObject * (*binaryfunc)(PyObject *, PyObject *);\r
-typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *);\r
-typedef int (*inquiry)(PyObject *);\r
-typedef Py_ssize_t (*lenfunc)(PyObject *);\r
-typedef int (*coercion)(PyObject **, PyObject **);\r
-typedef PyObject *(*intargfunc)(PyObject *, int) Py_DEPRECATED(2.5);\r
-typedef PyObject *(*intintargfunc)(PyObject *, int, int) Py_DEPRECATED(2.5);\r
-typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);\r
-typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);\r
-typedef int(*intobjargproc)(PyObject *, int, PyObject *);\r
-typedef int(*intintobjargproc)(PyObject *, int, int, PyObject *);\r
-typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);\r
-typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);\r
-typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);\r
-\r
-\r
-\r
-/* int-based buffer interface */\r
-typedef int (*getreadbufferproc)(PyObject *, int, void **);\r
-typedef int (*getwritebufferproc)(PyObject *, int, void **);\r
-typedef int (*getsegcountproc)(PyObject *, int *);\r
-typedef int (*getcharbufferproc)(PyObject *, int, char **);\r
-/* ssize_t-based buffer interface */\r
-typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **);\r
-typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **);\r
-typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *);\r
-typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **);\r
-\r
-\r
-/* Py3k buffer interface */\r
-typedef struct bufferinfo {\r
-    void *buf;\r
-    PyObject *obj;        /* owned reference */\r
-    Py_ssize_t len;\r
-    Py_ssize_t itemsize;  /* This is Py_ssize_t so it can be\r
-                             pointed to by strides in simple case.*/\r
-    int readonly;\r
-    int ndim;\r
-    char *format;\r
-    Py_ssize_t *shape;\r
-    Py_ssize_t *strides;\r
-    Py_ssize_t *suboffsets;\r
-    Py_ssize_t smalltable[2];  /* static store for shape and strides of\r
-                                  mono-dimensional buffers. */\r
-    void *internal;\r
-} Py_buffer;\r
-\r
-typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);\r
-typedef void (*releasebufferproc)(PyObject *, Py_buffer *);\r
-\r
-    /* Flags for getting buffers */\r
-#define PyBUF_SIMPLE 0\r
-#define PyBUF_WRITABLE 0x0001\r
-/*  we used to include an E, backwards compatible alias  */\r
-#define PyBUF_WRITEABLE PyBUF_WRITABLE\r
-#define PyBUF_FORMAT 0x0004\r
-#define PyBUF_ND 0x0008\r
-#define PyBUF_STRIDES (0x0010 | PyBUF_ND)\r
-#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)\r
-#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)\r
-#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)\r
-#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)\r
-\r
-#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)\r
-#define PyBUF_CONTIG_RO (PyBUF_ND)\r
-\r
-#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)\r
-#define PyBUF_STRIDED_RO (PyBUF_STRIDES)\r
-\r
-#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)\r
-#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)\r
-\r
-#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)\r
-#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)\r
-\r
-\r
-#define PyBUF_READ  0x100\r
-#define PyBUF_WRITE 0x200\r
-#define PyBUF_SHADOW 0x400\r
-/* end Py3k buffer interface */\r
-\r
-typedef int (*objobjproc)(PyObject *, PyObject *);\r
-typedef int (*visitproc)(PyObject *, void *);\r
-typedef int (*traverseproc)(PyObject *, visitproc, void *);\r
-\r
-typedef struct {\r
-    /* For numbers without flag bit Py_TPFLAGS_CHECKTYPES set, all\r
-       arguments are guaranteed to be of the object's type (modulo\r
-       coercion hacks -- i.e. if the type's coercion function\r
-       returns other types, then these are allowed as well).  Numbers that\r
-       have the Py_TPFLAGS_CHECKTYPES flag bit set should check *both*\r
-       arguments for proper type and implement the necessary conversions\r
-       in the slot functions themselves. */\r
-\r
-    binaryfunc nb_add;\r
-    binaryfunc nb_subtract;\r
-    binaryfunc nb_multiply;\r
-    binaryfunc nb_divide;\r
-    binaryfunc nb_remainder;\r
-    binaryfunc nb_divmod;\r
-    ternaryfunc nb_power;\r
-    unaryfunc nb_negative;\r
-    unaryfunc nb_positive;\r
-    unaryfunc nb_absolute;\r
-    inquiry nb_nonzero;\r
-    unaryfunc nb_invert;\r
-    binaryfunc nb_lshift;\r
-    binaryfunc nb_rshift;\r
-    binaryfunc nb_and;\r
-    binaryfunc nb_xor;\r
-    binaryfunc nb_or;\r
-    coercion nb_coerce;\r
-    unaryfunc nb_int;\r
-    unaryfunc nb_long;\r
-    unaryfunc nb_float;\r
-    unaryfunc nb_oct;\r
-    unaryfunc nb_hex;\r
-    /* Added in release 2.0 */\r
-    binaryfunc nb_inplace_add;\r
-    binaryfunc nb_inplace_subtract;\r
-    binaryfunc nb_inplace_multiply;\r
-    binaryfunc nb_inplace_divide;\r
-    binaryfunc nb_inplace_remainder;\r
-    ternaryfunc nb_inplace_power;\r
-    binaryfunc nb_inplace_lshift;\r
-    binaryfunc nb_inplace_rshift;\r
-    binaryfunc nb_inplace_and;\r
-    binaryfunc nb_inplace_xor;\r
-    binaryfunc nb_inplace_or;\r
-\r
-    /* Added in release 2.2 */\r
-    /* The following require the Py_TPFLAGS_HAVE_CLASS flag */\r
-    binaryfunc nb_floor_divide;\r
-    binaryfunc nb_true_divide;\r
-    binaryfunc nb_inplace_floor_divide;\r
-    binaryfunc nb_inplace_true_divide;\r
-\r
-    /* Added in release 2.5 */\r
-    unaryfunc nb_index;\r
-} PyNumberMethods;\r
-\r
-typedef struct {\r
-    lenfunc sq_length;\r
-    binaryfunc sq_concat;\r
-    ssizeargfunc sq_repeat;\r
-    ssizeargfunc sq_item;\r
-    ssizessizeargfunc sq_slice;\r
-    ssizeobjargproc sq_ass_item;\r
-    ssizessizeobjargproc sq_ass_slice;\r
-    objobjproc sq_contains;\r
-    /* Added in release 2.0 */\r
-    binaryfunc sq_inplace_concat;\r
-    ssizeargfunc sq_inplace_repeat;\r
-} PySequenceMethods;\r
-\r
-typedef struct {\r
-    lenfunc mp_length;\r
-    binaryfunc mp_subscript;\r
-    objobjargproc mp_ass_subscript;\r
-} PyMappingMethods;\r
-\r
-typedef struct {\r
-    readbufferproc bf_getreadbuffer;\r
-    writebufferproc bf_getwritebuffer;\r
-    segcountproc bf_getsegcount;\r
-    charbufferproc bf_getcharbuffer;\r
-    getbufferproc bf_getbuffer;\r
-    releasebufferproc bf_releasebuffer;\r
-} PyBufferProcs;\r
-\r
-\r
-typedef void (*freefunc)(void *);\r
-typedef void (*destructor)(PyObject *);\r
-typedef int (*printfunc)(PyObject *, FILE *, int);\r
-typedef PyObject *(*getattrfunc)(PyObject *, char *);\r
-typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);\r
-typedef int (*setattrfunc)(PyObject *, char *, PyObject *);\r
-typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);\r
-typedef int (*cmpfunc)(PyObject *, PyObject *);\r
-typedef PyObject *(*reprfunc)(PyObject *);\r
-typedef long (*hashfunc)(PyObject *);\r
-typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int);\r
-typedef PyObject *(*getiterfunc) (PyObject *);\r
-typedef PyObject *(*iternextfunc) (PyObject *);\r
-typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *);\r
-typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *);\r
-typedef int (*initproc)(PyObject *, PyObject *, PyObject *);\r
-typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *);\r
-typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t);\r
-\r
-typedef struct _typeobject {\r
-    PyObject_VAR_HEAD\r
-    const char *tp_name; /* For printing, in format "<module>.<name>" */\r
-    Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\r
-\r
-    /* Methods to implement standard operations */\r
-\r
-    destructor tp_dealloc;\r
-    printfunc tp_print;\r
-    getattrfunc tp_getattr;\r
-    setattrfunc tp_setattr;\r
-    cmpfunc tp_compare;\r
-    reprfunc tp_repr;\r
-\r
-    /* Method suites for standard classes */\r
-\r
-    PyNumberMethods *tp_as_number;\r
-    PySequenceMethods *tp_as_sequence;\r
-    PyMappingMethods *tp_as_mapping;\r
-\r
-    /* More standard operations (here for binary compatibility) */\r
-\r
-    hashfunc tp_hash;\r
-    ternaryfunc tp_call;\r
-    reprfunc tp_str;\r
-    getattrofunc tp_getattro;\r
-    setattrofunc tp_setattro;\r
-\r
-    /* Functions to access object as input/output buffer */\r
-    PyBufferProcs *tp_as_buffer;\r
-\r
-    /* Flags to define presence of optional/expanded features */\r
-    long tp_flags;\r
-\r
-    const char *tp_doc; /* Documentation string */\r
-\r
-    /* Assigned meaning in release 2.0 */\r
-    /* call function for all accessible objects */\r
-    traverseproc tp_traverse;\r
-\r
-    /* delete references to contained objects */\r
-    inquiry tp_clear;\r
-\r
-    /* Assigned meaning in release 2.1 */\r
-    /* rich comparisons */\r
-    richcmpfunc tp_richcompare;\r
-\r
-    /* weak reference enabler */\r
-    Py_ssize_t tp_weaklistoffset;\r
-\r
-    /* Added in release 2.2 */\r
-    /* Iterators */\r
-    getiterfunc tp_iter;\r
-    iternextfunc tp_iternext;\r
-\r
-    /* Attribute descriptor and subclassing stuff */\r
-    struct PyMethodDef *tp_methods;\r
-    struct PyMemberDef *tp_members;\r
-    struct PyGetSetDef *tp_getset;\r
-    struct _typeobject *tp_base;\r
-    PyObject *tp_dict;\r
-    descrgetfunc tp_descr_get;\r
-    descrsetfunc tp_descr_set;\r
-    Py_ssize_t tp_dictoffset;\r
-    initproc tp_init;\r
-    allocfunc tp_alloc;\r
-    newfunc tp_new;\r
-    freefunc tp_free; /* Low-level free-memory routine */\r
-    inquiry tp_is_gc; /* For PyObject_IS_GC */\r
-    PyObject *tp_bases;\r
-    PyObject *tp_mro; /* method resolution order */\r
-    PyObject *tp_cache;\r
-    PyObject *tp_subclasses;\r
-    PyObject *tp_weaklist;\r
-    destructor tp_del;\r
-\r
-    /* Type attribute cache version tag. Added in version 2.6 */\r
-    unsigned int tp_version_tag;\r
-\r
-#ifdef COUNT_ALLOCS\r
-    /* these must be last and never explicitly initialized */\r
-    Py_ssize_t tp_allocs;\r
-    Py_ssize_t tp_frees;\r
-    Py_ssize_t tp_maxalloc;\r
-    struct _typeobject *tp_prev;\r
-    struct _typeobject *tp_next;\r
-#endif\r
-} PyTypeObject;\r
-\r
-\r
-/* The *real* layout of a type object when allocated on the heap */\r
-typedef struct _heaptypeobject {\r
-    /* Note: there's a dependency on the order of these members\r
-       in slotptr() in typeobject.c . */\r
-    PyTypeObject ht_type;\r
-    PyNumberMethods as_number;\r
-    PyMappingMethods as_mapping;\r
-    PySequenceMethods as_sequence; /* as_sequence comes after as_mapping,\r
-                                      so that the mapping wins when both\r
-                                      the mapping and the sequence define\r
-                                      a given operator (e.g. __getitem__).\r
-                                      see add_operators() in typeobject.c . */\r
-    PyBufferProcs as_buffer;\r
-    PyObject *ht_name, *ht_slots;\r
-    /* here are optional user slots, followed by the members. */\r
-} PyHeapTypeObject;\r
-\r
-/* access macro to the members which are floating "behind" the object */\r
-#define PyHeapType_GET_MEMBERS(etype) \\r
-    ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize))\r
-\r
-\r
-/* Generic type check */\r
-PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);\r
-#define PyObject_TypeCheck(ob, tp) \\r
-    (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp)))\r
-\r
-PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */\r
-PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */\r
-PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */\r
-\r
-#define PyType_Check(op) \\r
-    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS)\r
-#define PyType_CheckExact(op) (Py_TYPE(op) == &PyType_Type)\r
-\r
-PyAPI_FUNC(int) PyType_Ready(PyTypeObject *);\r
-PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);\r
-PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *,\r
-                                               PyObject *, PyObject *);\r
-PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);\r
-PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **);\r
-PyAPI_FUNC(unsigned int) PyType_ClearCache(void);\r
-PyAPI_FUNC(void) PyType_Modified(PyTypeObject *);\r
-\r
-/* Generic operations on objects */\r
-PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);\r
-PyAPI_FUNC(void) _PyObject_Dump(PyObject *);\r
-PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *);\r
-PyAPI_FUNC(PyObject *) _PyObject_Str(PyObject *);\r
-PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *);\r
-#define PyObject_Bytes PyObject_Str\r
-#ifdef Py_USING_UNICODE\r
-PyAPI_FUNC(PyObject *) PyObject_Unicode(PyObject *);\r
-#endif\r
-PyAPI_FUNC(int) PyObject_Compare(PyObject *, PyObject *);\r
-PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int);\r
-PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int);\r
-PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);\r
-PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *);\r
-PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);\r
-PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);\r
-PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);\r
-PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *);\r
-PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);\r
-PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *);\r
-PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);\r
-PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);\r
-PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *,\r
-                                              PyObject *, PyObject *);\r
-PyAPI_FUNC(long) PyObject_Hash(PyObject *);\r
-PyAPI_FUNC(long) PyObject_HashNotImplemented(PyObject *);\r
-PyAPI_FUNC(int) PyObject_IsTrue(PyObject *);\r
-PyAPI_FUNC(int) PyObject_Not(PyObject *);\r
-PyAPI_FUNC(int) PyCallable_Check(PyObject *);\r
-PyAPI_FUNC(int) PyNumber_Coerce(PyObject **, PyObject **);\r
-PyAPI_FUNC(int) PyNumber_CoerceEx(PyObject **, PyObject **);\r
-\r
-PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *);\r
-\r
-/* A slot function whose address we need to compare */\r
-extern int _PyObject_SlotCompare(PyObject *, PyObject *);\r
-/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes\r
-   dict as the last parameter. */\r
-PyAPI_FUNC(PyObject *)\r
-_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *);\r
-PyAPI_FUNC(int)\r
-_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,\r
-                                 PyObject *, PyObject *);\r
-\r
-\r
-/* PyObject_Dir(obj) acts like Python __builtin__.dir(obj), returning a\r
-   list of strings.  PyObject_Dir(NULL) is like __builtin__.dir(),\r
-   returning the names of the current locals.  In this case, if there are\r
-   no current locals, NULL is returned, and PyErr_Occurred() is false.\r
-*/\r
-PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *);\r
-\r
-\r
-/* Helpers for printing recursive container types */\r
-PyAPI_FUNC(int) Py_ReprEnter(PyObject *);\r
-PyAPI_FUNC(void) Py_ReprLeave(PyObject *);\r
-\r
-/* Helpers for hash functions */\r
-PyAPI_FUNC(long) _Py_HashDouble(double);\r
-PyAPI_FUNC(long) _Py_HashPointer(void*);\r
-\r
-typedef struct {\r
-    long prefix;\r
-    long suffix;\r
-} _Py_HashSecret_t;\r
-PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;\r
-\r
-#ifdef Py_DEBUG\r
-PyAPI_DATA(int) _Py_HashSecret_Initialized;\r
-#endif\r
-\r
-/* Helper for passing objects to printf and the like.\r
-   Leaks refcounts.  Don't use it!\r
-*/\r
-#define PyObject_REPR(obj) PyString_AS_STRING(PyObject_Repr(obj))\r
-\r
-/* Flag bits for printing: */\r
-#define Py_PRINT_RAW    1       /* No string quotes etc. */\r
-\r
-/*\r
-`Type flags (tp_flags)\r
-\r
-These flags are used to extend the type structure in a backwards-compatible\r
-fashion. Extensions can use the flags to indicate (and test) when a given\r
-type structure contains a new feature. The Python core will use these when\r
-introducing new functionality between major revisions (to avoid mid-version\r
-changes in the PYTHON_API_VERSION).\r
-\r
-Arbitration of the flag bit positions will need to be coordinated among\r
-all extension writers who publically release their extensions (this will\r
-be fewer than you might expect!)..\r
-\r
-Python 1.5.2 introduced the bf_getcharbuffer slot into PyBufferProcs.\r
-\r
-Type definitions should use Py_TPFLAGS_DEFAULT for their tp_flags value.\r
-\r
-Code can use PyType_HasFeature(type_ob, flag_value) to test whether the\r
-given type object has a specified feature.\r
-\r
-NOTE: when building the core, Py_TPFLAGS_DEFAULT includes\r
-Py_TPFLAGS_HAVE_VERSION_TAG; outside the core, it doesn't.  This is so\r
-that extensions that modify tp_dict of their own types directly don't\r
-break, since this was allowed in 2.5.  In 3.0 they will have to\r
-manually remove this flag though!\r
-*/\r
-\r
-/* PyBufferProcs contains bf_getcharbuffer */\r
-#define Py_TPFLAGS_HAVE_GETCHARBUFFER  (1L<<0)\r
-\r
-/* PySequenceMethods contains sq_contains */\r
-#define Py_TPFLAGS_HAVE_SEQUENCE_IN (1L<<1)\r
-\r
-/* This is here for backwards compatibility.  Extensions that use the old GC\r
- * API will still compile but the objects will not be tracked by the GC. */\r
-#define Py_TPFLAGS_GC 0 /* used to be (1L<<2) */\r
-\r
-/* PySequenceMethods and PyNumberMethods contain in-place operators */\r
-#define Py_TPFLAGS_HAVE_INPLACEOPS (1L<<3)\r
-\r
-/* PyNumberMethods do their own coercion */\r
-#define Py_TPFLAGS_CHECKTYPES (1L<<4)\r
-\r
-/* tp_richcompare is defined */\r
-#define Py_TPFLAGS_HAVE_RICHCOMPARE (1L<<5)\r
-\r
-/* Objects which are weakly referencable if their tp_weaklistoffset is >0 */\r
-#define Py_TPFLAGS_HAVE_WEAKREFS (1L<<6)\r
-\r
-/* tp_iter is defined */\r
-#define Py_TPFLAGS_HAVE_ITER (1L<<7)\r
-\r
-/* New members introduced by Python 2.2 exist */\r
-#define Py_TPFLAGS_HAVE_CLASS (1L<<8)\r
-\r
-/* Set if the type object is dynamically allocated */\r
-#define Py_TPFLAGS_HEAPTYPE (1L<<9)\r
-\r
-/* Set if the type allows subclassing */\r
-#define Py_TPFLAGS_BASETYPE (1L<<10)\r
-\r
-/* Set if the type is 'ready' -- fully initialized */\r
-#define Py_TPFLAGS_READY (1L<<12)\r
-\r
-/* Set while the type is being 'readied', to prevent recursive ready calls */\r
-#define Py_TPFLAGS_READYING (1L<<13)\r
-\r
-/* Objects support garbage collection (see objimp.h) */\r
-#define Py_TPFLAGS_HAVE_GC (1L<<14)\r
-\r
-/* These two bits are preserved for Stackless Python, next after this is 17 */\r
-#ifdef STACKLESS\r
-#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3L<<15)\r
-#else\r
-#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0\r
-#endif\r
-\r
-/* Objects support nb_index in PyNumberMethods */\r
-#define Py_TPFLAGS_HAVE_INDEX (1L<<17)\r
-\r
-/* Objects support type attribute cache */\r
-#define Py_TPFLAGS_HAVE_VERSION_TAG   (1L<<18)\r
-#define Py_TPFLAGS_VALID_VERSION_TAG  (1L<<19)\r
-\r
-/* Type is abstract and cannot be instantiated */\r
-#define Py_TPFLAGS_IS_ABSTRACT (1L<<20)\r
-\r
-/* Has the new buffer protocol */\r
-#define Py_TPFLAGS_HAVE_NEWBUFFER (1L<<21)\r
-\r
-/* These flags are used to determine if a type is a subclass. */\r
-#define Py_TPFLAGS_INT_SUBCLASS         (1L<<23)\r
-#define Py_TPFLAGS_LONG_SUBCLASS        (1L<<24)\r
-#define Py_TPFLAGS_LIST_SUBCLASS        (1L<<25)\r
-#define Py_TPFLAGS_TUPLE_SUBCLASS       (1L<<26)\r
-#define Py_TPFLAGS_STRING_SUBCLASS      (1L<<27)\r
-#define Py_TPFLAGS_UNICODE_SUBCLASS     (1L<<28)\r
-#define Py_TPFLAGS_DICT_SUBCLASS        (1L<<29)\r
-#define Py_TPFLAGS_BASE_EXC_SUBCLASS    (1L<<30)\r
-#define Py_TPFLAGS_TYPE_SUBCLASS        (1L<<31)\r
-\r
-#define Py_TPFLAGS_DEFAULT_EXTERNAL ( \\r
-                 Py_TPFLAGS_HAVE_GETCHARBUFFER | \\r
-                 Py_TPFLAGS_HAVE_SEQUENCE_IN | \\r
-                 Py_TPFLAGS_HAVE_INPLACEOPS | \\r
-                 Py_TPFLAGS_HAVE_RICHCOMPARE | \\r
-                 Py_TPFLAGS_HAVE_WEAKREFS | \\r
-                 Py_TPFLAGS_HAVE_ITER | \\r
-                 Py_TPFLAGS_HAVE_CLASS | \\r
-                 Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \\r
-                 Py_TPFLAGS_HAVE_INDEX | \\r
-                 0)\r
-#define Py_TPFLAGS_DEFAULT_CORE (Py_TPFLAGS_DEFAULT_EXTERNAL | \\r
-                 Py_TPFLAGS_HAVE_VERSION_TAG)\r
-\r
-#ifdef Py_BUILD_CORE\r
-#define Py_TPFLAGS_DEFAULT Py_TPFLAGS_DEFAULT_CORE\r
-#else\r
-#define Py_TPFLAGS_DEFAULT Py_TPFLAGS_DEFAULT_EXTERNAL\r
-#endif\r
-\r
-#define PyType_HasFeature(t,f)  (((t)->tp_flags & (f)) != 0)\r
-#define PyType_FastSubclass(t,f)  PyType_HasFeature(t,f)\r
-\r
-\r
-/*\r
-The macros Py_INCREF(op) and Py_DECREF(op) are used to increment or decrement\r
-reference counts.  Py_DECREF calls the object's deallocator function when\r
-the refcount falls to 0; for\r
-objects that don't contain references to other objects or heap memory\r
-this can be the standard function free().  Both macros can be used\r
-wherever a void expression is allowed.  The argument must not be a\r
-NULL pointer.  If it may be NULL, use Py_XINCREF/Py_XDECREF instead.\r
-The macro _Py_NewReference(op) initialize reference counts to 1, and\r
-in special builds (Py_REF_DEBUG, Py_TRACE_REFS) performs additional\r
-bookkeeping appropriate to the special build.\r
-\r
-We assume that the reference count field can never overflow; this can\r
-be proven when the size of the field is the same as the pointer size, so\r
-we ignore the possibility.  Provided a C int is at least 32 bits (which\r
-is implicitly assumed in many parts of this code), that's enough for\r
-about 2**31 references to an object.\r
-\r
-XXX The following became out of date in Python 2.2, but I'm not sure\r
-XXX what the full truth is now.  Certainly, heap-allocated type objects\r
-XXX can and should be deallocated.\r
-Type objects should never be deallocated; the type pointer in an object\r
-is not considered to be a reference to the type object, to save\r
-complications in the deallocation function.  (This is actually a\r
-decision that's up to the implementer of each new type so if you want,\r
-you can count such references to the type object.)\r
-\r
-*** WARNING*** The Py_DECREF macro must have a side-effect-free argument\r
-since it may evaluate its argument multiple times.  (The alternative\r
-would be to mace it a proper function or assign it to a global temporary\r
-variable first, both of which are slower; and in a multi-threaded\r
-environment the global variable trick is not safe.)\r
-*/\r
-\r
-/* First define a pile of simple helper macros, one set per special\r
- * build symbol.  These either expand to the obvious things, or to\r
- * nothing at all when the special mode isn't in effect.  The main\r
- * macros can later be defined just once then, yet expand to different\r
- * things depending on which special build options are and aren't in effect.\r
- * Trust me <wink>:  while painful, this is 20x easier to understand than,\r
- * e.g, defining _Py_NewReference five different times in a maze of nested\r
- * #ifdefs (we used to do that -- it was impenetrable).\r
- */\r
-#ifdef Py_REF_DEBUG\r
-PyAPI_DATA(Py_ssize_t) _Py_RefTotal;\r
-PyAPI_FUNC(void) _Py_NegativeRefcount(const char *fname,\r
-                                            int lineno, PyObject *op);\r
-PyAPI_FUNC(PyObject *) _PyDict_Dummy(void);\r
-PyAPI_FUNC(PyObject *) _PySet_Dummy(void);\r
-PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);\r
-#define _Py_INC_REFTOTAL        _Py_RefTotal++\r
-#define _Py_DEC_REFTOTAL        _Py_RefTotal--\r
-#define _Py_REF_DEBUG_COMMA     ,\r
-#define _Py_CHECK_REFCNT(OP)                                    \\r
-{       if (((PyObject*)OP)->ob_refcnt < 0)                             \\r
-                _Py_NegativeRefcount(__FILE__, __LINE__,        \\r
-                                     (PyObject *)(OP));         \\r
-}\r
-#else\r
-#define _Py_INC_REFTOTAL\r
-#define _Py_DEC_REFTOTAL\r
-#define _Py_REF_DEBUG_COMMA\r
-#define _Py_CHECK_REFCNT(OP)    /* a semicolon */;\r
-#endif /* Py_REF_DEBUG */\r
-\r
-#ifdef COUNT_ALLOCS\r
-PyAPI_FUNC(void) inc_count(PyTypeObject *);\r
-PyAPI_FUNC(void) dec_count(PyTypeObject *);\r
-#define _Py_INC_TPALLOCS(OP)    inc_count(Py_TYPE(OP))\r
-#define _Py_INC_TPFREES(OP)     dec_count(Py_TYPE(OP))\r
-#define _Py_DEC_TPFREES(OP)     Py_TYPE(OP)->tp_frees--\r
-#define _Py_COUNT_ALLOCS_COMMA  ,\r
-#else\r
-#define _Py_INC_TPALLOCS(OP)\r
-#define _Py_INC_TPFREES(OP)\r
-#define _Py_DEC_TPFREES(OP)\r
-#define _Py_COUNT_ALLOCS_COMMA\r
-#endif /* COUNT_ALLOCS */\r
-\r
-#ifdef Py_TRACE_REFS\r
-/* Py_TRACE_REFS is such major surgery that we call external routines. */\r
-PyAPI_FUNC(void) _Py_NewReference(PyObject *);\r
-PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);\r
-PyAPI_FUNC(void) _Py_Dealloc(PyObject *);\r
-PyAPI_FUNC(void) _Py_PrintReferences(FILE *);\r
-PyAPI_FUNC(void) _Py_PrintReferenceAddresses(FILE *);\r
-PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force);\r
-\r
-#else\r
-/* Without Py_TRACE_REFS, there's little enough to do that we expand code\r
- * inline.\r
- */\r
-#define _Py_NewReference(op) (                          \\r
-    _Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA         \\r
-    _Py_INC_REFTOTAL  _Py_REF_DEBUG_COMMA               \\r
-    Py_REFCNT(op) = 1)\r
-\r
-#define _Py_ForgetReference(op) _Py_INC_TPFREES(op)\r
-\r
-#define _Py_Dealloc(op) (                               \\r
-    _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA          \\r
-    (*Py_TYPE(op)->tp_dealloc)((PyObject *)(op)))\r
-#endif /* !Py_TRACE_REFS */\r
-\r
-#define Py_INCREF(op) (                         \\r
-    _Py_INC_REFTOTAL  _Py_REF_DEBUG_COMMA       \\r
-    ((PyObject*)(op))->ob_refcnt++)\r
-\r
-#define Py_DECREF(op)                                   \\r
-    do {                                                \\r
-        if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \\r
-        --((PyObject*)(op))->ob_refcnt != 0)            \\r
-            _Py_CHECK_REFCNT(op)                        \\r
-        else                                            \\r
-        _Py_Dealloc((PyObject *)(op));                  \\r
-    } while (0)\r
-\r
-/* Safely decref `op` and set `op` to NULL, especially useful in tp_clear\r
- * and tp_dealloc implementatons.\r
- *\r
- * Note that "the obvious" code can be deadly:\r
- *\r
- *     Py_XDECREF(op);\r
- *     op = NULL;\r
- *\r
- * Typically, `op` is something like self->containee, and `self` is done\r
- * using its `containee` member.  In the code sequence above, suppose\r
- * `containee` is non-NULL with a refcount of 1.  Its refcount falls to\r
- * 0 on the first line, which can trigger an arbitrary amount of code,\r
- * possibly including finalizers (like __del__ methods or weakref callbacks)\r
- * coded in Python, which in turn can release the GIL and allow other threads\r
- * to run, etc.  Such code may even invoke methods of `self` again, or cause\r
- * cyclic gc to trigger, but-- oops! --self->containee still points to the\r
- * object being torn down, and it may be in an insane state while being torn\r
- * down.  This has in fact been a rich historic source of miserable (rare &\r
- * hard-to-diagnose) segfaulting (and other) bugs.\r
- *\r
- * The safe way is:\r
- *\r
- *      Py_CLEAR(op);\r
- *\r
- * That arranges to set `op` to NULL _before_ decref'ing, so that any code\r
- * triggered as a side-effect of `op` getting torn down no longer believes\r
- * `op` points to a valid object.\r
- *\r
- * There are cases where it's safe to use the naive code, but they're brittle.\r
- * For example, if `op` points to a Python integer, you know that destroying\r
- * one of those can't cause problems -- but in part that relies on that\r
- * Python integers aren't currently weakly referencable.  Best practice is\r
- * to use Py_CLEAR() even if you can't think of a reason for why you need to.\r
- */\r
-#define Py_CLEAR(op)                            \\r
-    do {                                        \\r
-        if (op) {                               \\r
-            PyObject *_py_tmp = (PyObject *)(op);               \\r
-            (op) = NULL;                        \\r
-            Py_DECREF(_py_tmp);                 \\r
-        }                                       \\r
-    } while (0)\r
-\r
-/* Macros to use in case the object pointer may be NULL: */\r
-#define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0)\r
-#define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0)\r
-\r
-/*\r
-These are provided as conveniences to Python runtime embedders, so that\r
-they can have object code that is not dependent on Python compilation flags.\r
-*/\r
-PyAPI_FUNC(void) Py_IncRef(PyObject *);\r
-PyAPI_FUNC(void) Py_DecRef(PyObject *);\r
-\r
-/*\r
-_Py_NoneStruct is an object of undefined type which can be used in contexts\r
-where NULL (nil) is not suitable (since NULL often means 'error').\r
-\r
-Don't forget to apply Py_INCREF() when returning this value!!!\r
-*/\r
-PyAPI_DATA(PyObject) _Py_NoneStruct; /* Don't use this directly */\r
-#define Py_None (&_Py_NoneStruct)\r
-\r
-/* Macro for returning Py_None from a function */\r
-#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None\r
-\r
-/*\r
-Py_NotImplemented is a singleton used to signal that an operation is\r
-not implemented for a given type combination.\r
-*/\r
-PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */\r
-#define Py_NotImplemented (&_Py_NotImplementedStruct)\r
-\r
-/* Rich comparison opcodes */\r
-#define Py_LT 0\r
-#define Py_LE 1\r
-#define Py_EQ 2\r
-#define Py_NE 3\r
-#define Py_GT 4\r
-#define Py_GE 5\r
-\r
-/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.\r
- * Defined in object.c.\r
- */\r
-PyAPI_DATA(int) _Py_SwappedOp[];\r
-\r
-/*\r
-Define staticforward and statichere for source compatibility with old\r
-C extensions.\r
-\r
-The staticforward define was needed to support certain broken C\r
-compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the\r
-static keyword when it was used with a forward declaration of a static\r
-initialized structure.  Standard C allows the forward declaration with\r
-static, and we've decided to stop catering to broken C compilers.\r
-(In fact, we expect that the compilers are all fixed eight years later.)\r
-*/\r
-\r
-#define staticforward static\r
-#define statichere static\r
-\r
-\r
-/*\r
-More conventions\r
-================\r
-\r
-Argument Checking\r
------------------\r
-\r
-Functions that take objects as arguments normally don't check for nil\r
-arguments, but they do check the type of the argument, and return an\r
-error if the function doesn't apply to the type.\r
-\r
-Failure Modes\r
--------------\r
-\r
-Functions may fail for a variety of reasons, including running out of\r
-memory.  This is communicated to the caller in two ways: an error string\r
-is set (see errors.h), and the function result differs: functions that\r
-normally return a pointer return NULL for failure, functions returning\r
-an integer return -1 (which could be a legal return value too!), and\r
-other functions return 0 for success and -1 for failure.\r
-Callers should always check for errors before using the result.  If\r
-an error was set, the caller must either explicitly clear it, or pass\r
-the error on to its caller.\r
-\r
-Reference Counts\r
-----------------\r
-\r
-It takes a while to get used to the proper usage of reference counts.\r
-\r
-Functions that create an object set the reference count to 1; such new\r
-objects must be stored somewhere or destroyed again with Py_DECREF().\r
-Some functions that 'store' objects, such as PyTuple_SetItem() and\r
-PyList_SetItem(),\r
-don't increment the reference count of the object, since the most\r
-frequent use is to store a fresh object.  Functions that 'retrieve'\r
-objects, such as PyTuple_GetItem() and PyDict_GetItemString(), also\r
-don't increment\r
-the reference count, since most frequently the object is only looked at\r
-quickly.  Thus, to retrieve an object and store it again, the caller\r
-must call Py_INCREF() explicitly.\r
-\r
-NOTE: functions that 'consume' a reference count, like\r
-PyList_SetItem(), consume the reference even if the object wasn't\r
-successfully stored, to simplify error handling.\r
-\r
-It seems attractive to make other functions that take an object as\r
-argument consume a reference count; however, this may quickly get\r
-confusing (even the current practice is already confusing).  Consider\r
-it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at\r
-times.\r
-*/\r
-\r
-\r
-/* Trashcan mechanism, thanks to Christian Tismer.\r
-\r
-When deallocating a container object, it's possible to trigger an unbounded\r
-chain of deallocations, as each Py_DECREF in turn drops the refcount on "the\r
-next" object in the chain to 0.  This can easily lead to stack faults, and\r
-especially in threads (which typically have less stack space to work with).\r
-\r
-A container object that participates in cyclic gc can avoid this by\r
-bracketing the body of its tp_dealloc function with a pair of macros:\r
-\r
-static void\r
-mytype_dealloc(mytype *p)\r
-{\r
-    ... declarations go here ...\r
-\r
-    PyObject_GC_UnTrack(p);        // must untrack first\r
-    Py_TRASHCAN_SAFE_BEGIN(p)\r
-    ... The body of the deallocator goes here, including all calls ...\r
-    ... to Py_DECREF on contained objects.                         ...\r
-    Py_TRASHCAN_SAFE_END(p)\r
-}\r
-\r
-CAUTION:  Never return from the middle of the body!  If the body needs to\r
-"get out early", put a label immediately before the Py_TRASHCAN_SAFE_END\r
-call, and goto it.  Else the call-depth counter (see below) will stay\r
-above 0 forever, and the trashcan will never get emptied.\r
-\r
-How it works:  The BEGIN macro increments a call-depth counter.  So long\r
-as this counter is small, the body of the deallocator is run directly without\r
-further ado.  But if the counter gets large, it instead adds p to a list of\r
-objects to be deallocated later, skips the body of the deallocator, and\r
-resumes execution after the END macro.  The tp_dealloc routine then returns\r
-without deallocating anything (and so unbounded call-stack depth is avoided).\r
-\r
-When the call stack finishes unwinding again, code generated by the END macro\r
-notices this, and calls another routine to deallocate all the objects that\r
-may have been added to the list of deferred deallocations.  In effect, a\r
-chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces,\r
-with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL.\r
-*/\r
-\r
-/* This is the old private API, invoked by the macros before 2.7.4.\r
-   Kept for binary compatibility of extensions. */\r
-PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*);\r
-PyAPI_FUNC(void) _PyTrash_destroy_chain(void);\r
-PyAPI_DATA(int) _PyTrash_delete_nesting;\r
-PyAPI_DATA(PyObject *) _PyTrash_delete_later;\r
-\r
-/* The new thread-safe private API, invoked by the macros below. */\r
-PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyObject*);\r
-PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void);\r
-\r
-#define PyTrash_UNWIND_LEVEL 50\r
-\r
-/* Note the workaround for when the thread state is NULL (issue #17703) */\r
-#define Py_TRASHCAN_SAFE_BEGIN(op) \\r
-    do { \\r
-        PyThreadState *_tstate = PyThreadState_GET(); \\r
-        if (!_tstate || \\r
-            _tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \\r
-            if (_tstate) \\r
-                ++_tstate->trash_delete_nesting;\r
-            /* The body of the deallocator is here. */\r
-#define Py_TRASHCAN_SAFE_END(op) \\r
-            if (_tstate) { \\r
-                --_tstate->trash_delete_nesting; \\r
-                if (_tstate->trash_delete_later \\r
-                    && _tstate->trash_delete_nesting <= 0) \\r
-                    _PyTrash_thread_destroy_chain(); \\r
-            } \\r
-        } \\r
-        else \\r
-            _PyTrash_thread_deposit_object((PyObject*)op); \\r
-    } while (0);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* !Py_OBJECT_H */\r