MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / createsearcherstable

Function createsearcherstable

extlibs/lua/src/loadlib.c:702–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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