MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / ll_loadlib

Function ll_loadlib

third-party/lua-5.5.0/src/loadlib.c:405–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403
404
405static int ll_loadlib (lua_State *L) {
406 const char *path = luaL_checkstring(L, 1);
407 const char *init = luaL_checkstring(L, 2);
408 int stat = lookforfunc(L, path, init);
409 if (l_likely(stat == 0)) /* no errors? */
410 return 1; /* return the loaded function */
411 else { /* error; error message is on stack top */
412 luaL_pushfail(L);
413 lua_insert(L, -2);
414 lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
415 return 3; /* return fail, error message, and where */
416 }
417}
418
419
420

Callers

nothing calls this directly

Calls 3

lookforfuncFunction · 0.70
lua_pushstringFunction · 0.70
lua_insertFunction · 0.50

Tested by

no test coverage detected