summaryrefslogtreecommitdiff
path: root/evbuffer-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-01-23 01:11:13 +0000
committerNick Mathewson <nickm@torproject.org>2009-01-23 01:11:13 +0000
commitc735f2b45aaca4d9c118245e407a00e6b8f4d234 (patch)
tree6d6a507255d7c222cf1917110d58fdf256dd35cf /evbuffer-internal.h
parent86d526a0648a884dd966b52142c620f2f5180c28 (diff)
downloadlibevent-c735f2b45aaca4d9c118245e407a00e6b8f4d234.tar.gz
Code to allow multiple callbacks per evbuffer.
svn:r1042
Diffstat (limited to 'evbuffer-internal.h')
-rw-r--r--evbuffer-internal.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/evbuffer-internal.h b/evbuffer-internal.h
index 4637d87f..5f7fc109 100644
--- a/evbuffer-internal.h
+++ b/evbuffer-internal.h
@@ -34,9 +34,16 @@ extern "C" {
#include "config.h"
#include "evutil.h"
+#include <sys/queue.h>
/* minimum allocation */
#define MIN_BUFFER_SIZE 256
+struct evbuffer_cb_entry {
+ TAILQ_ENTRY(evbuffer_cb_entry) next;
+ evbuffer_cb cb;
+ void *cbarg;
+};
+
struct evbuffer_chain;
struct evbuffer {
struct evbuffer_chain *first;
@@ -45,8 +52,11 @@ struct evbuffer {
size_t total_len; /* total length of all buffers */
- void (*cb)(struct evbuffer *, size_t, size_t, void *);
+ evbuffer_cb cb;
void *cbarg;
+
+ TAILQ_HEAD(evbuffer_cb_queue, evbuffer_cb_entry) callbacks;
+ unsigned char in_callbacks;
};
struct evbuffer_chain {