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

Function ll_loadlib

source/extern/lua/loadlib.c:393–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391
392
393static int ll_loadlib (lua_State *L) {
394 const char *path = luaL_checkstring(L, 1);
395 const char *init = luaL_checkstring(L, 2);
396 int stat = lookforfunc(L, path, init);
397 if (stat == 0) /* no errors? */
398 return 1; /* return the loaded function */
399 else { /* error; error message is on stack top */
400 lua_pushnil(L);
401 lua_insert(L, -2);
402 lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
403 return 3; /* return nil, error message, and where */
404 }
405}
406
407
408

Callers

nothing calls this directly

Calls 3

lookforfuncFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected