MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / io_type

Function io_type

Source/Misc/lua/src/lua.c:11971–11983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11969
11970
11971static int io_type (lua_State *L) {
11972void *ud;
11973luaL_checkany(L, 1);
11974ud = lua_touserdata(L, 1);
11975lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE);
11976if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1))
11977lua_pushnil(L); /* not a file */
11978else if (*((FILE **)ud) == NULL)
11979lua_pushliteral(L, "closed file");
11980else
11981lua_pushliteral(L, "file");
11982return 1;
11983}
11984
11985
11986static FILE *tofile (lua_State *L) {

Callers

nothing calls this directly

Calls 6

luaL_checkanyFunction · 0.85
lua_touserdataFunction · 0.85
lua_getfieldFunction · 0.85
lua_getmetatableFunction · 0.85
lua_rawequalFunction · 0.85
lua_pushnilFunction · 0.85

Tested by

no test coverage detected