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

Method PushModulePublic

library/LuaTools.cpp:1043–1059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041}
1042
1043bool DFHack::Lua::PushModulePublic(color_ostream &out, lua_State *state,
1044 const char *module, const char *name)
1045{
1046 if (!PushModule(out, state, module))
1047 return false;
1048
1049 if (!lua_istable(state, -1))
1050 {
1051 lua_pop(state, 1);
1052 return false;
1053 }
1054
1055 lua_pushstring(state, name);
1056 lua_rawget(state, -2);
1057 lua_remove(state, -2);
1058 return true;
1059}
1060
1061bool DFHack::Lua::Require(color_ostream &out, lua_State *state,
1062 const std::string &module, bool setglobal)

Callers

nothing calls this directly

Calls 3

PushModuleFunction · 0.85
lua_pushstringFunction · 0.85
lua_rawgetFunction · 0.85

Tested by

no test coverage detected