#include struct sendbuf { struct event_base *ev_base; struct event *ev_timer; struct timeval ev_timer_tv; int sndbuf_max; int msec_max; int (*send_func)(void *, int, void *); void *usrdata; void *buffer; int buffer_size; int buffer_pos; int flushing; int flushed_len; }; struct sendbuf *sendbuf_init(struct event_base *, int, int, int (*send_func)(void *, int, void *), void *); void sendbuf_shutdown(struct sendbuf *); void *sendbuf_gettoken(struct sendbuf *, int);