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

Comparing libev/ev.h (file contents):
Revision 1.85 by root, Fri Dec 14 21:07:13 2007 UTC vs.
Revision 1.87 by root, Thu Dec 20 10:12:22 2007 UTC

118#endif 118#endif
119#ifndef EV_PROTOTYPES 119#ifndef EV_PROTOTYPES
120# define EV_PROTOTYPES 1 120# define EV_PROTOTYPES 1
121#endif 121#endif
122 122
123#define EV_VERSION_MAJOR 1 123#define EV_VERSION_MAJOR 2
124#define EV_VERSION_MINOR 0 124#define EV_VERSION_MINOR 0
125 125
126#ifndef EV_CB_DECLARE 126#ifndef EV_CB_DECLARE
127# define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents); 127# define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents);
128#endif 128#endif
283/* the callback gets invoked when the event loop has handled events, and can be 0 */ 283/* the callback gets invoked when the event loop has handled events, and can be 0 */
284typedef struct ev_embed 284typedef struct ev_embed
285{ 285{
286 EV_WATCHER (ev_embed) 286 EV_WATCHER (ev_embed)
287 287
288 ev_io io; /* private */
289 struct ev_loop *loop; /* ro */ 288 struct ev_loop *other; /* ro */
289 ev_io io; /* private */
290 ev_prepare prepare; /* private */
291 ev_check check; /* unused */
292 ev_timer timer; /* unused */
293 ev_periodic periodic; /* unused */
294 ev_idle idle; /* unused */
295 ev_fork fork; /* unused */
290} ev_embed; 296} ev_embed;
291#endif 297#endif
292 298
293/* the presence of this union forces similar struct layout */ 299/* the presence of this union forces similar struct layout */
294union ev_any_watcher 300union ev_any_watcher
440#define ev_child_set(ev,pid_) do { (ev)->pid = (pid_); } while (0) 446#define ev_child_set(ev,pid_) do { (ev)->pid = (pid_); } while (0)
441#define ev_stat_set(ev,path_,interval_) do { (ev)->path = (path_); (ev)->interval = (interval_); (ev)->wd = -2; } while (0) 447#define ev_stat_set(ev,path_,interval_) do { (ev)->path = (path_); (ev)->interval = (interval_); (ev)->wd = -2; } while (0)
442#define ev_idle_set(ev) /* nop, yes, this is a serious in-joke */ 448#define ev_idle_set(ev) /* nop, yes, this is a serious in-joke */
443#define ev_prepare_set(ev) /* nop, yes, this is a serious in-joke */ 449#define ev_prepare_set(ev) /* nop, yes, this is a serious in-joke */
444#define ev_check_set(ev) /* nop, yes, this is a serious in-joke */ 450#define ev_check_set(ev) /* nop, yes, this is a serious in-joke */
445#define ev_embed_set(ev,loop_) do { (ev)->loop = (loop_); } while (0) 451#define ev_embed_set(ev,other_) do { (ev)->other = (other_); } while (0)
446#define ev_fork_set(ev) /* nop, yes, this is a serious in-joke */ 452#define ev_fork_set(ev) /* nop, yes, this is a serious in-joke */
447 453
448#define ev_io_init(ev,cb,fd,events) do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0) 454#define ev_io_init(ev,cb,fd,events) do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0)
449#define ev_timer_init(ev,cb,after,repeat) do { ev_init ((ev), (cb)); ev_timer_set ((ev),(after),(repeat)); } while (0) 455#define ev_timer_init(ev,cb,after,repeat) do { ev_init ((ev), (cb)); ev_timer_set ((ev),(after),(repeat)); } while (0)
450#define ev_periodic_init(ev,cb,at,ival,res) do { ev_init ((ev), (cb)); ev_periodic_set ((ev),(at),(ival),(res)); } 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)
452#define ev_child_init(ev,cb,pid) do { ev_init ((ev), (cb)); ev_child_set ((ev),(pid)); } while (0) 458#define ev_child_init(ev,cb,pid) do { ev_init ((ev), (cb)); ev_child_set ((ev),(pid)); } while (0)
453#define ev_stat_init(ev,cb,path,interval) do { ev_init ((ev), (cb)); ev_path_set ((ev),(path),(interval)); } while (0) 459#define ev_stat_init(ev,cb,path,interval) do { ev_init ((ev), (cb)); ev_path_set ((ev),(path),(interval)); } while (0)
454#define ev_idle_init(ev,cb) do { ev_init ((ev), (cb)); ev_idle_set ((ev)); } while (0) 460#define ev_idle_init(ev,cb) do { ev_init ((ev), (cb)); ev_idle_set ((ev)); } while (0)
455#define ev_prepare_init(ev,cb) do { ev_init ((ev), (cb)); ev_prepare_set ((ev)); } while (0) 461#define ev_prepare_init(ev,cb) do { ev_init ((ev), (cb)); ev_prepare_set ((ev)); } while (0)
456#define ev_check_init(ev,cb) do { ev_init ((ev), (cb)); ev_check_set ((ev)); } while (0) 462#define ev_check_init(ev,cb) do { ev_init ((ev), (cb)); ev_check_set ((ev)); } while (0)
457#define ev_embed_init(ev,cb,loop) do { ev_init ((ev), (cb)); ev_embed_set ((ev),(loop)); } while (0) 463#define ev_embed_init(ev,cb,other) do { ev_init ((ev), (cb)); ev_embed_set ((ev),(other)); } while (0)
458#define ev_fork_init(ev,cb) do { ev_init ((ev), (cb)); ev_fork_set ((ev)); } while (0) 464#define ev_fork_init(ev,cb) do { ev_init ((ev), (cb)); ev_fork_set ((ev)); } while (0)
459 465
460#define ev_is_pending(ev) (0 + ((ev_watcher *)(void *)(ev))->pending) /* ro, true when watcher is waiting for callback invocation */ 466#define ev_is_pending(ev) (0 + ((ev_watcher *)(void *)(ev))->pending) /* ro, true when watcher is waiting for callback invocation */
461#define ev_is_active(ev) (0 + ((ev_watcher *)(void *)(ev))->active) /* ro, true when the watcher has been started */ 467#define ev_is_active(ev) (0 + ((ev_watcher *)(void *)(ev))->active) /* ro, true when the watcher has been started */
462 468

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines