Chris@87: Chris@87: /* Generator object interface */ Chris@87: Chris@87: #ifndef Py_GENOBJECT_H Chris@87: #define Py_GENOBJECT_H Chris@87: #ifdef __cplusplus Chris@87: extern "C" { Chris@87: #endif Chris@87: Chris@87: struct _frame; /* Avoid including frameobject.h */ Chris@87: Chris@87: typedef struct { Chris@87: PyObject_HEAD Chris@87: /* The gi_ prefix is intended to remind of generator-iterator. */ Chris@87: Chris@87: /* Note: gi_frame can be NULL if the generator is "finished" */ Chris@87: struct _frame *gi_frame; Chris@87: Chris@87: /* True if generator is being executed. */ Chris@87: int gi_running; Chris@87: Chris@87: /* The code object backing the generator */ Chris@87: PyObject *gi_code; Chris@87: Chris@87: /* List of weak reference. */ Chris@87: PyObject *gi_weakreflist; Chris@87: } PyGenObject; Chris@87: Chris@87: PyAPI_DATA(PyTypeObject) PyGen_Type; Chris@87: Chris@87: #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) Chris@87: #define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) Chris@87: Chris@87: PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); Chris@87: PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *); Chris@87: Chris@87: #ifdef __cplusplus Chris@87: } Chris@87: #endif Chris@87: #endif /* !Py_GENOBJECT_H */