NE_BUFFER_CLEAR(3)
π NE_BUFFER_CLEAR(3) π
okay so this is the neon API reference page for three lil buffer besties β ne_buffer_clear, ne_buffer_grow, and ne_buffer_altered β that clear, grow, or mark-as-altered a string buffer. yes they share one page, they're a package deal, we love a trio π«Ά
β¨ SYNOPSIS β¨
#include <ne_string.h>
void ne_buffer_clear(ne_buffer *buf);
void ne_buffer_altered(ne_buffer *buf);
void ne_buffer_grow(ne_buffer *buf, size_t size);
πΈ DESCRIPTION πΈ
π§Ό ne_buffer_clear
she sets the string stored in buf to be the empty string (""). that's it. that's the whole vibe. squeaky clean, fresh start, main character energy π
β¨
π ne_buffer_altered
okay bestie listen, this one is important. you must use ne_buffer_altered after the string stored in buf has been modified directly β like, by your own hands β instead of going through ne_buffer_append(3), ne_buffer_zappend(3) or ne_buffer_concat(3).
fr fr, don't skip this one. if you poked at the string yourself, tell the buffer about it. π
π¦ ne_buffer_grow
this cutie makes sure that at least size bytes are allocated for the string. when do you need it? when you know a big chunk of data is about to get appended to the buffer β pre-gaming it like this can result in more efficient memory allocation π₯ no cap.
π COPYRIGHT π
Copyright Β© 2001-2026 Joe Orton
k that's the whole page, go forth and buffer responsibly π
~ neon API reference, neon, dated 03/20/2026 ~ bye bestie, ily, drink some water ππ§
π¦ where this page comes from
- arch rolling: neon 0.37.1-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms