diff options
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.145 2002/07/01 19:31:10 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.146 2002/07/09 14:58:28 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 |
@@ -70,9 +70,9 @@ typedef const char * (*lua_Chunkreader) (void *ud, size_t *size); | |||
70 | #define LUA_TSTRING 2 | 70 | #define LUA_TSTRING 2 |
71 | #define LUA_TBOOLEAN 3 | 71 | #define LUA_TBOOLEAN 3 |
72 | #define LUA_TTABLE 4 | 72 | #define LUA_TTABLE 4 |
73 | #define LUA_TUSERDATA 5 | 73 | #define LUA_TFUNCTION 5 |
74 | #define LUA_TUDATAVAL 6 | 74 | #define LUA_TUSERDATA 6 |
75 | #define LUA_TFUNCTION 7 | 75 | #define LUA_TLIGHTUSERDATA 7 |
76 | 76 | ||
77 | 77 | ||
78 | /* minimum Lua stack available to a C function */ | 78 | /* minimum Lua stack available to a C function */ |
@@ -158,7 +158,7 @@ LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, | |||
158 | LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...); | 158 | LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...); |
159 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); | 159 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); |
160 | LUA_API void lua_pushboolean (lua_State *L, int b); | 160 | LUA_API void lua_pushboolean (lua_State *L, int b); |
161 | LUA_API void lua_pushudataval (lua_State *L, void *p); | 161 | LUA_API void lua_pushlightuserdata (lua_State *L, void *p); |
162 | 162 | ||
163 | 163 | ||
164 | /* | 164 | /* |
@@ -225,10 +225,10 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
225 | ** =============================================================== | 225 | ** =============================================================== |
226 | */ | 226 | */ |
227 | 227 | ||
228 | #define lua_newpointerbox(L,u) \ | 228 | #define lua_boxpointer(L,u) \ |
229 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) | 229 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) |
230 | 230 | ||
231 | #define lua_getfrombox(L,i) (*(void **)(lua_touserdata(L, i))) | 231 | #define lua_unboxpointer(L,i) (*(void **)(lua_touserdata(L, i))) |
232 | 232 | ||
233 | #define lua_pop(L,n) lua_settop(L, -(n)-1) | 233 | #define lua_pop(L,n) lua_settop(L, -(n)-1) |
234 | 234 | ||
@@ -241,8 +241,8 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
241 | 241 | ||
242 | #define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION) | 242 | #define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION) |
243 | #define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE) | 243 | #define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE) |
244 | #define lua_isuserdata(L,n) (lua_type(L,n) == LUA_TUSERDATA) | 244 | #define lua_isuserdata(L,n) (lua_type(L,n) >= LUA_TUSERDATA) |
245 | #define lua_isudataval(L,n) (lua_type(L,n) == LUA_TUDATAVAL) | 245 | #define lua_islightuserdata(L,n) (lua_type(L,n) == LUA_TLIGHTUSERDATA) |
246 | #define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL) | 246 | #define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL) |
247 | #define lua_isboolean(L,n) (lua_type(L,n) == LUA_TBOOLEAN) | 247 | #define lua_isboolean(L,n) (lua_type(L,n) == LUA_TBOOLEAN) |
248 | #define lua_isnone(L,n) (lua_type(L,n) == LUA_TNONE) | 248 | #define lua_isnone(L,n) (lua_type(L,n) == LUA_TNONE) |