blob: c9b7c193a6ff9972a130680e12978563a95909b3 [file] [log] [blame]
Martin v. Löwise440e472004-06-01 15:22:42 +00001
2/* Generator object interface */
3
4#ifndef Py_GENOBJECT_H
5#define Py_GENOBJECT_H
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef struct {
11 PyObject_HEAD
12 /* The gi_ prefix is intended to remind of generator-iterator. */
13
14 PyFrameObject *gi_frame;
15
16 /* True if generator is being executed. */
17 int gi_running;
18
19 /* List of weak reference. */
20 PyObject *gi_weakreflist;
21} PyGenObject;
22
23PyAPI_DATA(PyTypeObject) PyGen_Type;
24
25#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
26#define PyGen_CheckExact(op) ((op)->ob_type == &PyGen_Type)
27
28PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *);
29
30#ifdef __cplusplus
31}
32#endif
33#endif /* !Py_GENOBJECT_H */