MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / ll_module

Function ll_module

src/vm/luavm/lua/loadlib.c:634–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632
633
634static int ll_module (lua_State *L) {
635 const char *modname = luaL_checkstring(L, 1);
636 int lastarg = lua_gettop(L); /* last parameter */
637 luaL_pushmodule(L, modname, 1); /* get/create module table */
638 /* check whether table already has a _NAME field */
639 if (lua_getfield(L, -1, "_NAME") != LUA_TNIL)
640 lua_pop(L, 1); /* table is an initialized module */
641 else { /* no; initialize it */
642 lua_pop(L, 1);
643 modinit(L, modname);
644 }
645 lua_pushvalue(L, -1);
646 set_env(L);
647 dooptions(L, lastarg);
648 return 1;
649}
650
651
652static 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