mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
add PyFfi
This commit is contained in:
parent
d9f94badf6
commit
9d0ae31780
1 changed files with 14 additions and 0 deletions
|
|
@ -139,3 +139,17 @@ pub fn ensure_os_supported() -> Result<()> {
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type PyInitializeEx = extern "C" fn(initsigs: std::ffi::c_int);
|
||||||
|
pub type PyIsInitialized = extern "C" fn() -> std::ffi::c_int;
|
||||||
|
pub type PyRunSimpleString = extern "C" fn(command: *const std::ffi::c_char) -> std::ffi::c_int;
|
||||||
|
pub type PyFinalizeEx = extern "C" fn() -> std::ffi::c_int;
|
||||||
|
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
struct PyFfi {
|
||||||
|
lib: *mut std::ffi::c_void,
|
||||||
|
Py_InitializeEx: PyInitializeEx,
|
||||||
|
Py_IsInitialized: PyIsInitialized,
|
||||||
|
PyRun_SimpleString: PyRunSimpleString,
|
||||||
|
Py_FinalizeEx: PyFinalizeEx,
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue