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

Comparing libev/ev.h (file contents):
Revision 1.100 by root, Fri May 2 08:36:20 2008 UTC vs.
Revision 1.102 by root, Thu May 22 02:44:57 2008 UTC

164/* 164/*
165 * struct member types: 165 * struct member types:
166 * private: you can look at them, but not change them, and they might not mean anything to you. 166 * private: you can look at them, but not change them, and they might not mean anything to you.
167 * ro: can be read anytime, but only changed when the watcher isn't active 167 * ro: can be read anytime, but only changed when the watcher isn't active
168 * rw: can be read and modified anytime, even when the watcher is active 168 * rw: can be read and modified anytime, even when the watcher is active
169 *
170 * some internal details that might be helpful for debugging:
171 *
172 * active is either 0, which means the watcher is not active,
173 * or the array index of the watcher (periodics, timers)
174 * or the array index + 1 (most other watchers)
175 * or simply 1 for watchers that aren't in some array.
176 * pending is either 0, in which case the watcher isn't,
177 * or the array index + 1 in the pendings array.
169 */ 178 */
170 179
171/* shared by all watchers */ 180/* shared by all watchers */
172#define EV_WATCHER(type) \ 181#define EV_WATCHER(type) \
173 int active; /* private */ \ 182 int active; /* private */ \
408 * retryable syscall error 417 * retryable syscall error
409 * (such as failed select, poll, epoll_wait) 418 * (such as failed select, poll, epoll_wait)
410 */ 419 */
411void ev_set_syserr_cb (void (*cb)(const char *msg)); 420void ev_set_syserr_cb (void (*cb)(const char *msg));
412 421
413# if EV_MULTIPLICITY 422#if EV_MULTIPLICITY
414EV_INLINE struct ev_loop * 423EV_INLINE struct ev_loop *
415ev_default_loop_uc (void) 424ev_default_loop_uc (void)
416{ 425{
417 extern struct ev_loop *ev_default_loop_ptr; 426 extern struct ev_loop *ev_default_loop_ptr;
418 427
438 447
439/* create and destroy alternative loops that don't handle signals */ 448/* create and destroy alternative loops that don't handle signals */
440struct ev_loop *ev_loop_new (unsigned int flags); 449struct ev_loop *ev_loop_new (unsigned int flags);
441void ev_loop_destroy (EV_P); 450void ev_loop_destroy (EV_P);
442void ev_loop_fork (EV_P); 451void ev_loop_fork (EV_P);
452void ev_loop_verify (EV_P);
443 453
444ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ 454ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */
445 455
446# else 456#else
447 457
448int ev_default_loop (unsigned int flags); /* returns true when successful */ 458int ev_default_loop (unsigned int flags); /* returns true when successful */
449 459
450EV_INLINE ev_tstamp 460EV_INLINE ev_tstamp
451ev_now (void) 461ev_now (void)
452{ 462{
453 extern ev_tstamp ev_rt_now; 463 extern ev_tstamp ev_rt_now;
454 464
455 return ev_rt_now; 465 return ev_rt_now;
456} 466}
457# endif 467#endif /* multiplicity */
458 468
459EV_INLINE int 469EV_INLINE int
460ev_is_default_loop (EV_P) 470ev_is_default_loop (EV_P)
461{ 471{
462#if EV_MULTIPLICITY 472#if EV_MULTIPLICITY
475/* you can actually call it at any time, anywhere :) */ 485/* you can actually call it at any time, anywhere :) */
476void ev_default_fork (void); 486void ev_default_fork (void);
477 487
478unsigned int ev_backend (EV_P); /* backend in use by loop */ 488unsigned int ev_backend (EV_P); /* backend in use by loop */
479unsigned int ev_loop_count (EV_P); /* number of loop iterations */ 489unsigned int ev_loop_count (EV_P); /* number of loop iterations */
480#endif 490#endif /* prototypes */
481 491
482#define EVLOOP_NONBLOCK 1 /* do not block/wait */ 492#define EVLOOP_NONBLOCK 1 /* do not block/wait */
483#define EVLOOP_ONESHOT 2 /* block *once* only */ 493#define EVLOOP_ONESHOT 2 /* block *once* only */
484#define EVUNLOOP_CANCEL 0 /* undo unloop */ 494#define EVUNLOOP_CANCEL 0 /* undo unloop */
485#define EVUNLOOP_ONE 1 /* unloop once */ 495#define EVUNLOOP_ONE 1 /* unloop once */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines