wasmtime_caller_export_get function

  1. @Native<Bool Function(Pointer<wasmtime_caller_t>, Pointer<wasm_byte_t>, Size, Pointer<wasmtime_extern_t>)>(ffi.Pointer<wasmtime_caller_t>, ffi.Pointer<ffi.Char>, ffi.Size, ffi.Pointer<wasmtime_extern_t>)>()
bool wasmtime_caller_export_get(
  1. Pointer<wasmtime_caller_t> caller,
  2. Pointer<wasm_byte_t> name,
  3. int name_len,
  4. Pointer<wasmtime_extern_t> item,
)

\brief Loads a #wasmtime_extern_t from the caller's context

This function will attempt to look up the export named name on the caller instance provided. If it is found then the #wasmtime_extern_t for that is returned, otherwise NULL is returned.

Note that this only works for exported memories right now for WASI compatibility.

\param caller the caller object to look up the export from \param name the name that's being looked up \param name_len the byte length of name \param item where to store the return value

Returns a nonzero value if the export was found, or 0 if the export wasn't found. If the export wasn't found then item isn't written to.

Implementation

@ffi.Native<
  ffi.Bool Function(
    ffi.Pointer<wasmtime_caller_t>,
    ffi.Pointer<ffi.Char>,
    ffi.Size,
    ffi.Pointer<wasmtime_extern_t>,
  )
>()
external bool wasmtime_caller_export_get(
  ffi.Pointer<wasmtime_caller_t> caller,
  ffi.Pointer<ffi.Char> name,
  int name_len,
  ffi.Pointer<wasmtime_extern_t> item,
);