summaryrefslogtreecommitdiff
path: root/include/buffer.h
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-07-08 15:06:33 -0300
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-07-08 15:06:33 -0300
commit7a388dad85152a203033c14fee3c64607301865a (patch)
tree054b7bb03883576a8b68da8470908ff259e029d4 /include/buffer.h
libactivity: (tmp name) http request parse
the parse works via callbacks, registered to a method and path. further work will be done to simplify extraction of path, and to make the request struct more private. missing the parsing and handling of reponses. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
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