ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.xs
(Generate patch)

Comparing EV/EV.xs (file contents):
Revision 1.53 by root, Mon Nov 5 21:43:17 2007 UTC vs.
Revision 1.56 by root, Tue Nov 6 16:09:37 2007 UTC

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/* fix perl api breakage */
11#undef signal
12#undef sigaction
13
10/* due to bugs in OS X we have to use libev/ explicitly here */ 14/* due to bugs in OS X we have to use libev/ explicitly here */
11#include "libev/ev.c" 15#include "libev/ev.c"
12#include "event.c" 16#include "event.c"
17
18#ifndef WIN32
13#define DNS_USE_GETTIMEOFDAY_FOR_ID 1 19#define DNS_USE_GETTIMEOFDAY_FOR_ID 1
20#if !defined (WIN32) && !defined(__CYGWIN__)
14#define HAVE_STRUCT_IN6_ADDR 1 21# define HAVE_STRUCT_IN6_ADDR 1
22#endif
15#undef HAVE_STRTOK_R 23#undef HAVE_STRTOK_R
16#undef strtok_r 24#undef strtok_r
17#define strtok_r fake_strtok_r 25#define strtok_r fake_strtok_r
18#include "evdns.c" 26#include "evdns.c"
27#endif
28
29#ifndef WIN32
30# include <pthread.h>
31#endif
19 32
20typedef int Signal; 33typedef int Signal;
21 34
22static struct EVAPI evapi; 35static struct EVAPI evapi;
23 36
94 w->self = self; 107 w->self = self;
95 108
96 return (void *)w; 109 return (void *)w;
97} 110}
98 111
99static void * 112static void
100e_destroy (void *w_) 113e_destroy (void *w_)
101{ 114{
102 struct ev_watcher *w = w_; 115 struct ev_watcher *w = w_;
103 116
104 SvREFCNT_dec (w->fh ); w->fh = 0; 117 SvREFCNT_dec (w->fh ); w->fh = 0;
167} 180}
168 181
169///////////////////////////////////////////////////////////////////////////// 182/////////////////////////////////////////////////////////////////////////////
170// DNS 183// DNS
171 184
185#ifndef WIN32
172static void 186static void
173dns_cb (int result, char type, int count, int ttl, void *addresses, void *arg) 187dns_cb (int result, char type, int count, int ttl, void *addresses, void *arg)
174{ 188{
175 dSP; 189 dSP;
176 SV *cb = (SV *)arg; 190 SV *cb = (SV *)arg;
215 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); 229 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR);
216 } 230 }
217 231
218 LEAVE; 232 LEAVE;
219} 233}
234#endif
220 235
221#define CHECK_REPEAT(repeat) if (repeat < 0.) \ 236#define CHECK_REPEAT(repeat) if (repeat < 0.) \
222 croak (# repeat " value must be >= 0"); 237 croak (# repeat " value must be >= 0");
223 238
224#define CHECK_FD(fh,fd) if ((fd) < 0) \ 239#define CHECK_FD(fh,fd) if ((fd) < 0) \
231 246
232PROTOTYPES: ENABLE 247PROTOTYPES: ENABLE
233 248
234BOOT: 249BOOT:
235{ 250{
236 int i;
237 HV *stash = gv_stashpv ("EV", 1); 251 HV *stash = gv_stashpv ("EV", 1);
238 252
239 static const struct { 253 static const struct {
240 const char *name; 254 const char *name;
241 IV iv; 255 IV iv;
314 evapi.child_stop = ev_child_stop; 328 evapi.child_stop = ev_child_stop;
315 329
316 sv_setiv (sv, (IV)&evapi); 330 sv_setiv (sv, (IV)&evapi);
317 SvREADONLY_on (sv); 331 SvREADONLY_on (sv);
318 } 332 }
319 333#ifndef WIN32
320 pthread_atfork (0, 0, ev_default_fork); 334 pthread_atfork (0, 0, ev_default_fork);
335#endif
321} 336}
322 337
323NV ev_now () 338NV ev_now ()
324 339
325int ev_method () 340int ev_method ()
716 rpid = 1 731 rpid = 1
717 CODE: 732 CODE:
718 RETVAL = ix ? w->rpid : w->rstatus; 733 RETVAL = ix ? w->rpid : w->rstatus;
719 OUTPUT: 734 OUTPUT:
720 RETVAL 735 RETVAL
736
737#ifndef WIN32
721 738
722MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ 739MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_
723 740
724BOOT: 741BOOT:
725{ 742{
850 867
851#void DESTROY (struct evhttp_request *req); 868#void DESTROY (struct evhttp_request *req);
852 869
853#endif 870#endif
854 871
872#endif
855 873
856 874
857 875
858 876
859 877

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines