diff options
author | Victor Stinner <vstinner@python.org> | 2019-11-16 00:04:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-16 00:04:44 (GMT) |
commit | 51edf8aaa2e17626f9690ed29d25945fc03016b9 (patch) | |
tree | 51c19b0055844d2b541865d7396b4d17f628695a | |
parent | 7c6130c8c36c941255365e5414c956fc919b8629 (diff) | |
download | cpython-51edf8aaa2e17626f9690ed29d25945fc03016b9.zip cpython-51edf8aaa2e17626f9690ed29d25945fc03016b9.tar.gz cpython-51edf8aaa2e17626f9690ed29d25945fc03016b9.tar.bz2 |
bpo-38644: Cleanup ceval.h (GH-17185)
Move CPython API (Py_LIMITED_API macro not defined) from ceval.h
to cpython/ceval.h
-rw-r--r-- | Include/ceval.h | 36 | ||||
-rw-r--r-- | Include/cpython/ceval.h | 25 |
2 files changed, 25 insertions, 36 deletions
diff --git a/Include/ceval.h b/Include/ceval.h index 8da779b..62c6489 100644 --- a/Include/ceval.h +++ b/Include/ceval.h @@ -28,16 +28,6 @@ Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallFunction( Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod( PyObject *obj, const char *name, const char *format, ...); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *); -PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *); -PyAPI_FUNC(int) _PyEval_GetCoroutineOriginTrackingDepth(void); -PyAPI_FUNC(void) _PyEval_SetAsyncGenFirstiter(PyObject *); -PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFirstiter(void); -PyAPI_FUNC(void) _PyEval_SetAsyncGenFinalizer(PyObject *); -PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFinalizer(void); -#endif - struct _frame; /* Avoid including frameobject.h */ PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void); @@ -45,15 +35,6 @@ PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void); PyAPI_FUNC(PyObject *) PyEval_GetLocals(void); PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void); -#ifndef Py_LIMITED_API -/* Helper to look up a builtin object */ -PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *); -/* Look at the current frame's (if any) code's co_flags, and turn on - the corresponding compiler flags in cf->cf_flags. Return 1 if any - flag was set, else return 0. */ -PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); -#endif - PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg); PyAPI_FUNC(int) Py_MakePendingCalls(void); @@ -101,9 +82,6 @@ PyAPI_FUNC(const char *) PyEval_GetFuncDesc(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. @@ -160,15 +138,6 @@ Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_AcquireLock(void); PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate); PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate); -#ifndef Py_LIMITED_API -PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds); -PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void); -#endif - -#ifndef Py_LIMITED_API -PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc); -#endif - #define Py_BEGIN_ALLOW_THREADS { \ PyThreadState *_save; \ _save = PyEval_SaveThread(); @@ -177,11 +146,6 @@ PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc); #define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \ } -#ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); -PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); -#endif - /* Masks and values used by FORMAT_VALUE opcode. */ #define FVC_MASK 0x3 #define FVC_NONE 0x0 diff --git a/Include/cpython/ceval.h b/Include/cpython/ceval.h index 1e2c457..e601304 100644 --- a/Include/cpython/ceval.h +++ b/Include/cpython/ceval.h @@ -6,6 +6,31 @@ extern "C" { #endif +PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *); +PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *); +PyAPI_FUNC(int) _PyEval_GetCoroutineOriginTrackingDepth(void); +PyAPI_FUNC(void) _PyEval_SetAsyncGenFirstiter(PyObject *); +PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFirstiter(void); +PyAPI_FUNC(void) _PyEval_SetAsyncGenFinalizer(PyObject *); +PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFinalizer(void); + +/* Helper to look up a builtin object */ +PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *); +/* Look at the current frame's (if any) code's co_flags, and turn on + the corresponding compiler flags in cf->cf_flags. Return 1 if any + flag was set, else return 0. */ +PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); + +PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(struct _frame *f, int exc); + +PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds); +PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void); + +PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc); + +PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); + PyAPI_DATA(int) _Py_CheckRecursionLimit; #ifdef USE_STACKCHECK |