Skip to content

Commit

Permalink
Add new execlookup api
Browse files Browse the repository at this point in the history
  • Loading branch information
redstrate committed Jun 30, 2024
1 parent 0b09892 commit c3ad93a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/execlookup.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use core::ffi::c_char;
use core::ptr::null;
use crate::{ffi_from_c_string, ffi_to_c_string};
use physis::execlookup::extract_frontier_url;

#[no_mangle]
pub extern "C" fn physis_extract_frontier_url(launcher_path: *const c_char) -> *const c_char {
let launcher_path = ffi_from_c_string(launcher_path).unwrap();
if let Some(frontier_url) = extract_frontier_url(&launcher_path) {
ffi_to_c_string(&frontier_url)
} else {
null()
}
}
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,5 @@ mod logging;

mod schd;
mod existing_dirs;

mod execlookup;

0 comments on commit c3ad93a

Please sign in to comment.