| 305 | |
| 306 | |
| 307 | static int ll_loadlib (lua_State *L) { |
| 308 | const char *path = luaL_checkstring(L, 1); |
| 309 | const char *init = luaL_checkstring(L, 2); |
| 310 | int stat = ll_loadfunc(L, path, init); |
| 311 | if (stat == 0) /* no errors? */ |
| 312 | return 1; /* return the loaded function */ |
| 313 | else { /* error; error message is on stack top */ |
| 314 | lua_pushnil(L); |
| 315 | lua_insert(L, -2); |
| 316 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); |
| 317 | return 3; /* return nil, error message, and where */ |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | |
| 322 |
nothing calls this directly
no test coverage detected