ferretro/src/main.rs

20 lines
625 B
Rust
Raw Normal View History

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;
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(())
}