Use handle types for FFI functions

This commit is contained in:
Jackson Coxson
2025-03-24 16:03:03 -06:00
parent a67d15fe9b
commit 910fe83952
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@ Image.dmg.trustcache
idevice.h idevice.h
/ffi/examples/build /ffi/examples/build
/.cache /.cache
/ffi/examples/.cache

View File

@@ -67,7 +67,7 @@ pub unsafe extern "C" fn idevice_tcp_provider_new(
/// `provider` must be a valid pointer to a TcpProvider handle that was allocated by this library, /// `provider` must be a valid pointer to a TcpProvider handle that was allocated by this library,
/// or NULL (in which case this function does nothing) /// or NULL (in which case this function does nothing)
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
pub unsafe extern "C" fn tcp_provider_free(provider: *mut TcpProvider) { pub unsafe extern "C" fn tcp_provider_free(provider: *mut TcpProviderHandle) {
if !provider.is_null() { if !provider.is_null() {
unsafe { drop(Box::from_raw(provider)) }; unsafe { drop(Box::from_raw(provider)) };
} }
@@ -143,7 +143,7 @@ pub unsafe extern "C" fn usbmuxd_provider_new(
/// `provider` must be a valid pointer to a UsbmuxdProvider handle that was allocated by this library, /// `provider` must be a valid pointer to a UsbmuxdProvider handle that was allocated by this library,
/// or NULL (in which case this function does nothing) /// or NULL (in which case this function does nothing)
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
pub unsafe extern "C" fn usbmuxd_provider_free(provider: *mut UsbmuxdProvider) { pub unsafe extern "C" fn usbmuxd_provider_free(provider: *mut UsbmuxdProviderHandle) {
if !provider.is_null() { if !provider.is_null() {
unsafe { drop(Box::from_raw(provider)) }; unsafe { drop(Box::from_raw(provider)) };
} }