Home | History | Annotate | Download | only in libxml2

Lines Matching refs:buffer

4  * new buffer structures and entry points to simplify the maintainance
37 * A buffer structure. The base of the structure is somehow compatible
39 * directly the input->buf->buffer structures.
43 xmlChar *content; /* The buffer content UTF8 */
48 size_t use; /* The buffer size used */
49 size_t size; /* The buffer size */
50 xmlBufferPtr buffer; /* wrapper for an old buffer */
102 * Handle a buffer overflow error
117 * routine to create an XML buffer.
126 xmlBufMemoryError(NULL, "creating buffer");
132 ret->buffer = NULL;
138 xmlBufMemoryError(ret, "creating buffer");
149 * @size: initial size of buffer
151 * routine to create an XML buffer.
160 xmlBufMemoryError(NULL, "creating buffer");
166 ret->buffer = NULL;
173 xmlBufMemoryError(ret, "creating buffer");
186 * @buf: the buffer
188 * Remove the string contained in a buffer and give it back to the
189 * caller. The buffer is reset to an empty content.
192 * Returns the previous string contained by the buffer.
202 if (buf->buffer != NULL)
223 * routine to create an XML buffer from an immutable memory area.
225 * present until the end of the buffer lifetime.
238 xmlBufMemoryError(NULL, "creating buffer");
253 ret->buffer = NULL;
259 * @buf: the buffer
261 * Get the buffer allocation scheme
279 * @buf: the buffer to tune
282 * Sets the allocation scheme for this buffer
304 if (buf->buffer)
305 buf->buffer->alloc = scheme;
309 * Switching a buffer ALLOC_IO has the side effect of initializing
321 * @buf: the buffer to free
323 * Frees an XML buffer. It frees both the content and the structure which
348 * @buf: the buffer
350 * empty a buffer.
375 * @buf: the buffer to dump
378 * Remove the beginning of an XML buffer.
397 * the perceived buffer size has shrinked accordingly
425 * @buf: the buffer
428 * Grow the available space of an XML buffer, @len is the target value
448 * the buffer size (if that's enough) (bug 146697)
466 xmlBufMemoryError(buf, "growing buffer");
474 xmlBufMemoryError(buf, "growing buffer");
486 * @buf: the buffer
489 * Grow the available space of an XML buffer, @len is the target value
509 * @buf: the buffer
512 * Grow the available space of an XML buffer, adding at least @len bytes
528 * @buf: the buffer to dump
530 * Dumps an XML buffer to a FILE *.
560 * @buf: the buffer
562 * Function to extract the content of a buffer
578 * @buf: the buffer
580 * Function to extract the end of the content of a buffer
597 * @buf: the buffer
600 * Sometime data may be added at the end of the buffer without
602 * and set the zero terminating at the end of the buffer
624 * @buf: the buffer
627 * Sometime data need to be erased at the end of the buffer
646 * @buf: the buffer
648 * Function to get the length of a buffer
665 buffer
667 * Function to get the length of a buffer
684 * @buf: the buffer
687 * used in the buffer. It does not account for the terminating zero
705 * @buf: the buffer
707 * Tell if a buffer is empty
723 * @buf: the buffer to resize
726 * Resize a buffer to accommodate minimum size of @size.
755 xmlBufMemoryError(buf, "growing buffer");
771 xmlBufMemoryError(buf, "growing buffer");
796 xmlBufMemoryError(buf, "growing buffer");
809 * if we are reallocating a buffer far from being full, it's
821 xmlBufMemoryError(buf, "growing buffer");
834 * @buf: the buffer to dump
838 * Add a string range to an XML buffer. if len == -1, the length of
871 xmlBufMemoryError(buf, "growing buffer");
885 * @buf: the buffer
889 * Add a string range to the beginning of an XML buffer.
942 xmlBufMemoryError(buf, "growing buffer");
957 * @buf: the buffer to add to
960 * Append a zero terminated string to an XML buffer.
977 * @buf: the buffer to dump
980 * Append a zero terminated C string to an XML buffer.
1003 xmlBufMemoryError(buf, "growing buffer");
1016 * @buf: the XML buffer
1019 * routine which manages and grows an output buffer. This one adds
1020 * xmlChars at the end of the buffer.
1037 * @buf: the XML buffer output
1040 * routine which manage and grows an output buffer. This one add
1059 * @buf: the XML buffer output
1062 * routine which manage and grows an output buffer. This one writes
1116 * @buffer: incoming old buffer to convert to a new one
1118 * Helper routine to switch from the old buffer structures in use
1126 xmlBufFromBuffer(xmlBufferPtr buffer) {
1129 if (buffer == NULL)
1134 xmlBufMemoryError(NULL, "creating buffer");
1137 ret->use = buffer->use;
1138 ret->size = buffer->size;
1139 ret->compat_use = buffer->use;
1140 ret->compat_size = buffer->size;
1142 ret->buffer = buffer;
1143 ret->alloc = buffer->alloc;
1144 ret->content = buffer->content;
1145 ret->contentIO = buffer->contentIO;
1152 * @buf: new buffer wrapping the old one
1155 * update back the buffer provided by the user. This can lead to
1169 if (buf->buffer == NULL) {
1174 ret = buf->buffer;
1176 * What to do in case of error in the buffer ???
1182 * Keep the buffer but provide a truncated size value.
1192 * Keep the buffer but provide a truncated size value.
1209 * @buffer: the buffer to consume into @buf
1211 * The content of @buffer is appended to @buf and @buffer is freed
1213 * Returns -1 in case of error, 0 otherwise, in any case @buffer is freed
1216 xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer) {
1220 xmlBufferFree(buffer);
1224 if ((buffer != NULL) && (buffer->content != NULL) &&
1225 (buffer->use > 0)) {
1226 ret = xmlBufAdd(buf, buffer->content, buffer->use);
1228 xmlBufferFree(buffer);
1237 * Update the input to use the current set of pointers from the buffer.
1256 * Get the base of the @input relative to the beginning of the buffer
1273 xmlBufOverflowError(buf, "Input reference outside of the buffer");
1283 * @base: the base value relative to the beginning of the buffer
1284 * @cur: the cur value relative to the beginning of the buffer
1286 * Update the input to use the base and cur relative to the buffer