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

Function ll_module

depends/lua/src/loadlib.c:673–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671
672
673static int ll_module (lua_State *L) {
674 const char *modname = luaL_checkstring(L, 1);
675 int lastarg = lua_gettop(L); /* last parameter */
676 luaL_pushmodule(L, modname, 1); /* get/create module table */
677 /* check whether table already has a _NAME field */
678 if (lua_getfield(L, -1, "_NAME") != LUA_TNIL)
679 lua_pop(L, 1); /* table is an initialized module */
680 else { /* no; initialize it */
681 lua_pop(L, 1);
682 modinit(L, modname);
683 }
684 lua_pushvalue(L, -1);
685 set_env(L);
686 dooptions(L, lastarg);
687 return 1;
688}
689
690
691static int ll_seeall (lua_State *L) {

Callers

nothing calls this directly

Calls 7

lua_gettopFunction · 0.85
luaL_pushmoduleFunction · 0.85
lua_getfieldFunction · 0.85
modinitFunction · 0.85
lua_pushvalueFunction · 0.85
set_envFunction · 0.85
dooptionsFunction · 0.85

Tested by

no test coverage detected