aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-18 16:32:39 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-18 16:32:39 -0200
commitde79e7fc586c0b60a04823c0e930b227af2828d8 (patch)
treee48cd57eba16106100fb18e2bd2c1ab19f841347 /lapi.c
parent8b5b42563c317f83318a0386551f0f0252e387dc (diff)
downloadlua-de79e7fc586c0b60a04823c0e930b227af2828d8.tar.gz
lua-de79e7fc586c0b60a04823c0e930b227af2828d8.tar.bz2
lua-de79e7fc586c0b60a04823c0e930b227af2828d8.zip
back to "lua_upvalue"... (seems better choice)
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 3899bb86..464ef60a 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.13 1997/12/11 14:48:46 roberto Exp roberto $ 2** $Id: lapi.c,v 1.14 1997/12/15 16:17:20 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*/
@@ -124,6 +124,15 @@ lua_Object lua_lua2C (int number)
124} 124}
125 125
126 126
127lua_Object lua_upvalue (int n)
128{
129 TObject *f = L->stack.stack+L->Cstack.lua2C-1;
130 if (ttype(f) != LUA_T_CLMARK || n <= 0 || n > clvalue(f)->nelems)
131 return LUA_NOOBJECT;
132 return put_luaObject(&clvalue(f)->consts[n]);
133}
134
135
127int lua_callfunction (lua_Object function) 136int lua_callfunction (lua_Object function)
128{ 137{
129 if (function == LUA_NOOBJECT) 138 if (function == LUA_NOOBJECT)