ReactOS  0.4.14-dev-606-g14ebc0b
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
342 XMLPUBFUN int XMLCALL
346 
347 #ifdef IN_LIBXML
348 /* internal error reporting */
349 XMLPUBFUN void XMLCALL
351  xmlParserErrors xmlerr,
352  const char *msg,
353  const xmlChar * str1,
354  const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0);
355 #endif
356 
362  const xmlChar *buffer);
366 XMLPUBFUN int XMLCALL
371 XMLPUBFUN void XMLCALL
375  const char *filename);
378 
384  const xmlChar *name,
385  xmlChar **prefix);
386 
390 XMLPUBFUN const xmlChar * XMLCALL
396  xmlChar **orig);
403 XMLPUBFUN void XMLCALL
405  int cdata);
408  xmlChar **publicID,
409  int strict);
410 XMLPUBFUN void XMLCALL
412 XMLPUBFUN const xmlChar * XMLCALL
414 XMLPUBFUN void XMLCALL
416 XMLPUBFUN void XMLCALL
418 XMLPUBFUN void XMLCALL
420 XMLPUBFUN int XMLCALL
422  xmlChar **value);
427 XMLPUBFUN int XMLCALL
430 XMLPUBFUN int XMLCALL
433 XMLPUBFUN void XMLCALL
437  (xmlParserCtxtPtr ctxt,
438  int inputchk);
441  (xmlParserCtxtPtr ctxt,
442  int inputchk);
443 XMLPUBFUN int XMLCALL
445  const xmlChar *name,
447 XMLPUBFUN int XMLCALL
449 XMLPUBFUN void XMLCALL
451 XMLPUBFUN int XMLCALL
455 XMLPUBFUN void XMLCALL
457 XMLPUBFUN void XMLCALL
459 XMLPUBFUN void XMLCALL
461 #ifdef LIBXML_SAX1_ENABLED
462 XMLPUBFUN const xmlChar * XMLCALL
463  xmlParseAttribute (xmlParserCtxtPtr ctxt,
464  xmlChar **value);
465 XMLPUBFUN const xmlChar * XMLCALL
466  xmlParseStartTag (xmlParserCtxtPtr ctxt);
467 XMLPUBFUN void XMLCALL
468  xmlParseEndTag (xmlParserCtxtPtr ctxt);
469 #endif /* LIBXML_SAX1_ENABLED */
470 XMLPUBFUN void XMLCALL
472 XMLPUBFUN void XMLCALL
474 XMLPUBFUN void XMLCALL
482 XMLPUBFUN const xmlChar * XMLCALL
484 XMLPUBFUN int XMLCALL
486 XMLPUBFUN void XMLCALL
488 XMLPUBFUN void XMLCALL
490 XMLPUBFUN void XMLCALL
492 XMLPUBFUN void XMLCALL
494  const xmlChar *ExternalID,
495  const xmlChar *SystemID);
501 #define XML_SUBSTITUTE_NONE 0
502 
507 #define XML_SUBSTITUTE_REF 1
508 
513 #define XML_SUBSTITUTE_PEREF 2
514 
519 #define XML_SUBSTITUTE_BOTH 3
520 
523  const xmlChar *str,
524  int what,
525  xmlChar end,
526  xmlChar end2,
527  xmlChar end3);
530  const xmlChar *str,
531  int len,
532  int what,
533  xmlChar end,
534  xmlChar end2,
535  xmlChar end3);
536 
537 /*
538  * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
539  */
541  xmlNodePtr value);
548  const xmlChar *value);
549 
550 /*
551  * other commodities shared between parser.c and parserInternals.
552  */
555  const xmlChar *cur,
556  int *len);
559 
560 /*
561  * Really core function shared with HTML parser.
562  */
564  int *len);
566  int val);
568  xmlChar *out,
569  int val);
572 
573 #ifdef LIBXML_HTML_ENABLED
574 /*
575  * Actually comes from the HTML parser but launched from the init stuff.
576  */
577 XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
578 XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
579  const char *encoding);
580 #endif
581 
582 /*
583  * Specific function to keep track of entities references
584  * and used by the XSLT debugger.
585  */
586 #ifdef LIBXML_LEGACY_ENABLED
587 
596 typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
597  xmlNodePtr firstNode,
598  xmlNodePtr lastNode);
599 
600 XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
601 
603  xmlParseQuotedString (xmlParserCtxtPtr ctxt);
604 XMLPUBFUN void XMLCALL
605  xmlParseNamespace (xmlParserCtxtPtr ctxt);
607  xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
609  xmlScanName (xmlParserCtxtPtr ctxt);
611  xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
612 XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
614  xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
615  xmlChar **prefix);
620  xmlDecodeEntities (xmlParserCtxtPtr ctxt,
621  int len,
622  int what,
623  xmlChar end,
624  xmlChar end2,
625  xmlChar end3);
626 XMLPUBFUN void XMLCALL
627  xmlHandleEntity (xmlParserCtxtPtr ctxt,
629 
630 #endif /* LIBXML_LEGACY_ENABLED */
631 
632 #ifdef IN_LIBXML
633 /*
634  * internal only
635  */
636 XMLPUBFUN void XMLCALL
638  const char *extra);
639 #endif
640 
641 #ifdef __cplusplus
642 }
643 #endif
644 #endif /* __XML_PARSER_INTERNALS_H__ */
GLenum func
Definition: glext.h:6028
XMLPUBFUN int XMLCALL xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler)
XMLPUBFUN xmlChar *XMLCALL xmlParseVersionInfo(xmlParserCtxtPtr ctxt)
Definition: parser.c:10131
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
XMLPUBFUN void XMLCALL xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:8194
XMLPUBFUN int XMLCALL xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, xmlChar **value)
Definition: parser.c:5605
XMLPUBFUN void XMLCALL xmlParseTextDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6841
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte(xmlChar *out, int val)
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:2241
XMLPUBFUN const xmlChar *XMLCALL xmlParseName(xmlParserCtxtPtr ctxt)
Definition: parser.c:3281
XMLPUBFUN void XMLCALL xmlParseMisc(xmlParserCtxtPtr ctxt)
Definition: parser.c:10549
XMLPUBFUN int XMLCALL inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
Definition: parser.c:1709
XMLPUBFUN int XMLCALL xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result)
Definition: parser.c:6463
XMLPUBFUN xmlChar *XMLCALL xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig)
Definition: parser.c:3702
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, const xmlChar *base)
Definition: parser.c:14057
GLuint buffer
Definition: glext.h:5915
xmlCharEncoding
Definition: encoding.h:58
#define XMLPUBFUN
Definition: xmlexports.h:30
GLuint GLuint end
Definition: gl.h:1545
XMLPUBFUN xmlChar *XMLCALL xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict)
Definition: parser.c:4611
XMLPUBFUN xmlChar *XMLCALL xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3)
Definition: parser.c:2590
XMLPUBFUN int XMLCALL xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar *cur, int *len)
const char * filename
Definition: ioapi.h:135
XMLPUBFUN void XMLCALL xmlParseElement(xmlParserCtxtPtr ctxt)
Definition: parser.c:9892
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateMemoryParserCtxt(const char *buffer, int size)
Definition: parser.c:14369
XMLPUBFUN const xmlChar *XMLCALL namePop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1936
XMLPUBFUN int XMLCALL xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
Definition: parser.c:5794
Definition: actctx.c:371
XMLPUBFUN void XMLCALL xmlParseCDSect(xmlParserCtxtPtr ctxt)
Definition: parser.c:9703
XMLPUBFUN const xmlChar *XMLCALL xmlParsePITarget(xmlParserCtxtPtr ctxt)
Definition: parser.c:4984
XMLPUBFUN void XMLCALL xmlParseXMLDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10434
XMLPUBFUN void XMLCALL xmlParsePI(xmlParserCtxtPtr ctxt)
Definition: parser.c:5092
XMLPUBFUN xmlChar *XMLCALL xmlParseVersionNum(xmlParserCtxtPtr ctxt)
Definition: parser.c:10070
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:2497
XMLPUBVAR const xmlChar xmlStringText[]
XMLPUBFUN xmlChar *XMLCALL xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix)
Definition: parser.c:2887
XMLPUBFUN int XMLCALL xmlParseElementDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6508
const WCHAR * str
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseNotationType(xmlParserCtxtPtr ctxt)
Definition: parser.c:5655
XMLPUBFUN void XMLCALL xmlFreeInputStream(xmlParserInputPtr input)
XMLPUBFUN xmlChar XMLCALL xmlPopInput(xmlParserCtxtPtr ctxt)
Definition: parser.c:2216
GLuint GLfloat * val
Definition: glext.h:7180
XMLPUBFUN xmlEntityPtr XMLCALL xmlParseEntityRef(xmlParserCtxtPtr ctxt)
Definition: parser.c:7448
XMLPUBFUN void XMLCALL xmlParseNotationDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5254
static const WCHAR lang[]
Definition: wbemdisp.c:287
#define LIBXML_ATTR_FORMAT(fmt, args)
Definition: xmlversion.h:478
XMLPUBFUN xmlChar *XMLCALL xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3)
Definition: parser.c:2780
XMLPUBFUN void XMLCALL xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: parser.c:6916
GLsizeiptr size
Definition: glext.h:5919
Definition: id3.c:18
xmlParserErrors
Definition: xmlerror.h:99
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
XMLPUBFUN const xmlChar *XMLCALL xmlParseEncodingDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10240
#define XMLPUBVAR
Definition: xmlexports.h:36
XMLPUBFUN xmlChar *XMLCALL xmlParseAttValue(xmlParserCtxtPtr ctxt)
Definition: parser.c:4118
XMLPUBFUN xmlChar *XMLCALL xmlParseSystemLiteral(xmlParserCtxtPtr ctxt)
Definition: parser.c:4135
XMLPUBFUN int XMLCALL xmlParseCharRef(xmlParserCtxtPtr ctxt)
Definition: parser.c:2283
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:1438
void __xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr, const char *msg, const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int XMLCALL nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
Definition: parser.c:1767
Definition: tree.h:489
XMLPUBFUN int XMLCALL xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
Definition: parser.c:5857
XMLPUBFUN int XMLCALL xmlParseSDDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10372
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt, int inputchk)
Definition: parser.c:6443
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk)
Definition: parser.c:6027
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateURLParserCtxt(const char *filename, int options)
Definition: parser.c:14081
unsigned char xmlChar
Definition: xmlstring.h:28
XMLPUBFUN void XMLCALL xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5899
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:6996
ed encoding
Definition: write.c:2839
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1740
XMLPUBFUN int XMLCALL xmlSkipBlankChars(xmlParserCtxtPtr ctxt)
Definition: parser.c:2138
XMLPUBFUN void XMLCALL xmlParseEntityDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5332
XMLPUBFUN void XMLCALL xmlParseContent(xmlParserCtxtPtr ctxt)
Definition: parser.c:9809
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:6782
XMLPUBFUN void XMLCALL xmlParsePEReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:7829
#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:3598
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseEnumerationType(xmlParserCtxtPtr ctxt)
Definition: parser.c:5725
XMLPUBFUN int XMLCALL namePush(xmlParserCtxtPtr ctxt, const xmlChar *value)
Definition: parser.c:1905
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
XMLPUBFUN xmlNodePtr XMLCALL nodePop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1805
XMLPUBFUN void XMLCALL xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata)
Definition: parser.c:4355
GLuint64EXT * result
Definition: glext.h:11304
XMLPUBVAR const xmlChar xmlStringComment[]
XMLPUBFUN xmlChar *XMLCALL xmlParseEncName(xmlParserCtxtPtr ctxt)
Definition: parser.c:10175
XMLPUBFUN void XMLCALL xmlParserInputShrink(xmlParserInputPtr in)
XMLPUBFUN xmlChar *XMLCALL xmlParsePubidLiteral(xmlParserCtxtPtr ctxt)
Definition: parser.c:4224
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateFileParserCtxt(const char *filename)
Definition: parser.c:14123
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputStream(xmlParserCtxtPtr ctxt)
XMLPUBFUN int XMLCALL xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler)
XMLPUBFUN void XMLCALL xmlParseComment(xmlParserCtxtPtr ctxt)
Definition: parser.c:4812