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

Comparing libev/ev.h (file contents):
Revision 1.16 by root, Thu Nov 1 06:48:49 2007 UTC vs.
Revision 1.17 by root, Thu Nov 1 11:11:22 2007 UTC

31#define EV_H 31#define EV_H
32 32
33typedef double ev_tstamp; 33typedef double ev_tstamp;
34 34
35/* eventmask, revents, events... */ 35/* eventmask, revents, events... */
36#define EV_UNDEF -1 /* guaranteed to be invalid */ 36#define EV_UNDEF -1 /* guaranteed to be invalid */
37#define EV_NONE 0x00 37#define EV_NONE 0x00
38#define EV_READ 0x01 38#define EV_READ 0x01
39#define EV_WRITE 0x02 39#define EV_WRITE 0x02
40#define EV_REIFY 0x04 /* private */
41#define EV_TIMEOUT 0x000100 40#define EV_TIMEOUT 0x000100
41#define EV_PERIODIC 0x000200
42#define EV_SIGNAL 0x000200 42#define EV_SIGNAL 0x000400
43#define EV_IDLE 0x000400 43#define EV_IDLE 0x000800
44#define EV_CHECK 0x000800 44#define EV_CHECK 0x001000
45#define EV_PREPARE 0x001000 45#define EV_PREPARE 0x002000
46#define EV_CHILD 0x002000 46#define EV_CHILD 0x004000
47#define EV_ERROR 0x800000 /* sent when an error occurs */ 47#define EV_ERROR 0x800000 /* sent when an error occurs */
48 48
49/* can be used to add custom fields to all watchers */ 49/* can be used to add custom fields to all watchers */
50#ifndef EV_COMMON 50#ifndef EV_COMMON
51# define EV_COMMON void *data 51# define EV_COMMON void *data
52#endif 52#endif
93struct ev_watcher_time { 93struct ev_watcher_time {
94 EV_WATCHER_TIME (ev_watcher_time); 94 EV_WATCHER_TIME (ev_watcher_time);
95}; 95};
96 96
97/* invoked after a specific time, repeatable (based on monotonic clock) */ 97/* invoked after a specific time, repeatable (based on monotonic clock) */
98/* revent EV_TIMEOUT */
98struct ev_timer 99struct ev_timer
99{ 100{
100 EV_WATCHER_TIME (ev_timer); 101 EV_WATCHER_TIME (ev_timer);
101 102
102 ev_tstamp repeat; /* rw */ 103 ev_tstamp repeat; /* rw */
103}; 104};
104 105
105/* invoked at some specific time, possibly repeating at regular intervals (based on UTC) */ 106/* invoked at some specific time, possibly repeating at regular intervals (based on UTC) */
107/* revent EV_PERIODIC */
106struct ev_periodic 108struct ev_periodic
107{ 109{
108 EV_WATCHER_TIME (ev_periodic); 110 EV_WATCHER_TIME (ev_periodic);
109 111
110 ev_tstamp interval; /* rw */ 112 ev_tstamp interval; /* rw */
111}; 113};
112 114
113/* invoked when fd is either EV_READable or EV_WRITEable */ 115/* invoked when fd is either EV_READable or EV_WRITEable */
116/* revent EV_READ, EV_WRITE */
114struct ev_io 117struct ev_io
115{ 118{
116 EV_WATCHER_LIST (ev_io); 119 EV_WATCHER_LIST (ev_io);
117 120
118 int fd; /* ro */ 121 int fd; /* ro */
119 int events; /* ro */ 122 int events; /* ro */
120}; 123};
121 124
122/* invoked when the given signal has been received */ 125/* invoked when the given signal has been received */
126/* revent EV_SIGNAL */
123struct ev_signal 127struct ev_signal
124{ 128{
125 EV_WATCHER_LIST (ev_signal); 129 EV_WATCHER_LIST (ev_signal);
126 130
127 int signum; /* ro */ 131 int signum; /* ro */
128}; 132};
129 133
130/* invoked when the nothing else needs to be done, keeps the process from blocking */ 134/* invoked when the nothing else needs to be done, keeps the process from blocking */
135/* revent EV_IDLE */
131struct ev_idle 136struct ev_idle
132{ 137{
133 EV_WATCHER (ev_idle); 138 EV_WATCHER (ev_idle);
134}; 139};
135 140
136/* invoked for each run of the mainloop, just before the blocking call */ 141/* invoked for each run of the mainloop, just before the blocking call */
137/* you can still change events in any way you like */ 142/* you can still change events in any way you like */
143/* revent EV_PREPARE */
138struct ev_prepare 144struct ev_prepare
139{ 145{
140 EV_WATCHER (ev_prepare); 146 EV_WATCHER (ev_prepare);
141}; 147};
142 148
143/* invoked for each run of the mainloop, just after the blocking call */ 149/* invoked for each run of the mainloop, just after the blocking call */
150/* revent EV_CHECK */
144struct ev_check 151struct ev_check
145{ 152{
146 EV_WATCHER (ev_check); 153 EV_WATCHER (ev_check);
147}; 154};
148 155
149/* invoked when sigchld is received and waitpid indicates the givne pid */ 156/* invoked when sigchld is received and waitpid indicates the givne pid */
157/* revent EV_CHILD */
150struct ev_child 158struct ev_child
151{ 159{
152 EV_WATCHER_LIST (ev_child); 160 EV_WATCHER_LIST (ev_child);
153 161
154 int pid; /* ro */ 162 int pid; /* ro */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines