MCPcopy Create free account
hub / github.com/DFHack/dfhack / dfhack_open_plugin

Function dfhack_open_plugin

library/LuaTools.cpp:1422–1436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420}
1421
1422static int dfhack_open_plugin(lua_State *L)
1423{
1424 luaL_checktype(L, 1, LUA_TTABLE);
1425 luaL_checktype(L, 2, LUA_TSTRING);
1426 const char *name = lua_tostring(L, 2);
1427
1428 PluginManager *pmgr = Core::getInstance().getPluginManager();
1429 Plugin *plugin = pmgr->getPluginByName(name);
1430
1431 if (!plugin)
1432 luaL_error(L, "plugin not found: '%s'", name);
1433
1434 plugin->open_lua(L, 1);
1435 return 0;
1436}
1437
1438static int gettop_wrapper(lua_State *L, int, lua_KContext)
1439{

Callers

nothing calls this directly

Calls 3

luaL_checktypeFunction · 0.85
luaL_errorFunction · 0.85
open_luaMethod · 0.80

Tested by

no test coverage detected