• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(PyStatus) Py_PreInitialize(
18     const PyPreConfig *src_config);
19 PyAPI_FUNC(PyStatus) Py_PreInitializeFromBytesArgs(
20     const PyPreConfig *src_config,
21     Py_ssize_t argc,
22     char **argv);
23 PyAPI_FUNC(PyStatus) Py_PreInitializeFromArgs(
24     const PyPreConfig *src_config,
25     Py_ssize_t argc,
26     wchar_t **argv);
27 
28 PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
29 
30 
31 /* Initialization and finalization */
32 
33 PyAPI_FUNC(PyStatus) Py_InitializeFromConfig(
34     const PyConfig *config);
35 PyAPI_FUNC(PyStatus) _Py_InitializeMain(void);
36 
37 PyAPI_FUNC(int) Py_RunMain(void);
38 
39 
40 PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err);
41 
42 /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
43  * exit functions.
44  */
45 PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *);
46 
47 /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
48 PyAPI_FUNC(void) _Py_RestoreSignals(void);
49 
50 PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
51 
52 PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *);
53 
54 PyAPI_FUNC(const char *) _Py_gitidentifier(void);
55 PyAPI_FUNC(const char *) _Py_gitversion(void);
56 
57 PyAPI_FUNC(int) _Py_IsFinalizing(void);
58 
59 /* Random */
60 PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size);
61 PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
62 
63 /* Legacy locale support */
64 PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn);
65 PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn);
66 PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
67 
68 PyAPI_FUNC(PyThreadState *) _Py_NewInterpreter(int isolated_subinterpreter);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73