| 1 |
<refentry id="refbufutil"> |
| 2 |
|
| 3 |
<refmeta> |
| 4 |
<refentrytitle>ne_buffer_clear</refentrytitle> |
| 5 |
<manvolnum>3</manvolnum> |
| 6 |
</refmeta> |
| 7 |
|
| 8 |
<refnamediv> |
| 9 |
<refname id="ne_buffer_clear">ne_buffer_clear</refname> |
| 10 |
<refname id="ne_buffer_grow">ne_buffer_grow</refname> |
| 11 |
<refname id="ne_buffer_altered">ne_buffer_altered</refname> |
| 12 |
<refpurpose>clear, grow, or mark as altered a string buffer</refpurpose> |
| 13 |
</refnamediv> |
| 14 |
|
| 15 |
<refsynopsisdiv> |
| 16 |
|
| 17 |
<funcsynopsis> |
| 18 |
|
| 19 |
<funcsynopsisinfo>#include <ne_string.h></funcsynopsisinfo> |
| 20 |
|
| 21 |
<funcprototype> |
| 22 |
<funcdef>void <function>ne_buffer_clear</function></funcdef> |
| 23 |
<paramdef>ne_buffer *<parameter>buf</parameter></paramdef> |
| 24 |
</funcprototype> |
| 25 |
|
| 26 |
<funcprototype> |
| 27 |
<funcdef>void <function>ne_buffer_altered</function></funcdef> |
| 28 |
<paramdef>ne_buffer *<parameter>buf</parameter></paramdef> |
| 29 |
</funcprototype> |
| 30 |
|
| 31 |
<funcprototype> |
| 32 |
<funcdef>void <function>ne_buffer_grow</function></funcdef> |
| 33 |
<paramdef>ne_buffer *<parameter>buf</parameter></paramdef> |
| 34 |
<paramdef>size_t <parameter>size</parameter></paramdef> |
| 35 |
</funcprototype> |
| 36 |
|
| 37 |
</funcsynopsis> |
| 38 |
|
| 39 |
</refsynopsisdiv> |
| 40 |
|
| 41 |
<refsect1> |
| 42 |
<title>Description</title> |
| 43 |
|
| 44 |
<para>The <function>ne_buffer_clear</function> function sets |
| 45 |
the string stored in <parameter>buf</parameter> to be the empty string |
| 46 |
(<literal>""</literal>).</para> |
| 47 |
|
| 48 |
<para>The <function>ne_buffer_altered</function> function must |
| 49 |
be used after the string stored in the buffer |
| 50 |
<parameter>buf</parameter> is modified by directly rather than using |
| 51 |
<xref linkend="ne_buffer_append"/>, <xref linkend="ne_buffer_zappend"/> |
| 52 |
or <xref linkend="ne_buffer_concat"/>.</para> |
| 53 |
|
| 54 |
<para>The <function>ne_buffer_grow</function> function |
| 55 |
ensures that at least <parameter>size</parameter> bytes are allocated |
| 56 |
for the string; this can be used if a large amount of data is going to |
| 57 |
be appended to the buffer and may result in more efficient memory |
| 58 |
allocation.</para> |
| 59 |
|
| 60 |
</refsect1> |
| 61 |
|
| 62 |
</refentry> |