static FILE *getfile (char *name) { lua_Object f = lua_getglobal(name); if (!ishandler(f)) luaL_verror("global variable `%.50s' is not a file handle", name); return lua_getuserdata(f); }
static LuaFile *getfileparam(const char *name, int32 *arg) { lua_Object f = lua_getparam(*arg); if (ishandler(f)) { (*arg)++; return getfile(lua_getuserdata(f)); } else return getfile(name); }
static FILE *getfileparam (char *name, int *arg) { lua_Object f = lua_getparam(*arg); if (ishandler(f)) { (*arg)++; return lua_getuserdata(f); } else return getfile(name); }