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 | |
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
-rw-r--r-- | lauxlib.h | 19 | ||||
-rw-r--r-- | lua.h | 25 |
2 files changed, 23 insertions, 21 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 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.189 2004/04/30 20:13:38 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.190 2004/05/31 19:41:52 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil | 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil |
5 | ** http://www.lua.org mailto:info@lua.org | 5 | ** http://www.lua.org mailto:info@lua.org |
@@ -37,12 +37,11 @@ | |||
37 | #define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) | 37 | #define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) |
38 | 38 | ||
39 | 39 | ||
40 | /* error codes for `lua_load' and `lua_pcall' */ | 40 | /* error codes for `lua_pcall' */ |
41 | #define LUA_ERRRUN 1 | 41 | #define LUA_ERRRUN 1 |
42 | #define LUA_ERRFILE 2 | 42 | #define LUA_ERRSYNTAX 2 |
43 | #define LUA_ERRSYNTAX 3 | 43 | #define LUA_ERRMEM 3 |
44 | #define LUA_ERRMEM 4 | 44 | #define LUA_ERRERR 4 |
45 | #define LUA_ERRERR 5 | ||
46 | 45 | ||
47 | 46 | ||
48 | typedef struct lua_State lua_State; | 47 | typedef struct lua_State lua_State; |
@@ -282,20 +281,6 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud); | |||
282 | #define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) | 281 | #define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) |
283 | 282 | ||
284 | 283 | ||
285 | /* compatibility with ref system */ | ||
286 | |||
287 | /* pre-defined references */ | ||
288 | #define LUA_NOREF (-2) | ||
289 | #define LUA_REFNIL (-1) | ||
290 | |||
291 | #define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ | ||
292 | (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) | ||
293 | |||
294 | #define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) | ||
295 | |||
296 | #define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref) | ||
297 | |||
298 | |||
299 | 284 | ||
300 | 285 | ||
301 | 286 | ||