Move radio_list() to Rust

This commit is contained in:
Greg Shuflin 2021-02-27 22:59:06 -08:00
parent 2a91efd07f
commit c7c746a383
4 changed files with 14 additions and 2 deletions

1
main.c
View File

@ -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;

View File

@ -127,7 +127,7 @@ void radio_connect()
//
// List all supported radios.
//
void radio_list()
void radio_list_c()
{
int i;

View File

@ -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.

View File

@ -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]