MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / ll_loadlib

Function ll_loadlib

extlibs/lua/src/loadlib.c:404–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

lookforfuncFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected