summaryrefslogtreecommitdiff
path: root/lib/libevent/event.h
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-05-02 06:09:12 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-05-02 06:09:12 +0000
commitaca1b177e06cca0f06297751ac178ab96e04ae4f (patch)
tree40ed096e545ca29b466eb9e383e5d548f4a090ff /lib/libevent/event.h
parent0a4d9575993ffee6da26d8e1d2569a946fce5f41 (diff)
Update to libevent 1.3e while retaining our local changes.
"No objection" millert@ "the diff looks and works fine" reyk@
Diffstat (limited to 'lib/libevent/event.h')
-rw-r--r--lib/libevent/event.h45
1 files changed, 22 insertions, 23 deletions
diff --git a/lib/libevent/event.h b/lib/libevent/event.h
index 690322ee2af..82451393895 100644
--- a/lib/libevent/event.h
+++ b/lib/libevent/event.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.h,v 1.18 2007/03/19 15:12:49 millert Exp $ */
+/* $OpenBSD: event.h,v 1.19 2008/05/02 06:09:11 brad Exp $ */
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
@@ -33,6 +33,8 @@
extern "C" {
#endif
+#include <sys/time.h>
+#include <stdint.h>
#include <stdarg.h>
#ifdef WIN32
@@ -43,7 +45,7 @@ typedef unsigned char u_char;
typedef unsigned short u_short;
#endif
-#define LIBEVENT_VERSION "1.3b"
+#define LIBEVENT_VERSION "1.3e"
#define EVLIST_TIMEOUT 0x01
#define EVLIST_INSERTED 0x02
@@ -135,16 +137,14 @@ TAILQ_HEAD (evkeyvalq, evkeyval);
struct eventop {
char *name;
- void *(*init)(void);
+ void *(*init)(struct event_base *);
int (*add)(void *, struct event *);
int (*del)(void *, struct event *);
int (*recalc)(struct event_base *, void *, int);
int (*dispatch)(struct event_base *, void *, struct timeval *);
- void (*dealloc)(void *);
+ void (*dealloc)(struct event_base *, void *);
};
-#define TIMEOUT_DEFAULT {5, 0}
-
void *event_init(void);
int event_dispatch(void);
int event_base_dispatch(struct event_base *);
@@ -182,6 +182,7 @@ int event_base_loopexit(struct event_base *, struct timeval *);
void event_set(struct event *, int, short, void (*)(int, short, void *), void *);
int event_once(int, short, void (*)(int, short, void *), void *, struct timeval *);
+int event_base_once(struct event_base *, int, short, void (*)(int, short, void *), void *, struct timeval *);
int event_add(struct event *, struct timeval *);
int event_del(struct event *);
@@ -297,39 +298,37 @@ void evbuffer_setcb(struct evbuffer *, void (*)(struct evbuffer *, size_t, size_
void evtag_init(void);
-void evtag_marshal(struct evbuffer *evbuf, u_int8_t tag, const void *data,
- u_int32_t len);
+void evtag_marshal(struct evbuffer *evbuf, uint8_t tag, const void *data,
+ uint32_t len);
-void encode_int(struct evbuffer *evbuf, u_int32_t number);
+void encode_int(struct evbuffer *evbuf, uint32_t number);
-void evtag_marshal_int(struct evbuffer *evbuf, u_int8_t tag,
- u_int32_t integer);
+void evtag_marshal_int(struct evbuffer *evbuf, uint8_t tag, uint32_t integer);
-void evtag_marshal_string(struct evbuffer *buf, u_int8_t tag,
+void evtag_marshal_string(struct evbuffer *buf, uint8_t tag,
const char *string);
-void evtag_marshal_timeval(struct evbuffer *evbuf, u_int8_t tag,
+void evtag_marshal_timeval(struct evbuffer *evbuf, uint8_t tag,
struct timeval *tv);
void evtag_test(void);
-int evtag_unmarshal(struct evbuffer *src, u_int8_t *ptag,
- struct evbuffer *dst);
-int evtag_peek(struct evbuffer *evbuf, u_int8_t *ptag);
-int evtag_peek_length(struct evbuffer *evbuf, u_int32_t *plength);
-int evtag_payload_length(struct evbuffer *evbuf, u_int32_t *plength);
+int evtag_unmarshal(struct evbuffer *src, uint8_t *ptag, struct evbuffer *dst);
+int evtag_peek(struct evbuffer *evbuf, uint8_t *ptag);
+int evtag_peek_length(struct evbuffer *evbuf, uint32_t *plength);
+int evtag_payload_length(struct evbuffer *evbuf, uint32_t *plength);
int evtag_consume(struct evbuffer *evbuf);
-int evtag_unmarshal_int(struct evbuffer *evbuf, u_int8_t need_tag,
- u_int32_t *pinteger);
+int evtag_unmarshal_int(struct evbuffer *evbuf, uint8_t need_tag,
+ uint32_t *pinteger);
-int evtag_unmarshal_fixed(struct evbuffer *src, u_int8_t need_tag, void *data,
+int evtag_unmarshal_fixed(struct evbuffer *src, uint8_t need_tag, void *data,
size_t len);
-int evtag_unmarshal_string(struct evbuffer *evbuf, u_int8_t need_tag,
+int evtag_unmarshal_string(struct evbuffer *evbuf, uint8_t need_tag,
char **pstring);
-int evtag_unmarshal_timeval(struct evbuffer *evbuf, u_int8_t need_tag,
+int evtag_unmarshal_timeval(struct evbuffer *evbuf, uint8_t need_tag,
struct timeval *ptv);
#ifdef __cplusplus