---
name: "ne_buffer"
section: "3"
platform: "linux"
package: "neon"
version: "0.37.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ne_buffer"
---

# ne\_buffer(3)

string buffer handling

## NAME

ne\_buffer - string buffer handling

## SYNOPSIS

```
#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 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)](/ne_buffer_create/3.md) or [**ne\_buffer\_ncreate**(3)](/ne_buffer_ncreate/3.md), and destroyed using [**ne\_buffer\_destroy**(3)](/ne_buffer_destroy/3.md) or [**ne\_buffer\_finish**(3)](/ne_buffer_finish/3.md). The functions [**ne\_buffer\_append**(3)](/ne_buffer_append/3.md), [**ne\_buffer\_zappend**(3)](/ne_buffer_zappend/3.md) and [**ne\_buffer\_concat**(3)](/ne_buffer_concat/3.md) 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.

## COPYRIGHT

Copyright © 2001-2026 Joe Orton\
