MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ll_loadlib

Function ll_loadlib

deps/lua/src/loadlib.c:309–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307
308
309static int ll_loadlib (lua_State *L) {
310 const char *path = luaL_checkstring(L, 1);
311 const char *init = luaL_checkstring(L, 2);
312 int stat = ll_loadfunc(L, path, init);
313 if (stat == 0) /* no errors? */
314 return 1; /* return the loaded function */
315 else { /* error; error message is on stack top */
316 lua_pushnil(L);
317 lua_insert(L, -2);
318 lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
319 return 3; /* return nil, error message, and where */
320 }
321}
322
323
324

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