ne_buffer_append.3 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. '\" t
  2. .\" Title: ne_buffer_append
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 15 April 2025
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.34.2
  8. .\" Language: English
  9. .\"
  10. .TH "NE_BUFFER_APPEND" "3" "15 April 2025" "neon 0.34.2" "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_append, ne_buffer_zappend, ne_buffer_concat \- append data to a string buffer
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_string\&.h>
  37. .fi
  38. .ft
  39. .HP \w'void\ ne_buffer_append('u
  40. .BI "void ne_buffer_append(ne_buffer\ *" "buf" ", const\ char\ *" "string" ", size_t\ " "len" ");"
  41. .HP \w'void\ ne_buffer_zappend('u
  42. .BI "void ne_buffer_zappend(ne_buffer\ *" "buf" ", const\ char\ *" "string" ");"
  43. .HP \w'void\ ne_buffer_concat('u
  44. .BI "void ne_buffer_concat(ne_buffer\ *" "buf" ", const\ char\ *" "str" ", \&.\&.\&.);"
  45. .SH "DESCRIPTION"
  46. .PP
  47. The
  48. \fBne_buffer_append\fR
  49. and
  50. \fBne_buffer_zappend\fR
  51. functions append a string to the end of a buffer; extending the buffer as necessary\&. The
  52. \fIlen\fR
  53. passed to
  54. \fBne_buffer_append\fR
  55. specifies the length of the string to append; there must be no
  56. NUL
  57. terminator in the first
  58. \fIlen\fR
  59. bytes of the string\&.
  60. \fBne_buffer_zappend\fR
  61. must be passed a
  62. NUL\-terminated string\&.
  63. .PP
  64. The
  65. \fBne_buffer_concat\fR
  66. function takes a variable\-length argument list following
  67. \fIstr\fR; each argument must be a
  68. \fBchar *\fR
  69. pointer to a
  70. NUL\-terminated string\&. A
  71. NULL
  72. pointer must be given as the last argument to mark the end of the list\&. The strings (including
  73. \fIstr\fR) are appended to the buffer in the order given\&. None of the strings passed to
  74. \fBne_buffer_concat\fR
  75. are modified\&.
  76. .SH "EXAMPLES"
  77. .PP
  78. The following code will output "Hello, world\&. And goodbye\&."\&.
  79. .sp
  80. .if n \{\
  81. .RS 4
  82. .\}
  83. .nf
  84. ne_buffer *buf = ne_buffer_create();
  85. ne_buffer_zappend(buf, "Hello");
  86. ne_buffer_concat(buf, ", world\&. ", "And ", "goodbye\&.", NULL);
  87. puts(buf\->data);
  88. ne_buffer_destroy(buf);
  89. .fi
  90. .if n \{\
  91. .RE
  92. .\}
  93. .SH "SEE ALSO"
  94. .PP
  95. ne_buffer,
  96. ne_buffer_create,
  97. ne_buffer_destroy
  98. .SH "COPYRIGHT"
  99. .br
  100. Copyright \(co 2001-2024 Joe Orton
  101. .br