diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-14 16:18:14 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-14 16:18:14 -0300 |
| commit | ddc8d94a087f9c0ef758dc26540a5f5ac486e19d (patch) | |
| tree | 71d9fdd285fed688ba212cf9e9cec6ea70be979b | |
| parent | 5d9cbdadfb04e7ce8810af7d40e0723222937024 (diff) | |
| download | lua-ddc8d94a087f9c0ef758dc26540a5f5ac486e19d.tar.gz lua-ddc8d94a087f9c0ef758dc26540a5f5ac486e19d.tar.bz2 lua-ddc8d94a087f9c0ef758dc26540a5f5ac486e19d.zip | |
new name for `lua_[sg]etglobaltable'
| -rw-r--r-- | lapi.c | 10 | ||||
| -rw-r--r-- | lbuiltin.c | 8 | ||||
| -rw-r--r-- | liolib.c | 6 | ||||
| -rw-r--r-- | lua.h | 10 | ||||
| -rw-r--r-- | manual.tex | 12 |
5 files changed, 23 insertions, 23 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.85 2000/06/12 13:52:05 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.86 2000/08/09 19:16:57 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -61,14 +61,14 @@ lua_Object lua_pop (lua_State *L) { | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | 63 | ||
| 64 | void lua_pushglobaltable (lua_State *L) { | 64 | void lua_pushglobals (lua_State *L) { |
| 65 | hvalue(L->top) = L->gt; | 65 | hvalue(L->top) = L->gt; |
| 66 | ttype(L->top) = TAG_TABLE; | 66 | ttype(L->top) = TAG_TABLE; |
| 67 | incr_top; | 67 | incr_top; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | void lua_setglobaltable (lua_State *L, lua_Object newtable) { | 71 | void lua_setglobals (lua_State *L, lua_Object newtable) { |
| 72 | if (lua_type(L, newtable)[0] != 't') /* type == "table"? */ | 72 | if (lua_type(L, newtable)[0] != 't') /* type == "table"? */ |
| 73 | lua_error(L, "Lua API error - invalid value for global table"); | 73 | lua_error(L, "Lua API error - invalid value for global table"); |
| 74 | L->gt = hvalue(newtable); | 74 | L->gt = hvalue(newtable); |
| @@ -365,7 +365,7 @@ int lua_next (lua_State *L, lua_Object t, int i) { | |||
| 365 | */ | 365 | */ |
| 366 | 366 | ||
| 367 | lua_Object lua_rawgetglobal (lua_State *L, const char *name) { | 367 | lua_Object lua_rawgetglobal (lua_State *L, const char *name) { |
| 368 | lua_pushglobaltable(L); | 368 | lua_pushglobals(L); |
| 369 | lua_pushstring(L, name); | 369 | lua_pushstring(L, name); |
| 370 | return lua_rawget(L); | 370 | return lua_rawget(L); |
| 371 | } | 371 | } |
| @@ -375,7 +375,7 @@ void lua_rawsetglobal (lua_State *L, const char *name) { | |||
| 375 | lua_Object value; | 375 | lua_Object value; |
| 376 | lua_beginblock(L); | 376 | lua_beginblock(L); |
| 377 | value = lua_pop(L); | 377 | value = lua_pop(L); |
| 378 | lua_pushglobaltable(L); | 378 | lua_pushglobals(L); |
| 379 | lua_pushstring(L, name); | 379 | lua_pushstring(L, name); |
| 380 | lua_pushobject(L, value); | 380 | lua_pushobject(L, value); |
| 381 | lua_rawset(L); | 381 | lua_rawset(L); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbuiltin.c,v 1.118 2000/08/04 19:38:35 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.119 2000/08/09 19:16:57 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 | */ |
| @@ -101,7 +101,7 @@ void luaB__ALERT (lua_State *L) { | |||
| 101 | */ | 101 | */ |
| 102 | void luaB__ERRORMESSAGE (lua_State *L) { | 102 | void luaB__ERRORMESSAGE (lua_State *L) { |
| 103 | lua_Object al; | 103 | lua_Object al; |
| 104 | lua_pushglobaltable(L); | 104 | lua_pushglobals(L); |
| 105 | lua_pushstring(L, LUA_ALERT); | 105 | lua_pushstring(L, LUA_ALERT); |
| 106 | al = lua_rawget(L); | 106 | al = lua_rawget(L); |
| 107 | if (lua_isfunction(L, al)) { /* avoid error loop if _ALERT is not defined */ | 107 | if (lua_isfunction(L, al)) { /* avoid error loop if _ALERT is not defined */ |
| @@ -206,9 +206,9 @@ void luaB_copytagmethods (lua_State *L) { | |||
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | void luaB_globals (lua_State *L) { | 208 | void luaB_globals (lua_State *L) { |
| 209 | lua_pushglobaltable(L); | 209 | lua_pushglobals(L); |
| 210 | if (lua_getparam(L, 1) != LUA_NOOBJECT) | 210 | if (lua_getparam(L, 1) != LUA_NOOBJECT) |
| 211 | lua_setglobaltable(L, luaL_tablearg(L, 1)); | 211 | lua_setglobals(L, luaL_tablearg(L, 1)); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | void luaB_rawget (lua_State *L) { | 214 | void luaB_rawget (lua_State *L) { |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 1.68 2000/06/20 17:13:21 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 1.69 2000/08/09 19:16:57 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 | */ |
| @@ -73,7 +73,7 @@ static void atribTM (lua_State *L) { | |||
| 73 | ctrl->file[inout] = (FILE *)lua_getuserdata(L, newvalue); | 73 | ctrl->file[inout] = (FILE *)lua_getuserdata(L, newvalue); |
| 74 | } | 74 | } |
| 75 | /* set the actual variable */ | 75 | /* set the actual variable */ |
| 76 | lua_pushglobaltable(L); | 76 | lua_pushglobals(L); |
| 77 | lua_pushstring(L, varname); | 77 | lua_pushstring(L, varname); |
| 78 | lua_pushobject(L, newvalue); | 78 | lua_pushobject(L, newvalue); |
| 79 | lua_rawset(L); | 79 | lua_rawset(L); |
| @@ -590,7 +590,7 @@ static void errorfb (lua_State *L) { | |||
| 590 | sprintf(buff+strlen(buff), " [%.70s]", buffchunk); | 590 | sprintf(buff+strlen(buff), " [%.70s]", buffchunk); |
| 591 | strcat(buff, "\n"); | 591 | strcat(buff, "\n"); |
| 592 | } | 592 | } |
| 593 | lua_pushglobaltable(L); | 593 | lua_pushglobals(L); |
| 594 | lua_pushstring(L, LUA_ALERT); | 594 | lua_pushstring(L, LUA_ALERT); |
| 595 | alertfunc = lua_rawget(L); | 595 | alertfunc = lua_rawget(L); |
| 596 | if (lua_isfunction(L, alertfunc)) { /* avoid loop if _ALERT is not defined */ | 596 | if (lua_isfunction(L, alertfunc)) { /* avoid loop if _ALERT is not defined */ |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.56 2000/08/07 18:39:16 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.57 2000/08/09 19:16:57 roberto Exp roberto $ |
| 3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
| 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
| 5 | ** e-mail: lua@tecgraf.puc-rio.br | 5 | ** e-mail: lua@tecgraf.puc-rio.br |
| @@ -71,8 +71,8 @@ int lua_callfunction (lua_State *L, lua_Object f); | |||
| 71 | void lua_beginblock (lua_State *L); | 71 | void lua_beginblock (lua_State *L); |
| 72 | void lua_endblock (lua_State *L); | 72 | void lua_endblock (lua_State *L); |
| 73 | 73 | ||
| 74 | void lua_pushglobaltable (lua_State *L); | 74 | void lua_pushglobals (lua_State *L); |
| 75 | void lua_setglobaltable (lua_State *L, lua_Object newtable); | 75 | void lua_setglobals (lua_State *L, lua_Object newtable); |
| 76 | 76 | ||
| 77 | lua_Object lua_lua2C (lua_State *L, int number); | 77 | lua_Object lua_lua2C (lua_State *L, int number); |
| 78 | #define lua_getparam lua_lua2C | 78 | #define lua_getparam lua_lua2C |
| @@ -186,8 +186,8 @@ extern lua_State *lua_state; | |||
| 186 | #define lua_callfunction(f) (lua_callfunction)(lua_state, f) | 186 | #define lua_callfunction(f) (lua_callfunction)(lua_state, f) |
| 187 | #define lua_beginblock() (lua_beginblock)(lua_state) | 187 | #define lua_beginblock() (lua_beginblock)(lua_state) |
| 188 | #define lua_endblock() (lua_endblock)(lua_state) | 188 | #define lua_endblock() (lua_endblock)(lua_state) |
| 189 | #define lua_pushglobaltable() (lua_pushglobaltable)(lua_state) | 189 | #define lua_pushglobals() (lua_pushglobals)(lua_state) |
| 190 | #define lua_setglobaltable(t) (lua_setglobaltable)(lua_state, t) | 190 | #define lua_setglobals(t) (lua_setglobals)(lua_state, t) |
| 191 | #define lua_lua2C(number) (lua_lua2C)(lua_state, number) | 191 | #define lua_lua2C(number) (lua_lua2C)(lua_state, number) |
| 192 | #define lua_type(obj) (lua_type)(lua_state, obj) | 192 | #define lua_type(obj) (lua_type)(lua_state, obj) |
| 193 | #define lua_isnil(obj) (lua_isnil)(lua_state, obj) | 193 | #define lua_isnil(obj) (lua_isnil)(lua_state, obj) |
| @@ -1,4 +1,4 @@ | |||
| 1 | % $Id: manual.tex,v 1.39 2000/05/24 13:54:49 roberto Exp roberto $ | 1 | % $Id: manual.tex,v 1.40 2000/08/09 19:09:20 roberto Exp roberto $ |
| 2 | 2 | ||
| 3 | \documentclass[11pt]{article} | 3 | \documentclass[11pt]{article} |
| 4 | \usepackage{fullpage,bnf} | 4 | \usepackage{fullpage,bnf} |
| @@ -122,7 +122,7 @@ Waldemar Celes | |||
| 122 | \tecgraf\ --- Computer Science Department --- PUC-Rio | 122 | \tecgraf\ --- Computer Science Department --- PUC-Rio |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | \date{{\small \tt\$Date: 2000/05/24 13:54:49 $ $}} | 125 | \date{{\small \tt\$Date: 2000/08/09 19:09:20 $ $}} |
| 126 | 126 | ||
| 127 | \maketitle | 127 | \maketitle |
| 128 | 128 | ||
| @@ -1933,15 +1933,15 @@ use the \emph{lua_rawset} function over the table of globals. | |||
| 1933 | 1933 | ||
| 1934 | To get the table of globals, | 1934 | To get the table of globals, |
| 1935 | you should call | 1935 | you should call |
| 1936 | \Deffunc{lua_pushglobaltable} | 1936 | \Deffunc{lua_pushglobals} |
| 1937 | \begin{verbatim} | 1937 | \begin{verbatim} |
| 1938 | void lua_pushglobaltable (lua_State *L); | 1938 | void lua_pushglobals (lua_State *L); |
| 1939 | \end{verbatim} | 1939 | \end{verbatim} |
| 1940 | To set another table as the table of globals, | 1940 | To set another table as the table of globals, |
| 1941 | you use | 1941 | you use |
| 1942 | \Deffunc{lua_setglobaltable} | 1942 | \Deffunc{lua_setglobals} |
| 1943 | \begin{verbatim} | 1943 | \begin{verbatim} |
| 1944 | void lua_setglobaltable (lua_State *L, lua_Object newtable); | 1944 | void lua_setglobals (lua_State *L, lua_Object newtable); |
| 1945 | \end{verbatim} | 1945 | \end{verbatim} |
| 1946 | 1946 | ||
| 1947 | Tables can also be manipulated via the API. | 1947 | Tables can also be manipulated via the API. |
