diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 14:37:03 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-06-02 14:37:03 -0300 |
commit | f4718544de97bd2fc22117424ba0736c5295a8f2 (patch) | |
tree | e34f8ea84f4a7af058f6132687d745915e9f9166 /lauxlib.h | |
parent | 50f9cd201e34f3464362a63c54207fff963507d0 (diff) | |
download | lua-f4718544de97bd2fc22117424ba0736c5295a8f2.tar.gz lua-f4718544de97bd2fc22117424ba0736c5295a8f2.tar.bz2 lua-f4718544de97bd2fc22117424ba0736c5295a8f2.zip |
what is provided by lauxlib.c should be defined at lauxlib.h
Diffstat (limited to 'lauxlib.h')
-rw-r--r-- | lauxlib.h | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.h,v 1.64 2004/05/03 12:28:43 roberto Exp roberto $ | 2 | ** $Id: lauxlib.h,v 1.65 2004/05/31 19:27:14 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 | */ |
@@ -15,6 +15,9 @@ | |||
15 | #include "lua.h" | 15 | #include "lua.h" |
16 | 16 | ||
17 | 17 | ||
18 | /* extra error code for `luaL_load' */ | ||
19 | #define LUA_ERRFILE (LUA_ERRERR+1) | ||
20 | |||
18 | 21 | ||
19 | typedef struct luaL_reg { | 22 | typedef struct luaL_reg { |
20 | const char *name; | 23 | const char *name; |
@@ -113,6 +116,20 @@ LUALIB_API void luaL_pushresult (luaL_Buffer *B); | |||
113 | /* }====================================================== */ | 116 | /* }====================================================== */ |
114 | 117 | ||
115 | 118 | ||
119 | /* compatibility with ref system */ | ||
120 | |||
121 | /* pre-defined references */ | ||
122 | #define LUA_NOREF (-2) | ||
123 | #define LUA_REFNIL (-1) | ||
124 | |||
125 | #define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ | ||
126 | (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) | ||
127 | |||
128 | #define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) | ||
129 | |||
130 | #define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref) | ||
131 | |||
132 | |||
116 | #endif | 133 | #endif |
117 | 134 | ||
118 | 135 | ||