Rizin
unix-like reverse engineering framework and cli tools
main.c
Go to the documentation of this file.
1
#include <stdio.h>
2
3
#include <
uv.h
>
4
5
uv_loop_t
*
loop
;
6
uv_timer_t
gc_req
;
7
uv_timer_t
fake_job_req
;
8
9
void
gc
(
uv_timer_t
*
handle
) {
10
fprintf(stderr,
"Freeing unused objects\n"
);
11
}
12
13
void
fake_job
(
uv_timer_t
*
handle
) {
14
fprintf(stdout,
"Fake job done\n"
);
15
}
16
17
int
main
() {
18
loop
=
uv_default_loop
();
19
20
uv_timer_init
(
loop
, &
gc_req
);
21
uv_unref
((
uv_handle_t
*) &
gc_req
);
22
23
uv_timer_start
(&
gc_req
,
gc
, 0, 2000);
24
25
// could actually be a TCP download or something
26
uv_timer_init
(
loop
, &
fake_job_req
);
27
uv_timer_start
(&
fake_job_req
,
fake_job
, 9000, 0);
28
return
uv_run
(
loop
,
UV_RUN_DEFAULT
);
29
}
handle
static mcore_handle handle
Definition:
asm_mcore.c:8
main
int main(int argc, const char **argv)
Definition:
main.c:340
uv_handle_s
Definition:
uv.h:444
uv_loop_s
Definition:
uv.h:1780
uv_timer_s
Definition:
uv.h:860
loop
uv_loop_t * loop
Definition:
main.c:7
fake_job_req
uv_timer_t fake_job_req
Definition:
main.c:7
gc_req
uv_timer_t gc_req
Definition:
main.c:6
gc
void gc(uv_timer_t *handle)
Definition:
main.c:9
fake_job
void fake_job(uv_timer_t *handle)
Definition:
main.c:13
uv.h
UV_RUN_DEFAULT
@ UV_RUN_DEFAULT
Definition:
uv.h:255
uv_timer_start
UV_EXTERN int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
Definition:
timer.c:66
uv_timer_init
UV_EXTERN int uv_timer_init(uv_loop_t *, uv_timer_t *handle)
Definition:
timer.c:58
uv_run
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
Definition:
core.c:365
uv_unref
UV_EXTERN void uv_unref(uv_handle_t *)
Definition:
uv-common.c:552
uv_default_loop
UV_EXTERN uv_loop_t * uv_default_loop(void)
Definition:
uv-common.c:763
subprojects
libuv-v1.40.0
docs
code
ref-timer
main.c
Generated by
1.9.1