nfqws2: timer_enum return only names

This commit is contained in:
bol-van
2026-04-28 10:29:33 +03:00
parent 01a4ee63d4
commit b1afa7079f
2 changed files with 3 additions and 9 deletions
+2 -2
View File
@@ -938,9 +938,9 @@ function test_timer(opts)
print("* timers\n")
local timers=timer_enum()
for i,timer in ipairs(timers) do
for i,name in ipairs(timers) do
print("TIMER "..i.." :")
timer_info_print(timer)
timer_info_print_by_name(name)
end
print()
end
+1 -7
View File
@@ -3856,12 +3856,6 @@ static int lua_push_timer_info(lua_State *L, const timer_pool *timer)
lua_pushf_bool(L, "oneshot", timer->oneshot);
lua_pushf_lint(L, "fires", timer->fires);
}
static void lua_pushi_timer_info(lua_State *L, lua_Integer idx, const timer_pool *timer)
{
lua_pushinteger(L, idx);
lua_push_timer_info(L, timer);
lua_rawset(L,-3);
}
static int luacall_timer_info(lua_State *L)
{
// timer_del(name)
@@ -3889,7 +3883,7 @@ static int luacall_timer_enum(lua_State *L)
timer_pool *timer, *tmp, *p;
lua_newtable(L);
HASH_ITER(hh, params.timers, timer, tmp) lua_pushi_timer_info(L, n++, timer);
HASH_ITER(hh, params.timers, timer, tmp) lua_pushi_str(L, n++, timer->str);
LUA_STACK_GUARD_RETURN(L,1)
}