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

Comparing libev/ev.h (file contents):
Revision 1.87 by root, Thu Dec 20 10:12:22 2007 UTC vs.
Revision 1.89 by root, Mon Dec 24 03:41:38 2007 UTC

344unsigned int ev_supported_backends (void); 344unsigned int ev_supported_backends (void);
345unsigned int ev_recommended_backends (void); 345unsigned int ev_recommended_backends (void);
346unsigned int ev_embeddable_backends (void); 346unsigned int ev_embeddable_backends (void);
347 347
348ev_tstamp ev_time (void); 348ev_tstamp ev_time (void);
349void ev_sleep (ev_tstamp delay); /* sleep for a while */
349 350
350/* Sets the allocation function to use, works like realloc. 351/* Sets the allocation function to use, works like realloc.
351 * It is used to allocate and free memory. 352 * It is used to allocate and free memory.
352 * If it returns zero when memory needs to be allocated, the library might abort 353 * If it returns zero when memory needs to be allocated, the library might abort
353 * or take some potentially destructive action. 354 * or take some potentially destructive action.
401/* if you create alternative loops you have to call ev_loop_fork on them */ 402/* if you create alternative loops you have to call ev_loop_fork on them */
402/* you can call it in either the parent or the child */ 403/* you can call it in either the parent or the child */
403/* you can actually call it at any time, anywhere :) */ 404/* you can actually call it at any time, anywhere :) */
404void ev_default_fork (void); 405void ev_default_fork (void);
405 406
406unsigned int ev_backend (EV_P); 407unsigned int ev_backend (EV_P); /* backend in use by loop */
407unsigned int ev_loop_count (EV_P); 408unsigned int ev_loop_count (EV_P); /* number of loop iterations */
408#endif 409#endif
409 410
410#define EVLOOP_NONBLOCK 1 /* do not block/wait */ 411#define EVLOOP_NONBLOCK 1 /* do not block/wait */
411#define EVLOOP_ONESHOT 2 /* block *once* only */ 412#define EVLOOP_ONESHOT 2 /* block *once* only */
412#define EVUNLOOP_CANCEL 0 /* undo unloop */ 413#define EVUNLOOP_CANCEL 0 /* undo unloop */
414#define EVUNLOOP_ALL 2 /* unloop all loops */ 415#define EVUNLOOP_ALL 2 /* unloop all loops */
415 416
416#if EV_PROTOTYPES 417#if EV_PROTOTYPES
417void ev_loop (EV_P_ int flags); 418void ev_loop (EV_P_ int flags);
418void ev_unloop (EV_P_ int how); /* set to 1 to break out of event loop, set to 2 to break out of all event loops */ 419void ev_unloop (EV_P_ int how); /* set to 1 to break out of event loop, set to 2 to break out of all event loops */
420
421void ev_set_io_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
422void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
419 423
420/* 424/*
421 * ref/unref can be used to add or remove a refcount on the mainloop. every watcher 425 * ref/unref can be used to add or remove a refcount on the mainloop. every watcher
422 * keeps one reference. if you have a long-runing watcher you never unregister that 426 * keeps one reference. if you have a long-runing watcher you never unregister that
423 * should not keep ev_loop from running, unref() after starting, and ref() before stopping. 427 * should not keep ev_loop from running, unref() after starting, and ref() before stopping.
454#define ev_io_init(ev,cb,fd,events) do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0) 458#define ev_io_init(ev,cb,fd,events) do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0)
455#define ev_timer_init(ev,cb,after,repeat) do { ev_init ((ev), (cb)); ev_timer_set ((ev),(after),(repeat)); } while (0) 459#define ev_timer_init(ev,cb,after,repeat) do { ev_init ((ev), (cb)); ev_timer_set ((ev),(after),(repeat)); } while (0)
456#define ev_periodic_init(ev,cb,at,ival,res) do { ev_init ((ev), (cb)); ev_periodic_set ((ev),(at),(ival),(res)); } while (0) 460#define ev_periodic_init(ev,cb,at,ival,res) do { ev_init ((ev), (cb)); ev_periodic_set ((ev),(at),(ival),(res)); } while (0)
457#define ev_signal_init(ev,cb,signum) do { ev_init ((ev), (cb)); ev_signal_set ((ev), (signum)); } while (0) 461#define ev_signal_init(ev,cb,signum) do { ev_init ((ev), (cb)); ev_signal_set ((ev), (signum)); } while (0)
458#define ev_child_init(ev,cb,pid) do { ev_init ((ev), (cb)); ev_child_set ((ev),(pid)); } while (0) 462#define ev_child_init(ev,cb,pid) do { ev_init ((ev), (cb)); ev_child_set ((ev),(pid)); } while (0)
459#define ev_stat_init(ev,cb,path,interval) do { ev_init ((ev), (cb)); ev_path_set ((ev),(path),(interval)); } while (0) 463#define ev_stat_init(ev,cb,path,interval) do { ev_init ((ev), (cb)); ev_stat_set ((ev),(path),(interval)); } while (0)
460#define ev_idle_init(ev,cb) do { ev_init ((ev), (cb)); ev_idle_set ((ev)); } while (0) 464#define ev_idle_init(ev,cb) do { ev_init ((ev), (cb)); ev_idle_set ((ev)); } while (0)
461#define ev_prepare_init(ev,cb) do { ev_init ((ev), (cb)); ev_prepare_set ((ev)); } while (0) 465#define ev_prepare_init(ev,cb) do { ev_init ((ev), (cb)); ev_prepare_set ((ev)); } while (0)
462#define ev_check_init(ev,cb) do { ev_init ((ev), (cb)); ev_check_set ((ev)); } while (0) 466#define ev_check_init(ev,cb) do { ev_init ((ev), (cb)); ev_check_set ((ev)); } while (0)
463#define ev_embed_init(ev,cb,other) do { ev_init ((ev), (cb)); ev_embed_set ((ev),(other)); } while (0) 467#define ev_embed_init(ev,cb,other) do { ev_init ((ev), (cb)); ev_embed_set ((ev),(other)); } while (0)
464#define ev_fork_init(ev,cb) do { ev_init ((ev), (cb)); ev_fork_set ((ev)); } while (0) 468#define ev_fork_init(ev,cb) do { ev_init ((ev), (cb)); ev_fork_set ((ev)); } while (0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines