ReactOS  0.4.15-dev-5500-g82cf6c2
parserInternals.h
Go to the documentation of this file.
1 /*
2  * Summary: internals routines and limits exported by the parser.
3  * Description: this module exports a number of internal parsing routines
4  * they are not really all intended for applications but
5  * can prove useful doing low level processing.
6  *
7  * Copy: See Copyright for the status of this software.
8  *
9  * Author: Daniel Veillard
10  */
11 
12 #ifndef __XML_PARSER_INTERNALS_H__
13 #define __XML_PARSER_INTERNALS_H__
14 
15 #include <libxml/xmlversion.h>
16 #include <libxml/parser.h>
17 #include <libxml/HTMLparser.h>
18 #include <libxml/chvalid.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
32 
41 #define XML_MAX_TEXT_LENGTH 10000000
42 
53 #define XML_MAX_NAME_LENGTH 50000
54 
63 #define XML_MAX_DICTIONARY_LIMIT 10000000
64 
73 #define XML_MAX_LOOKUP_LIMIT 10000000
74 
81 #define XML_MAX_NAMELEN 100
82 
89 #define INPUT_CHUNK 250
90 
91 /************************************************************************
92  * *
93  * UNICODE version of the macros. *
94  * *
95  ************************************************************************/
105 #define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
106 
117 #define IS_CHAR(c) xmlIsCharQ(c)
118 
125 #define IS_CHAR_CH(c) xmlIsChar_ch(c)
126 
135 #define IS_BLANK(c) xmlIsBlankQ(c)
136 
143 #define IS_BLANK_CH(c) xmlIsBlank_ch(c)
144 
153 #define IS_BASECHAR(c) xmlIsBaseCharQ(c)
154 
163 #define IS_DIGIT(c) xmlIsDigitQ(c)
164 
171 #define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
172 
181 #define IS_COMBINING(c) xmlIsCombiningQ(c)
182 
189 #define IS_COMBINING_CH(c) 0
190 
202 #define IS_EXTENDER(c) xmlIsExtenderQ(c)
203 
210 #define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
211 
221 #define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
222 
232 #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
233 
241 #define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
242 
250 #define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
251  ((0x61 <= (c)) && ((c) <= 0x7a)))
252 
260 #define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
261 
271 #define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
272 
279 #define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
280 
287 #define SKIP_EOL(p) \
288  if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \
289  if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
290 
297 #define MOVETO_ENDTAG(p) \
298  while ((*p) && (*(p) != '>')) (p)++
299 
306 #define MOVETO_STARTTAG(p) \
307  while ((*p) && (*(p) != '<')) (p)++
308 
315 
316 /*
317  * Function to finish the work of the macros where needed.
318  */
319 XMLPUBFUN int XMLCALL xmlIsLetter (int c);
320 
325  xmlCreateFileParserCtxt (const char *filename);
327  xmlCreateURLParserCtxt (const char *filename,
328  int options);
330  xmlCreateMemoryParserCtxt(const char *buffer,
331  int size);
334  const xmlChar *ID,
335  const xmlChar *base);
336 XMLPUBFUN int XMLCALL
338  xmlCharEncoding enc);
339 XMLPUBFUN int XMLCALL
343 XMLPUBFUN int XMLCALL
347 
348 #ifdef IN_LIBXML
349 /* internal error reporting */
350 XMLPUBFUN void XMLCALL
352  xmlParserErrors xmlerr,
353  const char *msg,
354  const xmlChar * str1,
355  const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0);
356 #endif
357 
363  const xmlChar *buffer);
367 XMLPUBFUN int XMLCALL
372 XMLPUBFUN void XMLCALL
376  const char *filename);
379 
385  const xmlChar *name,
386  xmlChar **prefix);
387 
391 XMLPUBFUN const xmlChar * XMLCALL
397  xmlChar **orig);
404 XMLPUBFUN void XMLCALL
406  int cdata);
409  xmlChar **publicID,
410  int strict);
411 XMLPUBFUN void XMLCALL
413 XMLPUBFUN const xmlChar * XMLCALL
415 XMLPUBFUN void XMLCALL
417 XMLPUBFUN void XMLCALL
419 XMLPUBFUN void XMLCALL
421 XMLPUBFUN int XMLCALL
423  xmlChar **value);
428 XMLPUBFUN int XMLCALL
431 XMLPUBFUN int XMLCALL
434 XMLPUBFUN void XMLCALL
438  (xmlParserCtxtPtr ctxt,
439  int inputchk);
442  (xmlParserCtxtPtr ctxt,
443  int inputchk);
444 XMLPUBFUN int XMLCALL
446  const xmlChar *name,
448 XMLPUBFUN int XMLCALL
450 XMLPUBFUN void XMLCALL
452 XMLPUBFUN int XMLCALL
456 XMLPUBFUN void XMLCALL
458 XMLPUBFUN void XMLCALL
460 XMLPUBFUN void XMLCALL
462 #ifdef LIBXML_SAX1_ENABLED
463 XMLPUBFUN const xmlChar * XMLCALL
464  xmlParseAttribute (xmlParserCtxtPtr ctxt,
465  xmlChar **value);
466 XMLPUBFUN const xmlChar * XMLCALL
467  xmlParseStartTag (xmlParserCtxtPtr ctxt);
468 XMLPUBFUN void XMLCALL
469  xmlParseEndTag (xmlParserCtxtPtr ctxt);
470 #endif /* LIBXML_SAX1_ENABLED */
471 XMLPUBFUN void XMLCALL
473 XMLPUBFUN void XMLCALL
475 XMLPUBFUN void XMLCALL
483 XMLPUBFUN const xmlChar * XMLCALL
485 XMLPUBFUN int XMLCALL
487 XMLPUBFUN void XMLCALL
489 XMLPUBFUN void XMLCALL
491 XMLPUBFUN void XMLCALL
493 XMLPUBFUN void XMLCALL
495  const xmlChar *ExternalID,
496  const xmlChar *SystemID);
502 #define XML_SUBSTITUTE_NONE 0
503 
508 #define XML_SUBSTITUTE_REF 1
509 
514 #define XML_SUBSTITUTE_PEREF 2
515 
520 #define XML_SUBSTITUTE_BOTH 3
521 
524  const xmlChar *str,
525  int what,
526  xmlChar end,
527  xmlChar end2,
528  xmlChar end3);
531  const xmlChar *str,
532  int len,
533  int what,
534  xmlChar end,
535  xmlChar end2,
536  xmlChar end3);
537 
538 /*
539  * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
540  */
542  xmlNodePtr value);
549  const xmlChar *value);
550 
551 /*
552  * other commodities shared between parser.c and parserInternals.
553  */
556  const xmlChar *cur,
557  int *len);
560 
561 /*
562  * Really core function shared with HTML parser.
563  */
565  int *len);
567  int val);
569  xmlChar *out,
570  int val);
573 
574 #ifdef LIBXML_HTML_ENABLED
575 /*
576  * Actually comes from the HTML parser but launched from the init stuff.
577  */
579 XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
580 XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
581  const char *encoding);
582 #endif
583 
584 /*
585  * Specific function to keep track of entities references
586  * and used by the XSLT debugger.
587  */
588 #ifdef LIBXML_LEGACY_ENABLED
589 
598 typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
599  xmlNodePtr firstNode,
600  xmlNodePtr lastNode);
601 
603 XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
604 
607  xmlParseQuotedString (xmlParserCtxtPtr ctxt);
609 XMLPUBFUN void XMLCALL
610  xmlParseNamespace (xmlParserCtxtPtr ctxt);
613  xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
616  xmlScanName (xmlParserCtxtPtr ctxt);
619  xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
621 XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
624  xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
625  xmlChar **prefix);
631  xmlDecodeEntities (xmlParserCtxtPtr ctxt,
632  int len,
633  int what,
634  xmlChar end,
635  xmlChar end2,
636  xmlChar end3);
638 XMLPUBFUN void XMLCALL
639  xmlHandleEntity (xmlParserCtxtPtr ctxt,
641 
642 #endif /* LIBXML_LEGACY_ENABLED */
643 
644 #ifdef IN_LIBXML
645 /*
646  * internal only
647  */
648 XMLPUBFUN void XMLCALL
650  const char *extra);
651 #endif
652 
653 #ifdef __cplusplus
654 }
655 #endif
656 #endif /* __XML_PARSER_INTERNALS_H__ */
GLenum func
Definition: glext.h:6028
XMLPUBFUN int XMLCALL xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler)
Definition: pdh_main.c:93
XMLPUBFUN xmlChar *XMLCALL xmlParseVersionInfo(xmlParserCtxtPtr ctxt)
Definition: parser.c:10249
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define XML_DEPRECATED
Definition: xmlversion.h:494
XMLPUBFUN void XMLCALL xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:8282
XMLPUBFUN int XMLCALL xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, xmlChar **value)
Definition: parser.c:5682
XMLPUBFUN void XMLCALL xmlParseTextDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6915
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte(xmlChar *out, int val)
GLuint64EXT * result
Definition: glext.h:11304
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewStringInputStream(xmlParserCtxtPtr ctxt, const xmlChar *buffer)
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename)
XMLPUBFUN int XMLCALL xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input)
Definition: parser.c:2290
XMLPUBFUN const xmlChar *XMLCALL xmlParseName(xmlParserCtxtPtr ctxt)
Definition: parser.c:3344
XMLPUBFUN void XMLCALL xmlParseMisc(xmlParserCtxtPtr ctxt)
Definition: parser.c:10667
static char * encoding
Definition: xmllint.c:155
XMLPUBFUN int XMLCALL inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
Definition: parser.c:1745
XMLPUBFUN int XMLCALL xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result)
Definition: parser.c:6553
XMLPUBFUN xmlChar *XMLCALL xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig)
Definition: parser.c:3767
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, const xmlChar *base)
Definition: parser.c:14027
GLuint buffer
Definition: glext.h:5915
xmlCharEncoding
Definition: encoding.h:56
#define XMLPUBFUN
Definition: xmlexports.h:61
XMLPUBFUN xmlChar *XMLCALL xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict)
Definition: parser.c:4683
XMLPUBFUN xmlChar *XMLCALL xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3)
Definition: parser.c:2643
XMLPUBFUN int XMLCALL xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar *cur, int *len)
const char * filename
Definition: ioapi.h:137
XMLPUBFUN void XMLCALL xmlParseElement(xmlParserCtxtPtr ctxt)
Definition: parser.c:9987
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateMemoryParserCtxt(const char *buffer, int size)
Definition: parser.c:14339
XMLPUBFUN const xmlChar *XMLCALL namePop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1981
XMLPUBFUN int XMLCALL xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
Definition: parser.c:5871
Definition: actctx.c:387
XMLPUBFUN void XMLCALL xmlParseCDSect(xmlParserCtxtPtr ctxt)
Definition: parser.c:9765
XMLPUBFUN const xmlChar *XMLCALL xmlParsePITarget(xmlParserCtxtPtr ctxt)
Definition: parser.c:5066
XMLPUBFUN void XMLCALL xmlParseXMLDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10552
XMLPUBFUN void XMLCALL xmlParsePI(xmlParserCtxtPtr ctxt)
Definition: parser.c:5174
XMLPUBFUN xmlChar *XMLCALL xmlParseVersionNum(xmlParserCtxtPtr ctxt)
Definition: parser.c:10188
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:2550
XMLPUBVAR const xmlChar xmlStringText[]
XMLPUBFUN xmlChar *XMLCALL xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix)
Definition: parser.c:2946
XMLPUBFUN int XMLCALL xmlParseElementDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6598
const WCHAR * str
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseNotationType(xmlParserCtxtPtr ctxt)
Definition: parser.c:5732
XMLPUBFUN void XMLCALL xmlFreeInputStream(xmlParserInputPtr input)
XMLPUBFUN xmlChar XMLCALL xmlPopInput(xmlParserCtxtPtr ctxt)
Definition: parser.c:2265
GLuint GLfloat * val
Definition: glext.h:7180
XMLPUBFUN xmlEntityPtr XMLCALL xmlParseEntityRef(xmlParserCtxtPtr ctxt)
Definition: parser.c:7531
XMLPUBFUN void XMLCALL xmlParseNotationDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5331
static const WCHAR lang[]
Definition: wbemdisp.c:287
#define LIBXML_ATTR_FORMAT(fmt, args)
Definition: xmlversion.h:486
XMLPUBFUN xmlChar *XMLCALL xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3)
Definition: parser.c:2839
XMLPUBFUN void XMLCALL xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: parser.c:6998
GLsizeiptr size
Definition: glext.h:5919
Definition: id3.c:95
xmlParserErrors
Definition: xmlerror.h:99
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
XMLPUBFUN const xmlChar *XMLCALL xmlParseEncodingDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10358
#define XMLPUBVAR
Definition: xmlexports.h:68
XMLPUBFUN xmlChar *XMLCALL xmlParseAttValue(xmlParserCtxtPtr ctxt)
Definition: parser.c:4182
XMLPUBFUN xmlChar *XMLCALL xmlParseSystemLiteral(xmlParserCtxtPtr ctxt)
Definition: parser.c:4199
XMLPUBFUN int XMLCALL xmlParseCharRef(xmlParserCtxtPtr ctxt)
Definition: parser.c:2332
XMLPUBFUN void XMLCALL xmlNextChar(xmlParserCtxtPtr ctxt)
const GLubyte * c
Definition: glext.h:8905
static int strict
Definition: error.c:51
static FILE * out
Definition: regtests2xml.c:44
XMLPUBFUN int XMLCALL xmlCheckLanguageID(const xmlChar *lang)
Definition: parser.c:1474
void __xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr, const char *msg, const xmlChar *str1, const xmlChar *str2)
GLuint GLuint end
Definition: gl.h:1545
XMLPUBFUN int XMLCALL nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
Definition: parser.c:1801
Definition: tree.h:489
XMLPUBFUN int XMLCALL xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
Definition: parser.c:5934
XMLPUBFUN int XMLCALL xmlParseSDDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10490
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt, int inputchk)
Definition: parser.c:6533
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk)
Definition: parser.c:6104
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateURLParserCtxt(const char *filename, int options)
Definition: parser.c:14051
unsigned char xmlChar
Definition: xmlstring.h:28
XMLPUBFUN void XMLCALL xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5976
GLenum GLsizei len
Definition: glext.h:6722
#define ID
Definition: ruserpass.c:36
XMLPUBFUN int XMLCALL xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len)
XMLPUBFUN void XMLCALL xmlParseReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:7078
FxCollectionEntry * cur
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1774
XMLPUBFUN int XMLCALL xmlSkipBlankChars(xmlParserCtxtPtr ctxt)
Definition: parser.c:2184
XMLPUBFUN void XMLCALL xmlParseEntityDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5409
XMLPUBFUN void XMLCALL xmlParseContent(xmlParserCtxtPtr ctxt)
Definition: parser.c:9958
GLenum GLenum GLenum input
Definition: glext.h:9031
GLuint in
Definition: glext.h:9616
XMLPUBFUN int XMLCALL xmlIsLetter(int c)
XMLPUBFUN int XMLCALL xmlCopyChar(int len, xmlChar *out, int val)
XMLPUBVAR unsigned int xmlParserMaxDepth
XMLPUBFUN int XMLCALL xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
XMLPUBVAR const xmlChar xmlStringTextNoenc[]
XMLPUBFUN void XMLCALL xmlParseMarkupDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6866
XMLPUBFUN void XMLCALL xmlParsePEReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:7912
XML_DEPRECATED XMLPUBFUN int XMLCALL xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler)
#define msg(x)
Definition: auth_time.c:54
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity)
#define XMLCALL
Definition: name.c:38
XMLPUBFUN xmlChar *XMLCALL xmlParseNmtoken(xmlParserCtxtPtr ctxt)
Definition: parser.c:3662
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseEnumerationType(xmlParserCtxtPtr ctxt)
Definition: parser.c:5802
XMLPUBFUN int XMLCALL namePush(xmlParserCtxtPtr ctxt, const xmlChar *value)
Definition: parser.c:1950
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7482
XMLPUBFUN xmlNodePtr XMLCALL nodePop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1839
XMLPUBFUN void XMLCALL xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata)
Definition: parser.c:4425
XMLPUBVAR const xmlChar xmlStringComment[]
XMLPUBFUN xmlChar *XMLCALL xmlParseEncName(xmlParserCtxtPtr ctxt)
Definition: parser.c:10293
XMLPUBFUN void XMLCALL xmlParserInputShrink(xmlParserInputPtr in)
XMLPUBFUN xmlChar *XMLCALL xmlParsePubidLiteral(xmlParserCtxtPtr ctxt)
Definition: parser.c:4291
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateFileParserCtxt(const char *filename)
Definition: parser.c:14093
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputStream(xmlParserCtxtPtr ctxt)
XMLPUBFUN void XMLCALL xmlParseComment(xmlParserCtxtPtr ctxt)
Definition: parser.c:4888