aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-11-16 15:43:29 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-11-16 15:43:29 -0200
commit50334faad6349046c207d3d2b130b3c67339011c (patch)
tree49b718354b225acca460234addaf40f2fd944b28 /lauxlib.h
parentcee7a8e1eca3ca0e81e36e29608ec833dd6801a1 (diff)
downloadlua-50334faad6349046c207d3d2b130b3c67339011c.tar.gz
lua-50334faad6349046c207d3d2b130b3c67339011c.tar.bz2
lua-50334faad6349046c207d3d2b130b3c67339011c.zip
no more compatibility with (veryyyy) old ref system
Diffstat (limited to 'lauxlib.h')
-rw-r--r--lauxlib.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/lauxlib.h b/lauxlib.h
index f4c32647..908134ff 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.h,v 1.110 2010/11/10 17:38:10 roberto Exp roberto $ 2** $Id: lauxlib.h,v 1.111 2010/11/10 18:05:36 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -62,6 +62,10 @@ LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
62LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, 62LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
63 const char *const lst[]); 63 const char *const lst[]);
64 64
65/* pre-defined references */
66#define LUA_NOREF (-2)
67#define LUA_REFNIL (-1)
68
65LUALIB_API int (luaL_ref) (lua_State *L, int t); 69LUALIB_API int (luaL_ref) (lua_State *L, int t);
66LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); 70LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
67 71
@@ -164,23 +168,6 @@ LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,
164 const luaL_Reg *l, int nup); 168 const luaL_Reg *l, int nup);
165 169
166 170
167/* compatibility with ref system */
168
169/* pre-defined references */
170#define LUA_NOREF (-2)
171#define LUA_REFNIL (-1)
172
173#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
174 (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
175
176#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
177
178#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
179
180
181#define luaL_reg luaL_Reg
182
183
184#endif 171#endif
185 172
186 173