Files
chandra/interface/moonplasma/desktop/app-launch/top.mbt
T
2026-11-24 23:51:26 +00:00

30 lines
755 B
MoonBit

// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
/// Ask the host to start an application by catalog id.
pub fn launch(id : String) -> Result[Unit, String] {
let ptr = mbt_ffi_str2ptr(id)
let return_area = mbt_ffi_malloc(12)
wasmImportLaunch(ptr, id.length(), return_area);
let lifted = match (mbt_ffi_load8_u((return_area) + 0)) {
0 => {
Result::Ok(())
}
1 => {
let result = mbt_ffi_ptr2str(mbt_ffi_load32((return_area) + 4), mbt_ffi_load32((return_area) + 8))
Result::Err(result)
}
_ => panic()
}
let ret = lifted
mbt_ffi_free(ptr)
mbt_ffi_free(return_area)
return ret
}