| 149 | |
| 150 | |
| 151 | static int io_type (lua_State *L) { |
| 152 | LStream *p; |
| 153 | luaL_checkany(L, 1); |
| 154 | p = (LStream *)luaL_testudata(L, 1, LUA_FILEHANDLE); |
| 155 | if (p == NULL) |
| 156 | luaL_pushfail(L); /* not a file */ |
| 157 | else if (isclosed(p)) |
| 158 | lua_pushliteral(L, "closed file"); |
| 159 | else |
| 160 | lua_pushliteral(L, "file"); |
| 161 | return 1; |
| 162 | } |
| 163 | |
| 164 | |
| 165 | static int f_tostring (lua_State *L) { |
nothing calls this directly
no test coverage detected