MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / createsearcherstable

Function createsearcherstable

lib/lua/src/loadlib.c:701–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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