back to "lua_upvalue"... (seems better choice)

This commit is contained in:
Roberto Ierusalimschy
1997-12-18 16:32:39 -02:00
parent 8b5b42563c
commit de79e7fc58
5 changed files with 27 additions and 29 deletions

11
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 1.13 1997/12/11 14:48:46 roberto Exp roberto $
** $Id: lapi.c,v 1.14 1997/12/15 16:17:20 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -124,6 +124,15 @@ lua_Object lua_lua2C (int number)
}
lua_Object lua_upvalue (int n)
{
TObject *f = L->stack.stack+L->Cstack.lua2C-1;
if (ttype(f) != LUA_T_CLMARK || n <= 0 || n > clvalue(f)->nelems)
return LUA_NOOBJECT;
return put_luaObject(&clvalue(f)->consts[n]);
}
int lua_callfunction (lua_Object function)
{
if (function == LUA_NOOBJECT)