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

Comparing EV/EV.xs (file contents):
Revision 1.122 by root, Wed Apr 15 19:35:53 2009 UTC vs.
Revision 1.125 by root, Wed Jul 8 02:46:05 2009 UTC

33 33
34/* 5.6.x */ 34/* 5.6.x */
35#ifndef SvRV_set 35#ifndef SvRV_set
36# define SvRV_set(a,b) SvRV ((a)) = (b) 36# define SvRV_set(a,b) SvRV ((a)) = (b)
37#endif 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 38
48#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX ((w)->loop)) 39#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX ((w)->loop))
49 40
50#define WFLAG_KEEPALIVE 1 41#define WFLAG_KEEPALIVE 1
51#define WFLAG_UNREFED 2 /* has been unref'ed */ 42#define WFLAG_UNREFED 2 /* has been unref'ed */
399 const_iv (EV_, MINPRI) 390 const_iv (EV_, MINPRI)
400 const_iv (EV_, MAXPRI) 391 const_iv (EV_, MAXPRI)
401 392
402 const_iv (EV_, UNDEF) 393 const_iv (EV_, UNDEF)
403 const_iv (EV_, NONE) 394 const_iv (EV_, NONE)
404 const_iv (EV_, TIMEOUT)
405 const_iv (EV_, READ) 395 const_iv (EV_, READ)
406 const_iv (EV_, WRITE) 396 const_iv (EV_, WRITE)
397 const_iv (EV_, IO)
398 const_iv (EV_, TIMEOUT)
399 const_iv (EV_, TIMER)
400 const_iv (EV_, PERIODIC)
407 const_iv (EV_, SIGNAL) 401 const_iv (EV_, SIGNAL)
402 const_iv (EV_, CHILD)
403 const_iv (EV_, STAT)
408 const_iv (EV_, IDLE) 404 const_iv (EV_, IDLE)
405 const_iv (EV_, PREPARE)
409 const_iv (EV_, CHECK) 406 const_iv (EV_, CHECK)
407 const_iv (EV_, EMBED)
408 const_iv (EV_, FORK)
409 const_iv (EV_, ASYNC)
410 const_iv (EV_, CUSTOM)
410 const_iv (EV_, ERROR) 411 const_iv (EV_, ERROR)
411 412
413 const_iv (EV, LOOP_NONBLOCK)
412 const_iv (EV, LOOP_ONESHOT) 414 const_iv (EV, LOOP_ONESHOT)
415
413 const_iv (EV, LOOP_NONBLOCK) 416 const_iv (EV, UNLOOP_CANCEL)
414 const_iv (EV, UNLOOP_ONE) 417 const_iv (EV, UNLOOP_ONE)
415 const_iv (EV, UNLOOP_ALL) 418 const_iv (EV, UNLOOP_ALL)
416 419
417 const_iv (EV, BACKEND_SELECT) 420 const_iv (EV, BACKEND_SELECT)
418 const_iv (EV, BACKEND_POLL) 421 const_iv (EV, BACKEND_POLL)
421 const_iv (EV, BACKEND_DEVPOLL) 424 const_iv (EV, BACKEND_DEVPOLL)
422 const_iv (EV, BACKEND_PORT) 425 const_iv (EV, BACKEND_PORT)
423 const_iv (EV, FLAG_AUTO) 426 const_iv (EV, FLAG_AUTO)
424 const_iv (EV, FLAG_NOENV) 427 const_iv (EV, FLAG_NOENV)
425 const_iv (EV, FLAG_FORKCHECK) 428 const_iv (EV, FLAG_FORKCHECK)
429
430 const_iv (EV_, VERSION_MAJOR)
431 const_iv (EV_, VERSION_MINOR)
426 }; 432 };
427 433
428 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 434 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
429 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 435 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
430 436
459 evapi.sleep_ = ev_sleep; 465 evapi.sleep_ = ev_sleep;
460 evapi.loop_new = ev_loop_new; 466 evapi.loop_new = ev_loop_new;
461 evapi.loop_destroy = ev_loop_destroy; 467 evapi.loop_destroy = ev_loop_destroy;
462 evapi.loop_fork = ev_loop_fork; 468 evapi.loop_fork = ev_loop_fork;
463 evapi.loop_count = ev_loop_count; 469 evapi.loop_count = ev_loop_count;
470 evapi.loop_depth = ev_loop_depth;
464 evapi.now = ev_now; 471 evapi.now = ev_now;
465 evapi.now_update = ev_now_update; 472 evapi.now_update = ev_now_update;
466 evapi.suspend = ev_suspend; 473 evapi.suspend = ev_suspend;
467 evapi.resume = ev_resume; 474 evapi.resume = ev_resume;
468 evapi.backend = ev_backend; 475 evapi.backend = ev_backend;
557 C_ARGS: evapi.default_loop 564 C_ARGS: evapi.default_loop
558 565
559unsigned int ev_backend () 566unsigned int ev_backend ()
560 C_ARGS: evapi.default_loop 567 C_ARGS: evapi.default_loop
561 568
569void ev_loop_verify ()
570 C_ARGS: evapi.default_loop
571
562unsigned int ev_loop_count () 572unsigned int ev_loop_count ()
573 C_ARGS: evapi.default_loop
574
575unsigned int ev_loop_depth ()
563 C_ARGS: evapi.default_loop 576 C_ARGS: evapi.default_loop
564 577
565void ev_set_io_collect_interval (NV interval) 578void ev_set_io_collect_interval (NV interval)
566 C_ARGS: evapi.default_loop, interval 579 C_ARGS: evapi.default_loop, interval
567 580
1284 1297
1285unsigned int ev_backend (struct ev_loop *loop) 1298unsigned int ev_backend (struct ev_loop *loop)
1286 1299
1287unsigned int ev_loop_count (struct ev_loop *loop) 1300unsigned int ev_loop_count (struct ev_loop *loop)
1288 1301
1302unsigned int ev_loop_depth (struct ev_loop *loop)
1303
1289void ev_loop (struct ev_loop *loop, int flags = 0) 1304void ev_loop (struct ev_loop *loop, int flags = 0)
1290 1305
1291void ev_unloop (struct ev_loop *loop, int how = 1) 1306void ev_unloop (struct ev_loop *loop, int how = 1)
1292 1307
1293void ev_feed_fd_event (struct ev_loop *loop, int fd, int revents = EV_NONE) 1308void ev_feed_fd_event (struct ev_loop *loop, int fd, int revents = EV_NONE)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines