14#define XML_DIR_SEP '\\'
16#define XML_DIR_SEP '/'
36#ifdef LIBXML_CATALOG_ENABLED
42#define CUR(ctxt) ctxt->input->cur
43#define END(ctxt) ctxt->input->end
44#define VALID_CTXT(ctxt) (CUR(ctxt) <= END(ctxt))
66 if ((myversion / 10000) != (
version / 10000)) {
68 "Fatal: program compiled against libxml %d using libxml %d\n",
69 (
version / 10000), (myversion / 10000));
71 "Fatal: program compiled against libxml %d using libxml %d\n",
72 (
version / 10000), (myversion / 10000));
74 if ((myversion / 100) < (
version / 100)) {
76 "Warning: program compiled against libxml %d using older %d\n",
77 (
version / 100), (myversion / 100));
111 "Memory allocation failed : %s\n",
extra);
115 NULL,
NULL, 0, 0,
"Memory allocation failed\n");
136 ctxt->
errNo = xmlerr;
139 NULL, 0, (
const char *) str1, (
const char *) str2,
159 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
169 ctxt->wellFormed = 0;
170 if (ctxt->recovery == 0)
171 ctxt->disableSAX = 1;
188 if ((ctxt !=
NULL) && (ctxt->disableSAX != 0) &&
197 ctxt->wellFormed = 0;
198 if (ctxt->recovery == 0)
199 ctxt->disableSAX = 1;
232#define CHECK_BUFFER(in) check_buffer(in)
238 "xmlParserInput: base mismatch problem\n");
240 if (
in->cur <
in->base) {
242 "xmlParserInput: cur < base problem\n");
246 "xmlParserInput: cur > base + use problem\n");
254#define CHECK_BUFFER(in)
288 if ((
in ==
NULL) || (
len < 0))
return(-1);
292 if (
in->buf ==
NULL)
return(-1);
293 if (
in->base ==
NULL)
return(-1);
294 if (
in->cur ==
NULL)
return(-1);
295 if (
in->buf->buffer ==
NULL)
return(-1);
299 indx =
in->cur -
in->base;
306 if (
in->buf->readcallback !=
NULL) {
312 in->cur =
in->base + indx;
335 if (
in->buf ==
NULL)
return;
336 if (
in->base ==
NULL)
return;
337 if (
in->cur ==
NULL)
return;
338 if (
in->buf->buffer ==
NULL)
return;
387 xmlErrInternal(ctxt,
"Parser input data memory error\n",
NULL);
399 const unsigned char *
cur;
434 if ((
cur[1] & 0xc0) != 0x80)
436 if ((
c & 0xe0) == 0xe0) {
443 if ((
cur[2] & 0xc0) != 0x80)
445 if ((
c & 0xf0) == 0xf0) {
450 if (((
c & 0xf8) != 0xf0) ||
451 ((
cur[3] & 0xc0) != 0x80))
455 val = (
cur[0] & 0x7) << 18;
456 val |= (
cur[1] & 0x3f) << 12;
457 val |= (
cur[2] & 0x3f) << 6;
462 val = (
cur[0] & 0xf) << 12;
463 val |= (
cur[1] & 0x3f) << 6;
466 if (((
val > 0xd7ff) && (
val < 0xe000)) ||
467 ((
val > 0xfffd) && (
val < 0x10000)) ||
470 "Char 0x%X out of allowed range\n",
506 "Input is not proper UTF-8, indicate encoding !\n",
515 "Input is not proper UTF-8, indicate encoding !\n%s",
569 if (((
c & 0x40) == 0) || (
c == 0xC0))
575 if ((
cur[1] & 0xc0) != 0x80)
577 if ((
c & 0xe0) == 0xe0) {
582 if ((
cur[2] & 0xc0) != 0x80)
584 if ((
c & 0xf0) == 0xf0) {
589 if (((
c & 0xf8) != 0xf0) ||
590 ((
cur[3] & 0xc0) != 0x80))
594 val = (
cur[0] & 0x7) << 18;
595 val |= (
cur[1] & 0x3f) << 12;
596 val |= (
cur[2] & 0x3f) << 6;
603 val = (
cur[0] & 0xf) << 12;
604 val |= (
cur[1] & 0x3f) << 6;
612 val = (
cur[0] & 0x1f) << 6;
619 "Char 0x%X out of allowed range\n",
val);
630 "Char 0x0 out of allowed range\n", 0);
679 "Input is not proper UTF-8, indicate encoding !\n%s",
720 if ((
cur[1] & 0xc0) != 0x80)
722 if ((
c & 0xe0) == 0xe0) {
724 if ((
cur[2] & 0xc0) != 0x80)
726 if ((
c & 0xf0) == 0xf0) {
727 if (((
c & 0xf8) != 0xf0) || ((
cur[3] & 0xc0) != 0x80))
731 val = (
cur[0] & 0x7) << 18;
732 val |= (
cur[1] & 0x3f) << 12;
733 val |= (
cur[2] & 0x3f) << 6;
738 val = (
cur[0] & 0xf) << 12;
739 val |= (
cur[1] & 0x3f) << 6;
745 val = (
cur[0] & 0x1f) << 6;
750 "Char 0x%X out of allowed range\n",
val);
792 "Input is not proper UTF-8, indicate encoding !\n%s",
824 else if (
val < 0x10000) { *
out++= (
val >> 12) | 0xE0;
bits= 6;}
825 else if (
val < 0x110000) { *
out++= (
val >> 18) | 0xF0;
bits= 12; }
828 "Internal error, xmlCopyCharMultiByte 0x%X out of bound\n",
834 return (
out - savedout);
888 if (ctxt ==
NULL)
return(-1);
979 "encoding not supported: %s\n",
1074 (
input->cur[0] == 0xFF) && (
input->cur[1] == 0xFE)) {
1079 (
input->cur[0] == 0xFE) && (
input->cur[1] == 0xFF)) {
1089 (
input->cur[0] == 0xEF) &&
1090 (
input->cur[1] == 0xBB) && (
input->cur[2] == 0xBF)) {
1121 xmlErrInternal(ctxt,
1122 "switching encoding: encoder error\n",
1130 xmlErrInternal(ctxt,
1131 "static memory buffer doesn't support encoding\n",
NULL);
1220 xmlErrMemory(ctxt,
"couldn't allocate a new input stream\n");
1226 input->standalone = -1;
1259 if (inputStream ==
NULL) {
1270 return(inputStream);
1287 xmlErrInternal(ctxt,
"xmlNewEntityInputStream entity = NULL\n",
1293 "new input from entity: %s\n",
entity->
name);
1297 xmlErrInternal(ctxt,
"Cannot parse entity %s\n",
1303 (
char *)
entity->ExternalID, ctxt));
1305 xmlErrInternal(ctxt,
1306 "Internal entity %s without content !\n",
1310 xmlErrInternal(ctxt,
1311 "Internal parameter entity %s without content !\n",
1315 xmlErrInternal(ctxt,
1316 "Predefined entity %s without content !\n",
1350 xmlErrInternal(ctxt,
"xmlNewStringInputStream string = NULL\n",
1356 "new fixed input: %.30s\n",
buffer);
1359 xmlErrMemory(ctxt,
"couldn't allocate a new input stream\n");
1387 "new input from file: %s\n",
filename);
1393 "failed to load external entity: NULL filename \n",
1402 if (inputStream ==
NULL) {
1409 if (inputStream ==
NULL)
1425 return(inputStream);
1449 xmlErrInternal(
NULL,
"Got NULL parser context\n",
NULL);
1589 ctxt->
vctxt.flags = XML_VCTXT_USE_PCTXT;
1590 ctxt->
vctxt.userData = ctxt;
1598 ctxt->
vctxt.nodeMax = 0;
1633 if (ctxt ==
NULL)
return;
1647#ifdef LIBXML_SAX1_ENABLED
1699#ifdef LIBXML_CATALOG_ENABLED
1701 xmlCatalogFreeLocal(ctxt->
catalogs);
1773 if (pos < ctx->node_seq.length
1775 return &
ctx->node_seq.buffer[
pos];
1829 unsigned long upper, lower, middle;
1833 return ((
unsigned long) -1);
1839 while (lower <= upper && !found) {
1840 middle = lower + (upper - lower) / 2;
1843 else if (node < seq->
buffer[middle - 1].
node)
1876 if ((pos < ctxt->node_seq.length) &&
1887 unsigned int byte_size;
1901 if (tmp_buffer ==
NULL) {
XMLPUBFUN void XMLCALL xmlSAX2IgnorableWhitespace(void *ctx, const xmlChar *ch, int len)
XMLPUBFUN int XMLCALL xmlSAXVersion(xmlSAXHandler *hdlr, int version)
int strcmp(const char *String1, const char *String2)
int xmlBufIsEmpty(const xmlBufPtr buf)
int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input)
xmlBufPtr xmlBufCreate(void)
static const WCHAR version[]
UINT(* handler)(MSIPACKAGE *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
int xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
int xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
XMLPUBFUN int XMLCALL xmlCharEncCloseFunc(xmlCharEncodingHandler *handler)
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlGetCharEncodingHandler(xmlCharEncoding enc)
@ XML_CHAR_ENCODING_8859_6
@ XML_CHAR_ENCODING_8859_7
@ XML_CHAR_ENCODING_8859_2
@ XML_CHAR_ENCODING_8859_4
@ XML_CHAR_ENCODING_8859_8
@ XML_CHAR_ENCODING_UTF16BE
@ XML_CHAR_ENCODING_2022_JP
@ XML_CHAR_ENCODING_8859_3
@ XML_CHAR_ENCODING_EBCDIC
@ XML_CHAR_ENCODING_UCS4LE
@ XML_CHAR_ENCODING_ERROR
@ XML_CHAR_ENCODING_UCS4_3412
@ XML_CHAR_ENCODING_UCS4BE
@ XML_CHAR_ENCODING_8859_1
@ XML_CHAR_ENCODING_8859_9
@ XML_CHAR_ENCODING_UTF16LE
@ XML_CHAR_ENCODING_8859_5
@ XML_CHAR_ENCODING_ASCII
@ XML_CHAR_ENCODING_SHIFT_JIS
@ XML_CHAR_ENCODING_UCS4_2143
@ XML_CHAR_ENCODING_EUC_JP
XMLPUBFUN const char *XMLCALL xmlGetCharEncodingName(xmlCharEncoding enc)
@ XML_EXTERNAL_GENERAL_PARSED_ENTITY
@ XML_INTERNAL_PREDEFINED_ENTITY
@ XML_EXTERNAL_GENERAL_UNPARSED_ENTITY
@ XML_INTERNAL_GENERAL_ENTITY
@ XML_INTERNAL_PARAMETER_ENTITY
@ XML_EXTERNAL_PARAMETER_ENTITY
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2
static int xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler, int len)
unsigned long xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, const xmlNodePtr node)
void __xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr, const char *msg, const xmlChar *str1, const xmlChar *str2)
int xmlCopyCharMultiByte(xmlChar *out, int val)
xmlParserInputPtr xmlNewStringInputStream(xmlParserCtxtPtr ctxt, const xmlChar *buffer)
xmlParserCtxtPtr xmlNewParserCtxt(void)
void xmlFreeInputStream(xmlParserInputPtr input)
int xmlCopyChar(int len ATTRIBUTE_UNUSED, xmlChar *out, int val)
void xmlParserInputShrink(xmlParserInputPtr in)
int xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
void xmlClearNodeInfoSeq(xmlParserNodeInfoSeqPtr seq)
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
int xmlKeepBlanksDefault(int val)
void xmlNextChar(xmlParserCtxtPtr ctxt)
xmlParserInputPtr xmlNewInputStream(xmlParserCtxtPtr ctxt)
int xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar *cur, int *len)
void xmlCheckVersion(int version)
void xmlClearParserCtxt(xmlParserCtxtPtr ctxt)
xmlParserInputPtr xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity)
int xmlParserInputGrow(xmlParserInputPtr in, int len)
void xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
int xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler)
int xmlPedanticParserDefault(int val)
xmlParserInputPtr xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename)
int xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler)
const xmlParserNodeInfo * xmlParserFindNodeInfo(const xmlParserCtxtPtr ctx, const xmlNodePtr node)
int xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
int xmlSubstituteEntitiesDefault(int val)
void xmlInitNodeInfoSeq(xmlParserNodeInfoSeqPtr seq)
void xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, const xmlParserNodeInfoPtr info)
int xmlLineNumbersDefault(int val)
int xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len)
int xmlParserInputRead(xmlParserInputPtr in ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED)
xmlParserInputPtr xmlNewIOInputStream(xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc)
#define IS_IDEOGRAPHIC(c)
#define XML_MAX_DICTIONARY_LIMIT
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop(xmlParserCtxtPtr ctxt)
static BOOL check_buffer(parse_buffer *buf, ULONG size)
static unsigned __int64 next
XMLPUBFUN xmlDictPtr XMLCALL xmlDictCreate(void)
XMLPUBFUN size_t XMLCALL xmlDictSetLimit(xmlDictPtr dict, size_t limit)
XMLPUBFUN void XMLCALL xmlDictFree(xmlDictPtr dict)
XMLPUBVAR int xmlSubstituteEntitiesDefaultValue
XMLPUBVAR int xmlParserDebugEntities
XMLPUBVAR int xmlLineNumbersDefaultValue
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR int xmlKeepBlanksDefaultValue
XMLPUBVAR int xmlGetWarningsDefaultValue
XMLPUBVAR int xmlLoadExtDtdDefaultValue
XMLPUBVAR int xmlIndentTreeOutput
XMLPUBVAR int xmlDoValidityCheckingDefaultValue
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBVAR int xmlPedanticParserDefaultValue
XMLPUBVAR void * xmlGenericErrorContext
XMLPUBVAR xmlReallocFunc xmlRealloc
XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
XMLPUBFUN void XMLCALL xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f)
XMLPUBFUN void XMLCALL xmlHashDefaultDeallocator(void *entry, const xmlChar *name)
XMLPUBFUN void XMLCALL xmlStopParser(xmlParserCtxtPtr ctxt)
XMLPUBFUN void XMLCALL xmlCtxtReset(xmlParserCtxtPtr ctxt)
XMLPUBFUN void XMLCALL xmlInitParser(void)
XMLPUBFUN xmlParserInputPtr XMLCALL xmlLoadExternalEntity(const char *URL, const char *ID, xmlParserCtxtPtr ctxt)
XMLPUBFUN xmlChar *XMLCALL xmlBufEnd(xmlBufPtr buf)
XMLPUBFUN size_t XMLCALL xmlBufUse(const xmlBufPtr buf)
xmlParserInput * xmlParserInputPtr
XMLPUBFUN size_t XMLCALL xmlBufShrink(xmlBufPtr buf, size_t len)
xmlParserCtxt * xmlParserCtxtPtr
XMLPUBFUN xmlChar *XMLCALL xmlBufContent(const xmlBuf *buf)
struct _xmlSAXHandler * sax
xmlParserNodeInfoSeq node_seq
xmlParserInputState instate
xmlHashTablePtr attsSpecial
unsigned long sizeentities
unsigned long sizeentcopy
xmlParserInputPtr * inputTab
xmlHashTablePtr attsDefault
xmlParserNodeInfo * nodeInfoTab
xmlParserNodeInfo * buffer
const struct _xmlNode * node
static int processed(const type_t *type)
XMLPUBFUN xmlChar *XMLCALL xmlCanonicPath(const xmlChar *path)
XMLPUBFUN int XMLCALL xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len)
XMLPUBFUN char *XMLCALL xmlParserGetDirectory(const char *filename)
XMLPUBFUN void XMLCALL xmlFreeParserInputBuffer(xmlParserInputBufferPtr in)
XMLPUBFUN xmlParserInputPtr XMLCALL xmlCheckHTTPInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr ret)
XMLPUBFUN int XMLCALL xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len)
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc)
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserValidityWarning(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL XMLPUBFUN void XMLCDECL xmlParserValidityError(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
@ XML_ERR_UNKNOWN_ENCODING
@ XML_ERR_UNSUPPORTED_ENCODING
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrlen(const xmlChar *str)
#define LIBXML_ATTR_FORMAT(fmt, args)