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

Comparing libev/event.h (file contents):
Revision 1.3 by root, Fri Nov 2 11:02:23 2007 UTC vs.
Revision 1.15 by root, Fri Nov 9 19:14:37 2007 UTC

26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31#ifndef _EVENT_H_ 31#ifndef EVENT_H__
32#define _EVENT_H_ 32#define EVENT_H__
33
34#ifdef EV_H
35# include EV_H
36#else
37# include <ev.h>
38#endif
33 39
34#ifdef __cplusplus 40#ifdef __cplusplus
35extern "C" { 41extern "C" {
36#endif 42#endif
37 43
38#include "ev.h" 44struct event_base;
39 45
40struct event 46struct event
41 { 47{
48 /* libev watchers we map onto */
49 union {
42 struct ev_io io; 50 struct ev_io io;
51 struct ev_signal sig;
52 } iosig;
43 struct ev_timer to; 53 struct ev_timer to;
44 struct ev_signal sig;
45 54
55 /* compatibility slots */
46 struct event_base *ev_base; 56 struct event_base *ev_base;
47 void (*ev_callback)(int, short, void *arg); 57 void (*ev_callback)(int, short, void *arg);
48 void *ev_arg; 58 void *ev_arg;
49 int ev_fd; 59 int ev_fd;
50 int ev_pri; 60 int ev_pri;
98void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); 108void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg);
99int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); 109int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv);
100 110
101int event_add (struct event *ev, struct timeval *tv); 111int event_add (struct event *ev, struct timeval *tv);
102int event_del (struct event *ev); 112int event_del (struct event *ev);
113void event_active (struct event *ev, int res, short ncalls); /* ncalls is being ignored */
103 114
104int event_pending (struct event *ev, short, struct timeval *tv); 115int event_pending (struct event *ev, short, struct timeval *tv);
105 116
106int event_priority_init (int npri); 117int event_priority_init (int npri);
107int event_priority_set (struct event *ev, int pri); 118int event_priority_set (struct event *ev, int pri);
108
109struct event_base;
110 119
111int event_base_set (struct event_base *base, struct event *ev); 120int event_base_set (struct event_base *base, struct event *ev);
112int event_base_loop (struct event_base *base, int); 121int event_base_loop (struct event_base *base, int);
113int event_base_loopexit (struct event_base *base, struct timeval *tv); 122int event_base_loopexit (struct event_base *base, struct timeval *tv);
114int event_base_dispatch (struct event_base *base); 123int event_base_dispatch (struct event_base *base);
115int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); 124int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv);
116int event_base_priority_init (struct event_base *base, int fd); 125int event_base_priority_init (struct event_base *base, int fd);
117 126
127#ifndef EV_STANDALONE
128# include <event_compat.h>
118#endif 129#endif
130
131#ifdef __cplusplus
132}
133#endif
134
135#endif
136

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines