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