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

Comparing EV/EV.xs (file contents):
Revision 1.146 by root, Sun Oct 24 20:05:43 2010 UTC vs.
Revision 1.150 by root, Sun Nov 28 11:40:41 2010 UTC

341 croak ("illegal file descriptor or filehandle (either no attached file descriptor or illegal value): %s", SvPV_nolen (fh)); 341 croak ("illegal file descriptor or filehandle (either no attached file descriptor or illegal value): %s", SvPV_nolen (fh));
342 342
343#define CHECK_SIG(sv,num) if ((num) < 0) \ 343#define CHECK_SIG(sv,num) if ((num) < 0) \
344 croak ("illegal signal number or name: %s", SvPV_nolen (sv)); 344 croak ("illegal signal number or name: %s", SvPV_nolen (sv));
345 345
346static void
347default_fork (void)
348{
349 ev_loop_fork (EV_DEFAULT_UC);
350}
351
346///////////////////////////////////////////////////////////////////////////// 352/////////////////////////////////////////////////////////////////////////////
347// XS interface functions 353// XS interface functions
348 354
349MODULE = EV PACKAGE = EV PREFIX = ev_ 355MODULE = EV PACKAGE = EV PREFIX = ev_
350 356
365 const_iv (EV_, UNDEF) 371 const_iv (EV_, UNDEF)
366 const_iv (EV_, NONE) 372 const_iv (EV_, NONE)
367 const_iv (EV_, READ) 373 const_iv (EV_, READ)
368 const_iv (EV_, WRITE) 374 const_iv (EV_, WRITE)
369 const_iv (EV_, IO) 375 const_iv (EV_, IO)
370 const_iv (EV_, TIMEOUT) 376 const_iv (EV_, TIMER)
371 const_iv (EV_, PERIODIC) 377 const_iv (EV_, PERIODIC)
372 const_iv (EV_, SIGNAL) 378 const_iv (EV_, SIGNAL)
373 const_iv (EV_, CHILD) 379 const_iv (EV_, CHILD)
374 const_iv (EV_, STAT) 380 const_iv (EV_, STAT)
375 const_iv (EV_, IDLE) 381 const_iv (EV_, IDLE)
397 const_iv (EV, BACKEND_ALL) 403 const_iv (EV, BACKEND_ALL)
398 const_iv (EV, FLAG_AUTO) 404 const_iv (EV, FLAG_AUTO)
399 const_iv (EV, FLAG_FORKCHECK) 405 const_iv (EV, FLAG_FORKCHECK)
400 const_iv (EV, FLAG_SIGNALFD) 406 const_iv (EV, FLAG_SIGNALFD)
401 const_iv (EV, FLAG_NOENV) 407 const_iv (EV, FLAG_NOENV)
402 const_iv (EV, FLAG_NOSIGFD) /* compatibility, always 0 */
403 const_iv (EV, FLAG_NOINOTIFY) 408 const_iv (EV, FLAG_NOINOTIFY)
404 409
405 const_iv (EV_, VERSION_MAJOR) 410 const_iv (EV_, VERSION_MAJOR)
406 const_iv (EV_, VERSION_MINOR) 411 const_iv (EV_, VERSION_MINOR)
407#if EV_COMPAT3 412#if EV_COMPAT3
413 const_iv (EV, FLAG_NOSIGFD) /* compatibility, always 0 */
408 const_iv (EV_, TIMER) 414 const_iv (EV_, TIMEOUT)
409
410 const_iv (EV, LOOP_NONBLOCK) 415 const_iv (EV, LOOP_NONBLOCK)
411 const_iv (EV, LOOP_ONESHOT) 416 const_iv (EV, LOOP_ONESHOT)
412
413 const_iv (EV, UNLOOP_CANCEL) 417 const_iv (EV, UNLOOP_CANCEL)
414 const_iv (EV, UNLOOP_ONE) 418 const_iv (EV, UNLOOP_ONE)
415 const_iv (EV, UNLOOP_ALL) 419 const_iv (EV, UNLOOP_ALL)
416#endif 420#endif
417 }; 421 };
509 513
510 sv_setiv (sv, (IV)&evapi); 514 sv_setiv (sv, (IV)&evapi);
511 SvREADONLY_on (sv); 515 SvREADONLY_on (sv);
512 } 516 }
513#if !defined(_WIN32) && !defined(_MINIX) 517#if !defined(_WIN32) && !defined(_MINIX)
514 pthread_atfork (0, 0, ev_default_fork); 518 pthread_atfork (0, 0, default_fork);
515#endif 519#endif
516} 520}
517 521
518SV *ev_default_loop (unsigned int flags = 0) 522SV *ev_default_loop (unsigned int flags = 0)
519 CODE: 523 CODE:
754 ev_stat_set (RETVAL, SvPVbyte_nolen (e_fh (RETVAL)), interval); 758 ev_stat_set (RETVAL, SvPVbyte_nolen (e_fh (RETVAL)), interval);
755 if (!ix) START (stat, RETVAL); 759 if (!ix) START (stat, RETVAL);
756 OUTPUT: 760 OUTPUT:
757 RETVAL 761 RETVAL
758 762
763#ifndef EV_NO_LOOPS
764
759ev_embed *embed (struct ev_loop *loop, SV *cb = 0) 765ev_embed *embed (struct ev_loop *loop, SV *cb = 0)
760 ALIAS: 766 ALIAS:
761 embed_ns = 1 767 embed_ns = 1
762 CODE: 768 CODE:
763{ 769{
769 ev_embed_set (RETVAL, loop); 775 ev_embed_set (RETVAL, loop);
770 if (!ix) START (embed, RETVAL); 776 if (!ix) START (embed, RETVAL);
771} 777}
772 OUTPUT: 778 OUTPUT:
773 RETVAL 779 RETVAL
780
781#endif
774 782
775ev_async *async (SV *cb) 783ev_async *async (SV *cb)
776 ALIAS: 784 ALIAS:
777 async_ns = 1 785 async_ns = 1
778 CODE: 786 CODE:
1321 CODE: 1329 CODE:
1322 RETVAL = boolSV (ev_async_pending (w)); 1330 RETVAL = boolSV (ev_async_pending (w));
1323 OUTPUT: 1331 OUTPUT:
1324 RETVAL 1332 RETVAL
1325 1333
1334#ifndef EV_NO_LOOPS
1335
1326MODULE = EV PACKAGE = EV::Loop PREFIX = ev_ 1336MODULE = EV PACKAGE = EV::Loop PREFIX = ev_
1327 1337
1328SV *new (SV *klass, unsigned int flags = 0) 1338SV *new (SV *klass, unsigned int flags = 0)
1329 CODE: 1339 CODE:
1330{ 1340{
1569 SvOK (timeout) ? SvNV (timeout) : -1., 1579 SvOK (timeout) ? SvNV (timeout) : -1.,
1570 e_once_cb, 1580 e_once_cb,
1571 newSVsv (cb) 1581 newSVsv (cb)
1572 ); 1582 );
1573 1583
1584#endif
1585

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines