… | |
… | |
5 | /*#include <netinet/in.h>*/ |
5 | /*#include <netinet/in.h>*/ |
6 | |
6 | |
7 | #define EV_PROTOTYPES 1 |
7 | #define EV_PROTOTYPES 1 |
8 | #include "EV/EVAPI.h" |
8 | #include "EV/EVAPI.h" |
9 | |
9 | |
10 | #include "libev/ev.c" |
10 | #include "ev.c" |
11 | #include "libev/event.h" |
|
|
12 | #include "libev/event.c" |
11 | #include "event.c" |
13 | #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 |
12 | #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 |
14 | #define HAVE_STRUCT_IN6_ADDR 1 |
13 | #define HAVE_STRUCT_IN6_ADDR 1 |
15 | #undef HAVE_STRTOK_R |
14 | #undef HAVE_STRTOK_R |
16 | #undef strtok_r |
15 | #undef strtok_r |
17 | #define strtok_r fake_strtok_r |
16 | #define strtok_r fake_strtok_r |
18 | #include "libev/evdns.c" |
17 | #include "evdns.c" |
19 | |
18 | |
20 | typedef int Signal; |
19 | typedef int Signal; |
21 | |
20 | |
22 | static struct EVAPI evapi; |
21 | static struct EVAPI evapi; |
23 | |
22 | |
… | |
… | |
315 | |
314 | |
316 | sv_setiv (sv, (IV)&evapi); |
315 | sv_setiv (sv, (IV)&evapi); |
317 | SvREADONLY_on (sv); |
316 | SvREADONLY_on (sv); |
318 | } |
317 | } |
319 | |
318 | |
320 | pthread_atfork (ev_fork_prepare, ev_fork_parent, ev_fork_child); |
319 | pthread_atfork (0, 0, ev_default_fork); |
321 | } |
320 | } |
322 | |
321 | |
323 | NV ev_now () |
322 | NV ev_now () |
324 | |
323 | |
325 | int ev_method () |
324 | int ev_method () |
326 | |
325 | |
327 | NV ev_time () |
326 | NV ev_time () |
328 | |
327 | |
329 | int ev_init (int methods = EVMETHOD_AUTO) |
328 | int ev_default_loop (int methods = EVMETHOD_AUTO) |
330 | |
329 | |
331 | void ev_loop (int flags = 0) |
330 | void ev_loop (int flags = 0) |
332 | |
331 | |
333 | void ev_unloop (int how = 1) |
332 | void ev_unloop (int how = 1) |
334 | |
333 | |