summaryrefslogtreecommitdiff
path: root/include/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/buffer.h')
-rw-r--r--include/buffer.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/buffer.h b/include/buffer.h
new file mode 100644
index 0000000..dd4530c
--- /dev/null
+++ b/include/buffer.h
@@ -0,0 +1,19 @@
+#ifndef _BUFFER_H_
+#define _BUFFER_H_
+
+#include <stdlib.h>
+
+struct buffer {
+ char *data;
+ size_t len;
+ size_t size;
+};
+
+struct buffer *buf_new(const char *init);
+void buf_del(struct buffer **buf);
+struct buffer *buf_dup(struct buffer *src);
+char *buf_strdup(struct buffer *buf);
+void buf_append(struct buffer *buf, const char *str);
+void buf_printf(struct buffer *buf, char *fmt, ...);
+
+#endif