From d6d896b9532b3a88458a882690c56b391e1ecbc3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 21 Oct 2003 08:58:58 -0200 Subject: [PATCH] lua_set(get)global may use lua_set(get)field --- lua.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lua.h b/lua.h index ee932062..efd633c5 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.182 2003/10/10 13:29:08 roberto Exp roberto $ +** $Id: lua.h,v 1.183 2003/10/20 12:25:23 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil ** http://www.lua.org mailto:info@lua.org @@ -14,7 +14,7 @@ #include -#define LUA_VERSION "Lua 5.0" +#define LUA_VERSION "Lua 5.1 (work)" #define LUA_COPYRIGHT "Copyright (C) 1994-2003 Tecgraf, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" @@ -286,11 +286,8 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud); #define lua_open() luaL_newstate() #define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) -#define lua_setglobal(L,s) \ - (lua_pushstring(L, s), lua_insert(L, -2), lua_settable(L, LUA_GLOBALSINDEX)) - -#define lua_getglobal(L,s) \ - (lua_pushstring(L, s), lua_gettable(L, LUA_GLOBALSINDEX)) +#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, s) +#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, s) /* compatibility with ref system */