pub const SNAPSHOT_INTERVAL: usize = 50;
pub mod dtob_wire;
pub mod html;
pub mod xanadoc;
pub mod maps;
pub mod serve;
pub mod table;
pub mod remove;
pub mod daemon;
pub mod shared;
#[allow(non_upper_case_globals, non_camel_case_types, non_snake_case, improper_ctypes)]
pub mod dtob_ffi {
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
}
use std::path::Path;
pub fn decode_dtob_bytes(data: &[u8]) -> Option<*mut dtob_ffi::DtobValue> {
let root = unsafe { dtob_ffi::ffi_decode_dif(data.as_ptr(), data.len()) };
if root.is_null() {
None
} else {
Some(root)
}
}
pub(crate) fn decode_dtob_file(path: &Path) -> Option<*mut dtob_ffi::DtobValue> {
let data = std::fs::read(path).ok()?;
decode_dtob_bytes(&data)
}