aboutsummaryrefslogtreecommitdiff
path: root/buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'buf.h')
-rw-r--r--buf.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/buf.h b/buf.h
new file mode 100644
index 0000000..7323b83
--- /dev/null
+++ b/buf.h
@@ -0,0 +1,21 @@
+#ifndef _BUF_INCLUDE
+#define _BUF_INCLUDE
+
+typedef struct buf_node buf_node;
+typedef struct buf buf;
+
+buf* newbuf(size_t cap);
+
+void addchrbuf(buf* buffer, char chr); // front
+void addstrbuf(buf* buffer, char* str);
+char remchrbuf(buf* buffer);
+char* remstrbuf(buf* buffer, int ct);
+
+void prechrbuf(buf* buffer, char chr); // back
+void prestrbuf(buf* buffer, char* str);
+char shfchrbuf(buf* buffer);
+char* shfstrbuf(buf* buffer, int ct);
+
+char* strpeekbuf(buf* buffer, int loc);
+
+#endif