summaryrefslogtreecommitdiffhomepage
path: root/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.h')
-rw-r--r--buffer.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/buffer.h b/buffer.h
new file mode 100644
index 0000000..d4fafa6
--- /dev/null
+++ b/buffer.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <lua.h>
+
+struct stream; // TODO: Remove buffer to stream dependency.
+
+struct buffer
+{
+ char * data;
+ int length;
+ int offset;
+ int next;
+ int allocated;
+};
+
+void grow(lua_State *, struct buffer *);
+int prepare_at_least(lua_State *, struct stream *, const int, lua_KContext);
+int read_more(lua_State *, struct stream *, const int, lua_KContext);
+int until(struct buffer *, const char *, const int);