mirror of
https://github.com/lua/lua
synced 2024-11-22 21:01:26 +03:00
new function "lua_nups" (number of upvalues).
This commit is contained in:
parent
b04294d3d8
commit
b1450721be
8
lapi.c
8
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);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: luadebug.h,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $
|
||||
** $Id: luadebug.h,v 1.2 1998/06/19 16:14:09 roberto Exp roberto $
|
||||
** Debugging API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -24,6 +24,7 @@ char *lua_getobjname (lua_Object o, char **name);
|
||||
lua_Object lua_getlocal (lua_Function func, int local_number, char **name);
|
||||
int lua_setlocal (lua_Function func, int local_number);
|
||||
|
||||
int lua_nups (lua_Function func);
|
||||
|
||||
extern lua_LHFunction lua_linehook;
|
||||
extern lua_CHFunction lua_callhook;
|
||||
|
Loading…
Reference in New Issue
Block a user