ReactOS
0.4.15-dev-2359-g0dedb9b
|
#include "libxml.h"
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include <stdlib.h>
#include <libxml/tree.h>
#include <libxml/globals.h>
#include <libxml/parserInternals.h>
#include "buf.h"
#include "elfgcchack.h"
Go to the source code of this file.
Classes | |
struct | _xmlBuf |
Macros | |
#define | IN_LIBXML |
#define | WITH_BUFFER_COMPAT |
#define | UPDATE_COMPAT(buf) |
#define | CHECK_COMPAT(buf) |
#define | bottom_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 868 of file buf.c.
Referenced by xmlBufCat(), xmlBufMergeBuffer(), and xmlBufWriteQuotedString().
xmlBufAddHead: @buf: the buffer @str: the xmlChar string @len: the number of xmlChar to add
Add a string range to the beginning of 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 928 of file buf.c.
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
Definition at line 621 of file buf.c.
Referenced by xmlCharEncFirstLineInput(), and xmlCharEncInput().
xmlBufAvail: @buf: the buffer
Function to find how much free space is allocated but not used in the buffer. It does not account for the terminating zero usually needed
Returns the amount or 0 if none or an error occurred
Definition at line 708 of file buf.c.
Referenced by xmlCharEncFirstLineInput(), and xmlCharEncInput().
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 1204 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 1007 of file buf.c.
Referenced by xmlBufWriteCHAR(), 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 1027 of file buf.c.
Referenced by xmlBufWriteChar(), and xmlBufWriteQuotedString().
xmlBufContent: @buf: the buffer
Function to extract the content of a buffer
Returns the internal content
Definition at line 582 of file buf.c.
Referenced by xmlCharEncFirstLineInput(), xmlCharEncInput(), xmlParserInputGrow(), xmlParserInputShrink(), and xsltSaveResultToString().
xmlBufCreate:
routine to create an XML buffer. returns the new structure.
Definition at line 122 of file buf.c.
Referenced by xmlSwitchInputEncodingInt().
xmlBufCreateSize: @size: initial size of buffer
routine to create an XML buffer. returns the new structure.
Definition at line 156 of file buf.c.
xmlBufCreateStatic: @mem: the memory area @size: the size in byte
routine to create an XML buffer from an immutable memory area. The area won't be modified nor copied, and is expected to be present until the end of the buffer lifetime.
returns the new structure.
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.
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 600 of file buf.c.
Referenced by xmlCharEncFirstLineInput(), xmlCharEncInput(), xmlParserInputGrow(), and xmlParserInputShrink().
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
Definition at line 1167 of file buf.c.
size_t xmlBufGetInputBase | ( | xmlBufPtr | buf, |
xmlParserInputPtr | input | ||
) |
xmlBufGetInputBase: @buf: an xmlBufPtr @input: an xmlParserInputPtr
Get the base of the @input relative to the beginning of the buffer
Returns the size_t corresponding to the displacement
Definition at line 1302 of file buf.c.
Referenced by xmlCtxtResetPush().
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 509 of file buf.c.
Referenced by xmlCharEncFirstLineInput(), and xmlCharEncInput().
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 437 of file buf.c.
Referenced by xmlBufGrow(), and xmlBufInflate().
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 726 of file buf.c.
Referenced by xmlSwitchInputEncodingInt().
xmlBufMemoryError: @extra: extra informations
Handle an out of memory condition To be improved...
Definition at line 92 of file buf.c.
Referenced by xmlBufAdd(), xmlBufAddHead(), xmlBufCCat(), xmlBufCreate(), xmlBufCreateSize(), xmlBufCreateStatic(), 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
Definition at line 1257 of file buf.c.
xmlBufOverflowError: @extra: extra informations
Handle a buffer overflow error To be improved...
Definition at line 107 of file buf.c.
Referenced by xmlBufBackToBuffer(), and xmlBufGetInputBase().
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 1283 of file buf.c.
Referenced by xmlCreateMemoryParserCtxt(), xmlCtxtResetPush(), xmlNewInputFromFile(), xmlNewIOInputStream(), and xmlSwitchInputEncodingInt().
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 745 of file buf.c.
Referenced by xmlBufAdd(), xmlBufAddHead(), and xmlBufCCat().
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
int xmlBufSetInputBaseCur | ( | xmlBufPtr | buf, |
xmlParserInputPtr | input, | ||
size_t | base, | ||
size_t | cur | ||
) |
xmlBufSetInputBaseCur: @buf: an xmlBufPtr @input: an xmlParserInputPtr @base: the base value relative to the beginning of the buffer @cur: 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 1333 of file buf.c.
Referenced by xmlCtxtResetPush().
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 388 of file buf.c.
Referenced by xmlCharEncFirstLineInput(), xmlCharEncInput(), xmlParserInputShrink(), and xmlSwitchInputEncodingInt().
xmlBufUse: @buf: the buffer
Function to get the length of a buffer
Returns the length of data in the internal content
Definition at line 687 of file buf.c.
Referenced by xmlCharEncFirstLineInput(), xmlCharEncInput(), xmlParserInputGrow(), xmlParserInputShrink(), xmlSwitchInputEncodingInt(), and xsltSaveResultToString().
xmlBufWriteCHAR: @buf: the XML buffer @string: the string to add
routine which manages and grows an output buffer. This one adds xmlChars at the end of the buffer.
Returns 0 if successful, a positive error code number otherwise and -1 in case of internal or API error.
Definition at line 1067 of file buf.c.
xmlBufWriteChar: @buf: the XML buffer output @string: the string to add
routine which manage and grows an output buffer. This one add C chars at the end of the array.
Returns 0 if successful, a positive error code number otherwise and -1 in case of internal or API error.
Definition at line 1088 of file buf.c.
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 1111 of file buf.c.