Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | #ifndef Py_CELLOBJECT_H |
2 | #define Py_CELLOBJECT_H | |
3 | #ifdef __cplusplus | |
4 | extern "C" { | |
5 | #endif | |
6 | ||
7 | typedef struct { | |
8 | PyObject_HEAD | |
9 | PyObject *ob_ref; /* Content of the cell or NULL when empty */ | |
10 | } PyCellObject; | |
11 | ||
12 | PyAPI_DATA(PyTypeObject) PyCell_Type; | |
13 | ||
14 | #define PyCell_Check(op) ((op)->ob_type == &PyCell_Type) | |
15 | ||
16 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); | |
17 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); | |
18 | PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); | |
19 | ||
20 | #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) | |
21 | #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) | |
22 | ||
23 | #ifdef __cplusplus | |
24 | } | |
25 | #endif | |
26 | #endif /* !Py_TUPLEOBJECT_H */ |