| 671 | |
| 672 | |
| 673 | static 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 | |
| 691 | static int ll_seeall (lua_State *L) { |
nothing calls this directly
no test coverage detected