aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-06-18 12:16:18 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-06-18 12:16:18 -0300
commitd8678edddc98beab8eb78e63e698191a9ffd39b8 (patch)
treefa8b5e3595f0caa11fb8ee5bfc3412e76dbef230 /liolib.c
parente812aa200234629d89351b6653d6ae737478ccd8 (diff)
downloadlua-d8678edddc98beab8eb78e63e698191a9ffd39b8.tar.gz
lua-d8678edddc98beab8eb78e63e698191a9ffd39b8.tar.bz2
lua-d8678edddc98beab8eb78e63e698191a9ffd39b8.zip
luaL_verror -> luaL_error
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/liolib.c b/liolib.c
index 31fb4202..f0005e43 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.9 2002/06/06 12:43:08 roberto Exp roberto $ 2** $Id: liolib.c,v 2.10 2002/06/06 18:17:33 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*/
@@ -124,7 +124,7 @@ static int io_open (lua_State *L) {
124 124
125static int io_popen (lua_State *L) { 125static int io_popen (lua_State *L) {
126#ifndef POPEN 126#ifndef POPEN
127 luaL_verror(L, "`popen' not supported"); 127 luaL_error(L, "`popen' not supported");
128 return 0; 128 return 0;
129#else 129#else
130 FILE *f = popen(luaL_check_string(L, 1), luaL_opt_string(L, 2, "r")); 130 FILE *f = popen(luaL_check_string(L, 1), luaL_opt_string(L, 2, "r"));
@@ -144,7 +144,7 @@ static FILE *getiofile (lua_State *L, const char *name) {
144 lua_rawget(L, lua_upvalueindex(1)); 144 lua_rawget(L, lua_upvalueindex(1));
145 f = tofile(L, -1); 145 f = tofile(L, -1);
146 if (f == NULL) 146 if (f == NULL)
147 luaL_verror(L, "%s is closed", name); 147 luaL_error(L, "%s is closed", name);
148 return f; 148 return f;
149} 149}
150 150
@@ -267,7 +267,7 @@ static int g_read (lua_State *L, FILE *f, int first) {
267 else { 267 else {
268 const char *p = lua_tostring(L, n); 268 const char *p = lua_tostring(L, n);
269 if (!p || p[0] != '*') 269 if (!p || p[0] != '*')
270 return luaL_verror(L, "invalid `read' option"); 270 return luaL_error(L, "invalid `read' option");
271 switch (p[1]) { 271 switch (p[1]) {
272 case 'n': /* number */ 272 case 'n': /* number */
273 success = read_number(L, f); 273 success = read_number(L, f);
@@ -280,7 +280,7 @@ static int g_read (lua_State *L, FILE *f, int first) {
280 success = 1; /* always success */ 280 success = 1; /* always success */
281 break; 281 break;
282 case 'w': /* word */ 282 case 'w': /* word */
283 return luaL_verror(L, "obsolete option `*w'"); 283 return luaL_error(L, "obsolete option `*w'");
284 default: 284 default:
285 return luaL_argerror(L, n, "invalid format"); 285 return luaL_argerror(L, n, "invalid format");
286 } 286 }
@@ -439,7 +439,7 @@ static int io_rename (lua_State *L) {
439static int io_tmpname (lua_State *L) { 439static int io_tmpname (lua_State *L) {
440 char buff[L_tmpnam]; 440 char buff[L_tmpnam];
441 if (tmpnam(buff) != buff) 441 if (tmpnam(buff) != buff)
442 return luaL_verror(L, "unable to generate a unique filename"); 442 return luaL_error(L, "unable to generate a unique filename");
443 lua_pushstring(L, buff); 443 lua_pushstring(L, buff);
444 return 1; 444 return 1;
445} 445}
@@ -480,7 +480,7 @@ static int getfield (lua_State *L, const char *key, int d) {
480 res = (int)(lua_tonumber(L, -1)); 480 res = (int)(lua_tonumber(L, -1));
481 else { 481 else {
482 if (d == -2) 482 if (d == -2)
483 return luaL_verror(L, "field `%s' missing in date table", key); 483 return luaL_error(L, "field `%s' missing in date table", key);
484 res = d; 484 res = d;
485 } 485 }
486 lua_pop(L, 1); 486 lua_pop(L, 1);
@@ -519,7 +519,7 @@ static int io_date (lua_State *L) {
519 if (strftime(b, sizeof(b), s, stm)) 519 if (strftime(b, sizeof(b), s, stm))
520 lua_pushstring(L, b); 520 lua_pushstring(L, b);
521 else 521 else
522 return luaL_verror(L, "invalid `date' format"); 522 return luaL_error(L, "invalid `date' format");
523 } 523 }
524 return 1; 524 return 1;
525} 525}