Staging
v0.5.1
https://github.com/python/cpython
Revision c392b570db0df5a11771921865a65d69646aa24b authored by Fred Drake on 21 March 2001, 22:15:01 UTC, committed by Fred Drake on 21 March 2001, 22:15:01 UTC
supporting cyclic garbage collection.  (This is not all of it, but I'm
taking a break!)

Also fixed some markup nits.
1 parent 09ccc3a
Raw File
Tip revision: c392b570db0df5a11771921865a65d69646aa24b authored by Fred Drake on 21 March 2001, 22:15:01 UTC
Integrated an expanded version of some text from Neil Schemenauer about
Tip revision: c392b57
cellobject.h
/* Cell object interface */

#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
	PyObject_VAR_HEAD
	PyObject *ob_ref;
} PyCellObject;

extern DL_IMPORT(PyTypeObject) PyCell_Type;

#define PyCell_Check(op) ((op)->ob_type == &PyCell_Type)

extern DL_IMPORT(PyObject *) PyCell_New(PyObject *);
extern DL_IMPORT(PyObject *) PyCell_Get(PyObject *);
extern DL_IMPORT(int) PyCell_Set(PyObject *, PyObject *);

#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 */
back to top