use maraiah::{err::*, ffi};

mod cc;
mod gui;
mod meta;

extern "C" {
	fn main_cc(app_name: *mut ffi::c_char);
}

fn main() -> ResultS<()>
{
	if cfg!(debug_assertions) {
		eprintln!("rust entry");
	}

	let mut args = std::env::args();
	let app_name = args.next().ok_or(err_msg("bad launch name"))?;
	let app_name = ffi::CString::new(app_name)?;

	unsafe {
		main_cc(app_name.into_raw());
	}

	Ok(())
}

// EOF
