|
ReactOS 0.4.16-dev-2208-g6350669
|
#include "libxml.h"#include <string.h>#include <limits.h>#include <ctype.h>#include <stdlib.h>#include <libxml/tree.h>#include <libxml/parserInternals.h>#include "private/buf.h"#include "private/error.h"
Go to the source code of this file.
Classes | |
| struct | _xmlBuf |
Macros | |
| #define | IN_LIBXML |
| #define | SIZE_MAX ((size_t) -1) |
| #define | WITH_BUFFER_COMPAT |
| #define | UPDATE_COMPAT(buf) |
| #define | CHECK_COMPAT(buf) |
xmlBufAdd: @buf: the buffer to dump @str: the xmlChar string @len: the number of xmlChar to add
Add a string range to an XML buffer. if len == -1, the length of str is recomputed.
Returns 0 successful, a positive error code number otherwise and -1 in case of internal or API error.
Definition at line 758 of file buf.c.
Referenced by xmlBufCat(), xmlBufMergeBuffer(), and xmlBufWriteQuotedString().
xmlBufAddLen: @buf: the buffer @len: the size which were added at the end
Sometime data may be added at the end of the buffer without using the xmlBuf APIs that is used to expand the used space and set the zero terminating at the end of the buffer
Returns -1 in case of error and 0 otherwise
xmlBufAvail: @buf: the buffer
Function to find how much free space is allocated but not used in the buffer. It reserves one byte for the NUL terminator character that is usually needed, so there is no need to subtract 1 from the result anymore.
Returns the amount, or 0 if none or if an error occurred.
| xmlBufferPtr xmlBufBackToBuffer | ( | xmlBufPtr | buf | ) |
xmlBufBackToBuffer: @buf: new buffer wrapping the old one
Function to be called once internal processing had been done to update back the buffer provided by the user. This can lead to a failure in case the size accumulated in the xmlBuf is larger than what an xmlBuffer can support on 64 bits (INT_MAX) The xmlBufPtr @buf wrapper is deallocated by this call in any case.
Returns the old xmlBufferPtr unless the call failed and NULL is returned
Definition at line 938 of file buf.c.
xmlBufCat: @buf: the buffer to add to @str: the xmlChar string
Append a zero terminated string to an XML buffer.
Returns 0 successful, a positive error code number otherwise and -1 in case of internal or API error.
Definition at line 816 of file buf.c.
Referenced by xmlBufCCat(), and xmlBufWriteQuotedString().
xmlBufCCat: @buf: the buffer to dump @str: the C char string
Append a zero terminated C string to an XML buffer.
Returns 0 successful, a positive error code number otherwise and -1 in case of internal or API error.
Definition at line 835 of file buf.c.
Referenced by xmlBufWriteQuotedString().
xmlBufContent: @buf: the buffer
Function to extract the content of a buffer
Returns the internal content
Definition at line 490 of file buf.c.
Referenced by node_transform_write_to_bstr(), xmlParserInputGrow(), xmlParserInputShrink(), and xsltSaveResultToString().
| xmlBufPtr xmlBufCreate | ( | void | ) |
| xmlBufPtr xmlBufCreateSize | ( | size_t | size | ) |
| xmlChar * xmlBufDetach | ( | xmlBufPtr | buf | ) |
xmlBufDetach: @buf: the buffer
Remove the string contained in a buffer and give it back to the caller. The buffer is reset to an empty content. This doesn't work with immutable buffers as they can't be reset.
Returns the previous string contained by the buffer.
Definition at line 196 of file buf.c.
Referenced by xmlLoadEntityContent().
Definition at line 464 of file buf.c.
| void xmlBufEmpty | ( | xmlBufPtr | buf | ) |
| xmlChar * xmlBufEnd | ( | xmlBufPtr | buf | ) |
xmlBufEnd: @buf: the buffer
Function to extract the end of the content of a buffer
Returns the end of the internal content or NULL in case of error
Definition at line 508 of file buf.c.
Referenced by xmlParserInputGrow(), and xmlParserInputShrink().
| void xmlBufFree | ( | xmlBufPtr | buf | ) |
xmlBufFree: @buf: the buffer to free
Frees an XML buffer. It frees both the content and the structure which encapsulate it.
Definition at line 276 of file buf.c.
Referenced by xmlBufBackToBuffer().
| xmlBufPtr xmlBufFromBuffer | ( | xmlBufferPtr | buffer | ) |
xmlBufFromBuffer: @buffer: incoming old buffer to convert to a new one
Helper routine to switch from the old buffer structures in use in various APIs. It creates a wrapper xmlBufPtr which will be used for internal processing until the xmlBufBackToBuffer() is issued.
Returns a new xmlBufPtr unless the call failed and NULL is returned
| int xmlBufGetAllocationScheme | ( | xmlBufPtr | buf | ) |
xmlBufGrow: @buf: the buffer @len: the minimum free size to allocate
Grow the available space of an XML buffer, @len is the target value This is been kept compatible with xmlBufferGrow() as much as possible
Returns -1 in case of error or the length made available otherwise
Definition at line 443 of file buf.c.
xmlBufGrowInternal: @buf: the buffer @len: the minimum free size to allocate
Grow the available space of an XML buffer, @len is the target value Error checking should be done on buf->error since using the return value doesn't work that well
Returns 0 in case of error or the length made available otherwise
Definition at line 376 of file buf.c.
Referenced by xmlBufGrow().
xmlBufIsEmpty: @buf: the buffer
Tell if a buffer is empty
Returns 0 if no, 1 if yes and -1 in case of error
Definition at line 610 of file buf.c.
Referenced by xmlParseDocument(), and xmlSwitchInputEncoding().
xmlBufMemoryError: @extra: extra information
Handle an out of memory condition To be improved...
Definition at line 92 of file buf.c.
Referenced by xmlBufAdd(), xmlBufCreate(), xmlBufCreateSize(), xmlBufFromBuffer(), xmlBufGrowInternal(), and xmlBufResize().
| int xmlBufMergeBuffer | ( | xmlBufPtr | buf, |
| xmlBufferPtr | buffer | ||
| ) |
xmlBufMergeBuffer: @buf: an xmlBufPtr @buffer: the buffer to consume into @buf
The content of @buffer is appended to @buf and @buffer is freed
Returns -1 in case of error, 0 otherwise, in any case @buffer is freed
xmlBufOverflowError: @extra: extra information
Handle a buffer overflow error To be improved...
Definition at line 107 of file buf.c.
Referenced by xmlBufBackToBuffer().
| int xmlBufResetInput | ( | xmlBufPtr | buf, |
| xmlParserInputPtr | input | ||
| ) |
xmlBufResetInput: @buf: an xmlBufPtr @input: an xmlParserInputPtr
Update the input to use the current set of pointers from the buffer.
Returns -1 in case of error, 0 otherwise
Definition at line 1019 of file buf.c.
Referenced by xmlCreateDocParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCtxtResetPush(), xmlLoadEntityContent(), xmlNewInputFromFile(), xmlNewIOInputStream(), xmlNewStringInputStream(), and xmlSwitchInputEncoding().
xmlBufResize: @buf: the buffer to resize @size: the desired size
Resize a buffer to accommodate minimum size of @size.
Returns 0 in case of problems, 1 otherwise
Definition at line 629 of file buf.c.
Referenced by xmlBufAdd().
| int xmlBufSetAllocationScheme | ( | xmlBufPtr | buf, |
| xmlBufferAllocationScheme | scheme | ||
| ) |
xmlBufSetAllocationScheme: @buf: the buffer to tune @scheme: allocation scheme to use
Sets the allocation scheme for this buffer
returns 0 in case of success and -1 in case of failure
Definition at line 241 of file buf.c.
xmlBufShrink: @buf: the buffer to dump @len: the number of xmlChar to remove
Remove the beginning of an XML buffer. NOTE that this routine behaviour differs from xmlBufferShrink() as it will return 0 on error instead of -1 due to size_t being used as the return type.
Returns the number of byte removed or 0 in case of failure
Definition at line 328 of file buf.c.
Referenced by xmlLoadEntityContent(), xmlParserInputShrink(), xmlParserShrink(), and xmlSwitchInputEncoding().
xmlBufUpdateInput: @buf: an xmlBufPtr @input: an xmlParserInputPtr @pos: the cur value relative to the beginning of the buffer
Update the input to use the base and cur relative to the buffer after a possible reallocation of its content
Returns -1 in case of error, 0 otherwise
Definition at line 1044 of file buf.c.
Referenced by xmlCtxtResetPush(), xmlParserGrow(), and xmlParserShrink().
xmlBufUse: @buf: the buffer
Function to get the length of a buffer
Returns the length of data in the internal content
Definition at line 570 of file buf.c.
Referenced by node_transform_write_to_bstr(), xmlLoadEntityContent(), xmlParserInputGrow(), xmlParserInputShrink(), and xsltSaveResultToString().
xmlBufWriteQuotedString: @buf: the XML buffer output @string: the string to add
routine which manage and grows an output buffer. This one writes a quoted or double quoted xmlChar string, checking first if it holds quote or double-quotes internally
Returns 0 if successful, a positive error code number otherwise and -1 in case of internal or API error.
Definition at line 852 of file buf.c.