diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-09 17:53:16 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-09 17:53:16 -0200 |
commit | 6875fdc8be9029b1bb29379c59d5409a0df42c10 (patch) | |
tree | af7d5845b1e209473ecf8ad0f53a188974628b20 /lua.h | |
parent | dc17a9cc24a52a298dbfb7ffe8aaad393f7c1bf9 (diff) | |
download | lua-6875fdc8be9029b1bb29379c59d5409a0df42c10.tar.gz lua-6875fdc8be9029b1bb29379c59d5409a0df42c10.tar.bz2 lua-6875fdc8be9029b1bb29379c59d5409a0df42c10.zip |
new semantics for pushuserdata (no more different userdatas with same value)
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.84 2001/01/25 16:45:36 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.85 2001/01/26 11:45:51 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: lua@tecgraf.puc-rio.br | 5 | ** e-mail: lua@tecgraf.puc-rio.br |
@@ -32,7 +32,6 @@ | |||
32 | #define LUA_REFREGISTRY 0 | 32 | #define LUA_REFREGISTRY 0 |
33 | 33 | ||
34 | /* pre-defined tags */ | 34 | /* pre-defined tags */ |
35 | #define LUA_ANYTAG (-1) | ||
36 | #define LUA_NOTAG (-2) | 35 | #define LUA_NOTAG (-2) |
37 | 36 | ||
38 | 37 | ||
@@ -137,7 +136,7 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n); | |||
137 | LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len); | 136 | LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len); |
138 | LUA_API void lua_pushstring (lua_State *L, const char *s); | 137 | LUA_API void lua_pushstring (lua_State *L, const char *s); |
139 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); | 138 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); |
140 | LUA_API void lua_pushusertag (lua_State *L, void *u, int tag); | 139 | LUA_API int lua_pushuserdata (lua_State *L, void *u); |
141 | 140 | ||
142 | 141 | ||
143 | /* | 142 | /* |
@@ -210,7 +209,7 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
210 | #define lua_pop(L,n) lua_settop(L, -(n)-1) | 209 | #define lua_pop(L,n) lua_settop(L, -(n)-1) |
211 | 210 | ||
212 | #define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n)) | 211 | #define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n)) |
213 | #define lua_pushuserdata(L,u) lua_pushusertag(L, u, 0) | 212 | #define lua_pushusertag(L,u,t) (lua_pushuserdata(L, u), lua_settag(L, t)) |
214 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0) | 213 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0) |
215 | #define lua_clonetag(L,t) lua_copytagmethods(L, lua_newtag(L), (t)) | 214 | #define lua_clonetag(L,t) lua_copytagmethods(L, lua_newtag(L), (t)) |
216 | 215 | ||