| 391 | |
| 392 | |
| 393 | static 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 |
nothing calls this directly
no test coverage detected