aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-10-31 17:40:14 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-10-31 17:40:14 -0200
commit46347d768e571ba9b36581c36d11d2de1dee2cfb (patch)
tree70818496b180f09e98693b9b2cf726bcf559076c /lua.h
parent36eb6658599f7ec158b819f259eca338ee9a0d1a (diff)
downloadlua-46347d768e571ba9b36581c36d11d2de1dee2cfb.tar.gz
lua-46347d768e571ba9b36581c36d11d2de1dee2cfb.tar.bz2
lua-46347d768e571ba9b36581c36d11d2de1dee2cfb.zip
`ref' support goes to auxlib
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/lua.h b/lua.h
index 1325f5f4..1691b07f 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.104 2001/10/11 21:41:21 roberto Exp $ 2** $Id: lua.h,v 1.105 2001/10/17 21:12:57 roberto Exp $
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: info@lua.org 5** e-mail: info@lua.org
@@ -26,11 +26,6 @@
26#define LUA_ERRORMESSAGE "_ERRORMESSAGE" 26#define LUA_ERRORMESSAGE "_ERRORMESSAGE"
27 27
28 28
29/* pre-defined references */
30#define LUA_NOREF (-2)
31#define LUA_REFNIL (-1)
32
33
34/* option for multiple returns in `lua_call' */ 29/* option for multiple returns in `lua_call' */
35#define LUA_MULTRET (-1) 30#define LUA_MULTRET (-1)
36 31
@@ -180,7 +175,6 @@ LUA_API void lua_rawset (lua_State *L, int index);
180LUA_API void lua_rawseti (lua_State *L, int index, int n); 175LUA_API void lua_rawseti (lua_State *L, int index, int n);
181LUA_API void lua_setglobals (lua_State *L); 176LUA_API void lua_setglobals (lua_State *L);
182LUA_API void lua_settagmethod (lua_State *L, int tag, const lua_char *event); 177LUA_API void lua_settagmethod (lua_State *L, int tag, const lua_char *event);
183LUA_API int lua_ref (lua_State *L, int lock);
184 178
185 179
186/* 180/*
@@ -214,8 +208,6 @@ LUA_API const lua_char *lua_tag2name (lua_State *L, int tag);
214 208
215LUA_API void lua_error (lua_State *L, const lua_char *s); 209LUA_API void lua_error (lua_State *L, const lua_char *s);
216 210
217LUA_API void lua_unref (lua_State *L, int ref);
218
219LUA_API int lua_next (lua_State *L, int index); 211LUA_API int lua_next (lua_State *L, int index);
220LUA_API int lua_getn (lua_State *L, int index); 212LUA_API int lua_getn (lua_State *L, int index);
221 213
@@ -253,7 +245,6 @@ LUA_API int lua_getweakmode (lua_State *L, int index);
253 245
254#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX); 246#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX);
255 247
256#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref)
257 248
258 249
259/* 250/*
@@ -264,6 +255,20 @@ LUA_API int lua_getweakmode (lua_State *L, int index);
264 255
265LUA_API void lua_pushupvalues (lua_State *L); 256LUA_API void lua_pushupvalues (lua_State *L);
266 257
258
259/* compatibility with ref system */
260
261/* pre-defined references */
262#define LUA_NOREF (-2)
263#define LUA_REFNIL (-1)
264
265#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
266 (lua_error(L, l_s("unlocked references are obsolete")), 0))
267
268#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
269
270#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref)
271
267#endif 272#endif
268 273
269 274