ne_buffer
3
ne_buffer
string buffer handling
#include <ne_string.h>
typedef struct {
char *data;
size_t used;
size_t length;
} ne_buffer;
Description
The ne_buffer type represents an expandable
memory buffer for holding &nul;-terminated strings. The
data field points to the beginnning of the
string, the length of which is given by the
used field. The current size of memory
allocated is given by the length field. It
is not recommended that the fields of a buffer are manipulated
directly. The data pointer may change when
the buffer is modified.
A buffer is created using or , and destroyed using or .
The functions , and are
used to append data to a buffer.
If the string referenced by the
data pointer is modified directly (rather
than using one of the functions listed above),
ne_buffer_altered must be called.