mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Update FFI bindings for get_all domain lookup
This commit is contained in:
@@ -227,15 +227,26 @@ pub unsafe extern "C" fn lockdownd_get_value(
|
|||||||
#[unsafe(no_mangle)]
|
#[unsafe(no_mangle)]
|
||||||
pub unsafe extern "C" fn lockdownd_get_all_values(
|
pub unsafe extern "C" fn lockdownd_get_all_values(
|
||||||
client: *mut LockdowndClientHandle,
|
client: *mut LockdowndClientHandle,
|
||||||
|
domain: *const libc::c_char,
|
||||||
out_plist: *mut *mut c_void,
|
out_plist: *mut *mut c_void,
|
||||||
) -> *mut IdeviceFfiError {
|
) -> *mut IdeviceFfiError {
|
||||||
if out_plist.is_null() {
|
if out_plist.is_null() {
|
||||||
return ffi_err!(IdeviceError::FfiInvalidArg);
|
return ffi_err!(IdeviceError::FfiInvalidArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let domain = if domain.is_null() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(
|
||||||
|
unsafe { std::ffi::CStr::from_ptr(domain) }
|
||||||
|
.to_string_lossy()
|
||||||
|
.into_owned(),
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
let res: Result<plist::Dictionary, IdeviceError> = RUNTIME.block_on(async move {
|
let res: Result<plist::Dictionary, IdeviceError> = RUNTIME.block_on(async move {
|
||||||
let client_ref = unsafe { &mut (*client).0 };
|
let client_ref = unsafe { &mut (*client).0 };
|
||||||
client_ref.get_all_values().await
|
client_ref.get_all_values(domain).await
|
||||||
});
|
});
|
||||||
|
|
||||||
match res {
|
match res {
|
||||||
|
|||||||
Reference in New Issue
Block a user