MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / loadModule

Function loadModule

test/api/APIUnitTest.cpp:387–394  ·  view source on GitHub ↗

Helper function to load wasm file into AST module.

Source from the content-addressed store, hash-verified

385
386// Helper function to load wasm file into AST module.
387WasmEdge_ASTModuleContext *loadModule(const WasmEdge_ConfigureContext *Conf,
388 const char *Path) {
389 WasmEdge_ASTModuleContext *Mod = nullptr;
390 WasmEdge_LoaderContext *Loader = WasmEdge_LoaderCreate(Conf);
391 WasmEdge_LoaderParseFromFile(Loader, &Mod, Path);
392 WasmEdge_LoaderDelete(Loader);
393 return Mod;
394}
395
396// Helper function to validate wasm module.
397bool validateModule(const WasmEdge_ConfigureContext *Conf,

Callers 3

loadUnitMethod · 0.85
loadSectionMethod · 0.85
TESTFunction · 0.85

Calls 2

WasmEdge_LoaderCreateFunction · 0.85
WasmEdge_LoaderDeleteFunction · 0.85

Tested by

no test coverage detected