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.176 by root, Tue Sep 9 13:28:21 2014 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines