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.149 by root, Sun Nov 28 06:34:10 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:
1321 CODE: 1325 CODE:
1322 RETVAL = boolSV (ev_async_pending (w)); 1326 RETVAL = boolSV (ev_async_pending (w));
1323 OUTPUT: 1327 OUTPUT:
1324 RETVAL 1328 RETVAL
1325 1329
1330#ifndef EV_NO_LOOP
1331
1326MODULE = EV PACKAGE = EV::Loop PREFIX = ev_ 1332MODULE = EV PACKAGE = EV::Loop PREFIX = ev_
1327 1333
1328SV *new (SV *klass, unsigned int flags = 0) 1334SV *new (SV *klass, unsigned int flags = 0)
1329 CODE: 1335 CODE:
1330{ 1336{
1569 SvOK (timeout) ? SvNV (timeout) : -1., 1575 SvOK (timeout) ? SvNV (timeout) : -1.,
1570 e_once_cb, 1576 e_once_cb,
1571 newSVsv (cb) 1577 newSVsv (cb)
1572 ); 1578 );
1573 1579
1580#endif
1581

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines