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

Comparing libev/ev.h (file contents):
Revision 1.168 by root, Wed Apr 18 06:06:04 2012 UTC vs.
Revision 1.175 by root, Tue Sep 9 13:24:13 2014 UTC

203#endif 203#endif
204 204
205/*****************************************************************************/ 205/*****************************************************************************/
206 206
207#define EV_VERSION_MAJOR 4 207#define EV_VERSION_MAJOR 4
208#define EV_VERSION_MINOR 11 208#define EV_VERSION_MINOR 18
209 209
210/* eventmask, revents, events... */ 210/* eventmask, revents, events... */
211enum { 211enum {
212 EV_UNDEF = 0xFFFFFFFF, /* guaranteed to be invalid */ 212 EV_UNDEF = (int)0xFFFFFFFF, /* guaranteed to be invalid */
213 EV_NONE = 0x00, /* no events */ 213 EV_NONE = 0x00, /* no events */
214 EV_READ = 0x01, /* ev_io detected read will not block */ 214 EV_READ = 0x01, /* ev_io detected read will not block */
215 EV_WRITE = 0x02, /* ev_io detected write will not block */ 215 EV_WRITE = 0x02, /* ev_io detected write will not block */
216 EV__IOFDSET = 0x80, /* internal use only */ 216 EV__IOFDSET = 0x80, /* internal use only */
217 EV_IO = EV_READ, /* alias for type-detection */ 217 EV_IO = EV_READ, /* alias for type-detection */
218 EV_TIMER = 0x00000100, /* timer timed out */ 218 EV_TIMER = 0x00000100, /* timer timed out */
219#if EV_COMPAT3 219#if EV_COMPAT3
220 EV_TIMEOUT = EV_TIMER, /* pre 4.0 API compatibility */ 220 EV_TIMEOUT = EV_TIMER, /* pre 4.0 API compatibility */
221#endif 221#endif
222 EV_PERIODIC = 0x00000200, /* periodic timer timed out */ 222 EV_PERIODIC = 0x00000200, /* periodic timer timed out */
223 EV_SIGNAL = 0x00000400, /* signal was received */ 223 EV_SIGNAL = 0x00000400, /* signal was received */
224 EV_CHILD = 0x00000800, /* child/pid had status change */ 224 EV_CHILD = 0x00000800, /* child/pid had status change */
225 EV_STAT = 0x00001000, /* stat data changed */ 225 EV_STAT = 0x00001000, /* stat data changed */
226 EV_IDLE = 0x00002000, /* event loop is idling */ 226 EV_IDLE = 0x00002000, /* event loop is idling */
227 EV_PREPARE = 0x00004000, /* event loop about to poll */ 227 EV_PREPARE = 0x00004000, /* event loop about to poll */
228 EV_CHECK = 0x00008000, /* event loop finished poll */ 228 EV_CHECK = 0x00008000, /* event loop finished poll */
229 EV_EMBED = 0x00010000, /* embedded event loop needs sweep */ 229 EV_EMBED = 0x00010000, /* embedded event loop needs sweep */
230 EV_FORK = 0x00020000, /* event loop resumed in child */ 230 EV_FORK = 0x00020000, /* event loop resumed in child */
231 EV_CLEANUP = 0x00040000, /* event loop resumed in child */ 231 EV_CLEANUP = 0x00040000, /* event loop resumed in child */
232 EV_ASYNC = 0x00080000, /* async intra-loop signal */ 232 EV_ASYNC = 0x00080000, /* async intra-loop signal */
233 EV_CUSTOM = 0x01000000, /* for use by user code */ 233 EV_CUSTOM = 0x01000000, /* for use by user code */
234 EV_ERROR = 0x80000000 /* sent when an error occurs */ 234 EV_ERROR = (int)0x80000000 /* sent when an error occurs */
235}; 235};
236 236
237/* can be used to add custom fields to all watchers, while losing binary compatibility */ 237/* can be used to add custom fields to all watchers, while losing binary compatibility */
238#ifndef EV_COMMON 238#ifndef EV_COMMON
239# define EV_COMMON void *data; 239# define EV_COMMON void *data;
593} 593}
594 594
595#endif /* multiplicity */ 595#endif /* multiplicity */
596 596
597/* destroy event loops, also works for the default loop */ 597/* destroy event loops, also works for the default loop */
598EV_API_DECL void ev_loop_destroy (EV_P) EV_THROW; 598EV_API_DECL void ev_loop_destroy (EV_P);
599 599
600/* this needs to be called after fork, to duplicate the loop */ 600/* this needs to be called after fork, to duplicate the loop */
601/* when you want to re-use it in the child */ 601/* when you want to re-use it in the child */
602/* you can call it in either the parent or the child */ 602/* you can call it in either the parent or the child */
603/* you can actually call it at any time, anywhere :) */ 603/* you can actually call it at any time, anywhere :) */
656EV_API_DECL void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_THROW; /* sleep at least this time, default 0 */ 656EV_API_DECL void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_THROW; /* sleep at least this time, default 0 */
657 657
658/* advanced stuff for threading etc. support, see docs */ 658/* advanced stuff for threading etc. support, see docs */
659EV_API_DECL void ev_set_userdata (EV_P_ void *data) EV_THROW; 659EV_API_DECL void ev_set_userdata (EV_P_ void *data) EV_THROW;
660EV_API_DECL void *ev_userdata (EV_P) EV_THROW; 660EV_API_DECL void *ev_userdata (EV_P) EV_THROW;
661typedef void (*ev_loop_callback)(EV_P);
661EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) EV_THROW; 662EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending_cb) EV_THROW;
662EV_API_DECL void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P) EV_THROW) EV_THROW; 663EV_API_DECL void ev_set_loop_release_cb (EV_P_ ev_loop_callback EV_THROW release, ev_loop_callback EV_THROW acquire) EV_THROW;
663 664
664EV_API_DECL unsigned int ev_pending_count (EV_P) EV_THROW; /* number of pending events, if any */ 665EV_API_DECL unsigned int ev_pending_count (EV_P) EV_THROW; /* number of pending events, if any */
665EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */ 666EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */
666 667
667/* 668/*
728#ifndef ev_set_cb 729#ifndef ev_set_cb
729# define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_) 730# define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_)
730#endif 731#endif
731 732
732/* stopping (enabling, adding) a watcher does nothing if it is already running */ 733/* stopping (enabling, adding) a watcher does nothing if it is already running */
733/* stopping (disabling, deleting) a watcher does nothing unless its already running */ 734/* stopping (disabling, deleting) a watcher does nothing unless it's already running */
734#if EV_PROTOTYPES 735#if EV_PROTOTYPES
735 736
736/* feeds an event into a watcher as if the event actually occurred */ 737/* feeds an event into a watcher as if the event actually occurred */
737/* accepts any ev_watcher type */ 738/* accepts any ev_watcher type */
738EV_API_DECL void ev_feed_event (EV_P_ void *w, int revents) EV_THROW; 739EV_API_DECL void ev_feed_event (EV_P_ void *w, int revents) EV_THROW;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines