MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / createsearcherstable

Function createsearcherstable

3rd/lua-5.4.3/src/loadlib.c:710–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708
709
710static void createsearcherstable (lua_State *L) {
711 static const lua_CFunction searchers[] =
712 {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL};
713 int i;
714 /* create 'searchers' table */
715 lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0);
716 /* fill it with predefined searchers */
717 for (i=0; searchers[i] != NULL; i++) {
718 lua_pushvalue(L, -2); /* set 'package' as upvalue for all searchers */
719 lua_pushcclosure(L, searchers[i], 1);
720 lua_rawseti(L, -2, i+1);
721 }
722 lua_setfield(L, -2, "searchers"); /* put it in field 'searchers' */
723}
724
725
726/*

Callers 1

luaopen_packageFunction · 0.85

Calls 5

lua_createtableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushcclosureFunction · 0.85
lua_rawsetiFunction · 0.85
lua_setfieldFunction · 0.85

Tested by

no test coverage detected