cellobject.h 701 Bytes
Newer Older
Jeremy Hylton's avatar
Jeremy Hylton committed
1
/* Cell object interface */
2
#ifndef Py_LIMITED_API
Jeremy Hylton's avatar
Jeremy Hylton committed
3 4 5 6 7 8 9
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
10
	PyObject_HEAD
11
	PyObject *ob_ref;	/* Content of the cell or NULL when empty */
Jeremy Hylton's avatar
Jeremy Hylton committed
12 13
} PyCellObject;

14
PyAPI_DATA(PyTypeObject) PyCell_Type;
Jeremy Hylton's avatar
Jeremy Hylton committed
15

16
#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)
Jeremy Hylton's avatar
Jeremy Hylton committed
17

18 19 20
PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
Jeremy Hylton's avatar
Jeremy Hylton committed
21 22 23 24 25 26 27 28

#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 */
29
#endif /* Py_LIMITED_API */