aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-01 15:21:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-01 15:21:32 -0300
commit4fe11ae232e37045feaaf08d72a5414fca463c1c (patch)
tree1bf874a3d69e296effa2a41b488f2644238d8277 /lapi.c
parentc549d4fe64c48ab645740e6d12c69c91250fad3d (diff)
downloadlua-4fe11ae232e37045feaaf08d72a5414fca463c1c.tar.gz
lua-4fe11ae232e37045feaaf08d72a5414fca463c1c.tar.bz2
lua-4fe11ae232e37045feaaf08d72a5414fca463c1c.zip
'lua_getuservalue' returns type of user value
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lapi.c b/lapi.c
index 27f51220..843e5606 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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
738LUA_API void lua_getuservalue (lua_State *L, int idx) { 738LUA_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