2001-01-25 16:04:14 -04:00
|
|
|
/* Cell object interface */
|
|
|
|
|
|
|
|
#ifndef Py_CELLOBJECT_H
|
|
|
|
#define Py_CELLOBJECT_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct {
|
2002-02-28 19:46:34 -04:00
|
|
|
PyObject_HEAD
|
2004-10-28 13:32:00 -03:00
|
|
|
PyObject *ob_ref; /* Content of the cell or NULL when empty */
|
2001-01-25 16:04:14 -04:00
|
|
|
} PyCellObject;
|
|
|
|
|
2002-08-12 04:21:58 -03:00
|
|
|
PyAPI_DATA(PyTypeObject) PyCell_Type;
|
2001-01-25 16:04:14 -04:00
|
|
|
|
2007-12-18 22:37:44 -04:00
|
|
|
#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)
|
2001-01-25 16:04:14 -04:00
|
|
|
|
2002-08-12 04:21:58 -03:00
|
|
|
PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
|
|
|
|
PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
|
2001-01-25 16:04:14 -04:00
|
|
|
|
|
|
|
#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 */
|