wasmtime_func_new function

  1. @Native<Void Function(Pointer<wasmtime_context_t>, Pointer<wasm_functype_t>, wasmtime_func_callback_t, Pointer<Void>, Pointer<NativeFunction<Void Function(Pointer<Void>)>>, Pointer<wasmtime_func_t>)>(ffi.Pointer<wasmtime_context_t>, ffi.Pointer<wasm_functype_t>, wasmtime_func_callback_t, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>, ffi.Pointer<wasmtime_func_t>)>()
void wasmtime_func_new(
  1. Pointer<wasmtime_context_t> store,
  2. Pointer<wasm_functype_t> type,
  3. wasmtime_func_callback_t callback,
  4. Pointer<Void> env,
  5. Pointer<NativeFunction<Void Function(Pointer<Void>)>> finalizer,
  6. Pointer<wasmtime_func_t> ret,
)

\brief Creates a new host-defined function.

Inserts a host-defined function into the store provided which can be used to then instantiate a module with or define within a #wasmtime_linker_t.

\param store the store in which to create the function \param type the wasm type of the function that's being created \param callback the host-defined callback to invoke \param env host-specific data passed to the callback invocation, can be NULL \param finalizer optional finalizer for env, can be NULL \param ret the #wasmtime_func_t return value to be filled in.

The returned function can only be used with the specified store.

Implementation

@ffi.Native<
  ffi.Void Function(
    ffi.Pointer<wasmtime_context_t>,
    ffi.Pointer<wasm_functype_t>,
    wasmtime_func_callback_t,
    ffi.Pointer<ffi.Void>,
    ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>,
    ffi.Pointer<wasmtime_func_t>,
  )
>()
external void wasmtime_func_new(
  ffi.Pointer<wasmtime_context_t> store,
  ffi.Pointer<wasm_functype_t> type,
  wasmtime_func_callback_t callback,
  ffi.Pointer<ffi.Void> env,
  ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
  finalizer,
  ffi.Pointer<wasmtime_func_t> ret,
);