pylifecycle.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
  19. * exit functions.
  20. */
  21. PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
  22. PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int);
  23. /* Bootstrap __main__ (defined in Modules/main.c) */
  24. PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
  25. PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv);
  26. PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
  27. /* In pathconfig.c */
  28. PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
  29. PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
  30. PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
  31. PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
  32. PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
  33. PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
  34. PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
  35. PyAPI_FUNC(wchar_t *) Py_GetPath(void);
  36. PyAPI_FUNC(void) Py_SetPath(const wchar_t *);
  37. #ifdef MS_WINDOWS
  38. int _Py_CheckPython3(void);
  39. #endif
  40. /* In their own files */
  41. PyAPI_FUNC(const char *) Anaconda_GetVersion(void);
  42. PyAPI_FUNC(const char *) Py_GetVersion(void);
  43. PyAPI_FUNC(const char *) Py_GetPlatform(void);
  44. PyAPI_FUNC(const char *) Py_GetCopyright(void);
  45. PyAPI_FUNC(const char *) Py_GetCompiler(void);
  46. PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
  47. /* Signals */
  48. typedef void (*PyOS_sighandler_t)(int);
  49. PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
  50. PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
  51. #ifndef Py_LIMITED_API
  52. # define Py_CPYTHON_PYLIFECYCLE_H
  53. # include "cpython/pylifecycle.h"
  54. # undef Py_CPYTHON_PYLIFECYCLE_H
  55. #endif
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif /* !Py_PYLIFECYCLE_H */