MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / ll_loadlib

Function ll_loadlib

other_src/lua/src/loadlib.cpp:324–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322
323
324static int ll_loadlib (lua_State *L) {
325 const char *path = luaL_checkstring(L, 1);
326 const char *init = luaL_checkstring(L, 2);
327 int stat = ll_loadfunc(L, path, init);
328 if (stat == 0) /* no errors? */
329 return 1; /* return the loaded function */
330 else { /* error; error message is on stack top */
331 lua_pushnil(L);
332 lua_insert(L, -2);
333 lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
334 return 3; /* return nil, error message, and where */
335 }
336}
337
338
339

Callers

nothing calls this directly

Calls 4

ll_loadfuncFunction · 0.70
lua_pushnilFunction · 0.70
lua_insertFunction · 0.70
lua_pushstringFunction · 0.70

Tested by

no test coverage detected