ref: 9c922c6d20518ad8485f3d21b12a9a0e1c8f9426
dir: /sbuf.h/
/* variable length string buffer */
struct sbuf {
char *s; /* allocated buffer */
int sz; /* buffer size */
int n; /* length of the string stored in s */
};
void sbuf_init(struct sbuf *sbuf);
void sbuf_done(struct sbuf *sbuf);
char *sbuf_buf(struct sbuf *sbuf);
void sbuf_printf(struct sbuf *sbuf, char *s, ...);
int sbuf_empty(struct sbuf *sbuf);