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

Comparing EV/EV.xs (file contents):
Revision 1.138 by root, Wed Apr 14 00:17:22 2010 UTC vs.
Revision 1.151 by root, Thu Dec 30 07:28:47 2010 UTC

29# define fd_mask Perl_fd_mask 29# define fd_mask Perl_fd_mask
30#endif 30#endif
31/* due to bugs in OS X we have to use libev/ explicitly here */ 31/* due to bugs in OS X we have to use libev/ explicitly here */
32#include "libev/ev.c" 32#include "libev/ev.c"
33 33
34#ifndef _WIN32 34#if !defined(_WIN32) && !defined(_MINIX)
35# include <pthread.h> 35# include <pthread.h>
36#endif 36#endif
37 37
38#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX (((ev_watcher *)(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 39#define e_flags(w) ((ev_watcher *)(w))->e_flags
120 *stash_idle, 120 *stash_idle,
121 *stash_prepare, 121 *stash_prepare,
122 *stash_check, 122 *stash_check,
123 *stash_embed, 123 *stash_embed,
124 *stash_fork, 124 *stash_fork,
125 *stash_cleanup,
125 *stash_async; 126 *stash_async;
126 127
127///////////////////////////////////////////////////////////////////////////// 128/////////////////////////////////////////////////////////////////////////////
128// Event 129// Event
129 130
207 208
208 if (expect_true (sv_events_cache)) 209 if (expect_true (sv_events_cache))
209 { 210 {
210 sv_events = sv_events_cache; sv_events_cache = 0; 211 sv_events = sv_events_cache; sv_events_cache = 0;
211 SvIV_set (sv_events, revents); 212 SvIV_set (sv_events, revents);
213 SvIOK_only (sv_events);
212 } 214 }
213 else 215 else
214 { 216 {
215 sv_events = newSViv (revents); 217 sv_events = newSViv (revents);
216 SvREADONLY_on (sv_events); 218 SvREADONLY_on (sv_events);
340 croak ("illegal file descriptor or filehandle (either no attached file descriptor or illegal value): %s", SvPV_nolen (fh)); 342 croak ("illegal file descriptor or filehandle (either no attached file descriptor or illegal value): %s", SvPV_nolen (fh));
341 343
342#define CHECK_SIG(sv,num) if ((num) < 0) \ 344#define CHECK_SIG(sv,num) if ((num) < 0) \
343 croak ("illegal signal number or name: %s", SvPV_nolen (sv)); 345 croak ("illegal signal number or name: %s", SvPV_nolen (sv));
344 346
347static void
348default_fork (void)
349{
350 ev_loop_fork (EV_DEFAULT_UC);
351}
352
345///////////////////////////////////////////////////////////////////////////// 353/////////////////////////////////////////////////////////////////////////////
346// XS interface functions 354// XS interface functions
347 355
348MODULE = EV PACKAGE = EV PREFIX = ev_ 356MODULE = EV PACKAGE = EV PREFIX = ev_
349 357
364 const_iv (EV_, UNDEF) 372 const_iv (EV_, UNDEF)
365 const_iv (EV_, NONE) 373 const_iv (EV_, NONE)
366 const_iv (EV_, READ) 374 const_iv (EV_, READ)
367 const_iv (EV_, WRITE) 375 const_iv (EV_, WRITE)
368 const_iv (EV_, IO) 376 const_iv (EV_, IO)
369 const_iv (EV_, TIMEOUT) /* deprecated */
370 const_iv (EV_, TIMER) 377 const_iv (EV_, TIMER)
371 const_iv (EV_, PERIODIC) 378 const_iv (EV_, PERIODIC)
372 const_iv (EV_, SIGNAL) 379 const_iv (EV_, SIGNAL)
373 const_iv (EV_, CHILD) 380 const_iv (EV_, CHILD)
374 const_iv (EV_, STAT) 381 const_iv (EV_, STAT)
375 const_iv (EV_, IDLE) 382 const_iv (EV_, IDLE)
376 const_iv (EV_, PREPARE) 383 const_iv (EV_, PREPARE)
377 const_iv (EV_, CHECK) 384 const_iv (EV_, CHECK)
378 const_iv (EV_, EMBED) 385 const_iv (EV_, EMBED)
379 const_iv (EV_, FORK) 386 const_iv (EV_, FORK)
387 const_iv (EV_, CLEANUP)
380 const_iv (EV_, ASYNC) 388 const_iv (EV_, ASYNC)
381 const_iv (EV_, CUSTOM) 389 const_iv (EV_, CUSTOM)
382 const_iv (EV_, ERROR) 390 const_iv (EV_, ERROR)
383 391
384 const_iv (EV, LOOP_NONBLOCK)
385 const_iv (EV, LOOP_ONESHOT)
386
387 const_iv (EV, UNLOOP_CANCEL) 392 const_iv (EV, RUN_NOWAIT)
388 const_iv (EV, UNLOOP_ONE) 393 const_iv (EV, RUN_ONCE)
394
395 const_iv (EV, BREAK_CANCEL)
396 const_iv (EV, BREAK_ONE)
389 const_iv (EV, UNLOOP_ALL) 397 const_iv (EV, BREAK_ALL)
390
391 const_iv (EV, BACKEND_SELECT) 398 const_iv (EV, BACKEND_SELECT)
392 const_iv (EV, BACKEND_POLL) 399 const_iv (EV, BACKEND_POLL)
393 const_iv (EV, BACKEND_EPOLL) 400 const_iv (EV, BACKEND_EPOLL)
394 const_iv (EV, BACKEND_KQUEUE) 401 const_iv (EV, BACKEND_KQUEUE)
395 const_iv (EV, BACKEND_DEVPOLL) 402 const_iv (EV, BACKEND_DEVPOLL)
397 const_iv (EV, BACKEND_ALL) 404 const_iv (EV, BACKEND_ALL)
398 const_iv (EV, FLAG_AUTO) 405 const_iv (EV, FLAG_AUTO)
399 const_iv (EV, FLAG_FORKCHECK) 406 const_iv (EV, FLAG_FORKCHECK)
400 const_iv (EV, FLAG_SIGNALFD) 407 const_iv (EV, FLAG_SIGNALFD)
401 const_iv (EV, FLAG_NOENV) 408 const_iv (EV, FLAG_NOENV)
402 const_iv (EV, FLAG_NOSIGFD) /* compatibility, always 0 */
403 const_iv (EV, FLAG_NOINOTIFY) 409 const_iv (EV, FLAG_NOINOTIFY)
404 410
405 const_iv (EV_, VERSION_MAJOR) 411 const_iv (EV_, VERSION_MAJOR)
406 const_iv (EV_, VERSION_MINOR) 412 const_iv (EV_, VERSION_MINOR)
413#if EV_COMPAT3
414 const_iv (EV, FLAG_NOSIGFD) /* compatibility, always 0 */
415 const_iv (EV_, TIMEOUT)
416 const_iv (EV, LOOP_NONBLOCK)
417 const_iv (EV, LOOP_ONESHOT)
418 const_iv (EV, UNLOOP_CANCEL)
419 const_iv (EV, UNLOOP_ONE)
420 const_iv (EV, UNLOOP_ALL)
421#endif
407 }; 422 };
408 423
409 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 424 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
410 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 425 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
411 426
420 stash_check = gv_stashpv ("EV::Check" , 1); 435 stash_check = gv_stashpv ("EV::Check" , 1);
421 stash_child = gv_stashpv ("EV::Child" , 1); 436 stash_child = gv_stashpv ("EV::Child" , 1);
422 stash_embed = gv_stashpv ("EV::Embed" , 1); 437 stash_embed = gv_stashpv ("EV::Embed" , 1);
423 stash_stat = gv_stashpv ("EV::Stat" , 1); 438 stash_stat = gv_stashpv ("EV::Stat" , 1);
424 stash_fork = gv_stashpv ("EV::Fork" , 1); 439 stash_fork = gv_stashpv ("EV::Fork" , 1);
440 stash_cleanup = gv_stashpv ("EV::Cleanup" , 1);
425 stash_async = gv_stashpv ("EV::Async" , 1); 441 stash_async = gv_stashpv ("EV::Async" , 1);
426 442
427 { 443 {
428 SV *sv = perl_get_sv ("EV::API", TRUE); 444 SV *sv = perl_get_sv ("EV::API", TRUE);
429 perl_get_sv ("EV::API", TRUE); /* silence 5.10 warning */ 445 perl_get_sv ("EV::API", TRUE); /* silence 5.10 warning */
448 evapi.now = ev_now; 464 evapi.now = ev_now;
449 evapi.now_update = ev_now_update; 465 evapi.now_update = ev_now_update;
450 evapi.suspend = ev_suspend; 466 evapi.suspend = ev_suspend;
451 evapi.resume = ev_resume; 467 evapi.resume = ev_resume;
452 evapi.backend = ev_backend; 468 evapi.backend = ev_backend;
453 evapi.unloop = ev_unloop; 469 evapi.break_ = ev_break;
454 evapi.invoke_pending = ev_invoke_pending; 470 evapi.invoke_pending = ev_invoke_pending;
455 evapi.pending_count = ev_pending_count; 471 evapi.pending_count = ev_pending_count;
456 evapi.verify = ev_verify; 472 evapi.verify = ev_verify;
457 evapi.set_loop_release_cb = ev_set_loop_release_cb; 473 evapi.set_loop_release_cb = ev_set_loop_release_cb;
458 evapi.set_invoke_pending_cb= ev_set_invoke_pending_cb; 474 evapi.set_invoke_pending_cb= ev_set_invoke_pending_cb;
459 evapi.ref = ev_ref; 475 evapi.ref = ev_ref;
460 evapi.unref = ev_unref; 476 evapi.unref = ev_unref;
461 evapi.loop = ev_loop; 477 evapi.run = ev_run;
462 evapi.once = ev_once; 478 evapi.once = ev_once;
463 evapi.io_start = ev_io_start; 479 evapi.io_start = ev_io_start;
464 evapi.io_stop = ev_io_stop; 480 evapi.io_stop = ev_io_stop;
465 evapi.timer_start = ev_timer_start; 481 evapi.timer_start = ev_timer_start;
466 evapi.timer_stop = ev_timer_stop; 482 evapi.timer_stop = ev_timer_stop;
474 evapi.idle_stop = ev_idle_stop; 490 evapi.idle_stop = ev_idle_stop;
475 evapi.prepare_start = ev_prepare_start; 491 evapi.prepare_start = ev_prepare_start;
476 evapi.prepare_stop = ev_prepare_stop; 492 evapi.prepare_stop = ev_prepare_stop;
477 evapi.check_start = ev_check_start; 493 evapi.check_start = ev_check_start;
478 evapi.check_stop = ev_check_stop; 494 evapi.check_stop = ev_check_stop;
495#if EV_CHILD_ENABLE
479 evapi.child_start = ev_child_start; 496 evapi.child_start = ev_child_start;
480 evapi.child_stop = ev_child_stop; 497 evapi.child_stop = ev_child_stop;
498#endif
481 evapi.stat_start = ev_stat_start; 499 evapi.stat_start = ev_stat_start;
482 evapi.stat_stop = ev_stat_stop; 500 evapi.stat_stop = ev_stat_stop;
483 evapi.stat_stat = ev_stat_stat; 501 evapi.stat_stat = ev_stat_stat;
484 evapi.embed_start = ev_embed_start; 502 evapi.embed_start = ev_embed_start;
485 evapi.embed_stop = ev_embed_stop; 503 evapi.embed_stop = ev_embed_stop;
486 evapi.embed_sweep = ev_embed_sweep; 504 evapi.embed_sweep = ev_embed_sweep;
487 evapi.fork_start = ev_fork_start; 505 evapi.fork_start = ev_fork_start;
488 evapi.fork_stop = ev_fork_stop; 506 evapi.fork_stop = ev_fork_stop;
507 evapi.cleanup_start = ev_cleanup_start;
508 evapi.cleanup_stop = ev_cleanup_stop;
489 evapi.async_start = ev_async_start; 509 evapi.async_start = ev_async_start;
490 evapi.async_stop = ev_async_stop; 510 evapi.async_stop = ev_async_stop;
491 evapi.async_send = ev_async_send; 511 evapi.async_send = ev_async_send;
492 evapi.clear_pending = ev_clear_pending; 512 evapi.clear_pending = ev_clear_pending;
493 evapi.invoke = ev_invoke; 513 evapi.invoke = ev_invoke;
494 514
495 sv_setiv (sv, (IV)&evapi); 515 sv_setiv (sv, (IV)&evapi);
496 SvREADONLY_on (sv); 516 SvREADONLY_on (sv);
497 } 517 }
498#ifndef _WIN32 518#if !defined(_WIN32) && !defined(_MINIX)
499 pthread_atfork (0, 0, ev_default_fork); 519 pthread_atfork (0, 0, default_fork);
500#endif 520#endif
501} 521}
502 522
503SV *ev_default_loop (unsigned int flags = 0) 523SV *ev_default_loop (unsigned int flags = 0)
504 CODE: 524 CODE:
518 OUTPUT: 538 OUTPUT:
519 RETVAL 539 RETVAL
520 540
521void ev_default_destroy () 541void ev_default_destroy ()
522 CODE: 542 CODE:
523 ev_default_destroy (); 543 ev_loop_destroy (EV_DEFAULT_UC);
524 SvREFCNT_dec (default_loop_sv); 544 SvREFCNT_dec (default_loop_sv);
525 default_loop_sv = 0; 545 default_loop_sv = 0;
526 546
527unsigned int ev_supported_backends () 547unsigned int ev_supported_backends ()
528 548
548 568
549unsigned int ev_backend () 569unsigned int ev_backend ()
550 C_ARGS: evapi.default_loop 570 C_ARGS: evapi.default_loop
551 571
552void ev_verify () 572void ev_verify ()
573 ALIAS:
574 loop_verify = 1
553 C_ARGS: evapi.default_loop 575 C_ARGS: evapi.default_loop
554 576
555unsigned int ev_iteration () 577unsigned int ev_iteration ()
578 ALIAS:
579 loop_count = 1
556 C_ARGS: evapi.default_loop 580 C_ARGS: evapi.default_loop
557 581
558unsigned int ev_depth () 582unsigned int ev_depth ()
583 ALIAS:
584 loop_depth = 1
559 C_ARGS: evapi.default_loop 585 C_ARGS: evapi.default_loop
560 586
561void ev_set_io_collect_interval (NV interval) 587void ev_set_io_collect_interval (NV interval)
562 C_ARGS: evapi.default_loop, interval 588 C_ARGS: evapi.default_loop, interval
563 589
564void ev_set_timeout_collect_interval (NV interval) 590void ev_set_timeout_collect_interval (NV interval)
565 C_ARGS: evapi.default_loop, interval 591 C_ARGS: evapi.default_loop, interval
566 592
567void ev_loop (int flags = 0) 593void ev_run (int flags = 0)
594 ALIAS:
595 loop = 1
568 C_ARGS: evapi.default_loop, flags 596 C_ARGS: evapi.default_loop, flags
569 597
570void ev_unloop (int how = EVUNLOOP_ONE) 598void ev_break (int how = EVBREAK_ONE)
599 ALIAS:
600 unloop = 1
571 C_ARGS: evapi.default_loop, how 601 C_ARGS: evapi.default_loop, how
572 602
573void ev_feed_fd_event (int fd, int revents = EV_NONE) 603void ev_feed_fd_event (int fd, int revents = EV_NONE)
574 C_ARGS: evapi.default_loop, fd, revents 604 C_ARGS: evapi.default_loop, fd, revents
575 605
693 ev_fork_set (RETVAL); 723 ev_fork_set (RETVAL);
694 if (!ix) START (fork, RETVAL); 724 if (!ix) START (fork, RETVAL);
695 OUTPUT: 725 OUTPUT:
696 RETVAL 726 RETVAL
697 727
728ev_cleanup *cleanup (SV *cb)
729 ALIAS:
730 cleanup_ns = 1
731 CODE:
732 RETVAL = e_new (sizeof (ev_cleanup), cb, default_loop_sv);
733 ev_cleanup_set (RETVAL);
734 if (!ix) START (cleanup, RETVAL);
735 OUTPUT:
736 RETVAL
737
698ev_child *child (int pid, int trace, SV *cb) 738ev_child *child (int pid, int trace, SV *cb)
699 ALIAS: 739 ALIAS:
700 child_ns = 1 740 child_ns = 1
701 CODE: 741 CODE:
742#if EV_CHILD_ENABLE
702 RETVAL = e_new (sizeof (ev_child), cb, default_loop_sv); 743 RETVAL = e_new (sizeof (ev_child), cb, default_loop_sv);
703 ev_child_set (RETVAL, pid, trace); 744 ev_child_set (RETVAL, pid, trace);
704 if (!ix) START (child, RETVAL); 745 if (!ix) START (child, RETVAL);
746#else
747 croak ("EV::child watchers not supported on this platform");
748#endif
705 OUTPUT: 749 OUTPUT:
706 RETVAL 750 RETVAL
751
707 752
708ev_stat *stat (SV *path, NV interval, SV *cb) 753ev_stat *stat (SV *path, NV interval, SV *cb)
709 ALIAS: 754 ALIAS:
710 stat_ns = 1 755 stat_ns = 1
711 CODE: 756 CODE:
714 ev_stat_set (RETVAL, SvPVbyte_nolen (e_fh (RETVAL)), interval); 759 ev_stat_set (RETVAL, SvPVbyte_nolen (e_fh (RETVAL)), interval);
715 if (!ix) START (stat, RETVAL); 760 if (!ix) START (stat, RETVAL);
716 OUTPUT: 761 OUTPUT:
717 RETVAL 762 RETVAL
718 763
764#ifndef EV_NO_LOOPS
765
719ev_embed *embed (struct ev_loop *loop, SV *cb = 0) 766ev_embed *embed (struct ev_loop *loop, SV *cb = 0)
720 ALIAS: 767 ALIAS:
721 embed_ns = 1 768 embed_ns = 1
722 CODE: 769 CODE:
723{ 770{
729 ev_embed_set (RETVAL, loop); 776 ev_embed_set (RETVAL, loop);
730 if (!ix) START (embed, RETVAL); 777 if (!ix) START (embed, RETVAL);
731} 778}
732 OUTPUT: 779 OUTPUT:
733 RETVAL 780 RETVAL
781
782#endif
734 783
735ev_async *async (SV *cb) 784ev_async *async (SV *cb)
736 ALIAS: 785 ALIAS:
737 async_ns = 1 786 async_ns = 1
738 CODE: 787 CODE:
1077void DESTROY (ev_fork *w) 1126void DESTROY (ev_fork *w)
1078 CODE: 1127 CODE:
1079 STOP (fork, w); 1128 STOP (fork, w);
1080 e_destroy (w); 1129 e_destroy (w);
1081 1130
1131MODULE = EV PACKAGE = EV::Cleanup PREFIX = ev_cleanup_
1132
1133void ev_cleanup_start (ev_cleanup *w)
1134 CODE:
1135 START (cleanup, w);
1136
1137void ev_cleanup_stop (ev_cleanup *w)
1138 CODE:
1139 STOP (cleanup, w);
1140
1141void DESTROY (ev_cleanup *w)
1142 CODE:
1143 STOP (cleanup, w);
1144 e_destroy (w);
1145
1146int keepalive (ev_watcher *w, int new_value = 0)
1147 CODE:
1148 RETVAL = 0;
1149 OUTPUT:
1150 RETVAL
1151
1082MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_ 1152MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_
1153
1154#if EV_CHILD_ENABLE
1083 1155
1084void ev_child_start (ev_child *w) 1156void ev_child_start (ev_child *w)
1085 CODE: 1157 CODE:
1086 START (child, w); 1158 START (child, w);
1087 1159
1106 RETVAL = ix == 0 ? w->pid 1178 RETVAL = ix == 0 ? w->pid
1107 : ix == 1 ? w->rpid 1179 : ix == 1 ? w->rpid
1108 : w->rstatus; 1180 : w->rstatus;
1109 OUTPUT: 1181 OUTPUT:
1110 RETVAL 1182 RETVAL
1183
1184#endif
1111 1185
1112MODULE = EV PACKAGE = EV::Stat PREFIX = ev_stat_ 1186MODULE = EV PACKAGE = EV::Stat PREFIX = ev_stat_
1113 1187
1114void ev_stat_start (ev_stat *w) 1188void ev_stat_start (ev_stat *w)
1115 CODE: 1189 CODE:
1256 CODE: 1330 CODE:
1257 RETVAL = boolSV (ev_async_pending (w)); 1331 RETVAL = boolSV (ev_async_pending (w));
1258 OUTPUT: 1332 OUTPUT:
1259 RETVAL 1333 RETVAL
1260 1334
1335#ifndef EV_NO_LOOPS
1336
1261MODULE = EV PACKAGE = EV::Loop PREFIX = ev_ 1337MODULE = EV PACKAGE = EV::Loop PREFIX = ev_
1262 1338
1263SV *new (SV *klass, unsigned int flags = 0) 1339SV *new (SV *klass, unsigned int flags = 0)
1264 CODE: 1340 CODE:
1265{ 1341{
1273 OUTPUT: 1349 OUTPUT:
1274 RETVAL 1350 RETVAL
1275 1351
1276void DESTROY (struct ev_loop *loop) 1352void DESTROY (struct ev_loop *loop)
1277 CODE: 1353 CODE:
1278 if (loop != evapi.default_loop) /* global destruction sucks */ 1354 /* 1. the default loop shouldn't be freed by destroying it'S pelr loop object */
1355 /* 2. not doing so helps avoid many global destruction bugs in perl, too */
1356 if (loop != evapi.default_loop)
1279 ev_loop_destroy (loop); 1357 ev_loop_destroy (loop);
1280 1358
1281void ev_loop_fork (struct ev_loop *loop) 1359void ev_loop_fork (struct ev_loop *loop)
1282 1360
1361NV ev_now (struct ev_loop *loop)
1362
1363void ev_now_update (struct ev_loop *loop)
1364
1365void ev_suspend (struct ev_loop *loop)
1366
1367void ev_resume (struct ev_loop *loop)
1368
1369void ev_set_io_collect_interval (struct ev_loop *loop, NV interval)
1370
1371void ev_set_timeout_collect_interval (struct ev_loop *loop, NV interval)
1372
1373unsigned int ev_backend (struct ev_loop *loop)
1374
1283void ev_verify (struct ev_loop *loop) 1375void ev_verify (struct ev_loop *loop)
1284 1376 ALIAS:
1285NV ev_now (struct ev_loop *loop) 1377 loop_verify = 1
1286
1287void ev_now_update (struct ev_loop *loop)
1288
1289void ev_suspend (struct ev_loop *loop)
1290
1291void ev_resume (struct ev_loop *loop)
1292
1293void ev_set_io_collect_interval (struct ev_loop *loop, NV interval)
1294
1295void ev_set_timeout_collect_interval (struct ev_loop *loop, NV interval)
1296
1297unsigned int ev_backend (struct ev_loop *loop)
1298 1378
1299unsigned int ev_iteration (struct ev_loop *loop) 1379unsigned int ev_iteration (struct ev_loop *loop)
1380 ALIAS:
1381 loop_count = 1
1300 1382
1301unsigned int ev_depth (struct ev_loop *loop) 1383unsigned int ev_depth (struct ev_loop *loop)
1384 ALIAS:
1385 loop_depth = 1
1302 1386
1303void ev_loop (struct ev_loop *loop, int flags = 0) 1387void ev_run (struct ev_loop *loop, int flags = 0)
1388 ALIAS:
1389 loop = 1
1304 1390
1305void ev_unloop (struct ev_loop *loop, int how = 1) 1391void ev_break (struct ev_loop *loop, int how = 1)
1392 ALIAS:
1393 unloop = 1
1306 1394
1307void ev_feed_fd_event (struct ev_loop *loop, int fd, int revents = EV_NONE) 1395void ev_feed_fd_event (struct ev_loop *loop, int fd, int revents = EV_NONE)
1308 1396
1309unsigned int ev_pending_count (struct ev_loop *loop) 1397unsigned int ev_pending_count (struct ev_loop *loop)
1310 1398
1421 ev_fork_set (RETVAL); 1509 ev_fork_set (RETVAL);
1422 if (!ix) START (fork, RETVAL); 1510 if (!ix) START (fork, RETVAL);
1423 OUTPUT: 1511 OUTPUT:
1424 RETVAL 1512 RETVAL
1425 1513
1514ev_cleanup *cleanup (struct ev_loop *loop, SV *cb)
1515 ALIAS:
1516 cleanup_ns = 1
1517 CODE:
1518 RETVAL = e_new (sizeof (ev_cleanup), cb, ST (0));
1519 ev_cleanup_set (RETVAL);
1520 if (!ix) START (cleanup, RETVAL);
1521 OUTPUT:
1522 RETVAL
1523
1426ev_child *child (struct ev_loop *loop, int pid, int trace, SV *cb) 1524ev_child *child (struct ev_loop *loop, int pid, int trace, SV *cb)
1427 ALIAS: 1525 ALIAS:
1428 child_ns = 1 1526 child_ns = 1
1429 CODE: 1527 CODE:
1528#if EV_CHILD_ENABLE
1430 RETVAL = e_new (sizeof (ev_child), cb, ST (0)); 1529 RETVAL = e_new (sizeof (ev_child), cb, ST (0));
1431 ev_child_set (RETVAL, pid, trace); 1530 ev_child_set (RETVAL, pid, trace);
1432 if (!ix) START (child, RETVAL); 1531 if (!ix) START (child, RETVAL);
1532#else
1533 croak ("EV::child watchers not supported on this platform");
1534#endif
1433 OUTPUT: 1535 OUTPUT:
1434 RETVAL 1536 RETVAL
1435 1537
1436ev_stat *stat (struct ev_loop *loop, SV *path, NV interval, SV *cb) 1538ev_stat *stat (struct ev_loop *loop, SV *path, NV interval, SV *cb)
1437 ALIAS: 1539 ALIAS:
1478 SvOK (timeout) ? SvNV (timeout) : -1., 1580 SvOK (timeout) ? SvNV (timeout) : -1.,
1479 e_once_cb, 1581 e_once_cb,
1480 newSVsv (cb) 1582 newSVsv (cb)
1481 ); 1583 );
1482 1584
1585#endif
1586

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines