MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / ll_loadlib

Function ll_loadlib

3rd/lua-5.4.3/src/loadlib.c:411–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

lookforfuncFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected