From 88e8fb48d82062c2b7e5f43e9bbc634e8fcc1144 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sat, 27 Feb 2021 23:16:01 -0800 Subject: [PATCH] Create radio module --- src/lib.rs | 13 ++----------- src/radio.rs | 10 ++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 src/radio.rs diff --git a/src/lib.rs b/src/lib.rs index 8528d77..7864c2b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,8 @@ use std::ffi::CStr; use libc::c_char; +mod radio; + const COPYRIGHT: &'static str = "Copyright (C) 2018 Serge Vakulenko KK6ABQ"; #[no_mangle] @@ -54,17 +56,6 @@ 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] diff --git a/src/radio.rs b/src/radio.rs new file mode 100644 index 0000000..58d293b --- /dev/null +++ b/src/radio.rs @@ -0,0 +1,10 @@ +extern { + fn radio_list_c(); +} + +#[no_mangle] +pub extern "C" fn radio_list() { + unsafe { + radio_list_c(); + } +}