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

Function ll_loadlib

third-party/lua-5.4.6/src/loadlib.c:402–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

lookforfuncFunction · 0.70
lua_pushstringFunction · 0.70
lua_insertFunction · 0.50

Tested by

no test coverage detected