jpayne@69: #ifndef Py_CPYTHON_TUPLEOBJECT_H jpayne@69: # error "this header file must not be included directly" jpayne@69: #endif jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: typedef struct { jpayne@69: PyObject_VAR_HEAD jpayne@69: /* ob_item contains space for 'ob_size' elements. jpayne@69: Items must normally not be NULL, except during construction when jpayne@69: the tuple is not yet visible outside the function that builds it. */ jpayne@69: PyObject *ob_item[1]; jpayne@69: } PyTupleObject; jpayne@69: jpayne@69: PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); jpayne@69: PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); jpayne@69: jpayne@69: /* Macros trading safety for speed */ jpayne@69: jpayne@69: /* Cast argument to PyTupleObject* type. */ jpayne@69: #define _PyTuple_CAST(op) (assert(PyTuple_Check(op)), (PyTupleObject *)(op)) jpayne@69: jpayne@69: #define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op)) jpayne@69: jpayne@69: #define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i]) jpayne@69: jpayne@69: /* Macro, *only* to be used to fill in brand new tuples */ jpayne@69: #define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v) jpayne@69: jpayne@69: PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif