| 1 |
#ifndef Py_CEVAL_H |
| 2 |
#define Py_CEVAL_H |
| 3 |
#ifdef __cplusplus |
| 4 |
extern "C" { |
| 5 |
#endif |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords( |
| 11 |
PyObject *, PyObject *, PyObject *); |
| 12 |
|
| 13 |
|
| 14 |
#define PyEval_CallObject(func,arg) \ |
| 15 |
PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL) |
| 16 |
|
| 17 |
PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj, |
| 18 |
const char *format, ...); |
| 19 |
PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj, |
| 20 |
const char *methodname, |
| 21 |
const char *format, ...); |
| 22 |
|
| 23 |
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *); |
| 24 |
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *); |
| 25 |
|
| 26 |
struct _frame; |
| 27 |
|
| 28 |
PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void); |
| 29 |
PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void); |
| 30 |
PyAPI_FUNC(PyObject *) PyEval_GetLocals(void); |
| 31 |
PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void); |
| 32 |
PyAPI_FUNC(int) PyEval_GetRestricted(void); |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); |
| 38 |
|
| 39 |
PyAPI_FUNC(int) Py_FlushLine(void); |
| 40 |
|
| 41 |
PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg); |
| 42 |
PyAPI_FUNC(int) Py_MakePendingCalls(void); |
| 43 |
|
| 44 |
|
| 45 |
PyAPI_FUNC(void) Py_SetRecursionLimit(int); |
| 46 |
PyAPI_FUNC(int) Py_GetRecursionLimit(void); |
| 47 |
|
| 48 |
#define Py_EnterRecursiveCall(where) \ |
| 49 |
(_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \ |
| 50 |
_Py_CheckRecursiveCall(where)) |
| 51 |
#define Py_LeaveRecursiveCall() \ |
| 52 |
(--PyThreadState_GET()->recursion_depth) |
| 53 |
PyAPI_FUNC(int) _Py_CheckRecursiveCall(const char *where); |
| 54 |
PyAPI_DATA(int) _Py_CheckRecursionLimit; |
| 55 |
#ifdef USE_STACKCHECK |
| 56 |
# define _Py_MakeRecCheck(x) (++(x) > --_Py_CheckRecursionLimit) |
| 57 |
#else |
| 58 |
# define _Py_MakeRecCheck(x) (++(x) > _Py_CheckRecursionLimit) |
| 59 |
#endif |
| 60 |
|
| 61 |
PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *); |
| 62 |
PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *); |
| 63 |
|
| 64 |
PyAPI_FUNC(PyObject *) PyEval_GetCallStats(PyObject *); |
| 65 |
PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *); |
| 66 |
PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc); |
| 67 |
|
| 68 |
|
| 69 |
PyAPI_DATA(volatile int) _Py_Ticker; |
| 70 |
PyAPI_DATA(int) _Py_CheckInterval; |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
PyAPI_FUNC(PyThreadState *) PyEval_SaveThread(void); |
| 118 |
PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *); |
| 119 |
|
| 120 |
#ifdef WITH_THREAD |
| 121 |
|
| 122 |
PyAPI_FUNC(int) PyEval_ThreadsInitialized(void); |
| 123 |
PyAPI_FUNC(void) PyEval_InitThreads(void); |
| 124 |
PyAPI_FUNC(void) PyEval_AcquireLock(void); |
| 125 |
PyAPI_FUNC(void) PyEval_ReleaseLock(void); |
| 126 |
PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate); |
| 127 |
PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate); |
| 128 |
PyAPI_FUNC(void) PyEval_ReInitThreads(void); |
| 129 |
|
| 130 |
#define Py_BEGIN_ALLOW_THREADS { \ |
| 131 |
PyThreadState *_save; \ |
| 132 |
_save = PyEval_SaveThread(); |
| 133 |
#define Py_BLOCK_THREADS PyEval_RestoreThread(_save); |
| 134 |
#define Py_UNBLOCK_THREADS _save = PyEval_SaveThread(); |
| 135 |
#define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \ |
| 136 |
} |
| 137 |
|
| 138 |
#else |
| 139 |
|
| 140 |
#define Py_BEGIN_ALLOW_THREADS { |
| 141 |
#define Py_BLOCK_THREADS |
| 142 |
#define Py_UNBLOCK_THREADS |
| 143 |
#define Py_END_ALLOW_THREADS } |
| 144 |
|
| 145 |
#endif |
| 146 |
|
| 147 |
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); |
| 148 |
PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); |
| 149 |
|
| 150 |
|
| 151 |
#ifdef __cplusplus |
| 152 |
} |
| 153 |
#endif |
| 154 |
#endif |