2019-11-04 09:14:16 +01:00
|
|
|
extern crate failure;
|
|
|
|
extern crate libloading;
|
|
|
|
|
|
|
|
use std::ffi::CStr;
|
|
|
|
|
|
|
|
#[allow(non_camel_case_types, non_upper_case_globals, non_snake_case, dead_code)]
|
|
|
|
mod libretro_types;
|
|
|
|
mod libretro_loading;
|
2019-11-08 03:43:14 +01:00
|
|
|
mod libretro_convert;
|
2019-11-04 09:14:16 +01:00
|
|
|
|
|
|
|
fn main() -> failure::Fallible<()> {
|
|
|
|
let lib = libloading::Library::new("/home/lifning/.config/retroarch/cores/gambatte_libretro.so")?;
|
|
|
|
let retro = libretro_loading::LibretroApi::from_library(&lib)?;
|
|
|
|
unsafe {
|
|
|
|
println!("api version: {}", (&retro.retro_api_version)());
|
|
|
|
println!("name: {}", CStr::from_ptr(retro.get_system_info().library_name).to_string_lossy());
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
}
|