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

Comparing EV/EV.xs (file contents):
Revision 1.138 by root, Wed Apr 14 00:17:22 2010 UTC vs.
Revision 1.141 by root, Thu Jul 8 00:45:03 2010 UTC

29# define fd_mask Perl_fd_mask 29# define fd_mask Perl_fd_mask
30#endif 30#endif
31/* due to bugs in OS X we have to use libev/ explicitly here */ 31/* due to bugs in OS X we have to use libev/ explicitly here */
32#include "libev/ev.c" 32#include "libev/ev.c"
33 33
34#ifndef _WIN32 34#if !defined(_WIN32) && !defined(_MINIX)
35# include <pthread.h> 35# include <pthread.h>
36#endif 36#endif
37 37
38#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX (((ev_watcher *)(w))->loop)) 38#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX (((ev_watcher *)(w))->loop))
39#define e_flags(w) ((ev_watcher *)(w))->e_flags 39#define e_flags(w) ((ev_watcher *)(w))->e_flags
474 evapi.idle_stop = ev_idle_stop; 474 evapi.idle_stop = ev_idle_stop;
475 evapi.prepare_start = ev_prepare_start; 475 evapi.prepare_start = ev_prepare_start;
476 evapi.prepare_stop = ev_prepare_stop; 476 evapi.prepare_stop = ev_prepare_stop;
477 evapi.check_start = ev_check_start; 477 evapi.check_start = ev_check_start;
478 evapi.check_stop = ev_check_stop; 478 evapi.check_stop = ev_check_stop;
479#if EV_CHILD_ENABLE
479 evapi.child_start = ev_child_start; 480 evapi.child_start = ev_child_start;
480 evapi.child_stop = ev_child_stop; 481 evapi.child_stop = ev_child_stop;
482#endif
481 evapi.stat_start = ev_stat_start; 483 evapi.stat_start = ev_stat_start;
482 evapi.stat_stop = ev_stat_stop; 484 evapi.stat_stop = ev_stat_stop;
483 evapi.stat_stat = ev_stat_stat; 485 evapi.stat_stat = ev_stat_stat;
484 evapi.embed_start = ev_embed_start; 486 evapi.embed_start = ev_embed_start;
485 evapi.embed_stop = ev_embed_stop; 487 evapi.embed_stop = ev_embed_stop;
493 evapi.invoke = ev_invoke; 495 evapi.invoke = ev_invoke;
494 496
495 sv_setiv (sv, (IV)&evapi); 497 sv_setiv (sv, (IV)&evapi);
496 SvREADONLY_on (sv); 498 SvREADONLY_on (sv);
497 } 499 }
498#ifndef _WIN32 500#if !defined(_WIN32) && !defined(_MINIX)
499 pthread_atfork (0, 0, ev_default_fork); 501 pthread_atfork (0, 0, ev_default_fork);
500#endif 502#endif
501} 503}
502 504
503SV *ev_default_loop (unsigned int flags = 0) 505SV *ev_default_loop (unsigned int flags = 0)
693 ev_fork_set (RETVAL); 695 ev_fork_set (RETVAL);
694 if (!ix) START (fork, RETVAL); 696 if (!ix) START (fork, RETVAL);
695 OUTPUT: 697 OUTPUT:
696 RETVAL 698 RETVAL
697 699
700
698ev_child *child (int pid, int trace, SV *cb) 701ev_child *child (int pid, int trace, SV *cb)
699 ALIAS: 702 ALIAS:
700 child_ns = 1 703 child_ns = 1
701 CODE: 704 CODE:
705#if EV_CHILD_ENABLE
702 RETVAL = e_new (sizeof (ev_child), cb, default_loop_sv); 706 RETVAL = e_new (sizeof (ev_child), cb, default_loop_sv);
703 ev_child_set (RETVAL, pid, trace); 707 ev_child_set (RETVAL, pid, trace);
704 if (!ix) START (child, RETVAL); 708 if (!ix) START (child, RETVAL);
709#else
710 croak ("EV::child watchers not supported on this platform");
711#endif
705 OUTPUT: 712 OUTPUT:
706 RETVAL 713 RETVAL
714
707 715
708ev_stat *stat (SV *path, NV interval, SV *cb) 716ev_stat *stat (SV *path, NV interval, SV *cb)
709 ALIAS: 717 ALIAS:
710 stat_ns = 1 718 stat_ns = 1
711 CODE: 719 CODE:
1079 STOP (fork, w); 1087 STOP (fork, w);
1080 e_destroy (w); 1088 e_destroy (w);
1081 1089
1082MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_ 1090MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_
1083 1091
1092#if EV_CHILD_ENABLE
1093
1084void ev_child_start (ev_child *w) 1094void ev_child_start (ev_child *w)
1085 CODE: 1095 CODE:
1086 START (child, w); 1096 START (child, w);
1087 1097
1088void ev_child_stop (ev_child *w) 1098void ev_child_stop (ev_child *w)
1106 RETVAL = ix == 0 ? w->pid 1116 RETVAL = ix == 0 ? w->pid
1107 : ix == 1 ? w->rpid 1117 : ix == 1 ? w->rpid
1108 : w->rstatus; 1118 : w->rstatus;
1109 OUTPUT: 1119 OUTPUT:
1110 RETVAL 1120 RETVAL
1121
1122#endif
1111 1123
1112MODULE = EV PACKAGE = EV::Stat PREFIX = ev_stat_ 1124MODULE = EV PACKAGE = EV::Stat PREFIX = ev_stat_
1113 1125
1114void ev_stat_start (ev_stat *w) 1126void ev_stat_start (ev_stat *w)
1115 CODE: 1127 CODE:
1421 ev_fork_set (RETVAL); 1433 ev_fork_set (RETVAL);
1422 if (!ix) START (fork, RETVAL); 1434 if (!ix) START (fork, RETVAL);
1423 OUTPUT: 1435 OUTPUT:
1424 RETVAL 1436 RETVAL
1425 1437
1438
1426ev_child *child (struct ev_loop *loop, int pid, int trace, SV *cb) 1439ev_child *child (struct ev_loop *loop, int pid, int trace, SV *cb)
1427 ALIAS: 1440 ALIAS:
1428 child_ns = 1 1441 child_ns = 1
1429 CODE: 1442 CODE:
1443#if EV_CHILD_ENABLE
1430 RETVAL = e_new (sizeof (ev_child), cb, ST (0)); 1444 RETVAL = e_new (sizeof (ev_child), cb, ST (0));
1431 ev_child_set (RETVAL, pid, trace); 1445 ev_child_set (RETVAL, pid, trace);
1432 if (!ix) START (child, RETVAL); 1446 if (!ix) START (child, RETVAL);
1447#else
1448 croak ("EV::child watchers not supported on this platform");
1449#endif
1433 OUTPUT: 1450 OUTPUT:
1434 RETVAL 1451 RETVAL
1435 1452
1436ev_stat *stat (struct ev_loop *loop, SV *path, NV interval, SV *cb) 1453ev_stat *stat (struct ev_loop *loop, SV *path, NV interval, SV *cb)
1437 ALIAS: 1454 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines