void lua_funcinfo(lua_Object func, const char **filename, int32 *linedefined) { if (!lua_isfunction(func)) lua_error("API - `funcinfo' called with a non-function value"); else { TObject *f = luaA_protovalue(Address(func)); if (normalized_type(f) == LUA_T_PROTO) { *filename = tfvalue(f)->fileName->str; *linedefined = tfvalue(f)->lineDefined; } else { *filename = "(C)"; *linedefined = -1; } } }
static TObject *luaA_protovalue (TObject *o) { return (normalized_type(o) == LUA_T_CLOSURE) ? protovalue(o) : o; }
int lua_nups (lua_Function func) { TObject *o = luaA_Address(func); return (!o || normalized_type(o) != LUA_T_CLOSURE) ? 0 : o->value.cl->nelems; }
static void set_normalized (TObject *d, TObject *s) { d->value = s->value; d->ttype = normalized_type(s); }
void set_normalized(TObject *d, TObject *s) { d->value = s->value; d->ttype = (lua_Type)normalized_type(s); }