diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-07-17 13:25:13 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-07-17 13:25:13 -0300 |
commit | 79c8edb6c423b48270c1f61df6fd5a889ca5da0e (patch) | |
tree | 1b79c096472f5f799f5576561e831b0d992c8cd0 /lapi.c | |
parent | e5146fb01f1ccb40c2663e745feffbf642cbf862 (diff) | |
download | lua-79c8edb6c423b48270c1f61df6fd5a889ca5da0e.tar.gz lua-79c8edb6c423b48270c1f61df6fd5a889ca5da0e.tar.bz2 lua-79c8edb6c423b48270c1f61df6fd5a889ca5da0e.zip |
new names for light userdata operations
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.203 2002/06/25 19:15:41 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.204 2002/06/26 19:28:44 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -305,7 +305,7 @@ LUA_API void *lua_touserdata (lua_State *L, int index) { | |||
305 | if (o == NULL) return NULL; | 305 | if (o == NULL) return NULL; |
306 | switch (ttype(o)) { | 306 | switch (ttype(o)) { |
307 | case LUA_TUSERDATA: return (uvalue(o) + 1); | 307 | case LUA_TUSERDATA: return (uvalue(o) + 1); |
308 | case LUA_TUDATAVAL: return pvalue(o); | 308 | case LUA_TLIGHTUSERDATA: return pvalue(o); |
309 | default: return NULL; | 309 | default: return NULL; |
310 | } | 310 | } |
311 | } | 311 | } |
@@ -318,6 +318,9 @@ LUA_API const void *lua_topointer (lua_State *L, int index) { | |||
318 | switch (ttype(o)) { | 318 | switch (ttype(o)) { |
319 | case LUA_TTABLE: return hvalue(o); | 319 | case LUA_TTABLE: return hvalue(o); |
320 | case LUA_TFUNCTION: return clvalue(o); | 320 | case LUA_TFUNCTION: return clvalue(o); |
321 | case LUA_TUSERDATA: | ||
322 | case LUA_TLIGHTUSERDATA: | ||
323 | return lua_touserdata(L, index); | ||
321 | default: return NULL; | 324 | default: return NULL; |
322 | } | 325 | } |
323 | } | 326 | } |
@@ -407,7 +410,7 @@ LUA_API void lua_pushboolean (lua_State *L, int b) { | |||
407 | } | 410 | } |
408 | 411 | ||
409 | 412 | ||
410 | LUA_API void lua_pushudataval (lua_State *L, void *p) { | 413 | LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { |
411 | lua_lock(L); | 414 | lua_lock(L); |
412 | setpvalue(L->top, p); | 415 | setpvalue(L->top, p); |
413 | api_incr_top(L); | 416 | api_incr_top(L); |