| 583 | |
| 584 | |
| 585 | static int ll_module (lua_State *L) { |
| 586 | const char *modname = luaL_checkstring(L, 1); |
| 587 | int lastarg = lua_gettop(L); /* last parameter */ |
| 588 | luaL_pushmodule(L, modname, 1); /* get/create module table */ |
| 589 | /* check whether table already has a _NAME field */ |
| 590 | lua_getfield(L, -1, "_NAME"); |
| 591 | if (!lua_isnil(L, -1)) /* is table an initialized module? */ |
| 592 | lua_pop(L, 1); |
| 593 | else { /* no; initialize it */ |
| 594 | lua_pop(L, 1); |
| 595 | modinit(L, modname); |
| 596 | } |
| 597 | lua_pushvalue(L, -1); |
| 598 | set_env(L); |
| 599 | dooptions(L, lastarg); |
| 600 | return 1; |
| 601 | } |
| 602 | |
| 603 | |
| 604 | static int ll_seeall (lua_State *L) { |
nothing calls this directly
no test coverage detected