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

Function WasmEdge_ModuleInstanceInitWasmEdgeProcess

lib/api/wasmedge.cpp:2450–2466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2448}
2449
2450WASMEDGE_CAPI_EXPORT void
2451WasmEdge_ModuleInstanceInitWasmEdgeProcess(const char *const *AllowedCmds,
2452 const uint32_t CmdsLen,
2453 const bool AllowAll) noexcept {
2454 using namespace std::literals::string_view_literals;
2455 if (const auto *Plugin =
2456 WasmEdge::Plugin::Plugin::find("wasmedge_process"sv)) {
2457 PO::ArgumentParser Parser;
2458 Plugin->registerOptions(Parser);
2459 Parser.set_raw_value<std::vector<std::string>>(
2460 "allow-command"sv,
2461 std::vector<std::string>(AllowedCmds, AllowedCmds + CmdsLen));
2462 if (AllowAll) {
2463 Parser.set_raw_value("allow-command-all"sv);
2464 }
2465 }
2466}
2467
2468WASMEDGE_CAPI_EXPORT WasmEdge_String WasmEdge_ModuleInstanceGetModuleName(
2469 const WasmEdge_ModuleInstanceContext *Cxt) noexcept {

Callers

nothing calls this directly

Calls 2

registerOptionsMethod · 0.80
set_raw_valueMethod · 0.45

Tested by

no test coverage detected