misc/liblua/liolib.c
changeset 10017 de822cd3df3a
parent 2812 0a24853de796
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    18 #include "lauxlib.h"
    18 #include "lauxlib.h"
    19 #include "lualib.h"
    19 #include "lualib.h"
    20 
    20 
    21 
    21 
    22 
    22 
    23 #define IO_INPUT	1
    23 #define IO_INPUT    1
    24 #define IO_OUTPUT	2
    24 #define IO_OUTPUT   2
    25 
    25 
    26 
    26 
    27 static const char *const fnames[] = {"input", "output"};
    27 static const char *const fnames[] = {"input", "output"};
    28 
    28 
    29 
    29 
    49   lua_pushfstring(L, "%s: %s", filename, strerror(errno));
    49   lua_pushfstring(L, "%s: %s", filename, strerror(errno));
    50   luaL_argerror(L, arg, lua_tostring(L, -1));
    50   luaL_argerror(L, arg, lua_tostring(L, -1));
    51 }
    51 }
    52 
    52 
    53 
    53 
    54 #define tofilep(L)	((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))
    54 #define tofilep(L)  ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))
    55 
    55 
    56 
    56 
    57 static int io_type (lua_State *L) {
    57 static int io_type (lua_State *L) {
    58   void *ud;
    58   void *ud;
    59   luaL_checkany(L, 1);
    59   luaL_checkany(L, 1);