| 402 | |
| 403 | |
| 404 | static int ll_loadlib (lua_State *L) { |
| 405 | const char *path = luaL_checkstring(L, 1); |
| 406 | const char *init = luaL_checkstring(L, 2); |
| 407 | int stat = lookforfunc(L, path, init); |
| 408 | if (stat == 0) /* no errors? */ |
| 409 | return 1; /* return the loaded function */ |
| 410 | else { /* error; error message is on stack top */ |
| 411 | luaL_pushfail(L); |
| 412 | lua_insert(L, -2); |
| 413 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); |
| 414 | return 3; /* return fail, error message, and where */ |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | |
| 419 |
nothing calls this directly
no test coverage detected