| 1420 | } |
| 1421 | |
| 1422 | static 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 | |
| 1438 | static int gettop_wrapper(lua_State *L, int, lua_KContext) |
| 1439 | { |
nothing calls this directly
no test coverage detected