| 351 | |
| 352 | |
| 353 | static int ll_loadlib (lua_State *L) { |
| 354 | const char *path = luaL_checkstring(L, 1); |
| 355 | const char *init = luaL_checkstring(L, 2); |
| 356 | int stat = lookforfunc(L, path, init); |
| 357 | if (stat == 0) /* no errors? */ |
| 358 | return 1; /* return the loaded function */ |
| 359 | else { /* error; error message is on stack top */ |
| 360 | lua_pushnil(L); |
| 361 | lua_insert(L, -2); |
| 362 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); |
| 363 | return 3; /* return nil, error message, and where */ |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | |
| 368 |
nothing calls this directly
no test coverage detected