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

Comparing libev/ev.h (file contents):
Revision 1.112 by root, Sat Mar 28 22:17:17 2009 UTC vs.
Revision 1.115 by root, Sat Apr 25 14:12:48 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
145#define EV_PREPARE 0x00004000 /* event loop about to poll */ 149#define EV_PREPARE 0x00004000 /* event loop about to poll */
146#define EV_CHECK 0x00008000 /* event loop finished poll */ 150#define EV_CHECK 0x00008000 /* event loop finished poll */
147#define EV_EMBED 0x00010000 /* embedded event loop needs sweep */ 151#define EV_EMBED 0x00010000 /* embedded event loop needs sweep */
148#define EV_FORK 0x00020000 /* event loop resumed in child */ 152#define EV_FORK 0x00020000 /* event loop resumed in child */
149#define EV_ASYNC 0x00040000 /* async intra-loop signal */ 153#define EV_ASYNC 0x00040000 /* async intra-loop signal */
154#define EV_CUSTOM 0x01000000 /* for use by user code */
150#define EV_ERROR 0x80000000 /* sent when an error occurs */ 155#define EV_ERROR 0x80000000 /* sent when an error occurs */
151 156
152/* can be used to add custom fields to all watchers, while losing binary compatibility */ 157/* can be used to add custom fields to all watchers, while losing binary compatibility */
153#ifndef EV_COMMON 158#ifndef EV_COMMON
154# define EV_COMMON void *data; 159# define EV_COMMON void *data;
491/* if you create alternative loops you have to call ev_loop_fork on them */ 496/* if you create alternative loops you have to call ev_loop_fork on them */
492/* you can call it in either the parent or the child */ 497/* you can call it in either the parent or the child */
493/* you can actually call it at any time, anywhere :) */ 498/* you can actually call it at any time, anywhere :) */
494void ev_default_fork (void); 499void ev_default_fork (void);
495 500
496#if 0 501#if EV_WALK_ENABLE
497/* walk (almost) all watchers in the loop of a given type, invoking the */ 502/* walk (almost) all watchers in the loop of a given type, invoking the */
498/* callback on every such watcher. The callback might stop the watcher, */ 503/* callback on every such watcher. The callback might stop the watcher, */
499/* but do nothing else with the loop */ 504/* but do nothing else with the loop */
500void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); 505void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w));
501#endif 506#endif
523 * should not keep ev_loop from running, unref() after starting, and ref() before stopping. 528 * should not keep ev_loop from running, unref() after starting, and ref() before stopping.
524 */ 529 */
525void ev_ref (EV_P); 530void ev_ref (EV_P);
526void ev_unref (EV_P); 531void ev_unref (EV_P);
527 532
533/*
534 * stop/start the timer handling.
535 */
536void ev_suspend (EV_P);
537void ev_resume (EV_P);
538
539/*
528/* convenience function, wait for a single event, without registering an event watcher */ 540 * convenience function, wait for a single event, without registering an event watcher
529/* if timeout is < 0, do wait indefinitely */ 541 * if timeout is < 0, do wait indefinitely
542 */
530void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg); 543void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg);
531#endif 544#endif
532 545
533/* these may evaluate ev multiple times, and the other arguments at most once */ 546/* these may evaluate ev multiple times, and the other arguments at most once */
534/* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */ 547/* 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