… | |
… | |
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 | |
|
|
10 | /* due to bugs in OS X we have to use libev/ explicitly here */ |
11 | #include "libev/ev.c" |
11 | #include "libev/ev.c" |
12 | #include "libev/event.h" |
|
|
13 | #include "libev/event.c" |
12 | #include "event.c" |
14 | #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 |
13 | #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 |
|
|
14 | #if !defined (WIN32) && !defined(__CYGWIN__) |
15 | #define HAVE_STRUCT_IN6_ADDR 1 |
15 | # define HAVE_STRUCT_IN6_ADDR 1 |
|
|
16 | #endif |
16 | #undef HAVE_STRTOK_R |
17 | #undef HAVE_STRTOK_R |
17 | #undef strtok_r |
18 | #undef strtok_r |
18 | #define strtok_r fake_strtok_r |
19 | #define strtok_r fake_strtok_r |
19 | #include "libev/evdns.c" |
20 | #include "evdns.c" |
|
|
21 | |
|
|
22 | #ifndef WIN32 |
|
|
23 | # include <pthread.h> |
|
|
24 | #endif |
20 | |
25 | |
21 | typedef int Signal; |
26 | typedef int Signal; |
22 | |
27 | |
23 | static struct EVAPI evapi; |
28 | static struct EVAPI evapi; |
24 | |
29 | |
… | |
… | |
316 | |
321 | |
317 | sv_setiv (sv, (IV)&evapi); |
322 | sv_setiv (sv, (IV)&evapi); |
318 | SvREADONLY_on (sv); |
323 | SvREADONLY_on (sv); |
319 | } |
324 | } |
320 | |
325 | |
321 | pthread_atfork (ev_fork_prepare, ev_fork_parent, ev_fork_child); |
326 | #ifndef WIN32 |
|
|
327 | pthread_atfork (0, 0, ev_default_fork); |
|
|
328 | #endif |
322 | } |
329 | } |
323 | |
330 | |
324 | NV ev_now () |
331 | NV ev_now () |
325 | |
332 | |
326 | int ev_method () |
333 | int ev_method () |
327 | |
334 | |
328 | NV ev_time () |
335 | NV ev_time () |
329 | |
336 | |
330 | int ev_init (int methods = EVMETHOD_AUTO) |
337 | int ev_default_loop (int methods = EVMETHOD_AUTO) |
331 | |
338 | |
332 | void ev_loop (int flags = 0) |
339 | void ev_loop (int flags = 0) |
333 | |
340 | |
334 | void ev_unloop (int how = 1) |
341 | void ev_unloop (int how = 1) |
335 | |
342 | |
… | |
… | |
581 | if (active) ev_signal_start (w); |
588 | if (active) ev_signal_start (w); |
582 | } |
589 | } |
583 | } |
590 | } |
584 | OUTPUT: |
591 | OUTPUT: |
585 | RETVAL |
592 | RETVAL |
586 | |
|
|
587 | MODULE = EV PACKAGE = EV::Time |
|
|
588 | |
593 | |
589 | MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_ |
594 | MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_ |
590 | |
595 | |
591 | void ev_timer_start (struct ev_timer *w) |
596 | void ev_timer_start (struct ev_timer *w) |
592 | INIT: |
597 | INIT: |