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

Comparing EV/EV.xs (file contents):
Revision 1.41 by root, Fri Nov 2 20:21:33 2007 UTC vs.
Revision 1.46 by root, Sat Nov 3 10:37:28 2007 UTC

25 *stash_idle, 25 *stash_idle,
26 *stash_prepare, 26 *stash_prepare,
27 *stash_check, 27 *stash_check,
28 *stash_child; 28 *stash_child;
29 29
30#ifndef SIG_SIZE
31/* kudos to Slaven Rezic for the idea */
32static char sig_size [] = { SIG_NUM };
33# define SIG_SIZE (sizeof (sig_size) + 1)
34#endif
35
30static int 36static int
31sv_signum (SV *sig) 37sv_signum (SV *sig)
32{ 38{
33 int signum; 39 int signum;
34 40
131 137
132 PUSHMARK (SP); 138 PUSHMARK (SP);
133 EXTEND (SP, 2); 139 EXTEND (SP, 2);
134 PUSHs (sv_self); 140 PUSHs (sv_self);
135 PUSHs (sv_events); 141 PUSHs (sv_events);
136
137 if (revents & EV_CHILD)
138 XPUSHs (sv_status = newSViv (((struct ev_child *)w)->status));
139 142
140 PUTBACK; 143 PUTBACK;
141 call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); 144 call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL);
142 SP = PL_stack_base + mark; PUTBACK; 145 SP = PL_stack_base + mark; PUTBACK;
143 146
251 254
252 const_iv (EV, METHOD_AUTO) 255 const_iv (EV, METHOD_AUTO)
253 const_iv (EV, METHOD_SELECT) 256 const_iv (EV, METHOD_SELECT)
254 const_iv (EV, METHOD_POLL) 257 const_iv (EV, METHOD_POLL)
255 const_iv (EV, METHOD_EPOLL) 258 const_iv (EV, METHOD_EPOLL)
259 const_iv (EV, METHOD_KQUEUE)
260 const_iv (EV, METHOD_DEVPOLL)
261 const_iv (EV, METHOD_PORT)
256 const_iv (EV, METHOD_ANY) 262 const_iv (EV, METHOD_ANY)
257 }; 263 };
258 264
259 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 265 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
260 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 266 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
321 OUTPUT: 327 OUTPUT:
322 RETVAL 328 RETVAL
323 329
324NV ev_time () 330NV ev_time ()
325 331
326void ev_init (int methods = EVMETHOD_AUTO) 332int ev_init (int methods = EVMETHOD_AUTO)
327 333
328void ev_loop (int flags = 0) 334void ev_loop (int flags = 0)
329 335
330void ev_loop_done (int value = 1) 336void ev_loop_done (int value = 1)
331 CODE: 337 CODE:
413 419
414struct ev_child *child (int pid, SV *cb) 420struct ev_child *child (int pid, SV *cb)
415 ALIAS: 421 ALIAS:
416 check_ns = 1 422 check_ns = 1
417 CODE: 423 CODE:
418 RETVAL = e_new (sizeof (struct ev_check), cb); 424 RETVAL = e_new (sizeof (struct ev_child), cb);
419 ev_child_set (RETVAL, pid); 425 ev_child_set (RETVAL, pid);
420 if (!ix) ev_child_start (RETVAL); 426 if (!ix) ev_child_start (RETVAL);
421 OUTPUT: 427 OUTPUT:
422 RETVAL 428 RETVAL
423 429
710} 716}
711 OUTPUT: 717 OUTPUT:
712 RETVAL 718 RETVAL
713 719
714 720
715int status (struct ev_child *w) 721int rstatus (struct ev_child *w)
722 ALIAS:
723 rpid = 1
716 CODE: 724 CODE:
717 RETVAL = w->status; 725 RETVAL = ix ? w->rpid : w->rstatus;
718 OUTPUT: 726 OUTPUT:
719 RETVAL 727 RETVAL
720 728
721MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ 729MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_
722 730

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines