From b1450721be39b9cb7b60144ec5115e379c56de77 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 7 Sep 1998 15:59:59 -0300 Subject: new function "lua_nups" (number of upvalues). --- lapi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 8747e67e..6db29a61 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.26 1998/07/12 16:16:02 roberto Exp roberto $ +** $Id: lapi.c,v 1.27 1998/08/21 17:43:44 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -452,6 +452,12 @@ lua_Function lua_stackedfunction (int level) } +int lua_nups (lua_Function func) { + TObject *o = luaA_Address(func); + return (!o || normalized_type(o) != LUA_T_CLOSURE) ? 0 : o->value.cl->nelems; +} + + int lua_currentline (lua_Function func) { TObject *f = Address(func); -- cgit v1.2.3-55-g6feb