no-more-secrets-rust/src/lib.rs
2023-07-23 03:19:40 -07:00

36 lines
656 B
Rust

mod args;
use libc::{c_int, c_void};
const VERSION: &str = "2.0.0";
extern "C" {
fn nmseffect_set_autodecrypt(_: c_int) -> c_void;
fn nmseffect_set_clearscr(_: c_int) -> c_void;
}
#[no_mangle]
pub extern "C" fn rust_main() {
println!("Hello from rust");
let args = args::parse_arguments().unwrap();
if args.version {
println!("nms version {VERSION}");
std::process::exit(0);
}
if args.clear_screen {
unsafe {
nmseffect_set_clearscr(1);
}
}
if args.autodecrypt {
unsafe {
nmseffect_set_autodecrypt(1);
}
}
println!("{:?}", args);
}