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