MCPcopy Create free account
hub / github.com/F-Stack/f-stack / loader_Croot

Function loader_Croot

app/redis-6.2.6/deps/lua/src/loadlib.c:414–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412
413
414static int loader_Croot (lua_State *L) {
415 const char *funcname;
416 const char *filename;
417 const char *name = luaL_checkstring(L, 1);
418 const char *p = strchr(name, '.');
419 int stat;
420 if (p == NULL) return 0; /* is root */
421 lua_pushlstring(L, name, p - name);
422 filename = findfile(L, lua_tostring(L, -1), "cpath");
423 if (filename == NULL) return 1; /* root not found */
424 funcname = mkfuncname(L, name);
425 if ((stat = ll_loadfunc(L, filename, funcname)) != 0) {
426 if (stat != ERRFUNC) loaderror(L, filename); /* real error */
427 lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS,
428 name, filename);
429 return 1; /* function not found */
430 }
431 return 1;
432}
433
434
435static int loader_preload (lua_State *L) {

Callers

nothing calls this directly

Calls 7

strchrFunction · 0.85
findfileFunction · 0.85
mkfuncnameFunction · 0.85
ll_loadfuncFunction · 0.85
loaderrorFunction · 0.85
lua_pushlstringFunction · 0.70
lua_pushfstringFunction · 0.70

Tested by

no test coverage detected