#![warn(missing_docs)]
use std::path::PathBuf;
pub mod api;
pub mod control;
pub mod hook;
#[cfg(feature = "host")]
pub mod host;
pub mod input_output;
#[cfg(feature = "host")]
pub mod plugin;
pub mod try_read;
pub use nitro_shared as shared;
pub static PLUGIN_DEBUG_ENV: &str = "NITRO_PLUGIN_DEBUG";
pub fn plugin_debug_enabled() -> bool {
std::env::var(PLUGIN_DEBUG_ENV).unwrap_or_default() == "1"
}
pub struct PluginPaths {
pub data_dir: PathBuf,
pub config_dir: PathBuf,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct PtrAndLength {
pub ptr: u32,
pub len: u32,
}
impl PtrAndLength {
pub fn null() -> Self {
Self { ptr: 0, len: 0 }
}
pub fn tuple(&self) -> (u32, u32) {
(self.ptr, self.len)
}
}