diff options
Diffstat (limited to 'libglouglou/sendbuf.h')
-rw-r--r-- | libglouglou/sendbuf.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libglouglou/sendbuf.h b/libglouglou/sendbuf.h index 90dc4bc..340e1c7 100644 --- a/libglouglou/sendbuf.h +++ b/libglouglou/sendbuf.h @@ -1,4 +1,5 @@ #include <event.h> +#include <sys/queue.h> struct sendbuf { struct event_base *ev_base; @@ -6,16 +7,23 @@ struct sendbuf { struct timeval ev_timer_tv; int sndbuf_max; int msec_max; - int (*send_func)(void *, int, void *); - void *usrdata; +}; + +struct sendbuf_queue { void *buffer; int buffer_size; int buffer_pos; + int (*send_func)(void *, int, void *); + void *usrdata; int flushing; int flushed_len; -}; +} -struct sendbuf *sendbuf_init(struct event_base *, int, int, - int (*send_func)(void *, int, void *), void *); +struct sendbuf *sendbuf_init(struct event_base *, int, int, int); void sendbuf_shutdown(struct sendbuf *); -void *sendbuf_gettoken(struct sendbuf *, int); +void sendbuf_queue_add(struct sendbuf *, + int (*send_func)(void *, int, void *), + void *); +void *sendbuf_token_get(struct sendbuf *, int); +void sendbuf_token_ready(struct sendbuf *, void *); + |