1991-02-19 12:39:46 +00:00
|
|
|
|
1990-12-20 15:06:42 +00:00
|
|
|
/* Interfaces to parse and execute pieces of python code */
|
|
|
|
|
2000-07-09 00:55:06 +00:00
|
|
|
#ifndef Py_PYTHONRUN_H
|
|
|
|
#define Py_PYTHONRUN_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2010-12-04 12:00:49 +00:00
|
|
|
PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
|
2020-12-08 23:51:54 +01:00
|
|
|
|
2002-08-12 07:21:58 +00:00
|
|
|
PyAPI_FUNC(void) PyErr_Print(void);
|
|
|
|
PyAPI_FUNC(void) PyErr_PrintEx(int);
|
|
|
|
PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
|
2023-03-21 09:36:18 +00:00
|
|
|
|
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
|
2023-03-16 22:18:04 +00:00
|
|
|
PyAPI_FUNC(void) PyErr_DisplayException(PyObject *);
|
2023-03-21 09:36:18 +00:00
|
|
|
#endif
|
1990-12-20 15:06:42 +00:00
|
|
|
|
2005-10-20 19:59:25 +00:00
|
|
|
|
1997-08-12 15:14:22 +00:00
|
|
|
/* Stuff with no proper home (yet) */
|
2002-08-12 13:06:35 +00:00
|
|
|
PyAPI_DATA(int) (*PyOS_InputHook)(void);
|
2000-08-27 19:15:31 +00:00
|
|
|
|
2025-02-25 09:24:48 +00:00
|
|
|
/* Stack size, in "pointers". This must be large enough, so
|
|
|
|
* no two calls to check recursion depth are more than this far
|
|
|
|
* apart. In practice, that means it must be larger than the C
|
|
|
|
* stack consumption of PyEval_EvalDefault */
|
|
|
|
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
|
2025-04-30 11:37:53 +01:00
|
|
|
# define PYOS_LOG2_STACK_MARGIN 12
|
2025-02-25 09:24:48 +00:00
|
|
|
#elif defined(Py_DEBUG) && defined(WIN32)
|
2025-04-30 11:37:53 +01:00
|
|
|
# define PYOS_LOG2_STACK_MARGIN 12
|
2025-02-25 09:24:48 +00:00
|
|
|
#else
|
2025-04-30 11:37:53 +01:00
|
|
|
# define PYOS_LOG2_STACK_MARGIN 11
|
2025-02-25 09:24:48 +00:00
|
|
|
#endif
|
2025-04-30 11:37:53 +01:00
|
|
|
#define PYOS_STACK_MARGIN (1 << PYOS_LOG2_STACK_MARGIN)
|
2025-02-25 09:24:48 +00:00
|
|
|
#define PYOS_STACK_MARGIN_BYTES (PYOS_STACK_MARGIN * sizeof(void *))
|
|
|
|
|
2025-04-30 11:37:53 +01:00
|
|
|
#if SIZEOF_VOID_P == 8
|
|
|
|
#define PYOS_STACK_MARGIN_SHIFT (PYOS_LOG2_STACK_MARGIN + 3)
|
|
|
|
#else
|
|
|
|
#define PYOS_STACK_MARGIN_SHIFT (PYOS_LOG2_STACK_MARGIN + 2)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2025-02-25 09:24:48 +00:00
|
|
|
#if defined(WIN32)
|
2000-08-27 19:15:31 +00:00
|
|
|
#define USE_STACKCHECK
|
|
|
|
#endif
|
|
|
|
|
2000-08-07 21:00:42 +00:00
|
|
|
#ifdef USE_STACKCHECK
|
2000-08-27 19:15:31 +00:00
|
|
|
/* Check that we aren't overflowing our stack */
|
2002-08-12 07:21:58 +00:00
|
|
|
PyAPI_FUNC(int) PyOS_CheckStack(void);
|
2000-08-07 21:00:42 +00:00
|
|
|
#endif
|
1997-08-12 15:14:22 +00:00
|
|
|
|
2020-12-08 23:51:54 +01:00
|
|
|
#ifndef Py_LIMITED_API
|
|
|
|
# define Py_CPYTHON_PYTHONRUN_H
|
2021-10-15 01:50:04 +02:00
|
|
|
# include "cpython/pythonrun.h"
|
2020-12-08 23:51:54 +01:00
|
|
|
# undef Py_CPYTHON_PYTHONRUN_H
|
|
|
|
#endif
|
|
|
|
|
1993-07-28 09:05:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_PYTHONRUN_H */
|