blob: 23b75d78c2e46e21b4cdb8703e2dcff69a4dd9a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/*
* 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_delete(struct textbuf *textbuf);
void textbuf_clear(struct textbuf *textbuf);
void textbuf_free(struct textbuf *textbuf);
#endif
|