source: vendor/python/2.5/Include/genobject.h

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

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