#include <ne_string.h>
ne_buffer_destroy
Any use of the buffer object after calling either of these functions gives undefined behaviour.
ne_buffer_finish returns the malloc-allocated string stored in the buffer.
An example use of ne_buffer_finish; the duplicate function returns a string made up of n copies of str:
static char *duplicate(int n, const char *str) { ne_buffer *buf = ne_buffer_create(); while (n--) { ne_buffer_zappend(buf, str); } return ne_buffer_finish(buf); }
ne_buffer, ne_buffer_create, ne_buffer_zappend
Joe Orton <neon@lists.manyfish.co.uk>