M0: WIT package, MoonBit components, JS host, docs, CI (#1)
CI / test (push) Successful in 19s
CI / test (push) Successful in 19s
This commit was merged in pull request #1.
This commit is contained in:
1 parent
e5548fc067
commit
880ecd4102
141 files changed
+9681
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// 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
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user