… | |
… | |
73 | SvPOK_only (self); |
73 | SvPOK_only (self); |
74 | SvCUR_set (self, size); |
74 | SvCUR_set (self, size); |
75 | |
75 | |
76 | w = (struct ev_watcher *)SvPVX (self); |
76 | w = (struct ev_watcher *)SvPVX (self); |
77 | |
77 | |
78 | evw_init (w, e_cb); |
78 | ev_watcher_init (w, e_cb); |
79 | |
79 | |
80 | w->fh = 0; |
80 | w->fh = 0; |
81 | w->cb_sv = newSVsv (cb_sv); |
81 | w->cb_sv = newSVsv (cb_sv); |
82 | w->self = self; |
82 | w->self = self; |
83 | |
83 | |
… | |
… | |
104 | static void |
104 | static void |
105 | e_cb (struct ev_watcher *w, int revents) |
105 | e_cb (struct ev_watcher *w, int revents) |
106 | { |
106 | { |
107 | dSP; |
107 | dSP; |
108 | I32 mark = SP - PL_stack_base; |
108 | I32 mark = SP - PL_stack_base; |
109 | SV *sv_self, *sv_events; |
109 | SV *sv_self, *sv_events, *sv_status = 0; |
110 | static SV *sv_events_cache; |
110 | static SV *sv_events_cache; |
111 | |
111 | |
112 | sv_self = newRV_inc (w->self); /* w->self MUST be blessed by now */ |
112 | sv_self = newRV_inc (w->self); /* w->self MUST be blessed by now */ |
113 | |
113 | |
114 | if (sv_events_cache) |
114 | if (sv_events_cache) |
… | |
… | |
121 | |
121 | |
122 | PUSHMARK (SP); |
122 | PUSHMARK (SP); |
123 | EXTEND (SP, 2); |
123 | EXTEND (SP, 2); |
124 | PUSHs (sv_self); |
124 | PUSHs (sv_self); |
125 | PUSHs (sv_events); |
125 | PUSHs (sv_events); |
|
|
126 | |
|
|
127 | if (revents & EV_CHILD) |
|
|
128 | XPUSHs (sv_status = newSViv (((struct ev_child *)w)->status)); |
|
|
129 | |
126 | PUTBACK; |
130 | PUTBACK; |
127 | call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); |
131 | call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); |
128 | SP = PL_stack_base + mark; PUTBACK; |
132 | SP = PL_stack_base + mark; PUTBACK; |
129 | |
133 | |
130 | SvREFCNT_dec (sv_self); |
134 | SvREFCNT_dec (sv_self); |
|
|
135 | SvREFCNT_dec (sv_status); |
131 | |
136 | |
132 | if (sv_events_cache) |
137 | if (sv_events_cache) |
133 | SvREFCNT_dec (sv_events); |
138 | SvREFCNT_dec (sv_events); |
134 | else |
139 | else |
135 | sv_events_cache = sv_events; |
140 | sv_events_cache = sv_events; |
… | |
… | |
237 | |
242 | |
238 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
243 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
239 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
244 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
240 | |
245 | |
241 | stash_watcher = gv_stashpv ("EV::Watcher" , 1); |
246 | stash_watcher = gv_stashpv ("EV::Watcher" , 1); |
242 | stash_io = gv_stashpv ("EV::IO" , 1); |
247 | stash_io = gv_stashpv ("EV::Io" , 1); |
243 | stash_time = gv_stashpv ("EV::Time" , 1); |
248 | stash_time = gv_stashpv ("EV::Time" , 1); |
244 | stash_timer = gv_stashpv ("EV::Timer" , 1); |
249 | stash_timer = gv_stashpv ("EV::Timer" , 1); |
245 | stash_periodic = gv_stashpv ("EV::Periodic", 1); |
250 | stash_periodic = gv_stashpv ("EV::Periodic", 1); |
246 | stash_signal = gv_stashpv ("EV::Signal" , 1); |
251 | stash_signal = gv_stashpv ("EV::Signal" , 1); |
247 | stash_idle = gv_stashpv ("EV::Idle" , 1); |
252 | stash_idle = gv_stashpv ("EV::Idle" , 1); |
… | |
… | |
262 | evapi.method = &ev_method; |
267 | evapi.method = &ev_method; |
263 | evapi.loop_done = &ev_loop_done; |
268 | evapi.loop_done = &ev_loop_done; |
264 | evapi.time = ev_time; |
269 | evapi.time = ev_time; |
265 | evapi.loop = ev_loop; |
270 | evapi.loop = ev_loop; |
266 | evapi.once = ev_once; |
271 | evapi.once = ev_once; |
267 | evapi.io_start = evio_start; |
272 | evapi.io_start = ev_io_start; |
268 | evapi.io_stop = evio_stop; |
273 | evapi.io_stop = ev_io_stop; |
269 | evapi.timer_start = evtimer_start; |
274 | evapi.timer_start = ev_timer_start; |
270 | evapi.timer_stop = evtimer_stop; |
275 | evapi.timer_stop = ev_timer_stop; |
271 | evapi.timer_again = evtimer_again; |
276 | evapi.timer_again = ev_timer_again; |
272 | evapi.periodic_start = evperiodic_start; |
277 | evapi.periodic_start = ev_periodic_start; |
273 | evapi.periodic_stop = evperiodic_stop; |
278 | evapi.periodic_stop = ev_periodic_stop; |
274 | evapi.signal_start = evsignal_start; |
279 | evapi.signal_start = ev_signal_start; |
275 | evapi.signal_stop = evsignal_stop; |
280 | evapi.signal_stop = ev_signal_stop; |
276 | evapi.idle_start = evidle_start; |
281 | evapi.idle_start = ev_idle_start; |
277 | evapi.idle_stop = evidle_stop; |
282 | evapi.idle_stop = ev_idle_stop; |
278 | evapi.prepare_start = evprepare_start; |
283 | evapi.prepare_start = ev_prepare_start; |
279 | evapi.prepare_stop = evprepare_stop; |
284 | evapi.prepare_stop = ev_prepare_stop; |
280 | evapi.check_start = evcheck_start; |
285 | evapi.check_start = ev_check_start; |
281 | evapi.check_stop = evcheck_stop; |
286 | evapi.check_stop = ev_check_stop; |
|
|
287 | evapi.child_start = ev_child_start; |
|
|
288 | evapi.child_stop = ev_child_stop; |
282 | |
289 | |
283 | sv_setiv (sv, (IV)&evapi); |
290 | sv_setiv (sv, (IV)&evapi); |
284 | SvREADONLY_on (sv); |
291 | SvREADONLY_on (sv); |
285 | } |
292 | } |
286 | } |
293 | } |
… | |
… | |
311 | ALIAS: |
318 | ALIAS: |
312 | io_ns = 1 |
319 | io_ns = 1 |
313 | CODE: |
320 | CODE: |
314 | RETVAL = e_new (sizeof (struct ev_io), cb); |
321 | RETVAL = e_new (sizeof (struct ev_io), cb); |
315 | RETVAL->fh = newSVsv (fh); |
322 | RETVAL->fh = newSVsv (fh); |
316 | evio_set (RETVAL, sv_fileno (RETVAL->fh), events); |
323 | ev_io_set (RETVAL, sv_fileno (RETVAL->fh), events); |
317 | if (!ix) evio_start (RETVAL); |
324 | if (!ix) ev_io_start (RETVAL); |
318 | OUTPUT: |
325 | OUTPUT: |
319 | RETVAL |
326 | RETVAL |
320 | |
327 | |
321 | struct ev_timer *timer (NV after, NV repeat, SV *cb) |
328 | struct ev_timer *timer (NV after, NV repeat, SV *cb) |
322 | ALIAS: |
329 | ALIAS: |
323 | timer_ns = 1 |
330 | timer_ns = 1 |
324 | INIT: |
331 | INIT: |
325 | CHECK_REPEAT (repeat); |
332 | CHECK_REPEAT (repeat); |
326 | CODE: |
333 | CODE: |
327 | RETVAL = e_new (sizeof (struct ev_timer), cb); |
334 | RETVAL = e_new (sizeof (struct ev_timer), cb); |
328 | evtimer_set (RETVAL, after, repeat); |
335 | ev_timer_set (RETVAL, after, repeat); |
329 | if (!ix) evtimer_start (RETVAL); |
336 | if (!ix) ev_timer_start (RETVAL); |
330 | OUTPUT: |
337 | OUTPUT: |
331 | RETVAL |
338 | RETVAL |
332 | |
339 | |
333 | struct ev_periodic *periodic (NV at, NV interval, SV *cb) |
340 | struct ev_periodic *periodic (NV at, NV interval, SV *cb) |
334 | ALIAS: |
341 | ALIAS: |
335 | periodic_ns = 1 |
342 | periodic_ns = 1 |
336 | INIT: |
343 | INIT: |
337 | CHECK_REPEAT (interval); |
344 | CHECK_REPEAT (interval); |
338 | CODE: |
345 | CODE: |
339 | RETVAL = e_new (sizeof (struct ev_periodic), cb); |
346 | RETVAL = e_new (sizeof (struct ev_periodic), cb); |
340 | evperiodic_set (RETVAL, at, interval); |
347 | ev_periodic_set (RETVAL, at, interval); |
341 | if (!ix) evperiodic_start (RETVAL); |
348 | if (!ix) ev_periodic_start (RETVAL); |
342 | OUTPUT: |
349 | OUTPUT: |
343 | RETVAL |
350 | RETVAL |
344 | |
351 | |
345 | struct ev_signal *signal (Signal signum, SV *cb) |
352 | struct ev_signal *signal (Signal signum, SV *cb) |
346 | ALIAS: |
353 | ALIAS: |
347 | signal_ns = 1 |
354 | signal_ns = 1 |
348 | CODE: |
355 | CODE: |
349 | RETVAL = e_new (sizeof (struct ev_signal), cb); |
356 | RETVAL = e_new (sizeof (struct ev_signal), cb); |
350 | evsignal_set (RETVAL, signum); |
357 | ev_signal_set (RETVAL, signum); |
351 | if (!ix) evsignal_start (RETVAL); |
358 | if (!ix) ev_signal_start (RETVAL); |
352 | OUTPUT: |
359 | OUTPUT: |
353 | RETVAL |
360 | RETVAL |
354 | |
361 | |
355 | struct ev_idle *idle (SV *cb) |
362 | struct ev_idle *idle (SV *cb) |
356 | ALIAS: |
363 | ALIAS: |
357 | idle_ns = 1 |
364 | idle_ns = 1 |
358 | CODE: |
365 | CODE: |
359 | RETVAL = e_new (sizeof (struct ev_idle), cb); |
366 | RETVAL = e_new (sizeof (struct ev_idle), cb); |
360 | evidle_set (RETVAL); |
367 | ev_idle_set (RETVAL); |
361 | if (!ix) evidle_start (RETVAL); |
368 | if (!ix) ev_idle_start (RETVAL); |
362 | OUTPUT: |
369 | OUTPUT: |
363 | RETVAL |
370 | RETVAL |
364 | |
371 | |
365 | struct ev_prepare *prepare (SV *cb) |
372 | struct ev_prepare *prepare (SV *cb) |
366 | ALIAS: |
373 | ALIAS: |
367 | prepare_ns = 1 |
374 | prepare_ns = 1 |
368 | CODE: |
375 | CODE: |
369 | RETVAL = e_new (sizeof (struct ev_prepare), cb); |
376 | RETVAL = e_new (sizeof (struct ev_prepare), cb); |
370 | evprepare_set (RETVAL); |
377 | ev_prepare_set (RETVAL); |
371 | if (!ix) evprepare_start (RETVAL); |
378 | if (!ix) ev_prepare_start (RETVAL); |
372 | OUTPUT: |
379 | OUTPUT: |
373 | RETVAL |
380 | RETVAL |
374 | |
381 | |
375 | struct ev_check *check (SV *cb) |
382 | struct ev_check *check (SV *cb) |
376 | ALIAS: |
383 | ALIAS: |
377 | check_ns = 1 |
384 | check_ns = 1 |
378 | CODE: |
385 | CODE: |
379 | RETVAL = e_new (sizeof (struct ev_check), cb); |
386 | RETVAL = e_new (sizeof (struct ev_check), cb); |
380 | evcheck_set (RETVAL); |
387 | ev_check_set (RETVAL); |
381 | if (!ix) evcheck_start (RETVAL); |
388 | if (!ix) ev_check_start (RETVAL); |
382 | OUTPUT: |
389 | OUTPUT: |
383 | RETVAL |
390 | RETVAL |
384 | |
391 | |
385 | struct ev_child *child (SV *cb, int pid) |
392 | struct ev_child *child (int pid, SV *cb) |
386 | ALIAS: |
393 | ALIAS: |
387 | check_ns = 1 |
394 | check_ns = 1 |
388 | CODE: |
395 | CODE: |
389 | RETVAL = e_new (sizeof (struct ev_check), cb); |
396 | RETVAL = e_new (sizeof (struct ev_check), cb); |
390 | evchild (RETVAL, pid); |
397 | ev_child_set (RETVAL, pid); |
391 | if (!ix) evchild_start (RETVAL); |
398 | if (!ix) ev_child_start (RETVAL); |
392 | OUTPUT: |
399 | OUTPUT: |
393 | RETVAL |
400 | RETVAL |
394 | |
401 | |
395 | |
402 | |
396 | PROTOTYPES: DISABLE |
403 | PROTOTYPES: DISABLE |
… | |
… | |
408 | sv_setsv (w->cb_sv, new_cb); |
415 | sv_setsv (w->cb_sv, new_cb); |
409 | } |
416 | } |
410 | OUTPUT: |
417 | OUTPUT: |
411 | RETVAL |
418 | RETVAL |
412 | |
419 | |
|
|
420 | void trigger (struct ev_watcher *w, int revents = EV_NONE) |
|
|
421 | CODE: |
|
|
422 | w->cb (w, revents); |
|
|
423 | |
413 | MODULE = EV PACKAGE = EV::IO PREFIX = evio_ |
424 | MODULE = EV PACKAGE = EV::Io PREFIX = ev_io_ |
414 | |
425 | |
415 | void evio_start (struct ev_io *w) |
426 | void ev_io_start (struct ev_io *w) |
416 | |
427 | |
417 | void evio_stop (struct ev_io *w) |
428 | void ev_io_stop (struct ev_io *w) |
|
|
429 | |
|
|
430 | void DESTROY (struct ev_io *w) |
|
|
431 | CODE: |
|
|
432 | ev_io_stop (w); |
418 | |
433 | |
419 | void set (struct ev_io *w, SV *fh, int events) |
434 | void set (struct ev_io *w, SV *fh, int events) |
420 | CODE: |
435 | CODE: |
421 | { |
436 | { |
422 | int active = w->active; |
437 | int active = w->active; |
423 | if (active) evio_stop (w); |
438 | if (active) ev_io_stop (w); |
424 | |
439 | |
425 | sv_setsv (w->fh, fh); |
440 | sv_setsv (w->fh, fh); |
426 | evio_set (w, sv_fileno (w->fh), events); |
441 | ev_io_set (w, sv_fileno (w->fh), events); |
427 | |
442 | |
428 | if (active) evio_start (w); |
443 | if (active) ev_io_start (w); |
429 | } |
444 | } |
430 | |
445 | |
431 | SV *fh (struct ev_io *w, SV *new_fh = 0) |
446 | SV *fh (struct ev_io *w, SV *new_fh = 0) |
432 | CODE: |
447 | CODE: |
433 | { |
448 | { |
434 | RETVAL = newSVsv (w->fh); |
449 | RETVAL = newSVsv (w->fh); |
435 | |
450 | |
436 | if (items > 1) |
451 | if (items > 1) |
437 | { |
452 | { |
438 | int active = w->active; |
453 | int active = w->active; |
439 | if (active) evio_stop (w); |
454 | if (active) ev_io_stop (w); |
440 | |
455 | |
441 | sv_setsv (w->fh, new_fh); |
456 | sv_setsv (w->fh, new_fh); |
442 | evio_set (w, sv_fileno (w->fh), w->events); |
457 | ev_io_set (w, sv_fileno (w->fh), w->events); |
443 | |
458 | |
444 | if (active) evio_start (w); |
459 | if (active) ev_io_start (w); |
445 | } |
460 | } |
446 | } |
461 | } |
447 | OUTPUT: |
462 | OUTPUT: |
448 | RETVAL |
463 | RETVAL |
449 | |
464 | |
… | |
… | |
453 | RETVAL = w->events; |
468 | RETVAL = w->events; |
454 | |
469 | |
455 | if (items > 1) |
470 | if (items > 1) |
456 | { |
471 | { |
457 | int active = w->active; |
472 | int active = w->active; |
458 | if (active) evio_stop (w); |
473 | if (active) ev_io_stop (w); |
459 | |
474 | |
460 | evio_set (w, w->fd, new_events); |
475 | ev_io_set (w, w->fd, new_events); |
461 | |
476 | |
462 | if (active) evio_start (w); |
477 | if (active) ev_io_start (w); |
463 | } |
478 | } |
464 | } |
479 | } |
465 | OUTPUT: |
480 | OUTPUT: |
466 | RETVAL |
481 | RETVAL |
467 | |
482 | |
468 | MODULE = EV PACKAGE = EV::Signal PREFIX = evsignal_ |
483 | MODULE = EV PACKAGE = EV::Signal PREFIX = ev_signal_ |
469 | |
484 | |
470 | void evsignal_start (struct ev_signal *w) |
485 | void ev_signal_start (struct ev_signal *w) |
471 | |
486 | |
472 | void evsignal_stop (struct ev_signal *w) |
487 | void ev_signal_stop (struct ev_signal *w) |
|
|
488 | |
|
|
489 | void DESTROY (struct ev_signal *w) |
|
|
490 | CODE: |
|
|
491 | ev_signal_stop (w); |
473 | |
492 | |
474 | void set (struct ev_signal *w, SV *signal = 0) |
493 | void set (struct ev_signal *w, SV *signal = 0) |
475 | CODE: |
494 | CODE: |
476 | { |
495 | { |
477 | Signal signum = sv_signum (signal); /* may croak here */ |
496 | Signal signum = sv_signum (signal); /* may croak here */ |
478 | int active = w->active; |
497 | int active = w->active; |
479 | |
498 | |
480 | if (active) evsignal_stop (w); |
499 | if (active) ev_signal_stop (w); |
481 | evsignal_set (w, signum); |
500 | ev_signal_set (w, signum); |
482 | if (active) evsignal_start (w); |
501 | if (active) ev_signal_start (w); |
483 | } |
502 | } |
484 | |
503 | |
485 | MODULE = EV PACKAGE = EV::Time |
504 | MODULE = EV PACKAGE = EV::Time |
486 | |
505 | |
487 | MODULE = EV PACKAGE = EV::Timer PREFIX = evtimer_ |
506 | MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_ |
488 | |
507 | |
489 | void evtimer_start (struct ev_timer *w) |
508 | void ev_timer_start (struct ev_timer *w) |
490 | INIT: |
509 | INIT: |
491 | CHECK_REPEAT (w->repeat); |
510 | CHECK_REPEAT (w->repeat); |
492 | |
511 | |
493 | void evtimer_stop (struct ev_timer *w) |
512 | void ev_timer_stop (struct ev_timer *w) |
494 | |
513 | |
495 | void evtimer_again (struct ev_timer *w) |
514 | void ev_timer_again (struct ev_timer *w) |
496 | INIT: |
515 | INIT: |
497 | CHECK_REPEAT (w->repeat); |
516 | CHECK_REPEAT (w->repeat); |
|
|
517 | |
|
|
518 | void DESTROY (struct ev_timer *w) |
|
|
519 | CODE: |
|
|
520 | ev_timer_stop (w); |
498 | |
521 | |
499 | void set (struct ev_timer *w, NV after, NV repeat = 0.) |
522 | void set (struct ev_timer *w, NV after, NV repeat = 0.) |
500 | INIT: |
523 | INIT: |
501 | CHECK_REPEAT (repeat); |
524 | CHECK_REPEAT (repeat); |
502 | CODE: |
525 | CODE: |
503 | { |
526 | { |
504 | int active = w->active; |
527 | int active = w->active; |
505 | if (active) evtimer_stop (w); |
528 | if (active) ev_timer_stop (w); |
506 | evtimer_set (w, after, repeat); |
529 | ev_timer_set (w, after, repeat); |
507 | if (active) evtimer_start (w); |
530 | if (active) ev_timer_start (w); |
508 | } |
531 | } |
509 | |
532 | |
510 | MODULE = EV PACKAGE = EV::Periodic PREFIX = evperiodic_ |
533 | MODULE = EV PACKAGE = EV::Periodic PREFIX = ev_periodic_ |
511 | |
534 | |
512 | void evperiodic_start (struct ev_periodic *w) |
535 | void ev_periodic_start (struct ev_periodic *w) |
513 | INIT: |
536 | INIT: |
514 | CHECK_REPEAT (w->interval); |
537 | CHECK_REPEAT (w->interval); |
515 | |
538 | |
516 | void evperiodic_stop (struct ev_periodic *w) |
539 | void ev_periodic_stop (struct ev_periodic *w) |
|
|
540 | |
|
|
541 | void DESTROY (struct ev_periodic *w) |
|
|
542 | CODE: |
|
|
543 | ev_periodic_stop (w); |
517 | |
544 | |
518 | void set (struct ev_periodic *w, NV at, NV interval = 0.) |
545 | void set (struct ev_periodic *w, NV at, NV interval = 0.) |
519 | INIT: |
546 | INIT: |
520 | CHECK_REPEAT (interval); |
547 | CHECK_REPEAT (interval); |
521 | CODE: |
548 | CODE: |
522 | { |
549 | { |
523 | int active = w->active; |
550 | int active = w->active; |
524 | if (active) evperiodic_stop (w); |
551 | if (active) ev_periodic_stop (w); |
525 | evperiodic_set (w, at, interval); |
552 | ev_periodic_set (w, at, interval); |
526 | if (active) evperiodic_start (w); |
553 | if (active) ev_periodic_start (w); |
527 | } |
554 | } |
528 | |
555 | |
529 | MODULE = EV PACKAGE = EV::Idle PREFIX = evidle_ |
556 | MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_ |
530 | |
557 | |
531 | void evidle_start (struct ev_idle *w) |
558 | void ev_idle_start (struct ev_idle *w) |
532 | |
559 | |
533 | void evidle_stop (struct ev_idle *w) |
560 | void ev_idle_stop (struct ev_idle *w) |
534 | |
561 | |
|
|
562 | void DESTROY (struct ev_idle *w) |
|
|
563 | CODE: |
|
|
564 | ev_idle_stop (w); |
|
|
565 | |
535 | MODULE = EV PACKAGE = EV::Prepare PREFIX = evcheck_ |
566 | MODULE = EV PACKAGE = EV::Prepare PREFIX = ev_check_ |
536 | |
567 | |
537 | void evprepare_start (struct ev_prepare *w) |
568 | void ev_prepare_start (struct ev_prepare *w) |
538 | |
569 | |
539 | void evprepare_stop (struct ev_prepare *w) |
570 | void ev_prepare_stop (struct ev_prepare *w) |
540 | |
571 | |
|
|
572 | void DESTROY (struct ev_prepare *w) |
|
|
573 | CODE: |
|
|
574 | ev_prepare_stop (w); |
|
|
575 | |
541 | MODULE = EV PACKAGE = EV::Check PREFIX = evcheck_ |
576 | MODULE = EV PACKAGE = EV::Check PREFIX = ev_check_ |
542 | |
577 | |
543 | void evcheck_start (struct ev_check *w) |
578 | void ev_check_start (struct ev_check *w) |
544 | |
579 | |
545 | void evcheck_stop (struct ev_check *w) |
580 | void ev_check_stop (struct ev_check *w) |
546 | |
581 | |
|
|
582 | void DESTROY (struct ev_check *w) |
|
|
583 | CODE: |
|
|
584 | ev_check_stop (w); |
|
|
585 | |
547 | MODULE = EV PACKAGE = EV::Child PREFIX = evchild_ |
586 | MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_ |
548 | |
587 | |
549 | void evchild_start (struct ev_child *w) |
588 | void ev_child_start (struct ev_child *w) |
550 | |
589 | |
551 | void evchild_stop (struct ev_child *w) |
590 | void ev_child_stop (struct ev_child *w) |
|
|
591 | |
|
|
592 | void DESTROY (struct ev_child *w) |
|
|
593 | CODE: |
|
|
594 | ev_child_stop (w); |
552 | |
595 | |
553 | void set (struct ev_child *w, int pid) |
596 | void set (struct ev_child *w, int pid) |
554 | CODE: |
597 | CODE: |
555 | { |
598 | { |
556 | int active = w->active; |
599 | int active = w->active; |
557 | if (active) evchild_stop (w); |
600 | if (active) ev_child_stop (w); |
558 | evchild_set (w, pid); |
601 | ev_child_set (w, pid); |
559 | if (active) evchild_start (w); |
602 | if (active) ev_child_start (w); |
560 | } |
603 | } |
|
|
604 | |
|
|
605 | int status (struct ev_child *w) |
|
|
606 | CODE: |
|
|
607 | RETVAL = w->status; |
|
|
608 | OUTPUT: |
|
|
609 | RETVAL |
561 | |
610 | |
562 | #if 0 |
611 | #if 0 |
563 | |
612 | |
564 | MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ |
613 | MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ |
565 | |
614 | |