2021-08-08 04:08:33 +00:00
|
|
|
#ifndef Py_LIMITED_API
|
|
|
|
#ifndef Py_CELLOBJECT_H
|
|
|
|
#define Py_CELLOBJECT_H
|
2021-08-12 07:42:14 +00:00
|
|
|
#include "third_party/python/Include/object.h"
|
2021-08-10 17:26:13 +00:00
|
|
|
COSMOPOLITAN_C_START_
|
2021-08-08 04:08:33 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
PyObject_HEAD
|
|
|
|
PyObject *ob_ref; /* Content of the cell or NULL when empty */
|
|
|
|
} PyCellObject;
|
|
|
|
|
2021-08-12 07:42:14 +00:00
|
|
|
extern PyTypeObject PyCell_Type;
|
2021-08-08 04:08:33 +00:00
|
|
|
|
|
|
|
#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)
|
|
|
|
|
2021-08-12 07:42:14 +00:00
|
|
|
PyObject * PyCell_New(PyObject *);
|
|
|
|
PyObject * PyCell_Get(PyObject *);
|
|
|
|
int PyCell_Set(PyObject *, PyObject *);
|
2021-08-08 04:08:33 +00:00
|
|
|
|
|
|
|
#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
|
|
|
|
#define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v)
|
|
|
|
|
2021-08-10 17:26:13 +00:00
|
|
|
COSMOPOLITAN_C_END_
|
2021-08-08 04:08:33 +00:00
|
|
|
#endif /* !Py_TUPLEOBJECT_H */
|
|
|
|
#endif /* Py_LIMITED_API */
|