#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum Portal {
Log = 0,
Prompt = 1,
Account = 2,
User = 3,
System = 4,
Host = 5,
Hardware = 6,
Platform = 7,
Spawn = 8,
SpawnBlocking = 9,
Channel = 10,
Admin = 11,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct Connect {
pub ready_capacity: usize,
pub ready_data: *mut usize,
pub portals_size: usize,
pub portals_data: *mut u32,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct Command {
pub ready: usize,
pub channel: u32,
pub size: usize,
pub data: *const (),
}
#[link(wasm_import_module = "daku")]
extern "C" {
pub fn ar(size: usize, data: *const Command) -> usize;
pub fn dbg(size: usize, text: *const u8);
}
#[repr(usize)]
#[derive(Debug, Copy, Clone)]
pub enum Level {
Trace = 0b0000_0000_0000_0000_0000_0000_0000_0000,
Debug = 0b0010_0000_0000_0000_0000_0000_0000_0000,
Info = 0b0100_0000_0000_0000_0000_0000_0000_0000,
Warn = 0b0110_0000_0000_0000_0000_0000_0000_0000,
Error = 0b1000_0000_0000_0000_0000_0000_0000_0000,
Trap = 0b1010_0000_0000_0000_0000_0000_0000_0000,
Mask = 0b1110_0000_0000_0000_0000_0000_0000_0000,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct Spawn {
pub func: extern "C" fn(data: *mut ()),
pub data: *mut (),
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct Log {
pub target_size: usize,
pub target_data: *const u8,
pub message_size: usize,
pub message_data: *const u8,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct Text {
pub size: usize,
pub data: *mut u8,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct Prompt {
pub text: *mut Text,
pub capacity: *mut usize,
}