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 Β© 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