blob: e5e0f03b7b1edeef1ac46f76fa46863e014c4777 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 <stddef.h>
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
|