diff options
Diffstat (limited to 'lauxlib.h')
-rw-r--r-- | lauxlib.h | 23 |
1 files changed, 5 insertions, 18 deletions
@@ -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, ...); | |||
62 | LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, | 62 | LUALIB_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 | |||
65 | LUALIB_API int (luaL_ref) (lua_State *L, int t); | 69 | LUALIB_API int (luaL_ref) (lua_State *L, int t); |
66 | LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); | 70 | LUALIB_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 | ||