diff --git a/main.c b/main.c index 088050a..641528f 100644 --- a/main.c +++ b/main.c @@ -38,6 +38,7 @@ extern int optind; extern void print_message_from_rust(); extern void print_usage(const char* version); +extern void radio_list(); int trace_flag = 0; diff --git a/radio.c b/radio.c index 55664ec..c5634d4 100644 --- a/radio.c +++ b/radio.c @@ -127,7 +127,7 @@ void radio_connect() // // List all supported radios. // -void radio_list() +void radio_list_c() { int i; diff --git a/radio.h b/radio.h index d35960f..48334e6 100644 --- a/radio.h +++ b/radio.h @@ -85,7 +85,7 @@ void radio_write_csv(const char *filename); // // List all supported radios. // -void radio_list(void); +void radio_list_c(void); // // Check for compatible radio model. diff --git a/src/lib.rs b/src/lib.rs index 8bdacad..8528d77 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,6 +54,17 @@ pub extern "C" fn process_options() { } +extern { + fn radio_list_c(); +} + +#[no_mangle] +pub extern "C" fn radio_list() { + unsafe { + radio_list_c(); + } +} + #[cfg(test)] mod tests { #[test]