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

Comparing EV/EV.xs (file contents):
Revision 1.132 by root, Sun Jul 19 21:59:55 2009 UTC vs.
Revision 1.138 by root, Wed Apr 14 00:17:22 2010 UTC

13sv_fileno (SV *fh) 13sv_fileno (SV *fh)
14{ 14{
15 return s_fileno (fh, 0); 15 return s_fileno (fh, 0);
16} 16}
17 17
18#define EV_STANDALONE 1
18#define EV_PROTOTYPES 1 19#define EV_PROTOTYPES 1
19#define EV_USE_NANOSLEEP EV_USE_MONOTONIC 20#define EV_USE_NANOSLEEP EV_USE_MONOTONIC
20#define EV_H <ev.h> 21#define EV_H <ev.h>
22#define EV_CONFIG_H error
21#include "EV/EVAPI.h" 23#include "EV/EVAPI.h"
22 24
23#define EV_SELECT_IS_WINSOCKET 0 25#define EV_SELECT_IS_WINSOCKET 0
24#ifdef _WIN32 26#ifdef _WIN32
25# define EV_SELECT_USE_FD_SET 0 27# define EV_SELECT_USE_FD_SET 0
31 33
32#ifndef _WIN32 34#ifndef _WIN32
33# include <pthread.h> 35# include <pthread.h>
34#endif 36#endif
35 37
36#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX ((w)->loop)) 38#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX (((ev_watcher *)(w))->loop))
39#define e_flags(w) ((ev_watcher *)(w))->e_flags
40#define e_self(w) ((ev_watcher *)(w))->self
41#define e_fh(w) ((ev_watcher *)(w))->fh
42#define e_data(w) ((ev_watcher *)(w))->data
37 43
38#define WFLAG_KEEPALIVE 1 44#define WFLAG_KEEPALIVE 1
39#define WFLAG_UNREFED 2 /* has been unref'ed */ 45#define WFLAG_UNREFED 2 /* has been unref'ed */
40 46
41#define UNREF(w) \ 47#define UNREF(w) \
42 if (!((w)->e_flags & (WFLAG_KEEPALIVE | WFLAG_UNREFED)) \ 48 if (!(e_flags (w) & (WFLAG_KEEPALIVE | WFLAG_UNREFED)) \
43 && ev_is_active (w)) \ 49 && ev_is_active (w)) \
44 { \ 50 { \
45 ev_unref (e_loop (w)); \ 51 ev_unref (e_loop (w)); \
46 (w)->e_flags |= WFLAG_UNREFED; \ 52 e_flags (w) |= WFLAG_UNREFED; \
47 } 53 }
48 54
49#define REF(w) \ 55#define REF(w) \
50 if ((w)->e_flags & WFLAG_UNREFED) \ 56 if (e_flags (w) & WFLAG_UNREFED) \
51 { \ 57 { \
52 (w)->e_flags &= ~WFLAG_UNREFED; \ 58 e_flags (w) &= ~WFLAG_UNREFED; \
53 ev_ref (e_loop (w)); \ 59 ev_ref (e_loop (w)); \
54 } 60 }
55 61
56#define START(type,w) \ 62#define START(type,w) \
57 do { \ 63 do { \
121///////////////////////////////////////////////////////////////////////////// 127/////////////////////////////////////////////////////////////////////////////
122// Event 128// Event
123 129
124static void e_cb (EV_P_ ev_watcher *w, int revents); 130static void e_cb (EV_P_ ev_watcher *w, int revents);
125 131
126static void * 132void *
127e_new (int size, SV *cb_sv, SV *loop) 133e_new (int size, SV *cb_sv, SV *loop)
128{ 134{
129 SV *cv = cb_sv ? s_get_cv_croak (cb_sv) : 0; 135 SV *cv = cb_sv ? s_get_cv_croak (cb_sv) : 0;
130 ev_watcher *w; 136 ev_watcher *w;
131 SV *self = NEWSV (0, size); 137 SV *self = NEWSV (0, size);
193 sv_self = sv_self_cache; sv_self_cache = 0; 199 sv_self = sv_self_cache; sv_self_cache = 0;
194 SvRV_set (sv_self, SvREFCNT_inc_NN (w->self)); 200 SvRV_set (sv_self, SvREFCNT_inc_NN (w->self));
195 } 201 }
196 else 202 else
197 { 203 {
198 sv_self = newRV_inc (w->self); /* w->self MUST be blessed by now */ 204 sv_self = newRV_inc (w->self); /* e_self (w) MUST be blessed by now */
199 SvREADONLY_on (sv_self); 205 SvREADONLY_on (sv_self);
200 } 206 }
201 207
202 if (expect_true (sv_events_cache)) 208 if (expect_true (sv_events_cache))
203 { 209 {
294 ENTER; 300 ENTER;
295 SAVETMPS; 301 SAVETMPS;
296 302
297 PUSHMARK (SP); 303 PUSHMARK (SP);
298 EXTEND (SP, 2); 304 EXTEND (SP, 2);
299 PUSHs (newRV_inc (w->self)); /* w->self MUST be blessed by now */ 305 PUSHs (newRV_inc (e_self (w))); /* e_self (w) MUST be blessed by now */
300 PUSHs (newSVnv (now)); 306 PUSHs (newSVnv (now));
301 307
302 PUTBACK; 308 PUTBACK;
303 count = call_sv (w->fh, G_SCALAR | G_EVAL); 309 count = call_sv (w->fh, G_SCALAR | G_EVAL);
304 SPAGAIN; 310 SPAGAIN;
358 const_iv (EV_, UNDEF) 364 const_iv (EV_, UNDEF)
359 const_iv (EV_, NONE) 365 const_iv (EV_, NONE)
360 const_iv (EV_, READ) 366 const_iv (EV_, READ)
361 const_iv (EV_, WRITE) 367 const_iv (EV_, WRITE)
362 const_iv (EV_, IO) 368 const_iv (EV_, IO)
363 const_iv (EV_, TIMEOUT) 369 const_iv (EV_, TIMEOUT) /* deprecated */
364 const_iv (EV_, TIMER) 370 const_iv (EV_, TIMER)
365 const_iv (EV_, PERIODIC) 371 const_iv (EV_, PERIODIC)
366 const_iv (EV_, SIGNAL) 372 const_iv (EV_, SIGNAL)
367 const_iv (EV_, CHILD) 373 const_iv (EV_, CHILD)
368 const_iv (EV_, STAT) 374 const_iv (EV_, STAT)
386 const_iv (EV, BACKEND_POLL) 392 const_iv (EV, BACKEND_POLL)
387 const_iv (EV, BACKEND_EPOLL) 393 const_iv (EV, BACKEND_EPOLL)
388 const_iv (EV, BACKEND_KQUEUE) 394 const_iv (EV, BACKEND_KQUEUE)
389 const_iv (EV, BACKEND_DEVPOLL) 395 const_iv (EV, BACKEND_DEVPOLL)
390 const_iv (EV, BACKEND_PORT) 396 const_iv (EV, BACKEND_PORT)
397 const_iv (EV, BACKEND_ALL)
391 const_iv (EV, FLAG_AUTO) 398 const_iv (EV, FLAG_AUTO)
399 const_iv (EV, FLAG_FORKCHECK)
400 const_iv (EV, FLAG_SIGNALFD)
392 const_iv (EV, FLAG_NOENV) 401 const_iv (EV, FLAG_NOENV)
402 const_iv (EV, FLAG_NOSIGFD) /* compatibility, always 0 */
393 const_iv (EV, FLAG_FORKCHECK) 403 const_iv (EV, FLAG_NOINOTIFY)
394 404
395 const_iv (EV_, VERSION_MAJOR) 405 const_iv (EV_, VERSION_MAJOR)
396 const_iv (EV_, VERSION_MINOR) 406 const_iv (EV_, VERSION_MINOR)
397 }; 407 };
398 408
429 evapi.time_ = ev_time; 439 evapi.time_ = ev_time;
430 evapi.sleep_ = ev_sleep; 440 evapi.sleep_ = ev_sleep;
431 evapi.loop_new = ev_loop_new; 441 evapi.loop_new = ev_loop_new;
432 evapi.loop_destroy = ev_loop_destroy; 442 evapi.loop_destroy = ev_loop_destroy;
433 evapi.loop_fork = ev_loop_fork; 443 evapi.loop_fork = ev_loop_fork;
434 evapi.loop_count = ev_loop_count; 444 evapi.iteration = ev_iteration;
435 evapi.loop_depth = ev_loop_depth; 445 evapi.depth = ev_depth;
436 evapi.set_userdata = ev_set_userdata; 446 evapi.set_userdata = ev_set_userdata;
437 evapi.userdata = ev_userdata; 447 evapi.userdata = ev_userdata;
438 evapi.now = ev_now; 448 evapi.now = ev_now;
439 evapi.now_update = ev_now_update; 449 evapi.now_update = ev_now_update;
440 evapi.suspend = ev_suspend; 450 evapi.suspend = ev_suspend;
441 evapi.resume = ev_resume; 451 evapi.resume = ev_resume;
442 evapi.backend = ev_backend; 452 evapi.backend = ev_backend;
443 evapi.unloop = ev_unloop; 453 evapi.unloop = ev_unloop;
444 evapi.invoke_pending = ev_invoke_pending; 454 evapi.invoke_pending = ev_invoke_pending;
445 evapi.pending_count = ev_pending_count; 455 evapi.pending_count = ev_pending_count;
456 evapi.verify = ev_verify;
446 evapi.set_loop_release_cb = ev_set_loop_release_cb; 457 evapi.set_loop_release_cb = ev_set_loop_release_cb;
447 evapi.set_invoke_pending_cb= ev_set_invoke_pending_cb; 458 evapi.set_invoke_pending_cb= ev_set_invoke_pending_cb;
448 evapi.ref = ev_ref; 459 evapi.ref = ev_ref;
449 evapi.unref = ev_unref; 460 evapi.unref = ev_unref;
450 evapi.loop = ev_loop; 461 evapi.loop = ev_loop;
536 C_ARGS: evapi.default_loop 547 C_ARGS: evapi.default_loop
537 548
538unsigned int ev_backend () 549unsigned int ev_backend ()
539 C_ARGS: evapi.default_loop 550 C_ARGS: evapi.default_loop
540 551
541void ev_loop_verify () 552void ev_verify ()
542 C_ARGS: evapi.default_loop 553 C_ARGS: evapi.default_loop
543 554
544unsigned int ev_loop_count () 555unsigned int ev_iteration ()
545 C_ARGS: evapi.default_loop 556 C_ARGS: evapi.default_loop
546 557
547unsigned int ev_loop_depth () 558unsigned int ev_depth ()
548 C_ARGS: evapi.default_loop 559 C_ARGS: evapi.default_loop
549 560
550void ev_set_io_collect_interval (NV interval) 561void ev_set_io_collect_interval (NV interval)
551 C_ARGS: evapi.default_loop, interval 562 C_ARGS: evapi.default_loop, interval
552 563
578 C_ARGS: evapi.default_loop 589 C_ARGS: evapi.default_loop
579 590
580ev_io *io (SV *fh, int events, SV *cb) 591ev_io *io (SV *fh, int events, SV *cb)
581 ALIAS: 592 ALIAS:
582 io_ns = 1 593 io_ns = 1
594 _ae_io = 2
583 CODE: 595 CODE:
584{ 596{
585 int fd = s_fileno (fh, events & EV_WRITE); 597 int fd = s_fileno (fh, events & EV_WRITE);
586 CHECK_FD (fh, fd); 598 CHECK_FD (fh, fd);
587 599
600 if (ix == 2)
601 {
602 ix = 0;
603 events = events ? EV_WRITE : EV_READ;
604 }
605
588 RETVAL = e_new (sizeof (ev_io), cb, default_loop_sv); 606 RETVAL = e_new (sizeof (ev_io), cb, default_loop_sv);
589 RETVAL->fh = newSVsv (fh); 607 e_fh (RETVAL) = newSVsv (fh);
590 ev_io_set (RETVAL, fd, events); 608 ev_io_set (RETVAL, fd, events);
591 if (!ix) START (io, RETVAL); 609 if (!ix) START (io, RETVAL);
592} 610}
593 OUTPUT: 611 OUTPUT:
594 RETVAL 612 RETVAL
612 CHECK_REPEAT (interval); 630 CHECK_REPEAT (interval);
613 CODE: 631 CODE:
614{ 632{
615 ev_periodic *w; 633 ev_periodic *w;
616 w = e_new (sizeof (ev_periodic), cb, default_loop_sv); 634 w = e_new (sizeof (ev_periodic), cb, default_loop_sv);
617 w->fh = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0; 635 e_fh (w) = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0;
618 ev_periodic_set (w, at, interval, w->fh ? e_periodic_cb : 0); 636 ev_periodic_set (w, at, interval, e_fh (w) ? e_periodic_cb : 0);
619 RETVAL = e_bless ((ev_watcher *)w, stash_periodic); 637 RETVAL = e_bless ((ev_watcher *)w, stash_periodic);
620 if (!ix) START (periodic, w); 638 if (!ix) START (periodic, w);
621} 639}
622 OUTPUT: 640 OUTPUT:
623 RETVAL 641 RETVAL
690ev_stat *stat (SV *path, NV interval, SV *cb) 708ev_stat *stat (SV *path, NV interval, SV *cb)
691 ALIAS: 709 ALIAS:
692 stat_ns = 1 710 stat_ns = 1
693 CODE: 711 CODE:
694 RETVAL = e_new (sizeof (ev_stat), cb, default_loop_sv); 712 RETVAL = e_new (sizeof (ev_stat), cb, default_loop_sv);
695 RETVAL->fh = newSVsv (path); 713 e_fh (RETVAL) = newSVsv (path);
696 ev_stat_set (RETVAL, SvPVbyte_nolen (RETVAL->fh), interval); 714 ev_stat_set (RETVAL, SvPVbyte_nolen (e_fh (RETVAL)), interval);
697 if (!ix) START (stat, RETVAL); 715 if (!ix) START (stat, RETVAL);
698 OUTPUT: 716 OUTPUT:
699 RETVAL 717 RETVAL
700 718
701ev_embed *embed (struct ev_loop *loop, SV *cb = 0) 719ev_embed *embed (struct ev_loop *loop, SV *cb = 0)
705{ 723{
706 if (!(ev_backend (loop) & ev_embeddable_backends ())) 724 if (!(ev_backend (loop) & ev_embeddable_backends ()))
707 croak ("passed loop is not embeddable via EV::embed,"); 725 croak ("passed loop is not embeddable via EV::embed,");
708 726
709 RETVAL = e_new (sizeof (ev_embed), cb, default_loop_sv); 727 RETVAL = e_new (sizeof (ev_embed), cb, default_loop_sv);
710 RETVAL->fh = newSVsv (ST (0)); 728 e_fh (RETVAL) = newSVsv (ST (0));
711 ev_embed_set (RETVAL, loop); 729 ev_embed_set (RETVAL, loop);
712 if (!ix) START (embed, RETVAL); 730 if (!ix) START (embed, RETVAL);
713} 731}
714 OUTPUT: 732 OUTPUT:
715 RETVAL 733 RETVAL
853 CODE: 871 CODE:
854{ 872{
855 int fd = s_fileno (fh, events & EV_WRITE); 873 int fd = s_fileno (fh, events & EV_WRITE);
856 CHECK_FD (fh, fd); 874 CHECK_FD (fh, fd);
857 875
858 sv_setsv (w->fh, fh); 876 sv_setsv (e_fh (w), fh);
859 RESET (io, w, (w, fd, events)); 877 RESET (io, w, (w, fd, events));
860} 878}
861 879
862SV *fh (ev_io *w, SV *new_fh = 0) 880SV *fh (ev_io *w, SV *new_fh = 0)
863 CODE: 881 CODE:
865 if (items > 1) 883 if (items > 1)
866 { 884 {
867 int fd = s_fileno (new_fh, w->events & EV_WRITE); 885 int fd = s_fileno (new_fh, w->events & EV_WRITE);
868 CHECK_FD (new_fh, fd); 886 CHECK_FD (new_fh, fd);
869 887
870 RETVAL = w->fh; 888 RETVAL = e_fh (w);
871 w->fh = newSVsv (new_fh); 889 e_fh (w) = newSVsv (new_fh);
872 890
873 RESET (io, w, (w, fd, w->events)); 891 RESET (io, w, (w, fd, w->events));
874 } 892 }
875 else 893 else
876 RETVAL = newSVsv (w->fh); 894 RETVAL = newSVsv (e_fh (w));
877} 895}
878 OUTPUT: 896 OUTPUT:
879 RETVAL 897 RETVAL
880 898
881int events (ev_io *w, int new_events = EV_UNDEF) 899int events (ev_io *w, int new_events = EV_UNDEF)
987void set (ev_periodic *w, NV at, NV interval = 0., SV *reschedule_cb = &PL_sv_undef) 1005void set (ev_periodic *w, NV at, NV interval = 0., SV *reschedule_cb = &PL_sv_undef)
988 INIT: 1006 INIT:
989 CHECK_REPEAT (interval); 1007 CHECK_REPEAT (interval);
990 CODE: 1008 CODE:
991{ 1009{
992 SvREFCNT_dec (w->fh); 1010 SvREFCNT_dec (e_fh (w));
993 w->fh = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0; 1011 e_fh (w) = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0;
994 1012
995 RESET (periodic, w, (w, at, interval, w->fh ? e_periodic_cb : 0)); 1013 RESET (periodic, w, (w, at, interval, e_fh (w) ? e_periodic_cb : 0));
996} 1014}
997 1015
998NV at (ev_periodic *w) 1016NV at (ev_periodic *w)
999 CODE: 1017 CODE:
1000 RETVAL = ev_periodic_at (w); 1018 RETVAL = ev_periodic_at (w);
1107 e_destroy (w); 1125 e_destroy (w);
1108 1126
1109void set (ev_stat *w, SV *path, NV interval) 1127void set (ev_stat *w, SV *path, NV interval)
1110 CODE: 1128 CODE:
1111{ 1129{
1112 sv_setsv (w->fh, path); 1130 sv_setsv (e_fh (w), path);
1113 RESET (stat, w, (w, SvPVbyte_nolen (w->fh), interval)); 1131 RESET (stat, w, (w, SvPVbyte_nolen (e_fh (w)), interval));
1114} 1132}
1115 1133
1116SV *path (ev_stat *w, SV *new_path = 0) 1134SV *path (ev_stat *w, SV *new_path = 0)
1117 CODE: 1135 CODE:
1118{ 1136{
1119 RETVAL = SvREFCNT_inc (w->fh); 1137 RETVAL = SvREFCNT_inc (e_fh (w));
1120 1138
1121 if (items > 1) 1139 if (items > 1)
1122 { 1140 {
1123 SvREFCNT_dec (w->fh); 1141 SvREFCNT_dec (e_fh (w));
1124 w->fh = newSVsv (new_path); 1142 e_fh (w) = newSVsv (new_path);
1125 RESET (stat, w, (w, SvPVbyte_nolen (w->fh), w->interval)); 1143 RESET (stat, w, (w, SvPVbyte_nolen (e_fh (w)), w->interval));
1126 } 1144 }
1127} 1145}
1128 OUTPUT: 1146 OUTPUT:
1129 RETVAL 1147 RETVAL
1130 1148
1132 CODE: 1150 CODE:
1133{ 1151{
1134 RETVAL = w->interval; 1152 RETVAL = w->interval;
1135 1153
1136 if (items > 1) 1154 if (items > 1)
1137 RESET (stat, w, (w, SvPVbyte_nolen (w->fh), new_interval)); 1155 RESET (stat, w, (w, SvPVbyte_nolen (e_fh (w)), new_interval));
1138} 1156}
1139 OUTPUT: 1157 OUTPUT:
1140 RETVAL 1158 RETVAL
1141 1159
1142void prev (ev_stat *w) 1160void prev (ev_stat *w)
1201 e_destroy (w); 1219 e_destroy (w);
1202 1220
1203void set (ev_embed *w, struct ev_loop *loop) 1221void set (ev_embed *w, struct ev_loop *loop)
1204 CODE: 1222 CODE:
1205{ 1223{
1206 sv_setsv (w->fh, ST (1)); 1224 sv_setsv (e_fh (w), ST (1));
1207 RESET (embed, w, (w, loop)); 1225 RESET (embed, w, (w, loop));
1208} 1226}
1209 1227
1210SV *other (ev_embed *w) 1228SV *other (ev_embed *w)
1211 CODE: 1229 CODE:
1212 RETVAL = newSVsv (w->fh); 1230 RETVAL = newSVsv (e_fh (w));
1213 OUTPUT: 1231 OUTPUT:
1214 RETVAL 1232 RETVAL
1215 1233
1216void ev_embed_sweep (ev_embed *w) 1234void ev_embed_sweep (ev_embed *w)
1217 C_ARGS: e_loop (w), w 1235 C_ARGS: e_loop (w), w
1260 if (loop != evapi.default_loop) /* global destruction sucks */ 1278 if (loop != evapi.default_loop) /* global destruction sucks */
1261 ev_loop_destroy (loop); 1279 ev_loop_destroy (loop);
1262 1280
1263void ev_loop_fork (struct ev_loop *loop) 1281void ev_loop_fork (struct ev_loop *loop)
1264 1282
1265void ev_loop_verify (struct ev_loop *loop) 1283void ev_verify (struct ev_loop *loop)
1266 1284
1267NV ev_now (struct ev_loop *loop) 1285NV ev_now (struct ev_loop *loop)
1268 1286
1269void ev_now_update (struct ev_loop *loop) 1287void ev_now_update (struct ev_loop *loop)
1270 1288
1276 1294
1277void ev_set_timeout_collect_interval (struct ev_loop *loop, NV interval) 1295void ev_set_timeout_collect_interval (struct ev_loop *loop, NV interval)
1278 1296
1279unsigned int ev_backend (struct ev_loop *loop) 1297unsigned int ev_backend (struct ev_loop *loop)
1280 1298
1281unsigned int ev_loop_count (struct ev_loop *loop) 1299unsigned int ev_iteration (struct ev_loop *loop)
1282 1300
1283unsigned int ev_loop_depth (struct ev_loop *loop) 1301unsigned int ev_depth (struct ev_loop *loop)
1284 1302
1285void ev_loop (struct ev_loop *loop, int flags = 0) 1303void ev_loop (struct ev_loop *loop, int flags = 0)
1286 1304
1287void ev_unloop (struct ev_loop *loop, int how = 1) 1305void ev_unloop (struct ev_loop *loop, int how = 1)
1288 1306
1312{ 1330{
1313 int fd = s_fileno (fh, events & EV_WRITE); 1331 int fd = s_fileno (fh, events & EV_WRITE);
1314 CHECK_FD (fh, fd); 1332 CHECK_FD (fh, fd);
1315 1333
1316 RETVAL = e_new (sizeof (ev_io), cb, ST (0)); 1334 RETVAL = e_new (sizeof (ev_io), cb, ST (0));
1317 RETVAL->fh = newSVsv (fh); 1335 e_fh (RETVAL) = newSVsv (fh);
1318 ev_io_set (RETVAL, fd, events); 1336 ev_io_set (RETVAL, fd, events);
1319 if (!ix) START (io, RETVAL); 1337 if (!ix) START (io, RETVAL);
1320} 1338}
1321 OUTPUT: 1339 OUTPUT:
1322 RETVAL 1340 RETVAL
1340 CHECK_REPEAT (interval); 1358 CHECK_REPEAT (interval);
1341 CODE: 1359 CODE:
1342{ 1360{
1343 ev_periodic *w; 1361 ev_periodic *w;
1344 w = e_new (sizeof (ev_periodic), cb, ST (0)); 1362 w = e_new (sizeof (ev_periodic), cb, ST (0));
1345 w->fh = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0; 1363 e_fh (w) = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0;
1346 ev_periodic_set (w, at, interval, w->fh ? e_periodic_cb : 0); 1364 ev_periodic_set (w, at, interval, e_fh (w) ? e_periodic_cb : 0);
1347 RETVAL = e_bless ((ev_watcher *)w, stash_periodic); 1365 RETVAL = e_bless ((ev_watcher *)w, stash_periodic);
1348 if (!ix) START (periodic, w); 1366 if (!ix) START (periodic, w);
1349} 1367}
1350 OUTPUT: 1368 OUTPUT:
1351 RETVAL 1369 RETVAL
1418ev_stat *stat (struct ev_loop *loop, SV *path, NV interval, SV *cb) 1436ev_stat *stat (struct ev_loop *loop, SV *path, NV interval, SV *cb)
1419 ALIAS: 1437 ALIAS:
1420 stat_ns = 1 1438 stat_ns = 1
1421 CODE: 1439 CODE:
1422 RETVAL = e_new (sizeof (ev_stat), cb, ST (0)); 1440 RETVAL = e_new (sizeof (ev_stat), cb, ST (0));
1423 RETVAL->fh = newSVsv (path); 1441 e_fh (RETVAL) = newSVsv (path);
1424 ev_stat_set (RETVAL, SvPVbyte_nolen (RETVAL->fh), interval); 1442 ev_stat_set (RETVAL, SvPVbyte_nolen (e_fh (RETVAL)), interval);
1425 if (!ix) START (stat, RETVAL); 1443 if (!ix) START (stat, RETVAL);
1426 OUTPUT: 1444 OUTPUT:
1427 RETVAL 1445 RETVAL
1428 1446
1429ev_embed *embed (struct ev_loop *loop, struct ev_loop *other, SV *cb = 0) 1447ev_embed *embed (struct ev_loop *loop, struct ev_loop *other, SV *cb = 0)
1433{ 1451{
1434 if (!(ev_backend (other) & ev_embeddable_backends ())) 1452 if (!(ev_backend (other) & ev_embeddable_backends ()))
1435 croak ("passed loop is not embeddable via EV::embed,"); 1453 croak ("passed loop is not embeddable via EV::embed,");
1436 1454
1437 RETVAL = e_new (sizeof (ev_embed), cb, ST (0)); 1455 RETVAL = e_new (sizeof (ev_embed), cb, ST (0));
1438 RETVAL->fh = newSVsv (ST (1)); 1456 e_fh (RETVAL) = newSVsv (ST (1));
1439 ev_embed_set (RETVAL, other); 1457 ev_embed_set (RETVAL, other);
1440 if (!ix) START (embed, RETVAL); 1458 if (!ix) START (embed, RETVAL);
1441} 1459}
1442 OUTPUT: 1460 OUTPUT:
1443 RETVAL 1461 RETVAL

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines