wasmtime_component_linker_instance_add_func function

  1. @Native<Pointer<wasmtime_error_t> Function(Pointer<wasmtime_component_linker_instance_t>, Pointer<wasm_byte_t>, Size, wasmtime_component_func_callback_t, Pointer<Void>, Pointer<NativeFunction<Void Function(Pointer<Void>)>>)>(ffi.Pointer<wasmtime_component_linker_instance_t>, ffi.Pointer<ffi.Char>, ffi.Size, wasmtime_component_func_callback_t, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>)>()
Pointer<wasmtime_error_t> wasmtime_component_linker_instance_add_func(
  1. Pointer<wasmtime_component_linker_instance_t> linker_instance,
  2. Pointer<wasm_byte_t> name,
  3. int name_len,
  4. wasmtime_component_func_callback_t callback,
  5. Pointer<Void> data,
  6. Pointer<NativeFunction<Void Function(Pointer<Void>)>> finalizer,
)

\brief Define a function within this instance.

\param linker_instance the instance to define the function in \param name the module name \param name_len length of \p name in bytes \param callback the callback when this function gets called \param data host-specific data passed to the callback invocation, can be NULL \param finalizer optional finalizer for \p data, can be NULL \return on success NULL, otherwise an error

Implementation

@ffi.Native<
  ffi.Pointer<wasmtime_error_t> Function(
    ffi.Pointer<wasmtime_component_linker_instance_t>,
    ffi.Pointer<ffi.Char>,
    ffi.Size,
    wasmtime_component_func_callback_t,
    ffi.Pointer<ffi.Void>,
    ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>,
  )
>()
external ffi.Pointer<wasmtime_error_t>
wasmtime_component_linker_instance_add_func(
  ffi.Pointer<wasmtime_component_linker_instance_t> linker_instance,
  ffi.Pointer<ffi.Char> name,
  int name_len,
  wasmtime_component_func_callback_t callback,
  ffi.Pointer<ffi.Void> data,
  ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
  finalizer,
);