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

Comparing EV/EV.xs (file contents):
Revision 1.85 by root, Sat Dec 1 22:51:34 2007 UTC vs.
Revision 1.90 by root, Mon Dec 17 07:24:12 2007 UTC

244 else 244 else
245 sv_events_cache = sv_events; 245 sv_events_cache = sv_events;
246 246
247 if (SvTRUE (ERRSV)) 247 if (SvTRUE (ERRSV))
248 { 248 {
249 SPAGAIN;
249 PUSHMARK (SP); 250 PUSHMARK (SP);
250 PUTBACK; 251 PUTBACK;
251 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); 252 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR);
252 } 253 }
253 254
402 evapi.child_start = ev_child_start; 403 evapi.child_start = ev_child_start;
403 evapi.child_stop = ev_child_stop; 404 evapi.child_stop = ev_child_stop;
404 evapi.stat_start = ev_stat_start; 405 evapi.stat_start = ev_stat_start;
405 evapi.stat_stop = ev_stat_stop; 406 evapi.stat_stop = ev_stat_stop;
406 evapi.stat_stat = ev_stat_stat; 407 evapi.stat_stat = ev_stat_stat;
408 evapi.clear_pending = ev_clear_pending;
409 evapi.invoke = ev_invoke;
407 410
408 sv_setiv (sv, (IV)&evapi); 411 sv_setiv (sv, (IV)&evapi);
409 SvREADONLY_on (sv); 412 SvREADONLY_on (sv);
410 } 413 }
411#ifndef _WIN32 414#ifndef _WIN32
419 422
420NV ev_time () 423NV ev_time ()
421 424
422unsigned int ev_default_loop (unsigned int flags = ev_supported_backends ()) 425unsigned int ev_default_loop (unsigned int flags = ev_supported_backends ())
423 426
427unsigned int ev_loop_count ()
428
424void ev_loop (int flags = 0) 429void ev_loop (int flags = 0)
425 430
426void ev_unloop (int how = 1) 431void ev_unloop (int how = 1)
432
433void ev_feed_fd_event (int fd, int revents = EV_NONE)
434
435void ev_feed_signal_event (SV *signal)
436 CODE:
437{
438 Signal signum = sv_signum (signal);
439 CHECK_SIG (signal, signum);
440
441 ev_feed_signal_event (EV_DEFAULT_ signum);
442}
427 443
428ev_io *io (SV *fh, int events, SV *cb) 444ev_io *io (SV *fh, int events, SV *cb)
429 ALIAS: 445 ALIAS:
430 io_ns = 1 446 io_ns = 1
431 CODE: 447 CODE:
551 567
552int ev_is_active (ev_watcher *w) 568int ev_is_active (ev_watcher *w)
553 569
554int ev_is_pending (ev_watcher *w) 570int ev_is_pending (ev_watcher *w)
555 571
572void ev_invoke (ev_watcher *w, int revents = EV_NONE)
573
574int ev_clear_pending (ev_watcher *w)
575
576void ev_feed_event (ev_watcher *w, int revents = EV_NONE)
577
556int keepalive (ev_watcher *w, int new_value = 0) 578int keepalive (ev_watcher *w, int new_value = 0)
557 CODE: 579 CODE:
558{ 580{
559 RETVAL = w->flags & WFLAG_KEEPALIVE; 581 RETVAL = w->flags & WFLAG_KEEPALIVE;
560 new_value = new_value ? WFLAG_KEEPALIVE : 0; 582 new_value = new_value ? WFLAG_KEEPALIVE : 0;
592 } 614 }
593} 615}
594 OUTPUT: 616 OUTPUT:
595 RETVAL 617 RETVAL
596 618
597void trigger (ev_watcher *w, int revents = EV_NONE)
598 CODE:
599 w->cb (w, revents);
600
601int priority (ev_watcher *w, int new_priority = 0) 619int priority (ev_watcher *w, int new_priority = 0)
602 CODE: 620 CODE:
603{ 621{
604 RETVAL = w->priority; 622 RETVAL = w->priority;
605 623
606 if (items > 1) 624 if (items > 1)
607 { 625 {
608 int active = ev_is_active (w); 626 int active = ev_is_active (w);
609
610 if (new_priority < EV_MINPRI || new_priority > EV_MAXPRI)
611 croak ("watcher priority out of range, value must be between %d and %d, inclusive", EV_MINPRI, EV_MAXPRI);
612 627
613 if (active) 628 if (active)
614 { 629 {
615 /* grrr. */ 630 /* grrr. */
616 PUSHMARK (SP); 631 PUSHMARK (SP);
617 XPUSHs (ST (0)); 632 XPUSHs (ST (0));
633 PUTBACK;
618 call_method ("stop", G_DISCARD | G_VOID); 634 call_method ("stop", G_DISCARD | G_VOID);
619 } 635 }
620 636
621 ev_set_priority (w, new_priority); 637 ev_set_priority (w, new_priority);
622 638
623 if (active) 639 if (active)
624 { 640 {
625 PUSHMARK (SP); 641 PUSHMARK (SP);
626 XPUSHs (ST (0)); 642 XPUSHs (ST (0));
643 PUTBACK;
627 call_method ("start", G_DISCARD | G_VOID); 644 call_method ("start", G_DISCARD | G_VOID);
628 } 645 }
629 } 646 }
630} 647}
631 OUTPUT: 648 OUTPUT:
755 INIT: 772 INIT:
756 CHECK_REPEAT (repeat); 773 CHECK_REPEAT (repeat);
757 CODE: 774 CODE:
758 RESET (timer, w, (w, after, repeat)); 775 RESET (timer, w, (w, after, repeat));
759 776
777NV at (ev_timer *w)
778 CODE:
779 RETVAL = w->at;
780 OUTPUT:
781 RETVAL
782
760MODULE = EV PACKAGE = EV::Periodic PREFIX = ev_periodic_ 783MODULE = EV PACKAGE = EV::Periodic PREFIX = ev_periodic_
761 784
762void ev_periodic_start (ev_periodic *w) 785void ev_periodic_start (ev_periodic *w)
763 INIT: 786 INIT:
764 CHECK_REPEAT (w->interval); 787 CHECK_REPEAT (w->interval);
788 SvREFCNT_dec (w->fh); 811 SvREFCNT_dec (w->fh);
789 w->fh = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0; 812 w->fh = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0;
790 813
791 RESET (periodic, w, (w, at, interval, w->fh ? e_periodic_cb : 0)); 814 RESET (periodic, w, (w, at, interval, w->fh ? e_periodic_cb : 0));
792} 815}
816
817NV at (ev_periodic *w)
818 CODE:
819 RETVAL = w->at;
820 OUTPUT:
821 RETVAL
793 822
794MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_ 823MODULE = EV PACKAGE = EV::Idle PREFIX = ev_idle_
795 824
796void ev_idle_start (ev_idle *w) 825void ev_idle_start (ev_idle *w)
797 CODE: 826 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines