Crate c_main

Source
Expand description

C main entry point with nice wrapper for arguments.

#![no_main]

#[no_mangle]
pub fn rust_main(args: c_main::Args) -> isize {
    for arg in args.into_iter().skip(1) {
        println!("arg={:?}", arg);
    }
    0
}

Structs§

Args
Wrapper over C-style arguments

Functions§

c_str_to_rust
Converts C string to Rust’s, verifying it is UTF-8
c_str_to_rust_unchecked
Converts C string to Rust’s one assuming it is UTF-8