From 7a388dad85152a203033c14fee3c64607301865a Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Sat, 8 Jul 2023 15:06:33 -0300 Subject: 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 --- include/buffer.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/buffer.h (limited to 'include/buffer.h') 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 + +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 -- cgit v1.2.3