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

Comparing EV/EV.xs (file contents):
Revision 1.45 by root, Sat Nov 3 09:19:58 2007 UTC vs.
Revision 1.54 by root, Tue Nov 6 12:31:20 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/* due to bugs in OS X we have to use libev/ explicitly here */
10#include "libev/ev.c" 11#include "libev/ev.c"
11#include "libev/event.h"
12#include "libev/event.c" 12#include "event.c"
13#define DNS_USE_GETTIMEOFDAY_FOR_ID 1
14#if !defined (WIN32) && !defined(__CYGWIN__)
15# define HAVE_STRUCT_IN6_ADDR 1
16#endif
17#undef HAVE_STRTOK_R
18#undef strtok_r
19#define strtok_r fake_strtok_r
13#include "libev/evdns.c" 20#include "evdns.c"
14 21
15typedef int Signal; 22typedef int Signal;
16 23
17static struct EVAPI evapi; 24static struct EVAPI evapi;
18 25
282 /* the poor man's shared library emulator */ 289 /* the poor man's shared library emulator */
283 evapi.ver = EV_API_VERSION; 290 evapi.ver = EV_API_VERSION;
284 evapi.rev = EV_API_REVISION; 291 evapi.rev = EV_API_REVISION;
285 evapi.sv_fileno = sv_fileno; 292 evapi.sv_fileno = sv_fileno;
286 evapi.sv_signum = sv_signum; 293 evapi.sv_signum = sv_signum;
287 evapi.now = &ev_now; 294 evapi.now = ev_now;
288 evapi.method = &ev_method; 295 evapi.method = ev_method;
289 evapi.loop_done = &ev_loop_done; 296 evapi.unloop = ev_unloop;
290 evapi.time = ev_time; 297 evapi.time = ev_time;
291 evapi.loop = ev_loop; 298 evapi.loop = ev_loop;
292 evapi.once = ev_once; 299 evapi.once = ev_once;
293 evapi.io_start = ev_io_start; 300 evapi.io_start = ev_io_start;
294 evapi.io_stop = ev_io_stop; 301 evapi.io_stop = ev_io_stop;
310 317
311 sv_setiv (sv, (IV)&evapi); 318 sv_setiv (sv, (IV)&evapi);
312 SvREADONLY_on (sv); 319 SvREADONLY_on (sv);
313 } 320 }
314 321
315 pthread_atfork (ev_fork_prepare, ev_fork_parent, ev_fork_child); 322 pthread_atfork (0, 0, ev_default_fork);
316} 323}
317 324
318NV ev_now () 325NV ev_now ()
319 CODE:
320 RETVAL = ev_now;
321 OUTPUT:
322 RETVAL
323 326
324int ev_method () 327int ev_method ()
325 CODE:
326 RETVAL = ev_method;
327 OUTPUT:
328 RETVAL
329 328
330NV ev_time () 329NV ev_time ()
331 330
332int ev_init (int methods = EVMETHOD_AUTO) 331int ev_default_loop (int methods = EVMETHOD_AUTO)
333 332
334void ev_loop (int flags = 0) 333void ev_loop (int flags = 0)
335 334
336void ev_loop_done (int value = 1) 335void ev_unloop (int how = 1)
337 CODE:
338 ev_loop_done = value;
339 336
340struct ev_io *io (SV *fh, int events, SV *cb) 337struct ev_io *io (SV *fh, int events, SV *cb)
341 ALIAS: 338 ALIAS:
342 io_ns = 1 339 io_ns = 1
343 CODE: 340 CODE:
419 416
420struct ev_child *child (int pid, SV *cb) 417struct ev_child *child (int pid, SV *cb)
421 ALIAS: 418 ALIAS:
422 check_ns = 1 419 check_ns = 1
423 CODE: 420 CODE:
424 RETVAL = e_new (sizeof (struct ev_check), cb); 421 RETVAL = e_new (sizeof (struct ev_child), cb);
425 ev_child_set (RETVAL, pid); 422 ev_child_set (RETVAL, pid);
426 if (!ix) ev_child_start (RETVAL); 423 if (!ix) ev_child_start (RETVAL);
427 OUTPUT: 424 OUTPUT:
428 RETVAL 425 RETVAL
429 426
585 if (active) ev_signal_start (w); 582 if (active) ev_signal_start (w);
586 } 583 }
587} 584}
588 OUTPUT: 585 OUTPUT:
589 RETVAL 586 RETVAL
590
591MODULE = EV PACKAGE = EV::Time
592 587
593MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_ 588MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_
594 589
595void ev_timer_start (struct ev_timer *w) 590void ev_timer_start (struct ev_timer *w)
596 INIT: 591 INIT:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines