diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-28 14:32:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 14:32:48 (GMT) |
commit | 7c59d7c9860cdbaf4a9c26c9142aebd3259d046e (patch) | |
tree | 25d14f4febac1b124878b5875a936b47c6706771 /Include/genobject.h | |
parent | 5da352616fb8290e3c2c0245f553280824093c6a (diff) | |
download | cpython-7c59d7c9860cdbaf4a9c26c9142aebd3259d046e.zip cpython-7c59d7c9860cdbaf4a9c26c9142aebd3259d046e.tar.gz cpython-7c59d7c9860cdbaf4a9c26c9142aebd3259d046e.tar.bz2 |
bpo-40421: Add pyframe.h header file (GH-19755)
Add a new separated pyframe.h header file of the PyFrame public C
API: it is included by Python.h.
Add PyFrame_GetLineNumber() to the limited C API.
Replace "struct _frame" with "PyFrameObject" in header files.
PyFrameObject is now defined as struct _frame by pyframe.h which is
included early enough in Python.h.
Diffstat (limited to 'Include/genobject.h')
-rw-r--r-- | Include/genobject.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Include/genobject.h b/Include/genobject.h index b87a648..a7393a9 100644 --- a/Include/genobject.h +++ b/Include/genobject.h @@ -10,14 +10,12 @@ extern "C" { #include "pystate.h" /* _PyErr_StackItem */ -struct _frame; /* Avoid including frameobject.h */ - /* _PyGenObject_HEAD defines the initial segment of generator and coroutine objects. */ #define _PyGenObject_HEAD(prefix) \ PyObject_HEAD \ /* Note: gi_frame can be NULL if the generator is "finished" */ \ - struct _frame *prefix##_frame; \ + PyFrameObject *prefix##_frame; \ /* True if generator is being executed. */ \ char prefix##_running; \ /* The code object backing the generator */ \ @@ -40,8 +38,8 @@ 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(struct _frame *); -PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(struct _frame *, +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 **); @@ -60,7 +58,7 @@ 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(struct _frame *, +PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *, PyObject *name, PyObject *qualname); /* Asynchronous Generators */ @@ -86,7 +84,7 @@ PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type; -PyAPI_FUNC(PyObject *) PyAsyncGen_New(struct _frame *, +PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *, PyObject *name, PyObject *qualname); #define PyAsyncGen_CheckExact(op) Py_IS_TYPE(op, &PyAsyncGen_Type) |