… | |
… | |
2 | #include "perl.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
3 | #include "XSUB.h" |
4 | |
4 | |
5 | /*#include <netinet/in.h>*/ |
5 | /*#include <netinet/in.h>*/ |
6 | |
6 | |
7 | #define TIMEOUT_NONE HUGE_VAL |
|
|
8 | |
|
|
9 | #define EV_PROTOTYPES 1 |
7 | #define EV_PROTOTYPES 1 |
10 | #include "EV/EVAPI.h" |
8 | #include "EV/EVAPI.h" |
11 | |
9 | |
12 | #include "libev/ev.c" |
10 | #include "libev/ev.c" |
|
|
11 | #include "libev/event.h" |
|
|
12 | #include "libev/event.c" |
|
|
13 | #include "libev/evdns.c" |
13 | |
14 | |
14 | typedef int Signal; |
15 | typedef int Signal; |
15 | |
16 | |
16 | static struct EVAPI evapi; |
17 | static struct EVAPI evapi; |
17 | |
18 | |
… | |
… | |
155 | call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); |
156 | call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); |
156 | SP = PL_stack_base + mark; PUTBACK; |
157 | SP = PL_stack_base + mark; PUTBACK; |
157 | } |
158 | } |
158 | } |
159 | } |
159 | |
160 | |
160 | #if 0 |
|
|
161 | ///////////////////////////////////////////////////////////////////////////// |
161 | ///////////////////////////////////////////////////////////////////////////// |
162 | // DNS |
162 | // DNS |
163 | |
163 | |
164 | static void |
164 | static void |
165 | dns_cb (int result, char type, int count, int ttl, void *addresses, void *arg) |
165 | dns_cb (int result, char type, int count, int ttl, void *addresses, void *arg) |
… | |
… | |
207 | call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); |
207 | call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); |
208 | } |
208 | } |
209 | |
209 | |
210 | LEAVE; |
210 | LEAVE; |
211 | } |
211 | } |
212 | #endif |
|
|
213 | |
212 | |
214 | #define CHECK_REPEAT(repeat) if (repeat < 0.) \ |
213 | #define CHECK_REPEAT(repeat) if (repeat < 0.) \ |
215 | croak (# repeat " value must be >= 0"); |
214 | croak (# repeat " value must be >= 0"); |
216 | |
215 | |
217 | #define CHECK_FD(fh,fd) if ((fd) < 0) \ |
216 | #define CHECK_FD(fh,fd) if ((fd) < 0) \ |
… | |
… | |
482 | } |
481 | } |
483 | } |
482 | } |
484 | OUTPUT: |
483 | OUTPUT: |
485 | RETVAL |
484 | RETVAL |
486 | |
485 | |
487 | short events (struct ev_io *w, short new_events = EV_UNDEF) |
486 | int events (struct ev_io *w, int new_events = EV_UNDEF) |
488 | CODE: |
487 | CODE: |
489 | { |
488 | { |
490 | RETVAL = w->events; |
489 | RETVAL = w->events; |
491 | |
490 | |
492 | if (items > 1) |
491 | if (items > 1) |
… | |
… | |
634 | int status (struct ev_child *w) |
633 | int status (struct ev_child *w) |
635 | CODE: |
634 | CODE: |
636 | RETVAL = w->status; |
635 | RETVAL = w->status; |
637 | OUTPUT: |
636 | OUTPUT: |
638 | RETVAL |
637 | RETVAL |
639 | |
|
|
640 | #if 0 |
|
|
641 | |
638 | |
642 | MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ |
639 | MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ |
643 | |
640 | |
644 | BOOT: |
641 | BOOT: |
645 | { |
642 | { |
… | |
… | |
728 | |
725 | |
729 | void evdns_search_add (char *domain) |
726 | void evdns_search_add (char *domain) |
730 | |
727 | |
731 | void evdns_search_ndots_set (int ndots) |
728 | void evdns_search_ndots_set (int ndots) |
732 | |
729 | |
|
|
730 | #if 0 |
733 | |
731 | |
734 | MODULE = EV PACKAGE = EV::HTTP PREFIX = evhttp_ |
732 | MODULE = EV PACKAGE = EV::HTTP PREFIX = evhttp_ |
735 | |
733 | |
736 | BOOT: |
734 | BOOT: |
737 | { |
735 | { |