1 /** 2 Mirror _genobject.h 3 4 Generator object interface 5 */ 6 module deimos.python.genobject; 7 8 import deimos.python.pyport; 9 import deimos.python.object; 10 import deimos.python.frameobject; 11 12 extern(C): 13 // Python-header-file: Include/genobject.h: 14 15 struct PyGenObject { 16 mixin PyObject_HEAD; 17 /** The gi_ prefix is intended to remind of generator-iterator. 18 19 Note: gi_frame can be NULL if the generator is "finished" 20 */ 21 PyFrameObject* gi_frame; 22 /** True if generator is being executed. */ 23 int gi_running; 24 version(Python_2_6_Or_Later){ 25 /** The code object backing the generator */ 26 /// Availability: >= 2.6 27 PyObject* gi_code; 28 } 29 /** List of weak reference. */ 30 PyObject* gi_weakreflist; 31 } 32 33 /// _ 34 mixin(PyAPI_DATA!"PyTypeObject PyGen_Type"); 35 36 // D translations of C macros: 37 /// _ 38 int PyGen_Check()(PyObject* op) { 39 return PyObject_TypeCheck(op, &PyGen_Type); 40 } 41 /// _ 42 int PyGen_CheckExact()(PyObject* op) { 43 return Py_TYPE(op) == &PyGen_Type; 44 } 45 46 /// _ 47 PyObject* PyGen_New(PyFrameObject*); 48 /// _ 49 int PyGen_NeedsFinalizing(PyGenObject*); 50