| 309 | |
| 310 | |
| 311 | static FILE *getiofile (lua_State *L, const char *findex) { |
| 312 | LStream *p; |
| 313 | lua_getfield(L, LUA_REGISTRYINDEX, findex); |
| 314 | p = (LStream *)lua_touserdata(L, -1); |
| 315 | if (l_unlikely(isclosed(p))) |
| 316 | luaL_error(L, "default %s file is closed", findex + IOPREF_LEN); |
| 317 | return p->f; |
| 318 | } |
| 319 | |
| 320 | |
| 321 | static int g_iofile (lua_State *L, const char *f, const char *mode) { |
no test coverage detected