| 357 | |
| 358 | |
| 359 | static int ll_loadlib(lua_State *L) { |
| 360 | const char *path = luaL_checkstring(L, 1); |
| 361 | const char *init = luaL_checkstring(L, 2); |
| 362 | int stat = lookforfunc(L, path, init); |
| 363 | if (stat == 0) /* no errors? */ |
| 364 | return 1; /* return the loaded function */ |
| 365 | else { /* error; error message is on stack top */ |
| 366 | lua_pushnil(L); |
| 367 | lua_insert(L, -2); |
| 368 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); |
| 369 | return 3; /* return nil, error message, and where */ |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | |
| 374 |
nothing calls this directly
no test coverage detected