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

Function WasmEdge_PluginListModule

lib/api/wasmedge.cpp:3867–3882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3865}
3866
3867WASMEDGE_CAPI_EXPORT uint32_t
3868WasmEdge_PluginListModule(const WasmEdge_PluginContext *Cxt,
3869 WasmEdge_String *Names, const uint32_t Len) noexcept {
3870 if (Cxt) {
3871 auto MList = fromPluginCxt(Cxt)->modules();
3872 if (Names) {
3873 for (uint32_t I = 0; I < Len && I < MList.size(); I++) {
3874 Names[I] = WasmEdge_String{
3875 /* Length */ static_cast<uint32_t>(std::strlen(MList[I].name())),
3876 /* Buf */ MList[I].name()};
3877 }
3878 }
3879 return static_cast<uint32_t>(MList.size());
3880 }
3881 return 0;
3882}
3883
3884WASMEDGE_CAPI_EXPORT WasmEdge_ModuleInstanceContext *
3885WasmEdge_PluginCreateModule(const WasmEdge_PluginContext *Cxt,

Callers 1

TESTFunction · 0.85

Calls 3

modulesMethod · 0.80
sizeMethod · 0.45
nameMethod · 0.45

Tested by 1

TESTFunction · 0.68