Staging
v0.5.1
Revision 949cf93f8ee27c37650483458f0aa3e295011ef6 authored by Miss Islington (bot) on 25 July 2020, 21:03:50 UTC, committed by GitHub on 25 July 2020, 21:03:50 UTC
(cherry picked from commit 2024d7aca100c3faa9c6730aba3de5f0528750be)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
1 parent a667e1c
Raw File
cellobject.h
/* Cell object interface */
#ifndef Py_LIMITED_API
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    PyObject_HEAD
    PyObject *ob_ref;       /* Content of the cell or NULL when empty */
} PyCellObject;

PyAPI_DATA(PyTypeObject) PyCell_Type;

#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)

PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);

#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
#define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v)

#ifdef __cplusplus
}
#endif
#endif /* !Py_TUPLEOBJECT_H */
#endif /* Py_LIMITED_API */
back to top