using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Wasmtime.Imports
{
///
/// Represents a function imported to a WebAssembly module.
///
public class FunctionImport : Import
{
internal FunctionImport(IntPtr importType, IntPtr externType) : base(importType)
{
Debug.Assert(Interop.wasm_externtype_kind(externType) == Interop.wasm_externkind_t.WASM_EXTERN_FUNC);
unsafe
{
var funcType = Interop.wasm_externtype_as_functype_const(externType);
Parameters = Interop.ToValueKindList(Interop.wasm_functype_params(funcType));
Results = Interop.ToValueKindList(Interop.wasm_functype_results(funcType));
}
}
///
/// The parameters of the imported function.
///
public IReadOnlyList Parameters { get; private set; }
///
/// The results of the imported function.
///
public IReadOnlyList Results { get; private set; }
}
}