Cleanup from removing most of main.c

This commit is contained in:
Greg Shuflin 2021-02-28 01:26:03 -08:00
parent 48552c64f6
commit 48faf189c8
2 changed files with 3 additions and 9 deletions

7
main.c
View File

@ -36,16 +36,11 @@ const char version[] = VERSION;
extern char *optarg;
extern int optind;
extern void print_message_from_rust();
extern void print_usage();
extern int rust_main(int argc, char** argv);
//TODO handle this correctly
int trace_flag = 0;
void usage() {
print_usage();
}
int main(int argc, char **argv) {
return rust_main(argc, argv);
}

View File

@ -15,8 +15,7 @@ extern {
fn radio_download();
}
#[no_mangle]
pub extern "C" fn print_usage() {
fn print_usage() {
let version = VERSION.unwrap_or("-----");
print!("DMR Config, Version {}, {}", version, COPYRIGHT);
@ -64,7 +63,7 @@ fn get_options() -> Options {
}
#[no_mangle]
pub extern "C" fn rust_main(argc: c_int, argv: *const *const c_char) -> c_int {
pub extern "C" fn rust_main(_argc: c_int, _argv: *const *const c_char) -> c_int {
let args = std::env::args().skip(1);
let matches = match get_options().parse(args) {