summaryrefslogtreecommitdiff
path: root/src/sbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbuf.h')
-rw-r--r--src/sbuf.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sbuf.h b/src/sbuf.h
new file mode 100644
index 0000000..a6ff01c
--- /dev/null
+++ b/src/sbuf.h
@@ -0,0 +1,21 @@
+#ifndef _SBUF_H
+#define _SBUF_H
+
+#include <stdlib.h>
+
+struct
+sbuf
+{
+ char *data;
+ size_t len;
+ size_t maxsz;
+};
+
+struct sbuf *sbuf_new (size_t initsz);
+void sbuf_free (struct sbuf *b);
+char *sbuf_concat (struct sbuf *b, const char *str);
+char *sbuf_copy (struct sbuf *b, const char *str);
+char *sbuf_clear (struct sbuf *b);
+char *sbuf_get (struct sbuf *b);
+
+#endif /* _SBUF_H */