MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / ll_loadlib

Function ll_loadlib

ThirdParty/lua/lua/loadlib.c:353–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351
352
353static int ll_loadlib (lua_State *L) {
354 const char *path = luaL_checkstring(L, 1);
355 const char *init = luaL_checkstring(L, 2);
356 int stat = lookforfunc(L, path, init);
357 if (stat == 0) /* no errors? */
358 return 1; /* return the loaded function */
359 else { /* error; error message is on stack top */
360 lua_pushnil(L);
361 lua_insert(L, -2);
362 lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
363 return 3; /* return nil, error message, and where */
364 }
365}
366
367
368

Callers

nothing calls this directly

Calls 3

lookforfuncFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected