diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-06 17:54:40 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-06 17:54:40 -0300 |
commit | d68d8287aa48270e9cb7a7c2c80563cb0039feee (patch) | |
tree | ec3645b6102294e7206e1e5c8f661735fa5aea96 | |
parent | e1249970c2d058d173e7b1c1dc7deab1ccd68b7d (diff) | |
download | lua-d68d8287aa48270e9cb7a7c2c80563cb0039feee.tar.gz lua-d68d8287aa48270e9cb7a7c2c80563cb0039feee.tar.bz2 lua-d68d8287aa48270e9cb7a7c2c80563cb0039feee.zip |
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.
-rw-r--r-- | lua.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2,7 +2,7 @@ | |||
2 | ** LUA - An Extensible Extension Language | 2 | ** LUA - An Extensible Extension Language |
3 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 3 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
4 | ** e-mail: lua@tecgraf.puc-rio.br | 4 | ** e-mail: lua@tecgraf.puc-rio.br |
5 | ** $Id: lua.h,v 4.3 1997/04/15 16:52:20 roberto Exp roberto $ | 5 | ** $Id: lua.h,v 4.4 1997/05/26 14:42:51 roberto Exp roberto $ |
6 | */ | 6 | */ |
7 | 7 | ||
8 | 8 | ||
@@ -78,7 +78,6 @@ int lua_tag (lua_Object object); | |||
78 | 78 | ||
79 | int lua_ref (int lock); /* In: value */ | 79 | int lua_ref (int lock); /* In: value */ |
80 | lua_Object lua_getref (int ref); | 80 | lua_Object lua_getref (int ref); |
81 | void lua_pushref (int ref); | ||
82 | void lua_unref (int ref); | 81 | void lua_unref (int ref); |
83 | 82 | ||
84 | lua_Object lua_createtable (void); | 83 | lua_Object lua_createtable (void); |
@@ -90,6 +89,8 @@ long lua_collectgarbage (long limit); | |||
90 | /* =============================================================== */ | 89 | /* =============================================================== */ |
91 | /* some useful macros */ | 90 | /* some useful macros */ |
92 | 91 | ||
92 | #define lua_pushref(ref) (lua_pushobject(lua_getref(ref))) | ||
93 | |||
93 | #define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) | 94 | #define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) |
94 | 95 | ||
95 | #define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n)) | 96 | #define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n)) |