ne_buffer(3)

ne_buffer3

String buffer handling

Usage

#include <ne_string.h>
typedef struct {
    char *data;
    size_t used;
    size_t length;
} ne_buffer;

Overview

The ne_buffer type represents an expandable memory buffer for holding NUL-terminated strings. The data field points to the beginning 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 ne_buffer_create(3) or ne_buffer_ncreate(3), and destroyed using ne_buffer_destroy(3) or ne_buffer_finish(3). The functions ne_buffer_append(3), ne_buffer_zappend(3) and ne_buffer_concat(3) 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.

Releases

11 releases since Debian 4.0 (Etch); the text changed 9 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9–10
  7. 11
  8. 12
  9. 13
  10. Arch

From neon 0.37.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.