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

Comparing EV/EV.xs (file contents):
Revision 1.123 by root, Sat Apr 25 14:12:48 2009 UTC vs.
Revision 1.134 by root, Fri Sep 18 21:28:33 2009 UTC

1#include "EXTERN.h" 1#include "EXTERN.h"
2#include "perl.h" 2#include "perl.h"
3#include "XSUB.h" 3#include "XSUB.h"
4 4
5/*#include <netinet/in.h>*/
6
7/* fix perl api breakage */ 5/* fix perl api breakage */
8#undef signal 6#undef signal
9#undef sigaction 7#undef sigaction
8
9#include "schmorp.h"
10
11/* old API compatibility */
12static int
13sv_fileno (SV *fh)
14{
15 return s_fileno (fh, 0);
16}
10 17
11#define EV_PROTOTYPES 1 18#define EV_PROTOTYPES 1
12#define EV_USE_NANOSLEEP EV_USE_MONOTONIC 19#define EV_USE_NANOSLEEP EV_USE_MONOTONIC
13#define EV_H <ev.h> 20#define EV_H <ev.h>
14#include "EV/EVAPI.h" 21#include "EV/EVAPI.h"
24 31
25#ifndef _WIN32 32#ifndef _WIN32
26# include <pthread.h> 33# include <pthread.h>
27#endif 34#endif
28 35
29/* 5.10.0 */
30#ifndef SvREFCNT_inc_NN
31# define SvREFCNT_inc_NN(sv) SvREFCNT_inc (sv)
32#endif
33
34/* 5.6.x */
35#ifndef SvRV_set
36# define SvRV_set(a,b) SvRV ((a)) = (b)
37#endif
38
39#if __GNUC__ >= 3
40# define expect(expr,value) __builtin_expect ((expr),(value))
41#else
42# define expect(expr,value) (expr)
43#endif
44
45#define expect_false(expr) expect ((expr) != 0, 0)
46#define expect_true(expr) expect ((expr) != 0, 1)
47
48#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX ((w)->loop)) 36#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX ((w)->loop))
49 37
50#define WFLAG_KEEPALIVE 1 38#define WFLAG_KEEPALIVE 1
51#define WFLAG_UNREFED 2 /* has been unref'ed */ 39#define WFLAG_UNREFED 2 /* has been unref'ed */
52 40
76 REF (w); \ 64 REF (w); \
77 ev_ ## type ## _stop (e_loop (w), w); \ 65 ev_ ## type ## _stop (e_loop (w), w); \
78 } while (0) 66 } while (0)
79 67
80#define RESET(type,w,seta) \ 68#define RESET(type,w,seta) \
81 do { \ 69 do { \
82 int active = ev_is_active (w); \ 70 int active = ev_is_active (w); \
83 if (active) STOP (type, w); \ 71 if (active) STOP (type, w); \
84 ev_ ## type ## _set seta; \ 72 ev_ ## type ## _set seta; \
85 if (active) START (type, w); \ 73 if (active) START (type, w); \
86 } while (0) 74 } while (0)
87 75
88typedef int Signal; 76typedef int Signal;
77
78/* horrible... */
79#define CHECK_SIGNAL_CAN_START(w) \
80 do { \
81 /* dive into the internals of libev to avoid aborting in libev */ \
82 if (signals [(w)->signum - 1].loop \
83 && signals [(w)->signum - 1].loop != e_loop (w)) \
84 croak ("unable to start signal watcher, signal %d already registered in another loop", w->signum); \
85 } while (0)
86
87#define START_SIGNAL(w) \
88 do { \
89 CHECK_SIGNAL_CAN_START (w); \
90 START (signal, w); \
91 } while (0) \
92
93#define RESET_SIGNAL(w,seta) \
94 do { \
95 int active = ev_is_active (w); \
96 if (active) STOP (signal, w); \
97 ev_ ## signal ## _set seta; \
98 if (active) START_SIGNAL (w); \
99 } while (0)
89 100
90static SV *default_loop_sv; 101static SV *default_loop_sv;
91 102
92static struct EVAPI evapi; 103static struct EVAPI evapi;
93 104
105 *stash_check, 116 *stash_check,
106 *stash_embed, 117 *stash_embed,
107 *stash_fork, 118 *stash_fork,
108 *stash_async; 119 *stash_async;
109 120
110#ifndef SIG_SIZE
111/* kudos to Slaven Rezic for the idea */
112static char sig_size [] = { SIG_NUM };
113# define SIG_SIZE (sizeof (sig_size) + 1)
114#endif
115
116static Signal
117sv_signum (SV *sig)
118{
119 Signal signum;
120
121 SvGETMAGIC (sig);
122
123 for (signum = 1; signum < SIG_SIZE; ++signum)
124 if (strEQ (SvPV_nolen (sig), PL_sig_name [signum]))
125 return signum;
126
127 signum = SvIV (sig);
128
129 if (signum > 0 && signum < SIG_SIZE)
130 return signum;
131
132 return -1;
133}
134
135///////////////////////////////////////////////////////////////////////////// 121/////////////////////////////////////////////////////////////////////////////
136// Event 122// Event
137 123
138static void e_cb (EV_P_ ev_watcher *w, int revents); 124static void e_cb (EV_P_ ev_watcher *w, int revents);
139 125
140static int
141sv_fileno (SV *fh)
142{
143 SvGETMAGIC (fh);
144
145 if (SvROK (fh))
146 fh = SvRV (fh);
147
148 if (SvTYPE (fh) == SVt_PVGV)
149 return PerlIO_fileno (IoIFP (sv_2io (fh)));
150
151 if (SvOK (fh) && (SvIV (fh) >= 0) && (SvIV (fh) < 0x7fffffffL))
152 return SvIV (fh);
153
154 return -1;
155}
156
157static SV *
158e_get_cv (SV *cb_sv)
159{
160 HV *st;
161 GV *gvp;
162 CV *cv = sv_2cv (cb_sv, &st, &gvp, 0);
163
164 if (!cv)
165 croak ("EV watcher callback must be a CODE reference");
166
167 return (SV *)cv;
168}
169
170static void * 126static void *
171e_new (int size, SV *cb_sv, SV *loop) 127e_new (int size, SV *cb_sv, SV *loop)
172{ 128{
173 SV *cv = cb_sv ? e_get_cv (cb_sv) : 0; 129 SV *cv = cb_sv ? s_get_cv_croak (cb_sv) : 0;
174 ev_watcher *w; 130 ev_watcher *w;
175 SV *self = NEWSV (0, size); 131 SV *self = NEWSV (0, size);
176 SvPOK_only (self); 132 SvPOK_only (self);
177 SvCUR_set (self, size); 133 SvCUR_set (self, size);
178 134
430 const_iv (EV, BACKEND_POLL) 386 const_iv (EV, BACKEND_POLL)
431 const_iv (EV, BACKEND_EPOLL) 387 const_iv (EV, BACKEND_EPOLL)
432 const_iv (EV, BACKEND_KQUEUE) 388 const_iv (EV, BACKEND_KQUEUE)
433 const_iv (EV, BACKEND_DEVPOLL) 389 const_iv (EV, BACKEND_DEVPOLL)
434 const_iv (EV, BACKEND_PORT) 390 const_iv (EV, BACKEND_PORT)
391 const_iv (EV, BACKEND_ALL)
435 const_iv (EV, FLAG_AUTO) 392 const_iv (EV, FLAG_AUTO)
393 const_iv (EV, FLAG_FORKCHECK)
436 const_iv (EV, FLAG_NOENV) 394 const_iv (EV, FLAG_NOENV)
437 const_iv (EV, FLAG_FORKCHECK) 395 const_iv (EV, FLAG_NOSIGFD)
396 const_iv (EV, FLAG_NOINOTIFY)
438 397
439 const_iv (EV_, VERSION_MAJOR) 398 const_iv (EV_, VERSION_MAJOR)
440 const_iv (EV_, VERSION_MINOR) 399 const_iv (EV_, VERSION_MINOR)
441 }; 400 };
442 401
464 423
465 /* the poor man's shared library emulator */ 424 /* the poor man's shared library emulator */
466 evapi.ver = EV_API_VERSION; 425 evapi.ver = EV_API_VERSION;
467 evapi.rev = EV_API_REVISION; 426 evapi.rev = EV_API_REVISION;
468 evapi.sv_fileno = sv_fileno; 427 evapi.sv_fileno = sv_fileno;
469 evapi.sv_signum = sv_signum; 428 evapi.sv_signum = s_signum;
470 evapi.supported_backends = ev_supported_backends (); 429 evapi.supported_backends = ev_supported_backends ();
471 evapi.recommended_backends = ev_recommended_backends (); 430 evapi.recommended_backends = ev_recommended_backends ();
472 evapi.embeddable_backends = ev_embeddable_backends (); 431 evapi.embeddable_backends = ev_embeddable_backends ();
473 evapi.time_ = ev_time; 432 evapi.time_ = ev_time;
474 evapi.sleep_ = ev_sleep; 433 evapi.sleep_ = ev_sleep;
475 evapi.loop_new = ev_loop_new; 434 evapi.loop_new = ev_loop_new;
476 evapi.loop_destroy = ev_loop_destroy; 435 evapi.loop_destroy = ev_loop_destroy;
477 evapi.loop_fork = ev_loop_fork; 436 evapi.loop_fork = ev_loop_fork;
478 evapi.loop_count = ev_loop_count; 437 evapi.loop_count = ev_loop_count;
438 evapi.loop_depth = ev_loop_depth;
439 evapi.set_userdata = ev_set_userdata;
440 evapi.userdata = ev_userdata;
479 evapi.now = ev_now; 441 evapi.now = ev_now;
480 evapi.now_update = ev_now_update; 442 evapi.now_update = ev_now_update;
481 evapi.suspend = ev_suspend; 443 evapi.suspend = ev_suspend;
482 evapi.resume = ev_resume; 444 evapi.resume = ev_resume;
483 evapi.backend = ev_backend; 445 evapi.backend = ev_backend;
484 evapi.unloop = ev_unloop; 446 evapi.unloop = ev_unloop;
447 evapi.invoke_pending = ev_invoke_pending;
448 evapi.pending_count = ev_pending_count;
449 evapi.set_loop_release_cb = ev_set_loop_release_cb;
450 evapi.set_invoke_pending_cb= ev_set_invoke_pending_cb;
485 evapi.ref = ev_ref; 451 evapi.ref = ev_ref;
486 evapi.unref = ev_unref; 452 evapi.unref = ev_unref;
487 evapi.loop = ev_loop; 453 evapi.loop = ev_loop;
488 evapi.once = ev_once; 454 evapi.once = ev_once;
489 evapi.io_start = ev_io_start; 455 evapi.io_start = ev_io_start;
490 evapi.io_stop = ev_io_stop; 456 evapi.io_stop = ev_io_stop;
491 evapi.timer_start = ev_timer_start; 457 evapi.timer_start = ev_timer_start;
492 evapi.timer_stop = ev_timer_stop; 458 evapi.timer_stop = ev_timer_stop;
493 evapi.timer_again = ev_timer_again; 459 evapi.timer_again = ev_timer_again;
460 evapi.timer_remaining = ev_timer_remaining;
494 evapi.periodic_start = ev_periodic_start; 461 evapi.periodic_start = ev_periodic_start;
495 evapi.periodic_stop = ev_periodic_stop; 462 evapi.periodic_stop = ev_periodic_stop;
496 evapi.signal_start = ev_signal_start; 463 evapi.signal_start = ev_signal_start;
497 evapi.signal_stop = ev_signal_stop; 464 evapi.signal_stop = ev_signal_stop;
498 evapi.idle_start = ev_idle_start; 465 evapi.idle_start = ev_idle_start;
572 C_ARGS: evapi.default_loop 539 C_ARGS: evapi.default_loop
573 540
574unsigned int ev_backend () 541unsigned int ev_backend ()
575 C_ARGS: evapi.default_loop 542 C_ARGS: evapi.default_loop
576 543
544void ev_loop_verify ()
545 C_ARGS: evapi.default_loop
546
577unsigned int ev_loop_count () 547unsigned int ev_loop_count ()
578 C_ARGS: evapi.default_loop 548 C_ARGS: evapi.default_loop
579 549
550unsigned int ev_loop_depth ()
551 C_ARGS: evapi.default_loop
552
580void ev_set_io_collect_interval (NV interval) 553void ev_set_io_collect_interval (NV interval)
581 C_ARGS: evapi.default_loop, interval 554 C_ARGS: evapi.default_loop, interval
582 555
583void ev_set_timeout_collect_interval (NV interval) 556void ev_set_timeout_collect_interval (NV interval)
584 C_ARGS: evapi.default_loop, interval 557 C_ARGS: evapi.default_loop, interval
593 C_ARGS: evapi.default_loop, fd, revents 566 C_ARGS: evapi.default_loop, fd, revents
594 567
595void ev_feed_signal_event (SV *signal) 568void ev_feed_signal_event (SV *signal)
596 CODE: 569 CODE:
597{ 570{
598 Signal signum = sv_signum (signal); 571 Signal signum = s_signum (signal);
599 CHECK_SIG (signal, signum); 572 CHECK_SIG (signal, signum);
600 573
601 ev_feed_signal_event (evapi.default_loop, signum); 574 ev_feed_signal_event (evapi.default_loop, signum);
602} 575}
603 576
577unsigned int ev_pending_count ()
578 C_ARGS: evapi.default_loop
579
580void ev_invoke_pending ()
581 C_ARGS: evapi.default_loop
582
604ev_io *io (SV *fh, int events, SV *cb) 583ev_io *io (SV *fh, int events, SV *cb)
605 ALIAS: 584 ALIAS:
606 io_ns = 1 585 io_ns = 1
586 _ae_io = 2
607 CODE: 587 CODE:
608{ 588{
609 int fd = sv_fileno (fh); 589 int fd = s_fileno (fh, events & EV_WRITE);
610 CHECK_FD (fh, fd); 590 CHECK_FD (fh, fd);
591
592 if (ix == 2)
593 {
594 ix = 0;
595 events = events ? EV_WRITE : EV_READ;
596 }
611 597
612 RETVAL = e_new (sizeof (ev_io), cb, default_loop_sv); 598 RETVAL = e_new (sizeof (ev_io), cb, default_loop_sv);
613 RETVAL->fh = newSVsv (fh); 599 RETVAL->fh = newSVsv (fh);
614 ev_io_set (RETVAL, fd, events); 600 ev_io_set (RETVAL, fd, events);
615 if (!ix) START (io, RETVAL); 601 if (!ix) START (io, RETVAL);
649ev_signal *signal (SV *signal, SV *cb) 635ev_signal *signal (SV *signal, SV *cb)
650 ALIAS: 636 ALIAS:
651 signal_ns = 1 637 signal_ns = 1
652 CODE: 638 CODE:
653{ 639{
654 Signal signum = sv_signum (signal); 640 Signal signum = s_signum (signal);
655 CHECK_SIG (signal, signum); 641 CHECK_SIG (signal, signum);
656 642
657 RETVAL = e_new (sizeof (ev_signal), cb, default_loop_sv); 643 RETVAL = e_new (sizeof (ev_signal), cb, default_loop_sv);
658 ev_signal_set (RETVAL, signum); 644 ev_signal_set (RETVAL, signum);
659 if (!ix) START (signal, RETVAL); 645 if (!ix) START_SIGNAL (RETVAL);
660} 646}
661 OUTPUT: 647 OUTPUT:
662 RETVAL 648 RETVAL
663 649
664ev_idle *idle (SV *cb) 650ev_idle *idle (SV *cb)
750 736
751void once (SV *fh, int events, SV *timeout, SV *cb) 737void once (SV *fh, int events, SV *timeout, SV *cb)
752 CODE: 738 CODE:
753 ev_once ( 739 ev_once (
754 evapi.default_loop, 740 evapi.default_loop,
755 sv_fileno (fh), events, 741 s_fileno (fh, events & EV_WRITE), events,
756 SvOK (timeout) ? SvNV (timeout) : -1., 742 SvOK (timeout) ? SvNV (timeout) : -1.,
757 e_once_cb, 743 e_once_cb,
758 newSVsv (cb) 744 newSVsv (cb)
759 ); 745 );
760 746
794SV *cb (ev_watcher *w, SV *new_cb = 0) 780SV *cb (ev_watcher *w, SV *new_cb = 0)
795 CODE: 781 CODE:
796{ 782{
797 if (items > 1) 783 if (items > 1)
798 { 784 {
799 new_cb = e_get_cv (new_cb); 785 new_cb = s_get_cv_croak (new_cb);
800 RETVAL = newRV_noinc (w->cb_sv); 786 RETVAL = newRV_noinc (w->cb_sv);
801 w->cb_sv = SvREFCNT_inc (new_cb); 787 w->cb_sv = SvREFCNT_inc (new_cb);
802 } 788 }
803 else 789 else
804 RETVAL = newRV_inc (w->cb_sv); 790 RETVAL = newRV_inc (w->cb_sv);
874 e_destroy (w); 860 e_destroy (w);
875 861
876void set (ev_io *w, SV *fh, int events) 862void set (ev_io *w, SV *fh, int events)
877 CODE: 863 CODE:
878{ 864{
879 int fd = sv_fileno (fh); 865 int fd = s_fileno (fh, events & EV_WRITE);
880 CHECK_FD (fh, fd); 866 CHECK_FD (fh, fd);
881 867
882 sv_setsv (w->fh, fh); 868 sv_setsv (w->fh, fh);
883 RESET (io, w, (w, fd, events)); 869 RESET (io, w, (w, fd, events));
884} 870}
886SV *fh (ev_io *w, SV *new_fh = 0) 872SV *fh (ev_io *w, SV *new_fh = 0)
887 CODE: 873 CODE:
888{ 874{
889 if (items > 1) 875 if (items > 1)
890 { 876 {
891 int fd = sv_fileno (new_fh); 877 int fd = s_fileno (new_fh, w->events & EV_WRITE);
892 CHECK_FD (new_fh, fd); 878 CHECK_FD (new_fh, fd);
893 879
894 RETVAL = w->fh; 880 RETVAL = w->fh;
895 w->fh = newSVsv (new_fh); 881 w->fh = newSVsv (new_fh);
896 882
915 901
916MODULE = EV PACKAGE = EV::Signal PREFIX = ev_signal_ 902MODULE = EV PACKAGE = EV::Signal PREFIX = ev_signal_
917 903
918void ev_signal_start (ev_signal *w) 904void ev_signal_start (ev_signal *w)
919 CODE: 905 CODE:
920 START (signal, w); 906 START_SIGNAL (w);
921 907
922void ev_signal_stop (ev_signal *w) 908void ev_signal_stop (ev_signal *w)
923 CODE: 909 CODE:
924 STOP (signal, w); 910 STOP (signal, w);
925 911
929 e_destroy (w); 915 e_destroy (w);
930 916
931void set (ev_signal *w, SV *signal) 917void set (ev_signal *w, SV *signal)
932 CODE: 918 CODE:
933{ 919{
934 Signal signum = sv_signum (signal); 920 Signal signum = s_signum (signal);
935 CHECK_SIG (signal, signum); 921 CHECK_SIG (signal, signum);
936 922
937 RESET (signal, w, (w, signum)); 923 RESET_SIGNAL (w, (w, signum));
938} 924}
939 925
940int signal (ev_signal *w, SV *new_signal = 0) 926int signal (ev_signal *w, SV *new_signal = 0)
941 CODE: 927 CODE:
942{ 928{
943 RETVAL = w->signum; 929 RETVAL = w->signum;
944 930
945 if (items > 1) 931 if (items > 1)
946 { 932 {
947 Signal signum = sv_signum (new_signal); 933 Signal signum = s_signum (new_signal);
948 CHECK_SIG (new_signal, signum); 934 CHECK_SIG (new_signal, signum);
949 935
950 RESET (signal, w, (w, signum)); 936 RESET_SIGNAL (w, (w, signum));
951 } 937 }
952} 938}
953 OUTPUT: 939 OUTPUT:
954 RETVAL 940 RETVAL
955 941
969 INIT: 955 INIT:
970 CHECK_REPEAT (w->repeat); 956 CHECK_REPEAT (w->repeat);
971 CODE: 957 CODE:
972 ev_timer_again (e_loop (w), w); 958 ev_timer_again (e_loop (w), w);
973 UNREF (w); 959 UNREF (w);
960
961NV ev_timer_remaining (ev_timer *w)
962 C_ARGS: e_loop (w), w
974 963
975void DESTROY (ev_timer *w) 964void DESTROY (ev_timer *w)
976 CODE: 965 CODE:
977 STOP (timer, w); 966 STOP (timer, w);
978 e_destroy (w); 967 e_destroy (w);
1299 1288
1300unsigned int ev_backend (struct ev_loop *loop) 1289unsigned int ev_backend (struct ev_loop *loop)
1301 1290
1302unsigned int ev_loop_count (struct ev_loop *loop) 1291unsigned int ev_loop_count (struct ev_loop *loop)
1303 1292
1293unsigned int ev_loop_depth (struct ev_loop *loop)
1294
1304void ev_loop (struct ev_loop *loop, int flags = 0) 1295void ev_loop (struct ev_loop *loop, int flags = 0)
1305 1296
1306void ev_unloop (struct ev_loop *loop, int how = 1) 1297void ev_unloop (struct ev_loop *loop, int how = 1)
1307 1298
1308void ev_feed_fd_event (struct ev_loop *loop, int fd, int revents = EV_NONE) 1299void ev_feed_fd_event (struct ev_loop *loop, int fd, int revents = EV_NONE)
1309 1300
1301unsigned int ev_pending_count (struct ev_loop *loop)
1302
1303void ev_invoke_pending (struct ev_loop *loop)
1304
1310#if 0 1305#if 0
1311 1306
1312void ev_feed_signal_event (struct ev_loop *loop, SV *signal) 1307void ev_feed_signal_event (struct ev_loop *loop, SV *signal)
1313 CODE: 1308 CODE:
1314{ 1309{
1315 Signal signum = sv_signum (signal); 1310 Signal signum = s_signum (signal);
1316 CHECK_SIG (signal, signum); 1311 CHECK_SIG (signal, signum);
1317 1312
1318 ev_feed_signal_event (loop, signum); 1313 ev_feed_signal_event (loop, signum);
1319} 1314}
1320 1315
1323ev_io *io (struct ev_loop *loop, SV *fh, int events, SV *cb) 1318ev_io *io (struct ev_loop *loop, SV *fh, int events, SV *cb)
1324 ALIAS: 1319 ALIAS:
1325 io_ns = 1 1320 io_ns = 1
1326 CODE: 1321 CODE:
1327{ 1322{
1328 int fd = sv_fileno (fh); 1323 int fd = s_fileno (fh, events & EV_WRITE);
1329 CHECK_FD (fh, fd); 1324 CHECK_FD (fh, fd);
1330 1325
1331 RETVAL = e_new (sizeof (ev_io), cb, ST (0)); 1326 RETVAL = e_new (sizeof (ev_io), cb, ST (0));
1332 RETVAL->fh = newSVsv (fh); 1327 RETVAL->fh = newSVsv (fh);
1333 ev_io_set (RETVAL, fd, events); 1328 ev_io_set (RETVAL, fd, events);
1363 if (!ix) START (periodic, w); 1358 if (!ix) START (periodic, w);
1364} 1359}
1365 OUTPUT: 1360 OUTPUT:
1366 RETVAL 1361 RETVAL
1367 1362
1368#if 0
1369
1370ev_signal *signal (struct ev_loop *loop, SV *signal, SV *cb) 1363ev_signal *signal (struct ev_loop *loop, SV *signal, SV *cb)
1371 ALIAS: 1364 ALIAS:
1372 signal_ns = 1 1365 signal_ns = 1
1373 CODE: 1366 CODE:
1374{ 1367{
1375 Signal signum = sv_signum (signal); 1368 Signal signum = s_signum (signal);
1376 CHECK_SIG (signal, signum); 1369 CHECK_SIG (signal, signum);
1377 1370
1378 RETVAL = e_new (sizeof (ev_signal), cb, ST (0)); 1371 RETVAL = e_new (sizeof (ev_signal), cb, ST (0));
1379 ev_signal_set (RETVAL, signum); 1372 ev_signal_set (RETVAL, signum);
1380 if (!ix) START (signal, RETVAL); 1373 if (!ix) START_SIGNAL (RETVAL);
1381} 1374}
1382 OUTPUT: 1375 OUTPUT:
1383 RETVAL 1376 RETVAL
1384
1385#endif
1386 1377
1387ev_idle *idle (struct ev_loop *loop, SV *cb) 1378ev_idle *idle (struct ev_loop *loop, SV *cb)
1388 ALIAS: 1379 ALIAS:
1389 idle_ns = 1 1380 idle_ns = 1
1390 CODE: 1381 CODE:
1473 1464
1474void once (struct ev_loop *loop, SV *fh, int events, SV *timeout, SV *cb) 1465void once (struct ev_loop *loop, SV *fh, int events, SV *timeout, SV *cb)
1475 CODE: 1466 CODE:
1476 ev_once ( 1467 ev_once (
1477 loop, 1468 loop,
1478 sv_fileno (fh), events, 1469 s_fileno (fh, events & EV_WRITE), events,
1479 SvOK (timeout) ? SvNV (timeout) : -1., 1470 SvOK (timeout) ? SvNV (timeout) : -1.,
1480 e_once_cb, 1471 e_once_cb,
1481 newSVsv (cb) 1472 newSVsv (cb)
1482 ); 1473 );
1483 1474

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines