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