mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
add ffi types
This commit is contained in:
parent
36ca68a869
commit
84619fd099
1 changed files with 15 additions and 1 deletions
|
|
@ -171,10 +171,24 @@ 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 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 PyRunSimpleString = extern "C" fn(command: *const std::ffi::c_char) -> std::ffi::c_int;
|
||||||
pub type PyFinalizeEx = extern "C" fn() -> std::ffi::c_int;
|
pub type PyFinalizeEx = extern "C" fn() -> std::ffi::c_int;
|
||||||
|
pub type PyConfigInitPythonConfig = extern "C" fn(*mut std::ffi::c_void);
|
||||||
|
// WARN: py39 and py313's PyStatus are identical
|
||||||
|
// check if this remains true in future versions
|
||||||
|
pub type PyConfigSetBytesString = extern "C" fn(
|
||||||
|
config: *mut std::ffi::c_void,
|
||||||
|
config_str: *mut *mut libc::wchar_t,
|
||||||
|
str_: *const std::os::raw::c_char,
|
||||||
|
) -> py313::PyStatus;
|
||||||
|
pub type PyConfigSetBytesArgv = extern "C" fn(
|
||||||
|
config: *mut std::ffi::c_void,
|
||||||
|
argc: isize,
|
||||||
|
argv: *const *mut std::os::raw::c_char,
|
||||||
|
) -> py313::PyStatus;
|
||||||
|
pub type PyInitializeFromConfig = extern "C" fn(*const std::ffi::c_void) -> py313::PyStatus;
|
||||||
|
pub type PyStatusException = extern "C" fn(err: py313::PyStatus) -> std::os::raw::c_int;
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
struct PyFfi {
|
struct PyFfi {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue