pylifecycle.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_InitializeFromArgs(
  28. const PyConfig *config,
  29. Py_ssize_t argc,
  30. char * const *argv);
  31. PyAPI_FUNC(PyStatus) _Py_InitializeFromWideArgs(
  32. const PyConfig *config,
  33. Py_ssize_t argc,
  34. wchar_t * const *argv);
  35. PyAPI_FUNC(PyStatus) _Py_InitializeMain(void);
  36. PyAPI_FUNC(int) Py_RunMain(void);
  37. PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err);
  38. /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
  39. * exit functions.
  40. */
  41. PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *);
  42. /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
  43. PyAPI_FUNC(void) _Py_RestoreSignals(void);
  44. PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
  45. PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *);
  46. PyAPI_FUNC(const char *) _Py_gitidentifier(void);
  47. PyAPI_FUNC(const char *) _Py_gitversion(void);
  48. PyAPI_FUNC(int) _Py_IsFinalizing(void);
  49. /* Random */
  50. PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size);
  51. PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
  52. /* Legacy locale support */
  53. PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn);
  54. PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn);
  55. PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
  56. #ifdef __cplusplus
  57. }
  58. #endif