summaryrefslogtreecommitdiff
path: root/lauxlib.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-06-02 14:37:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-06-02 14:37:03 -0300
commitf4718544de97bd2fc22117424ba0736c5295a8f2 (patch)
treee34f8ea84f4a7af058f6132687d745915e9f9166 /lauxlib.h
parent50f9cd201e34f3464362a63c54207fff963507d0 (diff)
downloadlua-github-f4718544de97bd2fc22117424ba0736c5295a8f2.tar.gz
what is provided by lauxlib.c should be defined at lauxlib.h
Diffstat (limited to 'lauxlib.h')
-rw-r--r--lauxlib.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/lauxlib.h b/lauxlib.h
index 23e99496..9ac7549f 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -1,5 +1,5 @@
/*
-** $Id: lauxlib.h,v 1.64 2004/05/03 12:28:43 roberto Exp roberto $
+** $Id: lauxlib.h,v 1.65 2004/05/31 19:27:14 roberto Exp roberto $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -15,6 +15,9 @@
#include "lua.h"
+/* extra error code for `luaL_load' */
+#define LUA_ERRFILE (LUA_ERRERR+1)
+
typedef struct luaL_reg {
const char *name;
@@ -113,6 +116,20 @@ LUALIB_API void luaL_pushresult (luaL_Buffer *B);
/* }====================================================== */
+/* compatibility with ref system */
+
+/* pre-defined references */
+#define LUA_NOREF (-2)
+#define LUA_REFNIL (-1)
+
+#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
+ (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
+
+#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
+
+#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref)
+
+
#endif