Files
chandra/interface/wasi-gfx/frame-buffer/frame-buffer/ffi.mbt
T
2026-11-25 02:54:03 +00:00

39 lines
1.2 KiB
MoonBit

// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
fn wasmImportResourceDropBuffer(resource : Int) = "wasi-gfx:frame-buffer/frame-buffer@0.2.0" "[resource-drop]buffer"
///|
fn wasmImportMethodBufferGetWithCopy(p0 : Int, p1 : Int) = "wasi-gfx:frame-buffer/frame-buffer@0.2.0" "[method]buffer.get-with-copy"
///|
fn wasmImportMethodBufferSetWithCopy(p0 : Int, p1 : Int, p2 : Int) = "wasi-gfx:frame-buffer/frame-buffer@0.2.0" "[method]buffer.set-with-copy"
///|
extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] =
#|(func (param i32) (param i32) (result i32)
#| local.get 0
#| local.get 1 call $moonbit.init_array8
#| local.get 0)
///|
extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int =
#|(func (param i32) (result i32) (local i32)
#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc
#| local.tee 1 i32.const 0 call $moonbit.init_array8
#| local.get 1)
///|
extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int =
#|(func (param i32) (result i32) local.get 0 i32.load)
///|
extern "wasm" fn mbt_ffi_free(position : Int) =
#|(func (param i32) local.get 0 call $moonbit.decref)
///|
#owned(bytes)
extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int =
#|(func (param i32) (result i32) local.get 0)