pylifecycle.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef Py_CPYTHON_PYLIFECYCLE_H
  2. # error "this header file must not be included directly"
  3. #endif
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /* Only used by applications that embed the interpreter and need to
  8. * override the standard encoding determination mechanism
  9. */
  10. PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding,
  11. const char *errors);
  12. /* PEP 432 Multi-phase initialization API (Private while provisional!) */
  13. PyAPI_FUNC(PyStatus) Py_PreInitialize(
  14. const PyPreConfig *src_config);
  15. PyAPI_FUNC(PyStatus) Py_PreInitializeFromBytesArgs(
  16. const PyPreConfig *src_config,
  17. Py_ssize_t argc,
  18. char **argv);
  19. PyAPI_FUNC(PyStatus) Py_PreInitializeFromArgs(
  20. const PyPreConfig *src_config,
  21. Py_ssize_t argc,
  22. wchar_t **argv);
  23. PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
  24. /* Initialization and finalization */
  25. PyAPI_FUNC(PyStatus) Py_InitializeFromConfig(
  26. const PyConfig *config);
  27. PyAPI_FUNC(PyStatus) _Py_InitializeMain(void);
  28. PyAPI_FUNC(int) Py_RunMain(void);
  29. PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err);
  30. /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
  31. * exit functions.
  32. */
  33. PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *);
  34. /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
  35. PyAPI_FUNC(void) _Py_RestoreSignals(void);
  36. PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
  37. PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *);
  38. PyAPI_FUNC(const char *) _Py_gitidentifier(void);
  39. PyAPI_FUNC(const char *) _Py_gitversion(void);
  40. PyAPI_FUNC(int) _Py_IsFinalizing(void);
  41. /* Random */
  42. PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size);
  43. PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
  44. /* Legacy locale support */
  45. PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn);
  46. PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn);
  47. PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
  48. PyAPI_FUNC(PyThreadState *) _Py_NewInterpreter(int isolated_subinterpreter);
  49. #ifdef __cplusplus
  50. }
  51. #endif