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 /lapi.c | |
| parent | 5d9cbdadfb04e7ce8810af7d40e0723222937024 (diff) | |
| download | lua-ddc8d94a087f9c0ef758dc26540a5f5ac486e19d.tar.gz lua-ddc8d94a087f9c0ef758dc26540a5f5ac486e19d.tar.bz2 lua-ddc8d94a087f9c0ef758dc26540a5f5ac486e19d.zip | |
new name for `lua_[sg]etglobaltable'
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 10 |
1 files changed, 5 insertions, 5 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); |
