Rizin
unix-like reverse engineering framework and cli tools
main.c File Reference
#include <stdio.h>
#include <uv.h>

Go to the source code of this file.

Functions

void idle_cb (uv_idle_t *handle)
 
void prep_cb (uv_prepare_t *handle)
 
int main ()
 

Variables

int64_t counter = 0
 

Function Documentation

◆ idle_cb()

void idle_cb ( uv_idle_t handle)

Definition at line 6 of file main.c.

6  {
7  printf("Idle callback\n");
8  counter++;
9 
10  if (counter >= 5) {
12  printf("uv_stop() called\n");
13  }
14 }
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition: cs_driver.c:93
int64_t counter
Definition: main.c:4
UV_EXTERN void uv_stop(uv_loop_t *)
Definition: uv-common.c:562
UV_EXTERN uv_loop_t * uv_default_loop(void)
Definition: uv-common.c:763

References counter, printf(), uv_default_loop(), and uv_stop().

Referenced by main().

◆ main()

int main ( void  )

Definition at line 20 of file main.c.

20  {
22  uv_prepare_t prep;
23 
26 
28  uv_prepare_start(&prep, prep_cb);
29 
31 
32  return 0;
33 }
Definition: uv.h:834
uv_idle_t idler
Definition: main.c:7
void idle_cb(uv_idle_t *handle)
Definition: main.c:6
void prep_cb(uv_prepare_t *handle)
Definition: main.c:16
@ UV_RUN_DEFAULT
Definition: uv.h:255
UV_EXTERN int uv_prepare_init(uv_loop_t *, uv_prepare_t *prepare)
UV_EXTERN int uv_prepare_start(uv_prepare_t *prepare, uv_prepare_cb cb)
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
Definition: core.c:365
UV_EXTERN int uv_idle_start(uv_idle_t *idle, uv_idle_cb cb)
UV_EXTERN int uv_idle_init(uv_loop_t *, uv_idle_t *idle)

References idle_cb(), idler, prep_cb(), uv_default_loop(), uv_idle_init(), uv_idle_start(), uv_prepare_init(), uv_prepare_start(), uv_run(), and UV_RUN_DEFAULT.

◆ prep_cb()

void prep_cb ( uv_prepare_t handle)

Definition at line 16 of file main.c.

16  {
17  printf("Prep callback\n");
18 }

References printf().

Referenced by main().

Variable Documentation

◆ counter

int64_t counter = 0

Definition at line 4 of file main.c.