… | |
… | |
25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | */ |
28 | */ |
29 | |
29 | |
30 | #ifndef EV_H |
30 | #ifndef EV_H__ |
31 | #define EV_H |
31 | #define EV_H__ |
32 | |
32 | |
33 | #ifdef __cplusplus |
33 | #ifdef __cplusplus |
34 | extern "C" { |
34 | extern "C" { |
35 | #endif |
35 | #endif |
36 | |
36 | |
… | |
… | |
195 | int pid; /* ro */ |
195 | int pid; /* ro */ |
196 | int rpid; /* rw, holds the received pid */ |
196 | int rpid; /* rw, holds the received pid */ |
197 | int rstatus; /* rw, holds the exit status, use the macros from sys/wait.h */ |
197 | int rstatus; /* rw, holds the exit status, use the macros from sys/wait.h */ |
198 | }; |
198 | }; |
199 | |
199 | |
|
|
200 | /* the presence of this union forces similar struct layout */ |
200 | union ev_any_watcher |
201 | union ev_any_watcher |
201 | { |
202 | { |
202 | struct ev_watcher w; |
203 | struct ev_watcher w; |
203 | struct ev_watcher_list wl; |
204 | struct ev_watcher_list wl; |
204 | struct ev_io io; |
205 | struct ev_io io; |
… | |
… | |
324 | #define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_) |
325 | #define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_) |
325 | |
326 | |
326 | /* stopping (enabling, adding) a watcher does nothing if it is already running */ |
327 | /* stopping (enabling, adding) a watcher does nothing if it is already running */ |
327 | /* stopping (disabling, deleting) a watcher does nothing unless its already running */ |
328 | /* stopping (disabling, deleting) a watcher does nothing unless its already running */ |
328 | #if EV_PROTOTYPES |
329 | #if EV_PROTOTYPES |
|
|
330 | |
|
|
331 | /* feeds an event into a watcher as if the event actually occured */ |
|
|
332 | /* accepts any ev_watcher type */ |
|
|
333 | void ev_feed_event (EV_P_ void *w, int revents); |
|
|
334 | void ev_feed_fd_event (EV_P_ int fd, int revents); |
|
|
335 | void ev_feed_signal_event (EV_P_ int signum); |
|
|
336 | |
329 | void ev_io_start (EV_P_ struct ev_io *w); |
337 | void ev_io_start (EV_P_ struct ev_io *w); |
330 | void ev_io_stop (EV_P_ struct ev_io *w); |
338 | void ev_io_stop (EV_P_ struct ev_io *w); |
331 | |
339 | |
332 | void ev_timer_start (EV_P_ struct ev_timer *w); |
340 | void ev_timer_start (EV_P_ struct ev_timer *w); |
333 | void ev_timer_stop (EV_P_ struct ev_timer *w); |
341 | void ev_timer_stop (EV_P_ struct ev_timer *w); |