1NE_BUFFER(3) neon API reference NE_BUFFER(3)
2
3
4
6 ne_buffer - string buffer handling
7
9 #include <ne_string.h>
10
11 typedef struct {
12 char *data;
13 size_t used;
14 size_t length;
15 } ne_buffer;
16
18 The ne_buffer type represents an expandable memory buffer for holding
19 NUL-terminated strings. The data field points to the beginning of the
20 string, the length of which is given by the used field. The current
21 size of memory allocated is given by the length field. It is not
22 recommended that the fields of a buffer are manipulated directly. The
23 data pointer may change when the buffer is modified.
24
25 A buffer is created using ne_buffer_create or ne_buffer_ncreate, and
26 destroyed using ne_buffer_destroy or ne_buffer_finish. The functions
27 ne_buffer_append, ne_buffer_zappend and ne_buffer_concat are used to
28 append data to a buffer.
29
30 If the string referenced by the data pointer is modified directly
31 (rather than using one of the functions listed above),
32 ne_buffer_altered must be called.
33
35 Joe Orton <neon@lists.manyfish.co.uk>
36 Author.
37
39neon 0.32.2 12 January 2022 NE_BUFFER(3)