Created
May 27, 2021 13:04
-
-
Save saivert/6d457611c04bf024d27fcc62b46cdaa7 to your computer and use it in GitHub Desktop.
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
#[no_mangle] | |
pub unsafe extern "C" fn libsampleplugin_load(functions: *const DB_functions_t ) -> *mut c_void { | |
// "functions" argument is a pointer to a struct with function pointers for each API function. | |
// Callable like so: | |
let confdir: &CStr = CStr::from_ptr( (*functions).get_config_dir.unwrap()() ); | |
println!("From rust: Deadbeef config dir is {}", confdir.to_str().unwrap()); | |
// How to store a reference or pointer to this structure in a global variable so I can reference it later? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment