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 | |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 17 | PyAPI_FUNC(PyStatus) Py_PreInitialize( |
| 18 | const PyPreConfig *src_config); |
| 19 | PyAPI_FUNC(PyStatus) Py_PreInitializeFromBytesArgs( |
| 20 | const PyPreConfig *src_config, |
Victor Stinner | b594784 | 2019-05-18 00:38:16 +0200 | [diff] [blame] | 21 | Py_ssize_t argc, |
Victor Stinner | 5ac27a5 | 2019-03-27 13:40:14 +0100 | [diff] [blame] | 22 | char **argv); |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 23 | PyAPI_FUNC(PyStatus) Py_PreInitializeFromArgs( |
| 24 | const PyPreConfig *src_config, |
Victor Stinner | b594784 | 2019-05-18 00:38:16 +0200 | [diff] [blame] | 25 | Py_ssize_t argc, |
Victor Stinner | 5ac27a5 | 2019-03-27 13:40:14 +0100 | [diff] [blame] | 26 | wchar_t **argv); |
Victor Stinner | f29084d | 2019-03-20 02:20:13 +0100 | [diff] [blame] | 27 | |
Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 28 | PyAPI_FUNC(int) _Py_IsCoreInitialized(void); |
| 29 | |
| 30 | |
Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 31 | /* Initialization and finalization */ |
| 32 | |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 33 | PyAPI_FUNC(PyStatus) Py_InitializeFromConfig( |
| 34 | const PyConfig *config); |
| 35 | PyAPI_FUNC(PyStatus) _Py_InitializeFromArgs( |
| 36 | const PyConfig *config, |
Victor Stinner | b594784 | 2019-05-18 00:38:16 +0200 | [diff] [blame] | 37 | Py_ssize_t argc, |
Victor Stinner | 6d1c467 | 2019-05-20 11:02:00 +0200 | [diff] [blame] | 38 | char * const *argv); |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 39 | PyAPI_FUNC(PyStatus) _Py_InitializeFromWideArgs( |
| 40 | const PyConfig *config, |
Victor Stinner | b594784 | 2019-05-18 00:38:16 +0200 | [diff] [blame] | 41 | Py_ssize_t argc, |
Victor Stinner | 6d1c467 | 2019-05-20 11:02:00 +0200 | [diff] [blame] | 42 | wchar_t * const *argv); |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 43 | PyAPI_FUNC(PyStatus) _Py_InitializeMain(void); |
Victor Stinner | 5ac27a5 | 2019-03-27 13:40:14 +0100 | [diff] [blame] | 44 | |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 45 | PyAPI_FUNC(int) Py_RunMain(void); |
Victor Stinner | 2f54908 | 2019-03-29 15:13:46 +0100 | [diff] [blame] | 46 | |
| 47 | |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 48 | PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err); |
Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 49 | |
| 50 | /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level |
| 51 | * exit functions. |
| 52 | */ |
| 53 | PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *); |
| 54 | |
| 55 | /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ |
| 56 | PyAPI_FUNC(void) _Py_RestoreSignals(void); |
| 57 | |
| 58 | PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); |
| 59 | |
| 60 | PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *); |
| 61 | |
| 62 | PyAPI_FUNC(const char *) _Py_gitidentifier(void); |
| 63 | PyAPI_FUNC(const char *) _Py_gitversion(void); |
| 64 | |
Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 65 | PyAPI_FUNC(int) _Py_IsFinalizing(void); |
| 66 | |
| 67 | /* Random */ |
| 68 | PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size); |
| 69 | PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size); |
| 70 | |
| 71 | /* Legacy locale support */ |
Victor Stinner | 0f72147 | 2019-05-20 17:16:38 +0200 | [diff] [blame] | 72 | PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn); |
| 73 | PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn); |
Victor Stinner | dd12aa0 | 2018-11-27 00:12:05 +0100 | [diff] [blame] | 74 | PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category); |
| 75 | |
| 76 | #ifdef __cplusplus |
| 77 | } |
| 78 | #endif |