mkfn: generate instead of produce
[neatmkfn.git] / sbuf.h
blob6de734512d873cde5ce1f5ee5bae3128e6706ba6
1 /* variable length string buffer */
2 struct sbuf {
3 char *s; /* allocated buffer */
4 int sz; /* buffer size */
5 int n; /* length of the string stored in s */
6 };
8 void sbuf_init(struct sbuf *sbuf);
9 void sbuf_done(struct sbuf *sbuf);
10 char *sbuf_buf(struct sbuf *sbuf);
11 void sbuf_printf(struct sbuf *sbuf, char *s, ...);
12 int sbuf_empty(struct sbuf *sbuf);