mirror of
https://github.com/bol-van/zapret2.git
synced 2026-10-29 06:02:05 +00:00
nfqws2: timer_enum return only names
This commit is contained in:
1 parent
01a4ee63d4
commit
b1afa7079f
2 files changed
+3
-9
No files matched your search
@@ -938,9 +938,9 @@ function test_timer(opts)
|
|||||||
|
|
||||||
print("* timers\n")
|
print("* timers\n")
|
||||||
local timers=timer_enum()
|
local timers=timer_enum()
|
||||||
for i,timer in ipairs(timers) do
|
for i,name in ipairs(timers) do
|
||||||
print("TIMER "..i.." :")
|
print("TIMER "..i.." :")
|
||||||
timer_info_print(timer)
|
timer_info_print_by_name(name)
|
||||||
end
|
end
|
||||||
print()
|
print()
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-7
@@ -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_bool(L, "oneshot", timer->oneshot);
|
||||||
lua_pushf_lint(L, "fires", timer->fires);
|
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)
|
static int luacall_timer_info(lua_State *L)
|
||||||
{
|
{
|
||||||
// timer_del(name)
|
// timer_del(name)
|
||||||
@@ -3889,7 +3883,7 @@ static int luacall_timer_enum(lua_State *L)
|
|||||||
timer_pool *timer, *tmp, *p;
|
timer_pool *timer, *tmp, *p;
|
||||||
|
|
||||||
lua_newtable(L);
|
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)
|
LUA_STACK_GUARD_RETURN(L,1)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user