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