buf.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <refentry id="refbuf">
  2. <refmeta>
  3. <refentrytitle>ne_buffer</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="ne_buffer">ne_buffer</refname>
  8. <refpurpose>string buffer handling</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis><funcsynopsisinfo>#include &lt;ne_string.h&gt;
  12. typedef struct {
  13. char *data;
  14. size_t used;
  15. size_t length;
  16. } <type>ne_buffer</type>;</funcsynopsisinfo></funcsynopsis>
  17. </refsynopsisdiv>
  18. <refsect1>
  19. <title>Description</title>
  20. <para>The <type>ne_buffer</type> type represents an expandable
  21. memory buffer for holding &nul;-terminated strings. The
  22. <structfield>data</structfield> field points to the beginnning of the
  23. string, the length of which is given by the
  24. <structfield>used</structfield> field. The current size of memory
  25. allocated is given by the <structfield>length</structfield> field. It
  26. is not recommended that the fields of a buffer are manipulated
  27. directly. The <structfield>data</structfield> pointer may change when
  28. the buffer is modified.</para>
  29. <para>A buffer is created using <xref
  30. linkend="ne_buffer_create"/> or <xref
  31. linkend="ne_buffer_create_sized"/>, and destroyed using <xref
  32. linkend="ne_buffer_destroy"/> or <xref linkend="ne_buffer_finish"/>.
  33. The functions <xref linkend="ne_buffer_append"/>, <xref
  34. linkend="ne_buffer_zappend"/> and <xref linkend="ne_buffer_concat"/> are
  35. used to append data to a buffer.</para>
  36. <para>If the string referenced by the
  37. <structfield>data</structfield> pointer is modified directly (rather
  38. than using one of the functions listed above),
  39. <function>ne_buffer_altered</function> must be called.</para>
  40. </refsect1>
  41. </refentry>