lua

A copy of the Lua development repository
Log | Files | Refs | README

commit d68d8287aa48270e9cb7a7c2c80563cb0039feee
parent e1249970c2d058d173e7b1c1dc7deab1ccd68b7d
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  6 Jun 1997 17:54:20 -0300

new lua_Objects are created below the C2lua stack, so most API functions
don't need to adjust stack. So lua_getref does not change the stack,
and lua_pushref can use it as a macro.

Diffstat:
Mlua.h | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lua.h b/lua.h @@ -2,7 +2,7 @@ ** LUA - An Extensible Extension Language ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** e-mail: lua@tecgraf.puc-rio.br -** $Id: lua.h,v 4.3 1997/04/15 16:52:20 roberto Exp roberto $ +** $Id: lua.h,v 4.4 1997/05/26 14:42:51 roberto Exp roberto $ */ @@ -78,7 +78,6 @@ int lua_tag (lua_Object object); int lua_ref (int lock); /* In: value */ lua_Object lua_getref (int ref); -void lua_pushref (int ref); void lua_unref (int ref); lua_Object lua_createtable (void); @@ -90,6 +89,8 @@ long lua_collectgarbage (long limit); /* =============================================================== */ /* some useful macros */ +#define lua_pushref(ref) (lua_pushobject(lua_getref(ref))) + #define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) #define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n))