| 301 | |
| 302 | |
| 303 | static void aux_lines (lua_State *L, int toclose) { |
| 304 | int i; |
| 305 | int n = lua_gettop(L) - 1; /* number of arguments to read */ |
| 306 | /* ensure that arguments will fit here and into 'io_readline' stack */ |
| 307 | luaL_argcheck(L, n <= LUA_MINSTACK - 3, LUA_MINSTACK - 3, "too many options"); |
| 308 | lua_pushvalue(L, 1); /* file handle */ |
| 309 | lua_pushinteger(L, n); /* number of arguments to read */ |
| 310 | lua_pushboolean(L, toclose); /* close/not close file when finished */ |
| 311 | for (i = 1; i <= n; i++) lua_pushvalue(L, i + 1); /* copy arguments */ |
| 312 | lua_pushcclosure(L, io_readline, 3 + n); |
| 313 | } |
| 314 | |
| 315 | |
| 316 | static int f_lines (lua_State *L) { |
no test coverage detected