ne_buffer.3 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. '\" t
  2. .\" Title: ne_buffer
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 21 January 2023
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.32.5
  8. .\" Language: English
  9. .\"
  10. .TH "NE_BUFFER" "3" "21 January 2023" "neon 0.32.5" "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 \- string buffer handling
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_string\&.h>
  37. typedef struct {
  38. char *data;
  39. size_t used;
  40. size_t length;
  41. } ne_buffer;
  42. .fi
  43. .ft
  44. .SH "DESCRIPTION"
  45. .PP
  46. The
  47. \fBne_buffer\fR
  48. type represents an expandable memory buffer for holding
  49. NUL\-terminated strings\&. The
  50. \fIdata\fR
  51. field points to the beginning of the string, the length of which is given by the
  52. \fIused\fR
  53. field\&. The current size of memory allocated is given by the
  54. \fIlength\fR
  55. field\&. It is not recommended that the fields of a buffer are manipulated directly\&. The
  56. \fIdata\fR
  57. pointer may change when the buffer is modified\&.
  58. .PP
  59. A buffer is created using
  60. ne_buffer_create
  61. or
  62. ne_buffer_ncreate, and destroyed using
  63. ne_buffer_destroy
  64. or
  65. ne_buffer_finish\&. The functions
  66. ne_buffer_append,
  67. ne_buffer_zappend
  68. and
  69. ne_buffer_concat
  70. are used to append data to a buffer\&.
  71. .PP
  72. If the string referenced by the
  73. \fIdata\fR
  74. pointer is modified directly (rather than using one of the functions listed above),
  75. \fBne_buffer_altered\fR
  76. must be called\&.
  77. .SH "AUTHOR"
  78. .PP
  79. \fBJoe Orton\fR
  80. .RS 4
  81. Author.
  82. .RE
  83. .SH "COPYRIGHT"
  84. .br