diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 22 |
1 files changed, 1 insertions, 21 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.50 2004/04/30 20:13:38 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.51 2004/05/10 20:26:37 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -30,11 +30,6 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | 32 | ||
33 | #if !USE_POPEN | ||
34 | #define pclose(f) (-1) | ||
35 | #endif | ||
36 | |||
37 | |||
38 | #define FILEHANDLE "FILE*" | 33 | #define FILEHANDLE "FILE*" |
39 | 34 | ||
40 | #define IO_INPUT 1 | 35 | #define IO_INPUT 1 |
@@ -148,20 +143,6 @@ static int io_open (lua_State *L) { | |||
148 | } | 143 | } |
149 | 144 | ||
150 | 145 | ||
151 | static int io_popen (lua_State *L) { | ||
152 | #if !USE_POPEN | ||
153 | luaL_error(L, "`popen' not supported"); | ||
154 | return 0; | ||
155 | #else | ||
156 | const char *filename = luaL_checkstring(L, 1); | ||
157 | const char *mode = luaL_optstring(L, 2, "r"); | ||
158 | FILE **pf = newfile(L); | ||
159 | *pf = popen(filename, mode); | ||
160 | return (*pf == NULL) ? pushresult(L, 0, filename) : 1; | ||
161 | #endif | ||
162 | } | ||
163 | |||
164 | |||
165 | static int io_tmpfile (lua_State *L) { | 146 | static int io_tmpfile (lua_State *L) { |
166 | FILE **pf = newfile(L); | 147 | FILE **pf = newfile(L); |
167 | *pf = tmpfile(); | 148 | *pf = tmpfile(); |
@@ -456,7 +437,6 @@ static const luaL_reg iolib[] = { | |||
456 | {"close", io_close}, | 437 | {"close", io_close}, |
457 | {"flush", io_flush}, | 438 | {"flush", io_flush}, |
458 | {"open", io_open}, | 439 | {"open", io_open}, |
459 | {"popen", io_popen}, | ||
460 | {"read", io_read}, | 440 | {"read", io_read}, |
461 | {"tmpfile", io_tmpfile}, | 441 | {"tmpfile", io_tmpfile}, |
462 | {"type", io_type}, | 442 | {"type", io_type}, |