From 723876da5741892530cd74112ec1510124e95cf9 Mon Sep 17 00:00:00 2001 From: cflip Date: Wed, 25 Jan 2023 11:28:09 -0700 Subject: Rename `append_buffer` to textbuf This name is a little bit better I think, and it will be nice to have a distinction between this utility and the 'file' kind of buffer. --- textbuf.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 textbuf.h (limited to 'textbuf.h') diff --git a/textbuf.h b/textbuf.h new file mode 100644 index 0000000..e5e0f03 --- /dev/null +++ b/textbuf.h @@ -0,0 +1,22 @@ +/* + * textbuf.h: A simple dynamic text buffer. + * + * This file provides the `textbuf` struct, which is a dynamically allocated + * buffer of text. + */ + +#ifndef _BUFFER_H +#define _BUFFER_H + +#include + +struct textbuf { + char *buffer; + size_t length; +}; + +struct textbuf textbuf_init(); +void textbuf_append(struct textbuf *textbuf, const char *str, int len); +void textbuf_free(struct textbuf *textbuf); + +#endif -- cgit v1.2.3