blob: 2a6dcaa483ac3b64f546a0f4972c7da9825cd249 [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
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000011 PyObject *ob_ref;
12} PyCellObject;
13
Mark Hammond91a681d2002-08-12 07:21:58 +000014PyAPI_DATA(PyTypeObject) PyCell_Type;
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000015
16#define PyCell_Check(op) ((op)->ob_type == &PyCell_Type)
17
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 */