1 | use crate::pystate::PyThreadState; |
2 | |
3 | use libc::wchar_t; |
4 | use std::os::raw::{c_char, c_int}; |
5 | |
6 | extern "C" { |
7 | pub fn Py_Initialize(); |
8 | pub fn Py_InitializeEx(arg1: c_int); |
9 | pub fn Py_Finalize(); |
10 | pub fn Py_FinalizeEx() -> c_int; |
11 | |
12 | #[cfg_attr (PyPy, link_name = "PyPy_IsInitialized" )] |
13 | pub fn Py_IsInitialized() -> c_int; |
14 | |
15 | pub fn Py_NewInterpreter() -> *mut PyThreadState; |
16 | pub fn Py_EndInterpreter(arg1: *mut PyThreadState); |
17 | |
18 | #[cfg_attr (PyPy, link_name = "PyPy_AtExit" )] |
19 | pub fn Py_AtExit(func: Option<extern "C" fn()>) -> c_int; |
20 | |
21 | pub fn Py_Exit(arg1: c_int); |
22 | |
23 | pub fn Py_Main(argc: c_int, argv: *mut *mut wchar_t) -> c_int; |
24 | pub fn Py_BytesMain(argc: c_int, argv: *mut *mut c_char) -> c_int; |
25 | |
26 | pub fn Py_SetProgramName(arg1: *const wchar_t); |
27 | #[cfg_attr (PyPy, link_name = "PyPy_GetProgramName" )] |
28 | pub fn Py_GetProgramName() -> *mut wchar_t; |
29 | |
30 | pub fn Py_SetPythonHome(arg1: *const wchar_t); |
31 | pub fn Py_GetPythonHome() -> *mut wchar_t; |
32 | |
33 | pub fn Py_GetProgramFullPath() -> *mut wchar_t; |
34 | |
35 | pub fn Py_GetPrefix() -> *mut wchar_t; |
36 | pub fn Py_GetExecPrefix() -> *mut wchar_t; |
37 | pub fn Py_GetPath() -> *mut wchar_t; |
38 | pub fn Py_SetPath(arg1: *const wchar_t); |
39 | |
40 | // skipped _Py_CheckPython3 |
41 | |
42 | #[cfg_attr (PyPy, link_name = "PyPy_GetVersion" )] |
43 | pub fn Py_GetVersion() -> *const c_char; |
44 | pub fn Py_GetPlatform() -> *const c_char; |
45 | pub fn Py_GetCopyright() -> *const c_char; |
46 | pub fn Py_GetCompiler() -> *const c_char; |
47 | pub fn Py_GetBuildInfo() -> *const c_char; |
48 | } |
49 | |
50 | type PyOS_sighandler_t = unsafe extern "C" fn(arg1: c_int); |
51 | |
52 | extern "C" { |
53 | pub fn PyOS_getsig(arg1: c_int) -> PyOS_sighandler_t; |
54 | pub fn PyOS_setsig(arg1: c_int, arg2: PyOS_sighandler_t) -> PyOS_sighandler_t; |
55 | } |
56 | |