| 3882 | } |
| 3883 | |
| 3884 | WASMEDGE_CAPI_EXPORT WasmEdge_ModuleInstanceContext * |
| 3885 | WasmEdge_PluginCreateModule(const WasmEdge_PluginContext *Cxt, |
| 3886 | const WasmEdge_String ModuleName) noexcept { |
| 3887 | try { |
| 3888 | if (Cxt) { |
| 3889 | if (const auto *PMod = |
| 3890 | fromPluginCxt(Cxt)->findModule(genStrView(ModuleName)); |
| 3891 | PMod) { |
| 3892 | return toModCxt(PMod->create().release()); |
| 3893 | } |
| 3894 | } |
| 3895 | } catch (...) { |
| 3896 | handleCAPIError(); |
| 3897 | } |
| 3898 | return nullptr; |
| 3899 | } |
| 3900 | |
| 3901 | WASMEDGE_CAPI_EXPORT void |
| 3902 | WasmEdge_PluginInitWASINN(const char *const *NNPreloads, |