MCPcopy Create free account
hub / github.com/DFHack/dfhack / io_type

Function io_type

depends/lua/src/liolib.c:150–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149
150static int io_type (lua_State *L) {
151 LStream *p;
152 luaL_checkany(L, 1);
153 p = (LStream *)luaL_testudata(L, 1, LUA_FILEHANDLE);
154 if (p == NULL)
155 lua_pushnil(L); /* not a file */
156 else if (isclosed(p))
157 lua_pushliteral(L, "closed file");
158 else
159 lua_pushliteral(L, "file");
160 return 1;
161}
162
163
164static int f_tostring (lua_State *L) {

Callers

nothing calls this directly

Calls 3

luaL_checkanyFunction · 0.85
luaL_testudataFunction · 0.85
lua_pushnilFunction · 0.85

Tested by

no test coverage detected