MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / loader_Croot

Function loader_Croot

other_src/lua/src/loadlib.cpp:429–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427
428
429static int loader_Croot (lua_State *L) {
430 const char *funcname;
431 const char *filename;
432 const char *name = luaL_checkstring(L, 1);
433 const char *p = strchr(name, '.');
434 int stat;
435 if (p == NULL) return 0; /* is root */
436 lua_pushlstring(L, name, p - name);
437 filename = findfile(L, lua_tostring(L, -1), "cpath");
438 if (filename == NULL) return 1; /* root not found */
439 funcname = mkfuncname(L, name);
440 if ((stat = ll_loadfunc(L, filename, funcname)) != 0) {
441 if (stat != ERRFUNC) loaderror(L, filename); /* real error */
442 lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS,
443 name, filename);
444 return 1; /* function not found */
445 }
446 return 1;
447}
448
449
450static int loader_preload (lua_State *L) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected