summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-09-05 22:33:46 (GMT)
committerBrett Cannon <brett@python.org>2016-09-05 22:33:46 (GMT)
commit3cebf9387279d8b21369f55e205392199ad9b1a2 (patch)
tree3ab40b5c47ee4876a46d2ca6920b402a0e63cd16 /Include
parent625cb379f7e77457ca5be94e175d4b71a1d8989f (diff)
downloadcpython-3cebf9387279d8b21369f55e205392199ad9b1a2.zip
cpython-3cebf9387279d8b21369f55e205392199ad9b1a2.tar.gz
cpython-3cebf9387279d8b21369f55e205392199ad9b1a2.tar.bz2
Implement the frame evaluation API aspect of PEP 523.
Diffstat (limited to 'Include')
-rw-r--r--Include/ceval.h3
-rw-r--r--Include/pystate.h7
2 files changed, 8 insertions, 2 deletions
diff --git a/Include/ceval.h b/Include/ceval.h
index 73b4ca6..7607f75 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -119,6 +119,9 @@ PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *);
PyAPI_FUNC(PyObject *) PyEval_GetCallStats(PyObject *);
PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *);
PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(struct _frame *f, int exc);
+#endif
/* Interface for threads.
diff --git a/Include/pystate.h b/Include/pystate.h
index f08618c..5a06773 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -12,10 +12,13 @@ extern "C" {
struct _ts; /* Forward */
struct _is; /* Forward */
+struct _frame; /* Forward declaration for PyFrameObject. */
#ifdef Py_LIMITED_API
typedef struct _is PyInterpreterState;
#else
+typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int);
+
typedef struct _is {
struct _is *next;
@@ -42,14 +45,14 @@ typedef struct _is {
PyObject *builtins_copy;
PyObject *import_func;
+ /* Initialized to PyEval_EvalFrameDefault(). */
+ _PyFrameEvalFunction eval_frame;
} PyInterpreterState;
#endif
/* State unique per thread */
-struct _frame; /* Avoid including frameobject.h */
-
#ifndef Py_LIMITED_API
/* Py_tracefunc return -1 when raising an exception, or 0 for success. */
typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);