pylifecycle.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Interfaces to configure, query, create & destroy the Python runtime */
  2. #ifndef Py_PYLIFECYCLE_H
  3. #define Py_PYLIFECYCLE_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /* Initialization and finalization */
  8. PyAPI_FUNC(void) Py_Initialize(void);
  9. PyAPI_FUNC(void) Py_InitializeEx(int);
  10. PyAPI_FUNC(void) Py_Finalize(void);
  11. #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
  12. PyAPI_FUNC(int) Py_FinalizeEx(void);
  13. #endif
  14. PyAPI_FUNC(int) Py_IsInitialized(void);
  15. /* Subinterpreter support */
  16. PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
  17. PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
  18. PyAPI_FUNC(wchar_t) Py_GetSepW(const wchar_t *);
  19. PyAPI_FUNC(char) Py_GetSepA(const char *);
  20. PyAPI_FUNC(void) Py_NormalizeSepsW(wchar_t *);
  21. PyAPI_FUNC(void) Py_NormalizeSepsA(char *);
  22. /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
  23. * exit functions.
  24. */
  25. PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
  26. PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int);
  27. /* Bootstrap __main__ (defined in Modules/main.c) */
  28. PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
  29. PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
  30. /* In pathconfig.c */
  31. PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
  32. PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
  33. PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
  34. PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
  35. PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
  36. PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
  37. PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
  38. PyAPI_FUNC(wchar_t *) Py_GetPath(void);
  39. PyAPI_FUNC(void) Py_SetPath(const wchar_t *);
  40. #ifdef _MSC_VER
  41. int _Py_CheckPython3(void);
  42. #endif
  43. /* In their own files */
  44. PyAPI_FUNC(const char *) Py_GetVersion(void);
  45. PyAPI_FUNC(const char *) Py_GetPlatform(void);
  46. PyAPI_FUNC(const char *) Py_GetCopyright(void);
  47. PyAPI_FUNC(const char *) Py_GetCompiler(void);
  48. PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
  49. /* Signals */
  50. typedef void (*PyOS_sighandler_t)(int);
  51. PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
  52. PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
  53. #ifndef Py_LIMITED_API
  54. # define Py_CPYTHON_PYLIFECYCLE_H
  55. # include "cpython/pylifecycle.h"
  56. # undef Py_CPYTHON_PYLIFECYCLE_H
  57. #endif
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* !Py_PYLIFECYCLE_H */