ne_buffer_finish (3) - Linux Manuals
ne_buffer_finish: destroy a buffer object
NAME
ne_buffer_destroy, ne_buffer_finish - destroy a buffer object
SYNOPSIS
#include <ne_string.h>
-
void ne_buffer_destroy(ne_buffer
* buf);- char *ne_buffer_finish(ne_buffer
* buf); - char *ne_buffer_finish(ne_buffer
DESCRIPTION
ne_buffer_destroy
Any use of the buffer object after calling either of these functions gives undefined behaviour.
RETURN VALUE
ne_buffer_finish returns the malloc-allocated string stored in the buffer.
EXAMPLES
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); }
AUTHOR
Joe Orton <neon [at] lists.manyfish.co.uk>
- Author.
COPYRIGHT