'\" t .\" Title: ne_buffer .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 03/20/2026 .\" Manual: neon API reference .\" Source: neon .\" Language: English .\" .TH "NE_BUFFER" "3" "03/20/2026" "neon" "neon API reference" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ne_buffer \- string buffer handling .SH "SYNOPSIS" .sp .ft B .nf #include typedef struct { char *data; size_t used; size_t length; } ne_buffer; .fi .ft .SH "DESCRIPTION" .PP The \fBne_buffer\fR type represents an expandable memory buffer for holding NUL\-terminated strings\&. The \fIdata\fR field points to the beginning of the string, the length of which is given by the \fIused\fR field\&. The current size of memory allocated is given by the \fIlength\fR field\&. It is not recommended that the fields of a buffer are manipulated directly\&. The \fIdata\fR pointer may change when the buffer is modified\&. .PP A buffer is created using \fBne_buffer_create\fR(3) or \fBne_buffer_ncreate\fR(3), and destroyed using \fBne_buffer_destroy\fR(3) or \fBne_buffer_finish\fR(3)\&. The functions \fBne_buffer_append\fR(3), \fBne_buffer_zappend\fR(3) and \fBne_buffer_concat\fR(3) are used to append data to a buffer\&. .PP If the string referenced by the \fIdata\fR pointer is modified directly (rather than using one of the functions listed above), \fBne_buffer_altered\fR must be called\&. .SH "COPYRIGHT" .br Copyright \(co 2001-2026 Joe Orton .br