]>
Commit | Line | Data |
---|---|---|
c8042e10 DM |
1 | \r |
2 | /* Generator object interface */\r | |
3 | \r | |
4 | #ifndef Py_GENOBJECT_H\r | |
5 | #define Py_GENOBJECT_H\r | |
6 | #ifdef __cplusplus\r | |
7 | extern "C" {\r | |
8 | #endif\r | |
9 | \r | |
10 | struct _frame; /* Avoid including frameobject.h */\r | |
11 | \r | |
12 | typedef struct {\r | |
13 | PyObject_HEAD\r | |
14 | /* The gi_ prefix is intended to remind of generator-iterator. */\r | |
15 | \r | |
16 | /* Note: gi_frame can be NULL if the generator is "finished" */\r | |
17 | struct _frame *gi_frame;\r | |
18 | \r | |
19 | /* True if generator is being executed. */\r | |
20 | int gi_running;\r | |
21 | \r | |
22 | /* The code object backing the generator */\r | |
23 | PyObject *gi_code;\r | |
24 | \r | |
25 | /* List of weak reference. */\r | |
26 | PyObject *gi_weakreflist;\r | |
27 | } PyGenObject;\r | |
28 | \r | |
29 | PyAPI_DATA(PyTypeObject) PyGen_Type;\r | |
30 | \r | |
31 | #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)\r | |
32 | #define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)\r | |
33 | \r | |
34 | PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);\r | |
35 | PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);\r | |
36 | \r | |
37 | #ifdef __cplusplus\r | |
38 | }\r | |
39 | #endif\r | |
40 | #endif /* !Py_GENOBJECT_H */\r |