Enclose repeated buffer draining code in a new msgbuf_drain()

function, which is additionally exported for use by others.

From nicm@, who reminded me that tmux is now using buffer.c, too.
This commit is contained in:
Jacek Masiulaniec
2009-09-15 18:12:51 +00:00
parent 4278199101
commit a6dd9e8e7e
2 changed files with 23 additions and 24 deletions

1
imsg.h
View File

@ -90,6 +90,7 @@ void buf_free(struct buf *);
void msgbuf_init(struct msgbuf *);
void msgbuf_clear(struct msgbuf *);
int msgbuf_write(struct msgbuf *);
void msgbuf_drain(struct msgbuf *, size_t);
/* imsg.c */
void imsg_init(struct imsgbuf *, int);