1NE_BUFFER_APPEND(3)           neon API reference           NE_BUFFER_APPEND(3)
2
3
4

NAME

6       ne_buffer_append, ne_buffer_zappend, ne_buffer_concat - append data to
7       a string buffer
8

SYNOPSIS

10       #include <ne_string.h>
11
12       void ne_buffer_append(ne_buffer *buf, const char *string, size_t len);
13
14       void ne_buffer_zappend(ne_buffer *buf, const char *string);
15
16       void ne_buffer_concat(ne_buffer *buf, const char *str, ...);
17

DESCRIPTION

19       The ne_buffer_append and ne_buffer_zappend functions append a string to
20       the end of a buffer; extending the buffer as necessary. The len passed
21       to ne_buffer_append specifies the length of the string to append; there
22       must be no NUL terminator in the first len bytes of the string.
23       ne_buffer_zappend must be passed a NUL-terminated string.
24
25       The ne_buffer_concat function takes a variable-length argument list
26       following str; each argument must be a char * pointer to a
27       NUL-terminated string. A NULL pointer must be given as the last
28       argument to mark the end of the list. The strings (including str) are
29       appended to the buffer in the order given. None of the strings passed
30       to ne_buffer_concat are modified.
31

EXAMPLES

33       The following code will output "Hello, world. And goodbye.".
34
35           ne_buffer *buf = ne_buffer_create();
36           ne_buffer_zappend(buf, "Hello");
37           ne_buffer_concat(buf, ", world. ", "And ", "goodbye.", NULL);
38           puts(buf->data);
39           ne_buffer_destroy(buf);
40

SEE ALSO

42       ne_buffer, ne_buffer_create, ne_buffer_destroy
43

AUTHOR

45       Joe Orton <neon@lists.manyfish.co.uk>
46           Author.
47
49neon 0.30.0                      31 July 2013              NE_BUFFER_APPEND(3)
Impressum