From 7ccae1c362a45b28f4fbf96da4f479730e4b382b Mon Sep 17 00:00:00 2001 From: Elis Eriksson Date: Sat, 13 Jun 2026 17:40:25 +0200 Subject: Initial Commit, probably needs heavy code cleanup --- src/str.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/str.h (limited to 'src/str.h') diff --git a/src/str.h b/src/str.h new file mode 100644 index 0000000..416a846 --- /dev/null +++ b/src/str.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include + +typedef struct { + char *data; + size_t length; + size_t capacity; +} str; + +void free_str(str *s); + +void str_append(str *s, const char *from); +void str_append_c(str *s, char c); +void str_append_len(str *s, const char *from, size_t len); + +void str_append_read(str *s, int fd); +void str_append_fread(str *s, FILE *file); +void str_append_fread_len(str *s, size_t size, FILE *file); + +void str_appendf(str *s, const char *fmt, ...); -- cgit v1.3-7-ge9ab