pylifecycle.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef Py_CPYTHON_PYLIFECYCLE_H
  2. # error "this header file must not be included directly"
  3. #endif
  4. /* Py_FrozenMain is kept out of the Limited API until documented and present
  5. in all builds of Python */
  6. PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv);
  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. /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
  31. PyAPI_FUNC(void) _Py_RestoreSignals(void);
  32. PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
  33. PyAPI_FUNC(int) _Py_FdIsInteractive(FILE *fp, PyObject *filename);
  34. PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *);
  35. PyAPI_FUNC(const char *) _Py_gitidentifier(void);
  36. PyAPI_FUNC(const char *) _Py_gitversion(void);
  37. PyAPI_FUNC(int) _Py_IsFinalizing(void);
  38. /* Random */
  39. PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size);
  40. PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
  41. /* Legacy locale support */
  42. PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn);
  43. PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn);
  44. PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
  45. PyAPI_FUNC(PyThreadState *) _Py_NewInterpreter(int isolated_subinterpreter);