Mercurial > cpython-lru_cache-weakref
annotate Include/genobject.h @ 70817:dd775b1561ba
Fix markup.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Tue, 14 Jun 2011 21:09:55 +0200 |
| parents | 62b61abd02b8 |
| children | d64ac9ab4cd0 |
| rev | line source |
|---|---|
|
32175
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
1 |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
2 /* Generator object interface */ |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
3 |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
44999
diff
changeset
|
4 #ifndef Py_LIMITED_API |
|
32175
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
5 #ifndef Py_GENOBJECT_H |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
6 #define Py_GENOBJECT_H |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
7 #ifdef __cplusplus |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
8 extern "C" { |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
9 #endif |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
10 |
|
32421
485d2ef43419
Patch #966493: Cleanup generator/eval_frame exposure.
Martin v. Löwis <martin@v.loewis.de>
parents:
32175
diff
changeset
|
11 struct _frame; /* Avoid including frameobject.h */ |
|
485d2ef43419
Patch #966493: Cleanup generator/eval_frame exposure.
Martin v. Löwis <martin@v.loewis.de>
parents:
32175
diff
changeset
|
12 |
|
32175
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
13 typedef struct { |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
14 PyObject_HEAD |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
15 /* The gi_ prefix is intended to remind of generator-iterator. */ |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
16 |
|
37879
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
32421
diff
changeset
|
17 /* Note: gi_frame can be NULL if the generator is "finished" */ |
|
32421
485d2ef43419
Patch #966493: Cleanup generator/eval_frame exposure.
Martin v. Löwis <martin@v.loewis.de>
parents:
32175
diff
changeset
|
18 struct _frame *gi_frame; |
|
32175
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
19 |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
20 /* True if generator is being executed. */ |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
21 int gi_running; |
|
44999
7c02182e2979
Merged revisions 60284-60349 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
44351
diff
changeset
|
22 |
|
7c02182e2979
Merged revisions 60284-60349 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
44351
diff
changeset
|
23 /* The code object backing the generator */ |
|
7c02182e2979
Merged revisions 60284-60349 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
44351
diff
changeset
|
24 PyObject *gi_code; |
|
32175
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
25 |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
26 /* List of weak reference. */ |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
27 PyObject *gi_weakreflist; |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
28 } PyGenObject; |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
29 |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
30 PyAPI_DATA(PyTypeObject) PyGen_Type; |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
31 |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
32 #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) |
|
44351
86a2679dca46
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
33 #define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) |
|
32175
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
34 |
|
32421
485d2ef43419
Patch #966493: Cleanup generator/eval_frame exposure.
Martin v. Löwis <martin@v.loewis.de>
parents:
32175
diff
changeset
|
35 PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); |
|
37879
f731859e9b3b
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
Thomas Wouters <thomas@python.org>
parents:
32421
diff
changeset
|
36 PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *); |
|
32175
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
37 |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
38 #ifdef __cplusplus |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
39 } |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
40 #endif |
|
8ee5a56b8031
Patch #957398: Add public API for Generator Object/Type.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
41 #endif /* !Py_GENOBJECT_H */ |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
44999
diff
changeset
|
42 #endif /* Py_LIMITED_API */ |
