2 stable releases

1.0.1 Mar 14, 2023

#7 in #main

BSL-1.0 license

7KB
112 lines

c-main

Rust Crates.io Documentation

Utility crate providing c-main style arguments by using C main function.

Usage

#![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
}

lib.rs:

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
}

Dependencies

~42KB