jpayne@69: jpayne@69: /* Named tuple object interface */ jpayne@69: jpayne@69: #ifndef Py_STRUCTSEQ_H jpayne@69: #define Py_STRUCTSEQ_H jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: typedef struct PyStructSequence_Field { jpayne@69: const char *name; jpayne@69: const char *doc; jpayne@69: } PyStructSequence_Field; jpayne@69: jpayne@69: typedef struct PyStructSequence_Desc { jpayne@69: const char *name; jpayne@69: const char *doc; jpayne@69: struct PyStructSequence_Field *fields; jpayne@69: int n_in_sequence; jpayne@69: } PyStructSequence_Desc; jpayne@69: jpayne@69: extern char* PyStructSequence_UnnamedField; jpayne@69: jpayne@69: #ifndef Py_LIMITED_API jpayne@69: PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, jpayne@69: PyStructSequence_Desc *desc); jpayne@69: PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type, jpayne@69: PyStructSequence_Desc *desc); jpayne@69: #endif jpayne@69: PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc); jpayne@69: jpayne@69: PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); jpayne@69: jpayne@69: #ifndef Py_LIMITED_API jpayne@69: typedef PyTupleObject PyStructSequence; jpayne@69: jpayne@69: /* Macro, *only* to be used to fill in brand new objects */ jpayne@69: #define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v) jpayne@69: jpayne@69: #define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i) jpayne@69: #endif jpayne@69: jpayne@69: PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*); jpayne@69: PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t); jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: #endif /* !Py_STRUCTSEQ_H */