1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_buffer_append</title><link rel="stylesheet" type="text/css" href="../manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refbuf.html" title="ne_buffer"><link rel="next" href="refbufutil.html" title="ne_buffer_clear"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_buffer_append</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refbuf.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refbufutil.html">Next</a></td></tr></table><hr></div><div class="refentry" title="ne_buffer_append"><a name="refbufapp"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_buffer_append, ne_buffer_zappend, ne_buffer_concat — append data to a string buffer</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;ne_string.h&gt;</pre><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">ne_buffer_append</b>(</code></td><td>ne_buffer *<var class="pdparam">buf</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">string</var>, </td></tr><tr><td> </td><td>size_t <var class="pdparam">len</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">ne_buffer_zappend</b>(</code></td><td>ne_buffer *<var class="pdparam">buf</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">string</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">ne_buffer_concat</b>(</code></td><td>ne_buffer *<var class="pdparam">buf</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">str</var>, </td></tr><tr><td> </td><td>...<code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Description"><a name="id449573"></a><h2>Description</h2><p>The <code class="function">ne_buffer_append</code> and
2<code class="function">ne_buffer_zappend</code> functions append a string to
3the end of a buffer; extending the buffer as necessary.  The
4<code class="parameter">len</code> passed to
5<code class="function">ne_buffer_append</code> specifies the length of the
6string to append; there must be no <code class="literal">NUL</code> terminator in the first
7<code class="parameter">len</code> bytes of the string.
8<code class="function">ne_buffer_zappend</code> must be passed a
9<code class="literal">NUL</code>-terminated string.</p><p>The <code class="function">ne_buffer_concat</code> function takes
10a variable-length argument list following <code class="parameter">str</code>;
11each argument must be a <em class="type">char *</em> pointer to a
12<code class="literal">NUL</code>-terminated string.  A <code class="literal">NULL</code> pointer must be given as the last
13argument to mark the end of the list.  The strings (including
14<code class="parameter">str</code>) are appended to the buffer in the order
15given. None of the strings passed to
16<code class="function">ne_buffer_concat</code> are modified.</p></div><div class="refsect1" title="Examples"><a name="id449666"></a><h2>Examples</h2><p>The following code will output "<code class="literal">Hello, world.
17And goodbye.</code>".</p><pre class="programlisting">ne_buffer *buf = ne_buffer_create();
18ne_buffer_zappend(buf, "Hello");
19ne_buffer_concat(buf, ", world. ", "And ", "goodbye.", NULL);
20puts(buf-&gt;data);
21ne_buffer_destroy(buf);</pre></div><div class="refsect1" title="See also"><a name="id449687"></a><h2>See also</h2><p><a class="xref" href="refbuf.html#ne_buffer">ne_buffer</a>, <a class="xref" href="refbufcr.html#ne_buffer_create">ne_buffer_create</a>,
22<a class="xref" href="refbufdest.html#ne_buffer_destroy">ne_buffer_destroy</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refbuf.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refbufutil.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_buffer </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_buffer_clear</td></tr></table></div></body></html>
23