| |
|
| | |
| |
|
| | #ifndef Py_LIMITED_API |
| | #ifndef Py_GENOBJECT_H |
| | #define Py_GENOBJECT_H |
| | #ifdef __cplusplus |
| | extern "C" { |
| | #endif |
| |
|
| | #include "pystate.h" |
| | #include "abstract.h" |
| |
|
| | |
| | |
| | #define _PyGenObject_HEAD(prefix) \ |
| | PyObject_HEAD \ |
| | \ |
| | PyFrameObject *prefix##_frame; \ |
| | \ |
| | PyObject *prefix##_code; \ |
| | \ |
| | PyObject *prefix##_weakreflist; \ |
| | \ |
| | PyObject *prefix##_name; \ |
| | \ |
| | PyObject *prefix##_qualname; \ |
| | _PyErr_StackItem prefix##_exc_state; |
| |
|
| | typedef struct { |
| | |
| | _PyGenObject_HEAD(gi) |
| | } PyGenObject; |
| |
|
| | PyAPI_DATA(PyTypeObject) PyGen_Type; |
| |
|
| | #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) |
| | #define PyGen_CheckExact(op) Py_IS_TYPE(op, &PyGen_Type) |
| |
|
| | PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *); |
| | PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *, |
| | PyObject *name, PyObject *qualname); |
| | PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *); |
| | PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **); |
| | PyObject *_PyGen_yf(PyGenObject *); |
| | PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self); |
| |
|
| | #ifndef Py_LIMITED_API |
| | typedef struct { |
| | _PyGenObject_HEAD(cr) |
| | PyObject *cr_origin; |
| | } PyCoroObject; |
| |
|
| | PyAPI_DATA(PyTypeObject) PyCoro_Type; |
| | PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type; |
| |
|
| | #define PyCoro_CheckExact(op) Py_IS_TYPE(op, &PyCoro_Type) |
| | PyObject *_PyCoro_GetAwaitableIter(PyObject *o); |
| | PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *, |
| | PyObject *name, PyObject *qualname); |
| |
|
| | |
| |
|
| | typedef struct { |
| | _PyGenObject_HEAD(ag) |
| | PyObject *ag_finalizer; |
| |
|
| | |
| | |
| | |
| | int ag_hooks_inited; |
| |
|
| | |
| | |
| | int ag_closed; |
| |
|
| | int ag_running_async; |
| | } PyAsyncGenObject; |
| |
|
| | PyAPI_DATA(PyTypeObject) PyAsyncGen_Type; |
| | PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type; |
| | PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type; |
| | PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type; |
| |
|
| | PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *, |
| | PyObject *name, PyObject *qualname); |
| |
|
| | #define PyAsyncGen_CheckExact(op) Py_IS_TYPE(op, &PyAsyncGen_Type) |
| |
|
| | PyObject *_PyAsyncGenValueWrapperNew(PyObject *); |
| |
|
| | #endif |
| |
|
| | #undef _PyGenObject_HEAD |
| |
|
| | #ifdef __cplusplus |
| | } |
| | #endif |
| | #endif |
| | #endif |
| |
|