diff options
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.124 2002/03/27 12:49:53 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.125 2002/03/27 15:30:41 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
5 | ** e-mail: info@lua.org | 5 | ** e-mail: info@lua.org |
@@ -17,8 +17,8 @@ | |||
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | #define LUA_VERSION "Lua 4.1 (beta)" | 20 | #define LUA_VERSION "Lua 5.0 (alpha)" |
21 | #define LUA_COPYRIGHT "Copyright (C) 1994-2001 TeCGraf, PUC-Rio" | 21 | #define LUA_COPYRIGHT "Copyright (C) 1994-2002 TeCGraf, PUC-Rio" |
22 | #define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" | 22 | #define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" |
23 | 23 | ||
24 | 24 | ||
@@ -63,7 +63,8 @@ typedef int (*lua_CFunction) (lua_State *L); | |||
63 | #define LUA_TBOOLEAN 3 | 63 | #define LUA_TBOOLEAN 3 |
64 | #define LUA_TTABLE 4 | 64 | #define LUA_TTABLE 4 |
65 | #define LUA_TUSERDATA 5 | 65 | #define LUA_TUSERDATA 5 |
66 | #define LUA_TFUNCTION 6 | 66 | #define LUA_TUDATAVAL 6 |
67 | #define LUA_TFUNCTION 7 | ||
67 | 68 | ||
68 | 69 | ||
69 | /* minimum Lua stack available to a C function */ | 70 | /* minimum Lua stack available to a C function */ |
@@ -143,6 +144,7 @@ LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len); | |||
143 | LUA_API void lua_pushstring (lua_State *L, const char *s); | 144 | LUA_API void lua_pushstring (lua_State *L, const char *s); |
144 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); | 145 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); |
145 | LUA_API void lua_pushboolean (lua_State *L, int b); | 146 | LUA_API void lua_pushboolean (lua_State *L, int b); |
147 | LUA_API void lua_pushudataval (lua_State *L, void *p); | ||
146 | 148 | ||
147 | 149 | ||
148 | /* | 150 | /* |
@@ -204,7 +206,6 @@ LUA_API int lua_getn (lua_State *L, int index); | |||
204 | LUA_API void lua_concat (lua_State *L, int n); | 206 | LUA_API void lua_concat (lua_State *L, int n); |
205 | 207 | ||
206 | LUA_API void *lua_newuserdata (lua_State *L, size_t size); | 208 | LUA_API void *lua_newuserdata (lua_State *L, size_t size); |
207 | LUA_API void lua_newuserdatabox (lua_State *L, void *u); | ||
208 | 209 | ||
209 | 210 | ||
210 | 211 | ||
@@ -214,6 +215,11 @@ LUA_API void lua_newuserdatabox (lua_State *L, void *u); | |||
214 | ** =============================================================== | 215 | ** =============================================================== |
215 | */ | 216 | */ |
216 | 217 | ||
218 | #define lua_newpointerbox(L,u) \ | ||
219 | (*(void **)(lua_newuserdata(L, sizeof(void *))) = (u)) | ||
220 | |||
221 | #define lua_getfrombox(L,i) (*(void **)(lua_touserdata(L, i))) | ||
222 | |||
217 | #define lua_pop(L,n) lua_settop(L, -(n)-1) | 223 | #define lua_pop(L,n) lua_settop(L, -(n)-1) |
218 | 224 | ||
219 | #define lua_register(L,n,f) \ | 225 | #define lua_register(L,n,f) \ |