-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibev.pxd
92 lines (65 loc) · 2.4 KB
/
libev.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cdef:
enum: EVLOOP_NORMAL = 0 # block and loop
ctypedef void (*ev_callback)(ev_loop_t *loop,
ev_watcher *obj, int revents) except *
cdef extern from "ev.h":
enum:
EV_NONE
EV_READ
EV_WRITE
EV_TIMER
struct ev_loop_t "ev_loop":
pass
ev_loop_t *EV_DEFAULT
struct ev_watcher:
void *data
struct ev_io:
void *data
int fd
struct ev_timer:
void *data
struct ev_idle:
void *data
struct ev_signal:
void *data
struct ev_prepare:
void *data
struct ev_check:
void *data
ctypedef double ev_tstamp
ev_tstamp ev_time()
void ev_sleep(ev_tstamp delay)
void ev_init(ev_watcher *watcher, ev_callback cb)
int ev_is_active(ev_watcher *watcher)
int ev_is_pending(ev_watcher *watcher)
void ev_io_init(ev_io *obj, ev_callback cb, int fd, int events)
void ev_io_start(ev_loop_t *loop, ev_io *obj)
void ev_io_stop(ev_loop_t *loop, ev_io *obj)
void ev_io_set(ev_io *obj, int fd, int events)
void ev_timer_init(ev_timer *obj, ev_callback cb,
float after, float repeat)
void ev_timer_start(ev_loop_t *loop, ev_timer *obj)
void ev_timer_stop(ev_loop_t *loop, ev_timer *obj)
void ev_timer_set(ev_timer *obj, float after, float repeat)
void ev_idle_init(ev_idle *obj, ev_callback cb)
void ev_idle_start(ev_loop_t *loop, ev_idle *obj)
void ev_idle_stop(ev_loop_t *loop, ev_idle *obj)
void ev_signal_init(ev_signal *obj, ev_callback cb, int signum)
void ev_signal_set(ev_signal *obj, int signum)
void ev_signal_start(ev_loop_t *loop, ev_signal *obj)
void ev_signal_stop(ev_loop_t *loop, ev_signal *obj)
void ev_prepare_init(ev_prepare *obj, ev_callback cb)
void ev_prepare_start(ev_loop_t *loop, ev_prepare *obj)
void ev_prepare_stop(ev_loop_t *loop, ev_prepare *obj)
void ev_check_init(ev_check *obj, ev_callback cb)
void ev_check_start(ev_loop_t *loop, ev_check *obj)
void ev_check_stop(ev_loop_t *loop, ev_check *obj)
enum:
EVLOOP_NONBLOCK # do not block/wait
EVLOOP_ONESHOT # block *once* only
void ev_loop(ev_loop_t *loop, int flags) except *
enum:
EVUNLOOP_CANCEL # undo unloop
EVUNLOOP_ONE # unloop once
EVUNLOOP_ALL # unloop all loops
void ev_unloop(ev_loop_t *loop, int how)