MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / ll_loadlib

Function ll_loadlib

Source/Misc/lua/src/lua.c:13077–13089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13075
13076
13077static int ll_loadlib (lua_State *L) {
13078const char *path = luaL_checkstring(L, 1);
13079const char *init = luaL_checkstring(L, 2);
13080int stat = ll_loadfunc(L, path, init);
13081if (stat == 0) /* no errors? */
13082return 1; /* return the loaded function */
13083else { /* error; error message is on stack top */
13084lua_pushnil(L);
13085lua_insert(L, -2);
13086lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
13087return 3; /* return nil, error message, and where */
13088}
13089}
13090
13091
13092

Callers

nothing calls this directly

Calls 4

ll_loadfuncFunction · 0.85
lua_pushnilFunction · 0.85
lua_insertFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected