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.
diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h
index 4ced967..e819cef 100644
--- a/Include/cpython/frameobject.h
+++ b/Include/cpython/frameobject.h
@@ -14,7 +14,7 @@
int b_level; /* value stack level to pop to */
} PyTryBlock;
-typedef struct _frame {
+struct _frame {
PyObject_VAR_HEAD
struct _frame *f_back; /* previous frame, or NULL */
PyCodeObject *f_code; /* code segment */
@@ -44,7 +44,7 @@
char f_executing; /* whether the frame is still executing */
PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
-} PyFrameObject;
+};
/* Standard object interface */
@@ -79,9 +79,6 @@
PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out);
-/* Return the line of code the frame is currently executing. */
-PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
-
#ifdef __cplusplus
}
#endif