ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.h
(Generate patch)

Comparing libev/ev.h (file contents):
Revision 1.113 by root, Wed Apr 15 17:49:27 2009 UTC vs.
Revision 1.116 by root, Wed Jul 8 02:46:05 2009 UTC

80 80
81#ifndef EV_ASYNC_ENABLE 81#ifndef EV_ASYNC_ENABLE
82# define EV_ASYNC_ENABLE 1 82# define EV_ASYNC_ENABLE 1
83#endif 83#endif
84 84
85#ifndef EV_WALK_ENABLE
86# define EV_WALK_ENABLE 0 /* not yet */
87#endif
88
85#ifndef EV_ATOMIC_T 89#ifndef EV_ATOMIC_T
86# include <signal.h> 90# include <signal.h>
87# define EV_ATOMIC_T sig_atomic_t volatile 91# define EV_ATOMIC_T sig_atomic_t volatile
88#endif 92#endif
89 93
455 459
456/* create and destroy alternative loops that don't handle signals */ 460/* create and destroy alternative loops that don't handle signals */
457struct ev_loop *ev_loop_new (unsigned int flags); 461struct ev_loop *ev_loop_new (unsigned int flags);
458void ev_loop_destroy (EV_P); 462void ev_loop_destroy (EV_P);
459void ev_loop_fork (EV_P); 463void ev_loop_fork (EV_P);
460void ev_loop_verify (EV_P);
461 464
462ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ 465ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */
463void ev_now_update (EV_P); 466void ev_now_update (EV_P);
464 467
465#else 468#else
492/* if you create alternative loops you have to call ev_loop_fork on them */ 495/* if you create alternative loops you have to call ev_loop_fork on them */
493/* you can call it in either the parent or the child */ 496/* you can call it in either the parent or the child */
494/* you can actually call it at any time, anywhere :) */ 497/* you can actually call it at any time, anywhere :) */
495void ev_default_fork (void); 498void ev_default_fork (void);
496 499
497#if 0 500unsigned int ev_backend (EV_P); /* backend in use by loop */
501unsigned int ev_loop_count (EV_P); /* number of loop iterations */
502unsigned int ev_loop_depth (EV_P); /* #ev_loop enters - #ev_loop leaves */
503void ev_loop_verify (EV_P); /* abort if loop data corrupted */
504
505#if EV_WALK_ENABLE
498/* walk (almost) all watchers in the loop of a given type, invoking the */ 506/* walk (almost) all watchers in the loop of a given type, invoking the */
499/* callback on every such watcher. The callback might stop the watcher, */ 507/* callback on every such watcher. The callback might stop the watcher, */
500/* but do nothing else with the loop */ 508/* but do nothing else with the loop */
501void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); 509void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w));
502#endif 510#endif
503 511
504unsigned int ev_backend (EV_P); /* backend in use by loop */
505unsigned int ev_loop_count (EV_P); /* number of loop iterations */
506#endif /* prototypes */ 512#endif /* prototypes */
507 513
508#define EVLOOP_NONBLOCK 1 /* do not block/wait */ 514#define EVLOOP_NONBLOCK 1 /* do not block/wait */
509#define EVLOOP_ONESHOT 2 /* block *once* only */ 515#define EVLOOP_ONESHOT 2 /* block *once* only */
510#define EVUNLOOP_CANCEL 0 /* undo unloop */ 516#define EVUNLOOP_CANCEL 0 /* undo unloop */
524 * should not keep ev_loop from running, unref() after starting, and ref() before stopping. 530 * should not keep ev_loop from running, unref() after starting, and ref() before stopping.
525 */ 531 */
526void ev_ref (EV_P); 532void ev_ref (EV_P);
527void ev_unref (EV_P); 533void ev_unref (EV_P);
528 534
535/*
536 * stop/start the timer handling.
537 */
538void ev_suspend (EV_P);
539void ev_resume (EV_P);
540
541/*
529/* convenience function, wait for a single event, without registering an event watcher */ 542 * convenience function, wait for a single event, without registering an event watcher
530/* if timeout is < 0, do wait indefinitely */ 543 * if timeout is < 0, do wait indefinitely
544 */
531void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg); 545void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg);
532#endif 546#endif
533 547
534/* these may evaluate ev multiple times, and the other arguments at most once */ 548/* these may evaluate ev multiple times, and the other arguments at most once */
535/* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */ 549/* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines