1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
extern crate libc; use libc::wchar_t; #[link(name = "tolk")] extern "C" { pub fn Tolk_Load(); pub fn Tolk_IsLoaded() -> bool; pub fn Tolk_Unload(); pub fn Tolk_TrySAPI(trySAPI: bool); pub fn Tolk_PreferSAPI(preferSAPI: bool); pub fn Tolk_DetectScreenReader() -> *const wchar_t; pub fn Tolk_HasSpeech() -> bool; pub fn Tolk_HasBraille() -> bool; pub fn Tolk_Output(str: *const wchar_t, interrupt: bool) -> bool; pub fn Tolk_Speak(str: *const wchar_t, interrupt: bool) -> bool; pub fn Tolk_Braille(str: *const wchar_t) -> bool; pub fn Tolk_IsSpeaking() -> bool; pub fn Tolk_Silence() -> bool; } #[test] fn load_unload() { unsafe { Tolk_Load(); assert_eq!(Tolk_IsLoaded(), true); Tolk_Unload(); assert_eq!(Tolk_IsLoaded(), false); } }