pythonrun.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Interfaces to parse and execute pieces of python code */
  2. #ifndef Py_PYTHONRUN_H
  3. #define Py_PYTHONRUN_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
  8. PyAPI_FUNC(void) PyErr_Print(void);
  9. PyAPI_FUNC(void) PyErr_PrintEx(int);
  10. PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
  11. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
  12. PyAPI_FUNC(void) PyErr_DisplayException(PyObject *);
  13. #endif
  14. /* Stuff with no proper home (yet) */
  15. PyAPI_DATA(int) (*PyOS_InputHook)(void);
  16. /* Stack size, in "pointers" (so we get extra safety margins
  17. on 64-bit platforms). On a 32-bit platform, this translates
  18. to an 8k margin. */
  19. #define PYOS_STACK_MARGIN 2048
  20. #if defined(WIN32) && !defined(MS_WIN64) && !defined(_M_ARM) && defined(_MSC_VER) && _MSC_VER >= 1300
  21. /* Enable stack checking under Microsoft C */
  22. // When changing the platforms, ensure PyOS_CheckStack() docs are still correct
  23. #define USE_STACKCHECK
  24. #endif
  25. #ifdef USE_STACKCHECK
  26. /* Check that we aren't overflowing our stack */
  27. PyAPI_FUNC(int) PyOS_CheckStack(void);
  28. #endif
  29. #ifndef Py_LIMITED_API
  30. # define Py_CPYTHON_PYTHONRUN_H
  31. # include "cpython/pythonrun.h"
  32. # undef Py_CPYTHON_PYTHONRUN_H
  33. #endif
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* !Py_PYTHONRUN_H */