blob: a0aa4d947c22115f8bc609c8d4f7ca57a2aa3773 [file] [log] [blame]
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +00001/* Cell object interface */
Martin v. Löwis4d0d4712010-12-03 20:14:31 +00002#ifndef Py_LIMITED_API
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +00003#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 */
Martin v. Löwis4d0d4712010-12-03 20:14:31 +000029#endif /* Py_LIMITED_API */