aboutsummaryrefslogtreecommitdiff
path: root/lbuiltin.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbuiltin.c')
-rw-r--r--lbuiltin.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lbuiltin.c b/lbuiltin.c
index 060127f7..22b23e5a 100644
--- a/lbuiltin.c
+++ b/lbuiltin.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbuiltin.c,v 1.107 2000/04/25 16:55:09 roberto Exp roberto $ 2** $Id: lbuiltin.c,v 1.108 2000/05/08 19:32:53 roberto Exp roberto $
3** Built-in functions 3** Built-in functions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -106,7 +106,7 @@ void luaB__ALERT (lua_State *L) {
106** The library `liolib' redefines _ERRORMESSAGE for better error information. 106** The library `liolib' redefines _ERRORMESSAGE for better error information.
107*/ 107*/
108void luaB__ERRORMESSAGE (lua_State *L) { 108void luaB__ERRORMESSAGE (lua_State *L) {
109 lua_Object al = lua_rawgetglobal(L, "_ALERT"); 109 lua_Object al = lua_rawgetglobal(L, LUA_ALERT);
110 if (lua_isfunction(L, al)) { /* avoid error loop if _ALERT is not defined */ 110 if (lua_isfunction(L, al)) { /* avoid error loop if _ALERT is not defined */
111 const char *s = luaL_check_string(L, 1); 111 const char *s = luaL_check_string(L, 1);
112 char *buff = luaL_openspace(L, strlen(s)+sizeof("error: \n")); 112 char *buff = luaL_openspace(L, strlen(s)+sizeof("error: \n"));
@@ -301,9 +301,9 @@ void luaB_call (lua_State *L) {
301 int narg = (int)getnarg(L, arg); 301 int narg = (int)getnarg(L, arg);
302 int i, status; 302 int i, status;
303 if (err != LUA_NOOBJECT) { /* set new error method */ 303 if (err != LUA_NOOBJECT) { /* set new error method */
304 lua_Object oldem = lua_getglobal(L, "_ERRORMESSAGE"); 304 lua_Object oldem = lua_getglobal(L, LUA_ERRORMESSAGE);
305 lua_pushobject(L, err); 305 lua_pushobject(L, err);
306 lua_setglobal(L, "_ERRORMESSAGE"); 306 lua_setglobal(L, LUA_ERRORMESSAGE);
307 err = oldem; 307 err = oldem;
308 } 308 }
309 /* push arg[1...n] */ 309 /* push arg[1...n] */
@@ -313,7 +313,7 @@ void luaB_call (lua_State *L) {
313 status = lua_callfunction(L, f); 313 status = lua_callfunction(L, f);
314 if (err != LUA_NOOBJECT) { /* restore old error method */ 314 if (err != LUA_NOOBJECT) { /* restore old error method */
315 lua_pushobject(L, err); 315 lua_pushobject(L, err);
316 lua_setglobal(L, "_ERRORMESSAGE"); 316 lua_setglobal(L, LUA_ERRORMESSAGE);
317 } 317 }
318 if (status != 0) { /* error in call? */ 318 if (status != 0) { /* error in call? */
319 if (strchr(options, 'x')) { 319 if (strchr(options, 'x')) {
@@ -596,8 +596,8 @@ static void deprecated_funcs (lua_State *L) {
596/* }====================================================== */ 596/* }====================================================== */
597 597
598static const struct luaL_reg builtin_funcs[] = { 598static const struct luaL_reg builtin_funcs[] = {
599 {"_ALERT", luaB__ALERT}, 599 {LUA_ALERT, luaB__ALERT},
600 {"_ERRORMESSAGE", luaB__ERRORMESSAGE}, 600 {LUA_ERRORMESSAGE, luaB__ERRORMESSAGE},
601 {"call", luaB_call}, 601 {"call", luaB_call},
602 {"collectgarbage", luaB_collectgarbage}, 602 {"collectgarbage", luaB_collectgarbage},
603 {"copytagmethods", luaB_copytagmethods}, 603 {"copytagmethods", luaB_copytagmethods},