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 36 37
use crate::bindings as b;
/// Log a debug message.
pub fn log_debug(t: &str) {
let ptr = t.as_ptr() as u32;
let len = t.len() as u32;
unsafe {
b::log_debug(ptr, len);
}
}
/// Log an error message.
pub fn log_error(t: &str) {
let ptr = t.as_ptr() as u32;
let len = t.len() as u32;
unsafe {
b::log_error(ptr, len);
}
}
/// Set the random seed.
pub fn set_seed(seed: u32) {
unsafe {
b::set_seed(seed);
}
}
/// Get a random value.
#[must_use]
pub fn get_random() -> u32 {
unsafe { b::get_random() }
}
/// Exit the app after the current update is finished.
pub fn quit() {
unsafe { b::quit() }
}