ffi/wasm/wasm library
Foreign Function Interface for interoperability with the C programming language.
This is quivalent to the dart:ffi
package for the web platform.
Classes
- Abi
- An application binary interface (ABI).
- AbiSpecificInteger
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- AbiSpecificIntegerMapping
- Mapping for a subtype of AbiSpecificInteger.
- Allocator
- Manages memory on the native heap.
- Arena
- An Allocator which frees all allocations at the same time.
-
Array<
T extends NativeType> -
A fixed-sized array of
T
s. - Bool
- Represents a native bool in C.
- Double
- Represents a native 64 bit double in C.
- DynamicLibrary
- Represents a dynamically loaded C library.
- FfiUniverseDynamicLibrary
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- Finalizable
- Marker interface for objects which should not be finalized too soon.
- Float
- Represents a native 32 bit float in C.
- Int
-
The C
int
type. - Int16
- Represents a native signed 16 bit integer in C.
- Int32
- Represents a native signed 32 bit integer in C.
- Int64
- Represents a native signed 64 bit integer in C.
- Int8
- Represents a native signed 8 bit integer in C.
- IntPtr
- Represents a native pointer-sized integer in C.
- Long
-
The C
unsigned int
type. -
NativeCallable<
T extends Function> - A native callable which listens for calls to a native function.
-
NativeFunction<
T extends Function> - Represents a function type in C.
- NativeType
- NativeType's subtypes represent a native type in C.
- Opaque
- Opaque's subtypes represent opaque types in C.
- Packed
-
Annotation to specify on
Struct
subtypes to indicate that its members need to be packed. -
Pointer<
T extends NativeType> - Represents a pointer into the native C memory. Cannot be extended.
- SignedChar
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- Size
- Represents a Size type in C.
- SizedNativeType
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- Struct
- The supertype of all FFI struct types.
- Uint16
- Represents a native unsigned 16 bit integer in C.
- Uint32
- Represents a native unsigned 32 bit integer in C.
- Uint64
- Represents a native unsigned 64 bit integer in C.
- Uint8
- Represents a native unsigned 8 bit integer in C.
- UintPtr
- Represents a native pointer-sized unsigned integer in C.
- Union
- The supertype of all FFI union types.
- UnsignedInt
-
The C
unsigned int
type. - UnsignedShort
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- Utf16
- The contents of a native zero-terminated array of UTF-16 code units.
- Utf8
- The contents of a native zero-terminated array of UTF-8 code units.
- Void
- Represents a void type in C.
- WebModuleLoader
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
Enums
- GlobalMemory
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- WasmType
- Enum for StandaloneWasmModule and EmscriptenModule
Mixins
- ModuleLoader
- An interface for loading module binary.
Extensions
-
AbiSpecificIntegerPointer
on Pointer<
T> - General Library Documentation Undocument By General Corporation & Global Corporation & General Developer not_real_implemented
- AllocatorAlloc on Allocator
- Extension on Allocator to provide allocation with NativeType.
-
BoolPointer
on Pointer<
Bool> - Extension on Pointer specialized for the type argument Bool.
-
DoublePointer
on Pointer<
Double> - Extension on Pointer specialized for the type argument Double.
-
FloatPointer
on Pointer<
Float> - Extension on Pointer specialized for the type argument Float.
-
Int16Pointer
on Pointer<
Int16> - Extension on Pointer specialized for the type argument Int16.
-
Int32Pointer
on Pointer<
Int32> - Extension on Pointer specialized for the type argument Int32.
-
Int64Pointer
on Pointer<
Int64> - Extension on Pointer specialized for the type argument Int64.
-
Int8Pointer
on Pointer<
Int8> - Extension on Pointer specialized for the type argument Int8.
-
IntPtrPointer
on Pointer<
IntPtr> - Extension on Pointer specialized for the type argument IntPtr.
-
ListExtension
on List<
T> - General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
-
NativeFunctionPointer
on Pointer<
NativeFunction< NF> > - Extension on Pointer specialized for the type argument NativeFunction.
-
PointerPointer
on Pointer<
Pointer< T> > - Extension on Pointer specialized for the type argument Pointer.
- StringUtf16Pointer on String
-
Extension method for converting a String to a
Pointer\<Utf16\>
. - StringUtf8Pointer on String
-
Extension method for converting a String to a
Pointer\<Utf8\>
. -
StructPointer
on Pointer<
T> - General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
-
Uint16Pointer
on Pointer<
Uint16> - Extension on Pointer specialized for the type argument Uint16.
-
Uint32Pointer
on Pointer<
Uint32> - Extension on Pointer specialized for the type argument Uint32.
-
Uint64Pointer
on Pointer<
Uint64> - Extension on Pointer specialized for the type argument Uint64.
-
Uint8Pointer
on Pointer<
Uint8> - Extension on Pointer specialized for the type argument Uint8.
-
Utf16Pointer
on Pointer<
Utf16> -
Extension method for converting a
Pointer\<Utf16\>
to a String. -
Utf8Pointer
on Pointer<
Utf8> -
Extension method for converting a
Pointer\<Utf8\>
to a String.
Constants
- calloc → const CallocAllocator
- Uses global memory instance to manage memory.
- malloc → const MallocAllocator
- Uses global memory instance to manage memory.
Properties
-
callbackHelpers
→ List<
Function Function(Function)> -
General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
final
-
exportedFunctions
→ Map<
Function, Pointer< NativeType> > -
General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
final
-
nullptr
→ Pointer<
Never> -
Represents a pointer into the native C memory corresponding to "NULL",
e.g. a pointer with address 0.
final
-
signatures
→ Map<
String, String> -
General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
final
- zoneArena → Arena
-
A zone-specific Arena.
no setter
Functions
-
initSignatures(
[int pointerSizeBytes = 4]) → void - General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
-
initTypes(
[int pointerSizeBytes = 4]) → void -
Must be called before working with
wasm_ffi
to initalize all type sizes. -
pointerFromFunctionImpl<
T extends Function> (Function func, WasmTable table, Memory memory) → Pointer< NativeFunction< T> > - General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
-
registerOpaqueType<
T extends Opaque> ([int? size]) → void - Must be called with each type that extends Opaque before attemtping to use that type.
-
sizeOf<
T extends NativeType> () → int - Number of bytes used by native type T.
-
using<
R> (R computation(Arena), [Allocator wrappedAllocator = calloc]) → R -
Runs
computation
with a new Arena, and releases all allocations at the end. -
withZoneArena<
R> (R computation(), [Allocator wrappedAllocator = calloc]) → R - Creates a zoned Arena to manage native resources.
Typedefs
- AllowedFunc = JSAny Function(JSAny?, JSAny?, JSAny?, JSAny?)
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- Char = Int8
- Miscellaneous types, defined as alias
- LongLong = Int64
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
-
NativeFinalizerFunction
= NativeFunction<
Void Function(Pointer< Void> token)> - The native function type fors.
- Short = Int16
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- UnsignedLong = Uint32
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- UnsignedLongLong = Uint64
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
- WChar = Int32
- General Library Documentation Undocument By General Corporation & Global Corporation & General Developer