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

Comparing EV/EV.xs (file contents):
Revision 1.31 by root, Thu Nov 1 11:11:21 2007 UTC vs.
Revision 1.59 by root, Thu Nov 8 00:44:17 2007 UTC

2#include "perl.h" 2#include "perl.h"
3#include "XSUB.h" 3#include "XSUB.h"
4 4
5/*#include <netinet/in.h>*/ 5/*#include <netinet/in.h>*/
6 6
7#define TIMEOUT_NONE HUGE_VAL
8#define EV_USE_EPOLL 1
9
10#define EV_PROTOTYPES 1 7#define EV_PROTOTYPES 1
11#include "EV/EVAPI.h" 8#include "EV/EVAPI.h"
12 9
10/* fix perl api breakage */
11#undef signal
12#undef sigaction
13
14#define EV_SELECT_USE_WIN32_HANDLES 0
15#define EV_SELECT_USE_FD_SET 0
16/* due to bugs in OS X we have to use libev/ explicitly here */
13#include "libev/ev.c" 17#include "libev/ev.c"
18#include "event.c"
19
20#ifndef WIN32
21#define DNS_USE_GETTIMEOFDAY_FOR_ID 1
22#if !defined (WIN32) && !defined(__CYGWIN__)
23# define HAVE_STRUCT_IN6_ADDR 1
24#endif
25#undef HAVE_STRTOK_R
26#undef strtok_r
27#define strtok_r fake_strtok_r
28#include "evdns.c"
29#endif
30
31#ifndef WIN32
32# include <pthread.h>
33#endif
14 34
15typedef int Signal; 35typedef int Signal;
16 36
17static struct EVAPI evapi; 37static struct EVAPI evapi;
18 38
25 *stash_idle, 45 *stash_idle,
26 *stash_prepare, 46 *stash_prepare,
27 *stash_check, 47 *stash_check,
28 *stash_child; 48 *stash_child;
29 49
50#ifndef SIG_SIZE
51/* kudos to Slaven Rezic for the idea */
52static char sig_size [] = { SIG_NUM };
53# define SIG_SIZE (sizeof (sig_size) + 1)
54#endif
55
30static int 56static int
31sv_signum (SV *sig) 57sv_signum (SV *sig)
32{ 58{
33 int signum; 59 int signum;
34 60
81 w->fh = 0; 107 w->fh = 0;
82 w->cb_sv = newSVsv (cb_sv); 108 w->cb_sv = newSVsv (cb_sv);
83 w->self = self; 109 w->self = self;
84 110
85 return (void *)w; 111 return (void *)w;
112}
113
114static void
115e_destroy (void *w_)
116{
117 struct ev_watcher *w = (struct ev_watcher *)w_;
118
119 SvREFCNT_dec (w->fh ); w->fh = 0;
120 SvREFCNT_dec (w->cb_sv); w->cb_sv = 0;
86} 121}
87 122
88static SV * 123static SV *
89e_bless (struct ev_watcher *w, HV *stash) 124e_bless (struct ev_watcher *w, HV *stash)
90{ 125{
108 dSP; 143 dSP;
109 I32 mark = SP - PL_stack_base; 144 I32 mark = SP - PL_stack_base;
110 SV *sv_self, *sv_events, *sv_status = 0; 145 SV *sv_self, *sv_events, *sv_status = 0;
111 static SV *sv_events_cache; 146 static SV *sv_events_cache;
112 147
113 fprintf (stderr, "e_cb %p,%x\n", w, revents);//D
114
115 sv_self = newRV_inc (w->self); /* w->self MUST be blessed by now */ 148 sv_self = newRV_inc (w->self); /* w->self MUST be blessed by now */
116 149
117 if (sv_events_cache) 150 if (sv_events_cache)
118 { 151 {
119 sv_events = sv_events_cache; sv_events_cache = 0; 152 sv_events = sv_events_cache; sv_events_cache = 0;
125 PUSHMARK (SP); 158 PUSHMARK (SP);
126 EXTEND (SP, 2); 159 EXTEND (SP, 2);
127 PUSHs (sv_self); 160 PUSHs (sv_self);
128 PUSHs (sv_events); 161 PUSHs (sv_events);
129 162
130 if (revents & EV_CHILD)
131 XPUSHs (sv_status = newSViv (((struct ev_child *)w)->status));
132
133 PUTBACK; 163 PUTBACK;
134 call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); 164 call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL);
135 SP = PL_stack_base + mark; PUTBACK; 165 SP = PL_stack_base + mark; PUTBACK;
136 166
137 SvREFCNT_dec (sv_self); 167 SvREFCNT_dec (sv_self);
149 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); 179 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR);
150 SP = PL_stack_base + mark; PUTBACK; 180 SP = PL_stack_base + mark; PUTBACK;
151 } 181 }
152} 182}
153 183
154#if 0 184static ev_tstamp
185e_periodic_cb (struct ev_periodic *w, ev_tstamp now)
186{
187 ev_tstamp retval;
188 int count;
189 dSP;
190
191 ENTER;
192 SAVETMPS;
193
194 PUSHMARK (SP);
195 EXTEND (SP, 2);
196 PUSHs (newRV_inc (w->self)); /* w->self MUST be blessed by now */
197 PUSHs (newSVnv (now));
198
199 PUTBACK;
200 count = call_sv (w->fh, G_SCALAR | G_EVAL);
201 SPAGAIN;
202
203 if (SvTRUE (ERRSV))
204 {
205 PUSHMARK (SP);
206 PUTBACK;
207 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR);
208 SPAGAIN;
209 }
210
211 if (count > 0)
212 {
213 retval = SvNV (TOPs);
214
215 if (retval < now)
216 retval = now;
217 }
218 else
219 retval = now;
220
221 FREETMPS;
222 LEAVE;
223
224 return retval;
225}
226
155///////////////////////////////////////////////////////////////////////////// 227/////////////////////////////////////////////////////////////////////////////
156// DNS 228// DNS
157 229
230#ifndef WIN32
158static void 231static void
159dns_cb (int result, char type, int count, int ttl, void *addresses, void *arg) 232dns_cb (int result, char type, int count, int ttl, void *addresses, void *arg)
160{ 233{
161 dSP; 234 dSP;
162 SV *cb = (SV *)arg; 235 SV *cb = (SV *)arg;
218 291
219PROTOTYPES: ENABLE 292PROTOTYPES: ENABLE
220 293
221BOOT: 294BOOT:
222{ 295{
223 int i;
224 HV *stash = gv_stashpv ("EV", 1); 296 HV *stash = gv_stashpv ("EV", 1);
225 297
226 static const struct { 298 static const struct {
227 const char *name; 299 const char *name;
228 IV iv; 300 IV iv;
229 } *civ, const_iv[] = { 301 } *civ, const_iv[] = {
230# define const_iv(pfx, name) { # name, (IV) pfx ## name }, 302# define const_iv(pfx, name) { # name, (IV) pfx ## name },
303 const_iv (EV_, MINPRI)
304 const_iv (EV_, MAXPRI)
305
231 const_iv (EV_, UNDEF) 306 const_iv (EV_, UNDEF)
232 const_iv (EV_, NONE) 307 const_iv (EV_, NONE)
233 const_iv (EV_, TIMEOUT) 308 const_iv (EV_, TIMEOUT)
234 const_iv (EV_, READ) 309 const_iv (EV_, READ)
235 const_iv (EV_, WRITE) 310 const_iv (EV_, WRITE)
239 const_iv (EV_, ERROR) 314 const_iv (EV_, ERROR)
240 315
241 const_iv (EV, LOOP_ONESHOT) 316 const_iv (EV, LOOP_ONESHOT)
242 const_iv (EV, LOOP_NONBLOCK) 317 const_iv (EV, LOOP_NONBLOCK)
243 318
244 const_iv (EV, METHOD_NONE) 319 const_iv (EV, METHOD_AUTO)
245 const_iv (EV, METHOD_SELECT) 320 const_iv (EV, METHOD_SELECT)
321 const_iv (EV, METHOD_POLL)
246 const_iv (EV, METHOD_EPOLL) 322 const_iv (EV, METHOD_EPOLL)
323 const_iv (EV, METHOD_KQUEUE)
324 const_iv (EV, METHOD_DEVPOLL)
325 const_iv (EV, METHOD_PORT)
326 const_iv (EV, METHOD_ANY)
247 }; 327 };
248 328
249 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 329 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
250 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 330 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
251 331
266 /* the poor man's shared library emulator */ 346 /* the poor man's shared library emulator */
267 evapi.ver = EV_API_VERSION; 347 evapi.ver = EV_API_VERSION;
268 evapi.rev = EV_API_REVISION; 348 evapi.rev = EV_API_REVISION;
269 evapi.sv_fileno = sv_fileno; 349 evapi.sv_fileno = sv_fileno;
270 evapi.sv_signum = sv_signum; 350 evapi.sv_signum = sv_signum;
271 evapi.now = &ev_now; 351 evapi.now = ev_now;
272 evapi.method = &ev_method; 352 evapi.method = ev_method;
273 evapi.loop_done = &ev_loop_done; 353 evapi.unloop = ev_unloop;
274 evapi.time = ev_time; 354 evapi.time = ev_time;
275 evapi.loop = ev_loop; 355 evapi.loop = ev_loop;
276 evapi.once = ev_once; 356 evapi.once = ev_once;
277 evapi.io_start = ev_io_start; 357 evapi.io_start = ev_io_start;
278 evapi.io_stop = ev_io_stop; 358 evapi.io_stop = ev_io_stop;
293 evapi.child_stop = ev_child_stop; 373 evapi.child_stop = ev_child_stop;
294 374
295 sv_setiv (sv, (IV)&evapi); 375 sv_setiv (sv, (IV)&evapi);
296 SvREADONLY_on (sv); 376 SvREADONLY_on (sv);
297 } 377 }
378#ifndef WIN32
379 pthread_atfork (0, 0, ev_default_fork);
380#endif
298} 381}
299 382
300NV ev_now () 383NV ev_now ()
301 CODE:
302 RETVAL = ev_now;
303 OUTPUT:
304 RETVAL
305 384
306int ev_method () 385int ev_method ()
307 CODE:
308 RETVAL = ev_method;
309 OUTPUT:
310 RETVAL
311 386
312NV ev_time () 387NV ev_time ()
313 388
314void ev_init (int flags = 0) 389int ev_default_loop (int methods = EVMETHOD_AUTO)
315 390
316void ev_loop (int flags = 0) 391void ev_loop (int flags = 0)
317 392
318void ev_loop_done (int value = 1) 393void ev_unloop (int how = 1)
319 CODE:
320 ev_loop_done = value;
321 394
322struct ev_io *io (SV *fh, int events, SV *cb) 395struct ev_io *io (SV *fh, int events, SV *cb)
323 ALIAS: 396 ALIAS:
324 io_ns = 1 397 io_ns = 1
325 CODE: 398 CODE:
345 ev_timer_set (RETVAL, after, repeat); 418 ev_timer_set (RETVAL, after, repeat);
346 if (!ix) ev_timer_start (RETVAL); 419 if (!ix) ev_timer_start (RETVAL);
347 OUTPUT: 420 OUTPUT:
348 RETVAL 421 RETVAL
349 422
350struct ev_periodic *periodic (NV at, NV interval, SV *cb) 423SV *periodic (NV at, NV interval, SV *reschedule_cb, SV *cb)
351 ALIAS: 424 ALIAS:
352 periodic_ns = 1 425 periodic_ns = 1
353 INIT: 426 INIT:
354 CHECK_REPEAT (interval); 427 CHECK_REPEAT (interval);
355 CODE: 428 CODE:
429{
430 struct ev_periodic *w;
356 RETVAL = e_new (sizeof (struct ev_periodic), cb); 431 w = e_new (sizeof (struct ev_periodic), cb);
357 ev_periodic_set (RETVAL, at, interval); 432 w->fh = SvOK (reschedule_cb) ? newSVsv (reschedule_cb) : 0;
433 ev_periodic_set (w, at, interval, w->fh ? e_periodic_cb : 0);
434 RETVAL = e_bless ((struct ev_watcher *)w, stash_periodic);
358 if (!ix) ev_periodic_start (RETVAL); 435 if (!ix) ev_periodic_start (w);
436}
359 OUTPUT: 437 OUTPUT:
360 RETVAL 438 RETVAL
361 439
362struct ev_signal *signal (Signal signum, SV *cb) 440struct ev_signal *signal (Signal signum, SV *cb)
363 ALIAS: 441 ALIAS:
401 479
402struct ev_child *child (int pid, SV *cb) 480struct ev_child *child (int pid, SV *cb)
403 ALIAS: 481 ALIAS:
404 check_ns = 1 482 check_ns = 1
405 CODE: 483 CODE:
406 RETVAL = e_new (sizeof (struct ev_check), cb); 484 RETVAL = e_new (sizeof (struct ev_child), cb);
407 ev_child_set (RETVAL, pid); 485 ev_child_set (RETVAL, pid);
408 if (!ix) ev_child_start (RETVAL); 486 if (!ix) ev_child_start (RETVAL);
409 OUTPUT: 487 OUTPUT:
410 RETVAL 488 RETVAL
411 489
429 507
430void trigger (struct ev_watcher *w, int revents = EV_NONE) 508void trigger (struct ev_watcher *w, int revents = EV_NONE)
431 CODE: 509 CODE:
432 w->cb (w, revents); 510 w->cb (w, revents);
433 511
512int priority (struct ev_watcher *w, int new_priority = 0)
513 CODE:
514{
515 RETVAL = w->priority;
516
517 if (items > 1)
518 {
519 int active = ev_is_active (w);
520
521 if (new_priority < EV_MINPRI || new_priority > EV_MAXPRI)
522 croak ("watcher priority out of range, value must be between %d and %d, inclusive", EV_MINPRI, EV_MAXPRI);
523
524 if (active)
525 {
526 /* grrr. */
527 PUSHMARK (SP);
528 XPUSHs (ST (0));
529 call_method ("stop", G_DISCARD | G_VOID);
530 }
531
532 ev_set_priority (w, new_priority);
533
534 if (active)
535 {
536 PUSHMARK (SP);
537 XPUSHs (ST (0));
538 call_method ("start", G_DISCARD | G_VOID);
539 }
540 }
541}
542 OUTPUT:
543 RETVAL
544
434MODULE = EV PACKAGE = EV::Io PREFIX = ev_io_ 545MODULE = EV PACKAGE = EV::Io PREFIX = ev_io_
435 546
436void ev_io_start (struct ev_io *w) 547void ev_io_start (struct ev_io *w)
437 548
438void ev_io_stop (struct ev_io *w) 549void ev_io_stop (struct ev_io *w)
439 550
440void DESTROY (struct ev_io *w) 551void DESTROY (struct ev_io *w)
441 CODE: 552 CODE:
442 ev_io_stop (w); 553 ev_io_stop (w);
554 e_destroy (w);
443 555
444void set (struct ev_io *w, SV *fh, int events) 556void set (struct ev_io *w, SV *fh, int events)
445 CODE: 557 CODE:
446{ 558{
447 int active = w->active; 559 int active = ev_is_active (w);
448 int fd = sv_fileno (fh); 560 int fd = sv_fileno (fh);
449 CHECK_FD (fh, fd); 561 CHECK_FD (fh, fd);
450 562
451 if (active) ev_io_stop (w); 563 if (active) ev_io_stop (w);
452 564
461{ 573{
462 RETVAL = newSVsv (w->fh); 574 RETVAL = newSVsv (w->fh);
463 575
464 if (items > 1) 576 if (items > 1)
465 { 577 {
466 int active = w->active; 578 int active = ev_is_active (w);
467 if (active) ev_io_stop (w); 579 if (active) ev_io_stop (w);
468 580
469 sv_setsv (w->fh, new_fh); 581 sv_setsv (w->fh, new_fh);
470 ev_io_set (w, sv_fileno (w->fh), w->events); 582 ev_io_set (w, sv_fileno (w->fh), w->events);
471 583
473 } 585 }
474} 586}
475 OUTPUT: 587 OUTPUT:
476 RETVAL 588 RETVAL
477 589
478short events (struct ev_io *w, short new_events = EV_UNDEF) 590int events (struct ev_io *w, int new_events = EV_UNDEF)
479 CODE: 591 CODE:
480{ 592{
481 RETVAL = w->events; 593 RETVAL = w->events;
482 594
483 if (items > 1) 595 if (items > 1)
484 { 596 {
485 int active = w->active; 597 int active = ev_is_active (w);
486 if (active) ev_io_stop (w); 598 if (active) ev_io_stop (w);
487 599
488 ev_io_set (w, w->fd, new_events); 600 ev_io_set (w, w->fd, new_events);
489 601
490 if (active) ev_io_start (w); 602 if (active) ev_io_start (w);
500void ev_signal_stop (struct ev_signal *w) 612void ev_signal_stop (struct ev_signal *w)
501 613
502void DESTROY (struct ev_signal *w) 614void DESTROY (struct ev_signal *w)
503 CODE: 615 CODE:
504 ev_signal_stop (w); 616 ev_signal_stop (w);
617 e_destroy (w);
505 618
506void set (struct ev_signal *w, SV *signal = 0) 619void set (struct ev_signal *w, SV *signal)
507 CODE: 620 CODE:
508{ 621{
509 Signal signum = sv_signum (signal); /* may croak here */ 622 Signal signum = sv_signum (signal); /* may croak here */
510 int active = w->active; 623 int active = ev_is_active (w);
511 624
512 if (active) ev_signal_stop (w); 625 if (active) ev_signal_stop (w);
626
513 ev_signal_set (w, signum); 627 ev_signal_set (w, signum);
628
514 if (active) ev_signal_start (w); 629 if (active) ev_signal_start (w);
515} 630}
516 631
517MODULE = EV PACKAGE = EV::Time 632int signal (struct ev_signal *w, SV *new_signal = 0)
633 CODE:
634{
635 RETVAL = w->signum;
636
637 if (items > 1)
638 {
639 Signal signum = sv_signum (new_signal); /* may croak here */
640 int active = ev_is_active (w);
641 if (active) ev_signal_stop (w);
642
643 ev_signal_set (w, signum);
644
645 if (active) ev_signal_start (w);
646 }
647}
648 OUTPUT:
649 RETVAL
518 650
519MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_ 651MODULE = EV PACKAGE = EV::Timer PREFIX = ev_timer_
520 652
521void ev_timer_start (struct ev_timer *w) 653void ev_timer_start (struct ev_timer *w)
522 INIT: 654 INIT:
529 CHECK_REPEAT (w->repeat); 661 CHECK_REPEAT (w->repeat);
530 662
531void DESTROY (struct ev_timer *w) 663void DESTROY (struct ev_timer *w)
532 CODE: 664 CODE:
533 ev_timer_stop (w); 665 ev_timer_stop (w);
666 e_destroy (w);
534 667
535void set (struct ev_timer *w, NV after, NV repeat = 0.) 668void set (struct ev_timer *w, NV after, NV repeat = 0.)
536 INIT: 669 INIT:
537 CHECK_REPEAT (repeat); 670 CHECK_REPEAT (repeat);
538 CODE: 671 CODE:
539{ 672{
540 int active = w->active; 673 int active = ev_is_active (w);
541 if (active) ev_timer_stop (w); 674 if (active) ev_timer_stop (w);
542 ev_timer_set (w, after, repeat); 675 ev_timer_set (w, after, repeat);
543 if (active) ev_timer_start (w); 676 if (active) ev_timer_start (w);
544} 677}
545 678
549 INIT: 682 INIT:
550 CHECK_REPEAT (w->interval); 683 CHECK_REPEAT (w->interval);
551 684
552void ev_periodic_stop (struct ev_periodic *w) 685void ev_periodic_stop (struct ev_periodic *w)
553 686
687void ev_periodic_again (struct ev_periodic *w)
688
554void DESTROY (struct ev_periodic *w) 689void DESTROY (struct ev_periodic *w)
555 CODE: 690 CODE:
556 ev_periodic_stop (w); 691 ev_periodic_stop (w);
692 e_destroy (w);
557 693
558void set (struct ev_periodic *w, NV at, NV interval = 0.) 694void set (struct ev_periodic *w, NV at, NV interval = 0., SV *reschedule_cb = &PL_sv_undef)
559 INIT: 695 INIT:
560 CHECK_REPEAT (interval); 696 CHECK_REPEAT (interval);
561 CODE: 697 CODE:
562{ 698{
563 int active = w->active; 699 int active = ev_is_active (w);
564 if (active) ev_periodic_stop (w); 700 if (active) ev_periodic_stop (w);
701
702 SvREFCNT_dec (w->fh);
703 w->fh = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0;
565 ev_periodic_set (w, at, interval); 704 ev_periodic_set (w, at, interval, w->fh ? e_periodic_cb : 0);
705
566 if (active) ev_periodic_start (w); 706 if (active) ev_periodic_start (w);
567} 707}
568 708
569MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_ 709MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_
570 710
573void ev_idle_stop (struct ev_idle *w) 713void ev_idle_stop (struct ev_idle *w)
574 714
575void DESTROY (struct ev_idle *w) 715void DESTROY (struct ev_idle *w)
576 CODE: 716 CODE:
577 ev_idle_stop (w); 717 ev_idle_stop (w);
718 e_destroy (w);
578 719
579MODULE = EV PACKAGE = EV::Prepare PREFIX = ev_check_ 720MODULE = EV PACKAGE = EV::Prepare PREFIX = ev_check_
580 721
581void ev_prepare_start (struct ev_prepare *w) 722void ev_prepare_start (struct ev_prepare *w)
582 723
583void ev_prepare_stop (struct ev_prepare *w) 724void ev_prepare_stop (struct ev_prepare *w)
584 725
585void DESTROY (struct ev_prepare *w) 726void DESTROY (struct ev_prepare *w)
586 CODE: 727 CODE:
587 ev_prepare_stop (w); 728 ev_prepare_stop (w);
729 e_destroy (w);
588 730
589MODULE = EV PACKAGE = EV::Check PREFIX = ev_check_ 731MODULE = EV PACKAGE = EV::Check PREFIX = ev_check_
590 732
591void ev_check_start (struct ev_check *w) 733void ev_check_start (struct ev_check *w)
592 734
593void ev_check_stop (struct ev_check *w) 735void ev_check_stop (struct ev_check *w)
594 736
595void DESTROY (struct ev_check *w) 737void DESTROY (struct ev_check *w)
596 CODE: 738 CODE:
597 ev_check_stop (w); 739 ev_check_stop (w);
740 e_destroy (w);
598 741
599MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_ 742MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_
600 743
601void ev_child_start (struct ev_child *w) 744void ev_child_start (struct ev_child *w)
602 745
603void ev_child_stop (struct ev_child *w) 746void ev_child_stop (struct ev_child *w)
604 747
605void DESTROY (struct ev_child *w) 748void DESTROY (struct ev_child *w)
606 CODE: 749 CODE:
607 ev_child_stop (w); 750 ev_child_stop (w);
751 e_destroy (w);
608 752
609void set (struct ev_child *w, int pid) 753void set (struct ev_child *w, int pid)
610 CODE: 754 CODE:
611{ 755{
612 int active = w->active; 756 int active = ev_is_active (w);
613 if (active) ev_child_stop (w); 757 if (active) ev_child_stop (w);
758
614 ev_child_set (w, pid); 759 ev_child_set (w, pid);
760
615 if (active) ev_child_start (w); 761 if (active) ev_child_start (w);
616} 762}
617 763
764int pid (struct ev_child *w, int new_pid = 0)
765 CODE:
766{
767 RETVAL = w->pid;
768
769 if (items > 1)
770 {
771 int active = ev_is_active (w);
772 if (active) ev_child_stop (w);
773
774 ev_child_set (w, new_pid);
775
776 if (active) ev_child_start (w);
777 }
778}
779 OUTPUT:
780 RETVAL
781
782
618int status (struct ev_child *w) 783int rstatus (struct ev_child *w)
784 ALIAS:
785 rpid = 1
619 CODE: 786 CODE:
620 RETVAL = w->status; 787 RETVAL = ix ? w->rpid : w->rstatus;
621 OUTPUT: 788 OUTPUT:
622 RETVAL 789 RETVAL
623 790
624#if 0 791#ifndef WIN32
625 792
626MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ 793MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_
627 794
628BOOT: 795BOOT:
629{ 796{
712 879
713void evdns_search_add (char *domain) 880void evdns_search_add (char *domain)
714 881
715void evdns_search_ndots_set (int ndots) 882void evdns_search_ndots_set (int ndots)
716 883
884#if 0
717 885
718MODULE = EV PACKAGE = EV::HTTP PREFIX = evhttp_ 886MODULE = EV PACKAGE = EV::HTTP PREFIX = evhttp_
719 887
720BOOT: 888BOOT:
721{ 889{
753 921
754#void DESTROY (struct evhttp_request *req); 922#void DESTROY (struct evhttp_request *req);
755 923
756#endif 924#endif
757 925
926#endif
758 927
759 928
760 929
761 930
762 931

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines