cellobject.h 713 B

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