Add lockdown location simulation to ffi#77
Merged
jkcoxson merged 3 commits intojkcoxson:masterfrom Mar 5, 2026
Merged
Conversation
Contributor
|
hey amazing pr just a nitpick i had is that, every other service in the FFI layer has both a you could maybe add something like this #[unsafe(no_mangle)]
pub unsafe extern "C" fn lockdown_location_simulation_new(
socket: *mut IdeviceHandle,
client: *mut *mut LocationSimulationServiceHandle,
) -> *mut IdeviceFfiError {
if socket.is_null() || client.is_null() {
return ffi_err!(IdeviceError::FfiInvalidArg);
}
let socket = unsafe { Box::from_raw(socket) }.0;
let r = LocationSimulationService::new(socket);
let boxed = Box::new(LocationSimulationServiceHandle(r));
unsafe { *client = Box::into_raw(boxed) };
null_mut()
} |
neoarz
reviewed
Feb 28, 2026
ffi/src/location_simulation.rs
Outdated
| pub unsafe extern "C" fn lockdown_location_simulation_set( | ||
| handle: *mut *mut LocationSimulationServiceHandle, | ||
| latitude: *const libc::c_char, | ||
| longtiude: *const libc::c_char, |
Contributor
There was a problem hiding this comment.
longitude is spelled incorrectly
neoarz
reviewed
Feb 28, 2026
ffi/src/location_simulation.rs
Outdated
| /// `latitude` and `longitude` must be valid, null-terminated C strings. | ||
| #[unsafe(no_mangle)] | ||
| pub unsafe extern "C" fn lockdown_location_simulation_set( | ||
| handle: *mut *mut LocationSimulationServiceHandle, |
Contributor
There was a problem hiding this comment.
this should be a single *mut
neoarz
reviewed
Mar 1, 2026
ffi/src/location_simulation.rs
Outdated
| /// `handle` must be a valid pointer to a `LocationSimulationServiceHandle` returned by `lockdown_location_simulation_connect`. | ||
| #[unsafe(no_mangle)] | ||
| pub unsafe extern "C" fn lockdown_location_simulation_clear( | ||
| handle: *mut *mut LocationSimulationServiceHandle, |
Contributor
There was a problem hiding this comment.
this still needs to be a single mut
Contributor
|
other than that looks good! |
Contributor
Author
neoarz
approved these changes
Mar 1, 2026
Contributor
neoarz
left a comment
There was a problem hiding this comment.
wait for jackson to review and merge
Owner
|
Thanks everyone! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#76