2021-08-08 04:08:33 +00:00
|
|
|
#ifndef Py_STRUCTSEQ_H
|
|
|
|
#define Py_STRUCTSEQ_H
|
2021-08-12 07:42:14 +00:00
|
|
|
#include "third_party/python/Include/object.h"
|
|
|
|
#include "third_party/python/Include/tupleobject.h"
|
2021-08-10 17:26:13 +00:00
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
/* clang-format off */
|
2021-08-08 04:08:33 +00:00
|
|
|
|
|
|
|
typedef struct PyStructSequence_Field {
|
|
|
|
char *name;
|
|
|
|
char *doc;
|
|
|
|
} PyStructSequence_Field;
|
|
|
|
|
|
|
|
typedef struct PyStructSequence_Desc {
|
|
|
|
char *name;
|
|
|
|
char *doc;
|
|
|
|
struct PyStructSequence_Field *fields;
|
|
|
|
int n_in_sequence;
|
|
|
|
} PyStructSequence_Desc;
|
|
|
|
|
|
|
|
extern char* PyStructSequence_UnnamedField;
|
|
|
|
|
|
|
|
#ifndef Py_LIMITED_API
|
2021-08-12 07:42:14 +00:00
|
|
|
void PyStructSequence_InitType(PyTypeObject *type,
|
2021-08-08 04:08:33 +00:00
|
|
|
PyStructSequence_Desc *desc);
|
2021-08-12 07:42:14 +00:00
|
|
|
int PyStructSequence_InitType2(PyTypeObject *type,
|
2021-08-08 04:08:33 +00:00
|
|
|
PyStructSequence_Desc *desc);
|
|
|
|
#endif
|
2021-08-12 07:42:14 +00:00
|
|
|
PyTypeObject* PyStructSequence_NewType(PyStructSequence_Desc *desc);
|
2021-08-08 04:08:33 +00:00
|
|
|
|
2021-08-12 07:42:14 +00:00
|
|
|
PyObject * PyStructSequence_New(PyTypeObject* type);
|
2021-08-08 04:08:33 +00:00
|
|
|
|
|
|
|
#ifndef Py_LIMITED_API
|
|
|
|
typedef PyTupleObject PyStructSequence;
|
|
|
|
|
|
|
|
/* Macro, *only* to be used to fill in brand new objects */
|
|
|
|
#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
|
|
|
|
|
|
|
|
#define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
|
|
|
|
#endif
|
|
|
|
|
2021-08-12 07:42:14 +00:00
|
|
|
void PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
|
|
|
|
PyObject* PyStructSequence_GetItem(PyObject*, Py_ssize_t);
|
2021-08-08 04:08:33 +00:00
|
|
|
|
2021-08-10 17:26:13 +00:00
|
|
|
COSMOPOLITAN_C_END_
|
2021-08-08 04:08:33 +00:00
|
|
|
#endif /* !Py_STRUCTSEQ_H */
|