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