| Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 1 | /* Cell object interface */ | 
| Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 2 | #ifndef Py_LIMITED_API | 
| Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 3 | #ifndef Py_CELLOBJECT_H | 
 | 4 | #define Py_CELLOBJECT_H | 
 | 5 | #ifdef __cplusplus | 
 | 6 | extern "C" { | 
 | 7 | #endif | 
 | 8 |  | 
 | 9 | typedef struct { | 
| Serhiy Storchaka | 598ceae | 2017-11-28 17:56:10 +0200 | [diff] [blame] | 10 |     PyObject_HEAD | 
 | 11 |     PyObject *ob_ref;       /* Content of the cell or NULL when empty */ | 
| Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 12 | } PyCellObject; | 
 | 13 |  | 
| Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 14 | PyAPI_DATA(PyTypeObject) PyCell_Type; | 
| Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 15 |  | 
| Dong-hee Na | d905df7 | 2020-02-14 02:37:17 +0900 | [diff] [blame] | 16 | #define PyCell_Check(op) Py_IS_TYPE(op, &PyCell_Type) | 
| Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 17 |  | 
| Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 18 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); | 
 | 19 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); | 
 | 20 | PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); | 
| Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 21 |  | 
 | 22 | #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) | 
| Victor Stinner | 0ef96c2 | 2020-12-07 11:56:20 +0100 | [diff] [blame] | 23 | #define PyCell_SET(op, v) ((void)(((PyCellObject *)(op))->ob_ref = v)) | 
| Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 24 |  | 
 | 25 | #ifdef __cplusplus | 
 | 26 | } | 
 | 27 | #endif | 
 | 28 | #endif /* !Py_TUPLEOBJECT_H */ | 
| Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 29 | #endif /* Py_LIMITED_API */ |