wasmedge-hs-0.17.1.0: Haskell bindings for the WasmEdge WebAssembly runtime
Copyright(c) 2026 Tushar Adhatrao
LicenseMIT
Stabilityinternal
Safe HaskellNone
LanguageGHC2021

WasmEdge.Internal.FFI.Value

Description

Do not import this module in user code.

Synopsis

ValType generators (via shims)

ValType predicates

Value generators (via shims)

c_ValueGenV128 :: Ptr CValue_ -> Word64 -> Word64 -> IO () #

Generate a V128 value from two Word64 (hi, lo).

c_ValueGenFuncRef :: Ptr CValue_ -> Ptr FunctionInstanceTag -> IO () #

Generate a FuncRef value from a FunctionInstance pointer. Passing nullPtr generates a null FuncRef.

c_ValueGenExternRef :: Ptr CValue_ -> Ptr () -> IO () #

Generate an ExternRef value from an arbitrary Haskell pointer.

c_ValueGenNullFuncRef :: Ptr CValue_ -> IO () #

Generate a null FuncRef value.

c_ValueGenNullExternRef :: Ptr CValue_ -> IO () #

Generate a null ExternRef value.

Value extractors

c_ValueGetV128 :: Ptr CValue_ -> Ptr Word64 -> Ptr Word64 -> IO () #

Retrieve V128 as two Word64 (hi, lo) written to output pointers.

c_ValueGetFuncRef :: Ptr CValue_ -> IO (Ptr FunctionInstanceTag) #

Get the FunctionInstance pointer from a FuncRef value. Returns nullPtr for a null FuncRef.

c_ValueGetExternRef :: Ptr CValue_ -> IO (Ptr ()) #

Get the ExternRef pointer from an ExternRef value.

c_ValueGetType :: Ptr CValue_ -> Ptr CValType_ -> IO () #

Get the ValType of a value (written to out pointer).

Value array helpers

c_ValueArrayAlloc :: Word32 -> IO (Ptr CValue_) #

Allocate a C heap array of n WasmEdge_Value structs. Caller must free.

c_ValueArrayFree :: Ptr CValue_ -> IO () #

Free an array allocated by c_ValueArrayAlloc.

c_ValueArraySet :: Ptr CValue_ -> Word32 -> Ptr CValue_ -> IO () #

Set arr[idx] from a value pointer.

c_ValueArrayGet :: Ptr CValue_ -> Word32 -> Ptr CValue_ -> IO () #

Get arr[idx] into an output value pointer.