| 1 |
'\" t |
| 2 |
.\" Title: ne_buffer_append |
| 3 |
.\" Author: |
| 4 |
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> |
| 5 |
.\" Date: 3 May 2011 |
| 6 |
.\" Manual: neon API reference |
| 7 |
.\" Source: neon 0.29.6 |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "NE_BUFFER_APPEND" "3" "3 May 2011" "neon 0.29.6" "neon API reference" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
ne_buffer_append, ne_buffer_zappend, ne_buffer_concat \- append data to a string buffer |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.ft B |
| 35 |
.nf |
| 36 |
#include <ne_string\&.h> |
| 37 |
.fi |
| 38 |
.ft |
| 39 |
.HP \w'void\ ne_buffer_append('u |
| 40 |
.BI "void ne_buffer_append(ne_buffer\ *" "buf" ", const\ char\ *" "string" ", size_t\ " "len" ");" |
| 41 |
.HP \w'void\ ne_buffer_zappend('u |
| 42 |
.BI "void ne_buffer_zappend(ne_buffer\ *" "buf" ", const\ char\ *" "string" ");" |
| 43 |
.HP \w'void\ ne_buffer_concat('u |
| 44 |
.BI "void ne_buffer_concat(ne_buffer\ *" "buf" ", const\ char\ *" "str" ", \&.\&.\&.);" |
| 45 |
.SH "DESCRIPTION" |
| 46 |
.PP |
| 47 |
The |
| 48 |
\fBne_buffer_append\fR |
| 49 |
and |
| 50 |
\fBne_buffer_zappend\fR |
| 51 |
functions append a string to the end of a buffer; extending the buffer as necessary\&. The |
| 52 |
\fIlen\fR |
| 53 |
passed to |
| 54 |
\fBne_buffer_append\fR |
| 55 |
specifies the length of the string to append; there must be no |
| 56 |
NUL |
| 57 |
terminator in the first |
| 58 |
\fIlen\fR |
| 59 |
bytes of the string\&. |
| 60 |
\fBne_buffer_zappend\fR |
| 61 |
must be passed a |
| 62 |
NUL\-terminated string\&. |
| 63 |
.PP |
| 64 |
The |
| 65 |
\fBne_buffer_concat\fR |
| 66 |
function takes a variable\-length argument list following |
| 67 |
\fIstr\fR; each argument must be a |
| 68 |
\fBchar *\fR |
| 69 |
pointer to a |
| 70 |
NUL\-terminated string\&. A |
| 71 |
NULL |
| 72 |
pointer must be given as the last argument to mark the end of the list\&. The strings (including |
| 73 |
\fIstr\fR) are appended to the buffer in the order given\&. None of the strings passed to |
| 74 |
\fBne_buffer_concat\fR |
| 75 |
are modified\&. |
| 76 |
.SH "EXAMPLES" |
| 77 |
.PP |
| 78 |
The following code will output "Hello, world\&. And goodbye\&."\&. |
| 79 |
.sp |
| 80 |
.if n \{\ |
| 81 |
.RS 4 |
| 82 |
.\} |
| 83 |
.nf |
| 84 |
ne_buffer *buf = ne_buffer_create(); |
| 85 |
ne_buffer_zappend(buf, "Hello"); |
| 86 |
ne_buffer_concat(buf, ", world\&. ", "And ", "goodbye\&.", NULL); |
| 87 |
puts(buf\->data); |
| 88 |
ne_buffer_destroy(buf); |
| 89 |
.fi |
| 90 |
.if n \{\ |
| 91 |
.RE |
| 92 |
.\} |
| 93 |
.SH "SEE ALSO" |
| 94 |
.PP |
| 95 |
ne_buffer, |
| 96 |
ne_buffer_create, |
| 97 |
ne_buffer_destroy |
| 98 |
.SH "AUTHOR" |
| 99 |
.PP |
| 100 |
\fBJoe Orton\fR <\&[email protected]\&> |
| 101 |
.RS 4 |
| 102 |
Author. |
| 103 |
.RE |
| 104 |
.SH "COPYRIGHT" |
| 105 |
.br |