diff options
Diffstat (limited to 'Include/genobject.h')
| -rw-r--r-- | Include/genobject.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Include/genobject.h b/Include/genobject.h index a76dc92..7488054 100644 --- a/Include/genobject.h +++ b/Include/genobject.h @@ -45,6 +45,21 @@ PyAPI_FUNC(PyObject *) _PyGen_Send(PyGenObject *, PyObject *); PyObject *_PyGen_yf(PyGenObject *); PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self); +typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, +} PySendResult; + +/* Sends the value into the generator or the coroutine. Returns: + - PYGEN_RETURN (0) if generator has returned. + 'result' parameter is filled with return value + - PYGEN_ERROR (-1) if exception was raised. + 'result' parameter is NULL + - PYGEN_NEXT (1) if generator has yielded. + 'result' parameter is filled with yielded value. */ +PyAPI_FUNC(PySendResult) PyGen_Send(PyGenObject *, PyObject *, PyObject **); + #ifndef Py_LIMITED_API typedef struct { _PyGenObject_HEAD(cr) |
