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

Function searcher_preload

lib/lua/src/loadlib.c:601–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599
600
601static int searcher_preload (lua_State *L) {
602 const char *name = luaL_checkstring(L, 1);
603 lua_getfield(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE);
604 if (lua_getfield(L, -1, name) == LUA_TNIL) { /* not found? */
605 lua_pushfstring(L, "no field package.preload['%s']", name);
606 return 1;
607 }
608 else {
609 lua_pushliteral(L, ":preload:");
610 return 2;
611 }
612}
613
614
615static void findloader (lua_State *L, const char *name) {

Callers

nothing calls this directly

Calls 2

lua_getfieldFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by

no test coverage detected