• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef Py_INTERNAL_LIFECYCLE_H
2 #define Py_INTERNAL_LIFECYCLE_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #ifndef Py_BUILD_CORE
8 #  error "this header requires Py_BUILD_CORE define"
9 #endif
10 
11 /* Forward declarations */
12 struct _PyArgv;
13 struct pyruntimestate;
14 
15 /* True if the main interpreter thread exited due to an unhandled
16  * KeyboardInterrupt exception, suggesting the user pressed ^C. */
17 PyAPI_DATA(int) _Py_UnhandledKeyboardInterrupt;
18 
19 extern int _Py_SetFileSystemEncoding(
20     const char *encoding,
21     const char *errors);
22 extern void _Py_ClearFileSystemEncoding(void);
23 extern PyStatus _PyUnicode_InitEncodings(PyThreadState *tstate);
24 #ifdef MS_WINDOWS
25 extern int _PyUnicode_EnableLegacyWindowsFSEncoding(void);
26 #endif
27 
28 PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void);
29 
30 PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc);
31 
32 /* Various one-time initializers */
33 
34 extern PyStatus _PyUnicode_Init(void);
35 extern int _PyStructSequence_Init(void);
36 extern int _PyLong_Init(PyThreadState *tstate);
37 extern PyStatus _PyFaulthandler_Init(int enable);
38 extern int _PyTraceMalloc_Init(int enable);
39 extern PyObject * _PyBuiltin_Init(PyThreadState *tstate);
40 extern PyStatus _PySys_Create(
41     PyThreadState *tstate,
42     PyObject **sysmod_p);
43 extern PyStatus _PySys_ReadPreinitWarnOptions(PyWideStringList *options);
44 extern PyStatus _PySys_ReadPreinitXOptions(PyConfig *config);
45 extern int _PySys_InitMain(PyThreadState *tstate);
46 extern PyStatus _PyExc_Init(void);
47 extern PyStatus _PyErr_Init(void);
48 extern PyStatus _PyBuiltins_AddExceptions(PyObject * bltinmod);
49 extern PyStatus _PyImportHooks_Init(PyThreadState *tstate);
50 extern int _PyFloat_Init(void);
51 extern PyStatus _Py_HashRandomization_Init(const PyConfig *);
52 
53 extern PyStatus _PyTypes_Init(void);
54 extern PyStatus _PyTypes_InitSlotDefs(void);
55 extern PyStatus _PyImportZip_Init(PyThreadState *tstate);
56 extern PyStatus _PyGC_Init(PyThreadState *tstate);
57 
58 
59 /* Various internal finalizers */
60 
61 extern void _PyFrame_Fini(void);
62 extern void _PyDict_Fini(void);
63 extern void _PyTuple_Fini(void);
64 extern void _PyList_Fini(void);
65 extern void _PySet_Fini(void);
66 extern void _PyBytes_Fini(void);
67 extern void _PyFloat_Fini(void);
68 extern void _PySlice_Fini(void);
69 extern void _PyAsyncGen_Fini(void);
70 
71 extern int _PySignal_Init(int install_signal_handlers);
72 extern void PyOS_FiniInterrupts(void);
73 
74 extern void _PyExc_Fini(void);
75 extern void _PyImport_Fini(void);
76 extern void _PyImport_Fini2(void);
77 extern void _PyGC_Fini(PyThreadState *tstate);
78 extern void _PyType_Fini(void);
79 extern void _Py_HashRandomization_Fini(void);
80 extern void _PyUnicode_Fini(PyThreadState *tstate);
81 extern void _PyLong_Fini(PyThreadState *tstate);
82 extern void _PyFaulthandler_Fini(void);
83 extern void _PyHash_Fini(void);
84 extern void _PyTraceMalloc_Fini(void);
85 extern void _PyWarnings_Fini(PyInterpreterState *interp);
86 extern void _PyAST_Fini(void);
87 
88 extern PyStatus _PyGILState_Init(PyThreadState *tstate);
89 extern void _PyGILState_Fini(PyThreadState *tstate);
90 
91 PyAPI_FUNC(void) _PyGC_DumpShutdownStats(PyThreadState *tstate);
92 
93 PyAPI_FUNC(PyStatus) _Py_PreInitializeFromPyArgv(
94     const PyPreConfig *src_config,
95     const struct _PyArgv *args);
96 PyAPI_FUNC(PyStatus) _Py_PreInitializeFromConfig(
97     const PyConfig *config,
98     const struct _PyArgv *args);
99 
100 
101 PyAPI_FUNC(int) _Py_HandleSystemExit(int *exitcode_p);
102 
103 PyAPI_FUNC(PyObject*) _PyErr_WriteUnraisableDefaultHook(PyObject *unraisable);
104 
105 PyAPI_FUNC(void) _PyErr_Print(PyThreadState *tstate);
106 PyAPI_FUNC(void) _PyErr_Display(PyObject *file, PyObject *exception,
107                                 PyObject *value, PyObject *tb);
108 
109 PyAPI_FUNC(void) _PyThreadState_DeleteCurrent(PyThreadState *tstate);
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 #endif /* !Py_INTERNAL_LIFECYCLE_H */
115