MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / createsearcherstable

Function createsearcherstable

third-party/lua-5.2.4/src/loadlib.c:675–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673
674
675static void createsearcherstable (lua_State *L) {
676 static const lua_CFunction searchers[] =
677 {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL};
678 int i;
679 /* create 'searchers' table */
680 lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0);
681 /* fill it with pre-defined searchers */
682 for (i=0; searchers[i] != NULL; i++) {
683 lua_pushvalue(L, -2); /* set 'package' as upvalue for all searchers */
684 lua_pushcclosure(L, searchers[i], 1);
685 lua_rawseti(L, -2, i+1);
686 }
687}
688
689
690LUAMOD_API int luaopen_package (lua_State *L) {

Callers 1

luaopen_packageFunction · 0.70

Calls 4

lua_createtableFunction · 0.70
lua_pushvalueFunction · 0.70
lua_pushcclosureFunction · 0.70
lua_rawsetiFunction · 0.70

Tested by

no test coverage detected