blob: c927ee5da12678c43a1b820f259a7fbfc73aac18 [file] [log] [blame]
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +00001/* Cell object interface */
2
3#ifndef Py_CELLOBJECT_H
4#define Py_CELLOBJECT_H
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9typedef struct {
Jeremy Hylton31e233a2002-02-28 23:46:34 +000010 PyObject_HEAD
Armin Rigo89a39462004-10-28 16:32:00 +000011 PyObject *ob_ref; /* Content of the cell or NULL when empty */
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000012} PyCellObject;
13
Mark Hammond91a681d2002-08-12 07:21:58 +000014PyAPI_DATA(PyTypeObject) PyCell_Type;
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000015
Christian Heimes90aa7642007-12-19 02:45:37 +000016#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000017
Mark Hammond91a681d2002-08-12 07:21:58 +000018PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
19PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
20PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000021
22#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
23#define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v)
24
25#ifdef __cplusplus
26}
27#endif
28#endif /* !Py_TUPLEOBJECT_H */