فهرست منبع

what is provided by lauxlib.c should be defined at lauxlib.h

Roberto Ierusalimschy 21 سال پیش
والد
کامیت
f4718544de
2فایلهای تغییر یافته به همراه23 افزوده شده و 21 حذف شده
  1. 18 1
      lauxlib.h
  2. 5 20
      lua.h

+ 18 - 1
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
 ** Auxiliary functions for building Lua libraries
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -15,6 +15,9 @@
 #include "lua.h"
 #include "lua.h"
 
 
 
 
+/* extra error code for `luaL_load' */
+#define LUA_ERRFILE     (LUA_ERRERR+1)
+
 
 
 typedef struct luaL_reg {
 typedef struct luaL_reg {
   const char *name;
   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
 #endif
 
 
 
 

+ 5 - 20
lua.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lua.h,v 1.189 2004/04/30 20:13:38 roberto Exp roberto $
+** $Id: lua.h,v 1.190 2004/05/31 19:41:52 roberto Exp roberto $
 ** Lua - An Extensible Extension Language
 ** Lua - An Extensible Extension Language
 ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
 ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
 ** http://www.lua.org	mailto:[email protected]
 ** http://www.lua.org	mailto:[email protected]
@@ -37,12 +37,11 @@
 #define lua_upvalueindex(i)	(LUA_GLOBALSINDEX-(i))
 #define lua_upvalueindex(i)	(LUA_GLOBALSINDEX-(i))
 
 
 
 
-/* error codes for `lua_load' and `lua_pcall' */
+/* error codes for `lua_pcall' */
 #define LUA_ERRRUN	1
 #define LUA_ERRRUN	1
-#define LUA_ERRFILE	2
-#define LUA_ERRSYNTAX	3
-#define LUA_ERRMEM	4
-#define LUA_ERRERR	5
+#define LUA_ERRSYNTAX	2
+#define LUA_ERRMEM	3
+#define LUA_ERRERR	4
 
 
 
 
 typedef struct lua_State lua_State;
 typedef struct lua_State lua_State;
@@ -282,20 +281,6 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud);
 #define lua_getgccount(L)	lua_gc(L, LUA_GCCOUNT, 0)
 #define lua_getgccount(L)	lua_gc(L, LUA_GCCOUNT, 0)
 
 
 
 
-/* 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)
-
-