diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-05-01 15:21:32 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-05-01 15:21:32 -0300 |
| commit | 4fe11ae232e37045feaaf08d72a5414fca463c1c (patch) | |
| tree | 1bf874a3d69e296effa2a41b488f2644238d8277 | |
| parent | c549d4fe64c48ab645740e6d12c69c91250fad3d (diff) | |
| download | lua-4fe11ae232e37045feaaf08d72a5414fca463c1c.tar.gz lua-4fe11ae232e37045feaaf08d72a5414fca463c1c.tar.bz2 lua-4fe11ae232e37045feaaf08d72a5414fca463c1c.zip | |
'lua_getuservalue' returns type of user value
| -rw-r--r-- | lapi.c | 5 | ||||
| -rw-r--r-- | lua.h | 4 |
2 files changed, 5 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.207 2014/04/30 16:48:44 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.208 2014/05/01 18:18:06 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 | */ |
| @@ -735,7 +735,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { | |||
| 735 | } | 735 | } |
| 736 | 736 | ||
| 737 | 737 | ||
| 738 | LUA_API void lua_getuservalue (lua_State *L, int idx) { | 738 | LUA_API int lua_getuservalue (lua_State *L, int idx) { |
| 739 | StkId o; | 739 | StkId o; |
| 740 | lua_lock(L); | 740 | lua_lock(L); |
| 741 | o = index2addr(L, idx); | 741 | o = index2addr(L, idx); |
| @@ -743,6 +743,7 @@ LUA_API void lua_getuservalue (lua_State *L, int idx) { | |||
| 743 | getuservalue(L, rawuvalue(o), L->top); | 743 | getuservalue(L, rawuvalue(o), L->top); |
| 744 | api_incr_top(L); | 744 | api_incr_top(L); |
| 745 | lua_unlock(L); | 745 | lua_unlock(L); |
| 746 | return ttnov(L->top - 1); | ||
| 746 | } | 747 | } |
| 747 | 748 | ||
| 748 | 749 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.302 2014/03/20 19:42:35 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.303 2014/05/01 18:18:06 roberto Exp roberto $ |
| 3 | ** Lua - A Scripting Language | 3 | ** Lua - A Scripting Language |
| 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) | 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) |
| 5 | ** See Copyright Notice at the end of this file | 5 | ** See Copyright Notice at the end of this file |
| @@ -238,7 +238,7 @@ LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); | |||
| 238 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); | 238 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); |
| 239 | LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); | 239 | LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); |
| 240 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); | 240 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); |
| 241 | LUA_API void (lua_getuservalue) (lua_State *L, int idx); | 241 | LUA_API int (lua_getuservalue) (lua_State *L, int idx); |
| 242 | 242 | ||
| 243 | 243 | ||
| 244 | /* | 244 | /* |
