Implement WASI C API.
This commit implements an initial WASI C API that can be used to instantiate and configure a WASI instance from C. This also implements a `WasiBuilder` for the C# API enabling .NET hosts to bind to Wasmtime's WASI implementation.
This commit is contained in:
@@ -12,10 +12,12 @@ namespace Wasmtime.Imports
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
var moduleName = Interop.wasm_importtype_module(importType);
|
||||
Handle = importType;
|
||||
|
||||
var moduleName = Interop.wasm_importtype_module(Handle);
|
||||
ModuleName = Marshal.PtrToStringUTF8((IntPtr)moduleName->data, (int)moduleName->size);
|
||||
|
||||
var name = Interop.wasm_importtype_name(importType);
|
||||
var name = Interop.wasm_importtype_name(Handle);
|
||||
Name = Marshal.PtrToStringUTF8((IntPtr)name->data, (int)name->size);
|
||||
}
|
||||
}
|
||||
@@ -30,6 +32,8 @@ namespace Wasmtime.Imports
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
|
||||
internal IntPtr Handle { get; private set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user