wasmedge_sys::ffi

Function WasmEdge_ConfigureAddHostRegistration

Source
pub unsafe extern "C" fn WasmEdge_ConfigureAddHostRegistration(
    Cxt: *mut WasmEdge_ConfigureContext,
    Host: WasmEdge_HostRegistration,
)
Expand description

Add a built-in host registration setting into WasmEdge_ConfigureContext.

For turning on the Wasi support in WasmEdge_VMContext, you can set the built-in host registration value into the WasmEdge_ConfigureContext and create VM with this context.

WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();
WasmEdge_ConfigureAddHostRegistration(Conf, WasmEdge_HostRegistration_Wasi);
WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);

This function is thread-safe.

\param Cxt the WasmEdge_ConfigureContext to add built-in host registration. \param Host the built-in host registration value.