aboutsummaryrefslogtreecommitdiff
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
parent50f9cd201e34f3464362a63c54207fff963507d0 (diff)
downloadlua-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.h19
-rw-r--r--lua.h25
2 files changed, 23 insertions, 21 deletions
diff --git a/lauxlib.h b/lauxlib.h
index 23e99496..9ac7549f 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -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
19typedef struct luaL_reg { 22typedef 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
diff --git a/lua.h b/lua.h
index 48b69b5f..94d4166e 100644
--- a/lua.h
+++ b/lua.h
@@ -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
48typedef struct lua_State lua_State; 47typedef 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