Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 1 | #ifndef Py_CPYTHON_PYLIFECYCLE_H |
| 2 | # error "this header file must not be included directly" |
| 3 | #endif |
| 4 | |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
| 9 | /* Only used by applications that embed the interpreter and need to |
| 10 | * override the standard encoding determination mechanism |
| 11 | */ |
| 12 | PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding, |
| 13 | const char *errors); |
| 14 | |
| 15 | /* PEP 432 Multi-phase initialization API (Private while provisional!) */ |
| 16 | |
| 17 | PyAPI_FUNC(_PyInitError) _Py_InitializeCore( |
| 18 | PyInterpreterState **interp, |
| 19 | const _PyCoreConfig *); |
| 20 | PyAPI_FUNC(int) _Py_IsCoreInitialized(void); |
| 21 | |
| 22 | |
| 23 | PyAPI_FUNC(_PyInitError) _PyMainInterpreterConfig_Read( |
| 24 | _PyMainInterpreterConfig *config, |
| 25 | const _PyCoreConfig *core_config); |
| 26 | PyAPI_FUNC(void) _PyMainInterpreterConfig_Clear(_PyMainInterpreterConfig *); |
| 27 | PyAPI_FUNC(int) _PyMainInterpreterConfig_Copy( |
| 28 | _PyMainInterpreterConfig *config, |
| 29 | const _PyMainInterpreterConfig *config2); |
| 30 | /* Used by _testcapi.get_main_config() */ |
| 31 | PyAPI_FUNC(PyObject*) _PyMainInterpreterConfig_AsDict( |
| 32 | const _PyMainInterpreterConfig *config); |
| 33 | |
| 34 | PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter( |
| 35 | PyInterpreterState *interp, |
| 36 | const _PyMainInterpreterConfig *); |
| 37 | |
| 38 | /* Initialization and finalization */ |
| 39 | |
| 40 | PyAPI_FUNC(_PyInitError) _Py_InitializeFromConfig( |
| 41 | const _PyCoreConfig *config); |
Victor Stinner | dfe8847 | 2019-03-01 12:14:41 +0100 | [diff] [blame^] | 42 | PyAPI_FUNC(void) _Py_NO_RETURN _Py_ExitInitError(_PyInitError err); |
Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 43 | |
| 44 | /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level |
| 45 | * exit functions. |
| 46 | */ |
| 47 | PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *); |
| 48 | |
| 49 | /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ |
| 50 | PyAPI_FUNC(void) _Py_RestoreSignals(void); |
| 51 | |
| 52 | PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); |
| 53 | |
| 54 | PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *); |
| 55 | |
| 56 | PyAPI_FUNC(const char *) _Py_gitidentifier(void); |
| 57 | PyAPI_FUNC(const char *) _Py_gitversion(void); |
| 58 | |
Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 59 | PyAPI_FUNC(int) _Py_IsFinalizing(void); |
| 60 | |
| 61 | /* Random */ |
| 62 | PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size); |
| 63 | PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size); |
| 64 | |
| 65 | /* Legacy locale support */ |
| 66 | PyAPI_FUNC(void) _Py_CoerceLegacyLocale(int warn); |
| 67 | PyAPI_FUNC(int) _Py_LegacyLocaleDetected(void); |
| 68 | PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category); |
| 69 | |
| 70 | #ifdef __cplusplus |
| 71 | } |
| 72 | #endif |