bufapp.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <refentry id="refbufapp">
  2. <refmeta>
  3. <refentrytitle>ne_buffer_append</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="ne_buffer_append">ne_buffer_append</refname>
  8. <refname id="ne_buffer_zappend">ne_buffer_zappend</refname>
  9. <refname id="ne_buffer_concat">ne_buffer_concat</refname>
  10. <refpurpose>append data to a string buffer</refpurpose>
  11. </refnamediv>
  12. <refsynopsisdiv>
  13. <funcsynopsis>
  14. <funcsynopsisinfo>#include &lt;ne_string.h&gt;</funcsynopsisinfo>
  15. <funcprototype>
  16. <funcdef>void <function>ne_buffer_append</function></funcdef>
  17. <paramdef>ne_buffer *<parameter>buf</parameter></paramdef>
  18. <paramdef>const char *<parameter>string</parameter></paramdef>
  19. <paramdef>size_t <parameter>len</parameter></paramdef>
  20. </funcprototype>
  21. <funcprototype>
  22. <funcdef>void <function>ne_buffer_zappend</function></funcdef>
  23. <paramdef>ne_buffer *<parameter>buf</parameter></paramdef>
  24. <paramdef>const char *<parameter>string</parameter></paramdef>
  25. </funcprototype>
  26. <funcprototype>
  27. <funcdef>void <function>ne_buffer_concat</function></funcdef>
  28. <paramdef>ne_buffer *<parameter>buf</parameter></paramdef>
  29. <paramdef>const char *<parameter>str</parameter></paramdef>
  30. <paramdef>...</paramdef>
  31. </funcprototype>
  32. </funcsynopsis>
  33. </refsynopsisdiv>
  34. <refsect1>
  35. <title>Description</title>
  36. <para>The <function>ne_buffer_append</function> and
  37. <function>ne_buffer_zappend</function> functions append a string to
  38. the end of a buffer; extending the buffer as necessary. The
  39. <parameter>len</parameter> passed to
  40. <function>ne_buffer_append</function> specifies the length of the
  41. string to append; there must be no &nul; terminator in the first
  42. <parameter>len</parameter> bytes of the string.
  43. <function>ne_buffer_zappend</function> must be passed a
  44. &nul;-terminated string.</para>
  45. <para>The <function>ne_buffer_concat</function> function takes
  46. a variable-length argument list following <parameter>str</parameter>;
  47. each argument must be a <type>char *</type> pointer to a
  48. &nul;-terminated string. A &null; pointer must be given as the last
  49. argument to mark the end of the list. The strings (including
  50. <parameter>str</parameter>) are appended to the buffer in the order
  51. given. None of the strings passed to
  52. <function>ne_buffer_concat</function> are modified.</para>
  53. </refsect1>
  54. <refsect1>
  55. <title>Examples</title>
  56. <para>The following code will output "<literal>Hello, world.
  57. And goodbye.</literal>".</para>
  58. <programlisting>ne_buffer *buf = ne_buffer_create();
  59. ne_buffer_zappend(buf, "Hello");
  60. ne_buffer_concat(buf, ", world. ", "And ", "goodbye.", NULL);
  61. puts(buf->data);
  62. ne_buffer_destroy(buf);</programlisting>
  63. </refsect1>
  64. <refsect1>
  65. <title>See also</title>
  66. <para><xref linkend="ne_buffer"/>, <xref linkend="ne_buffer_create"/>,
  67. <xref linkend="ne_buffer_destroy"/></para>
  68. </refsect1>
  69. </refentry>