ReactOS 0.4.16-dev-88-ga65b6ae
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
21extern "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 */
320
325 xmlCreateFileParserCtxt (const char *filename);
327 xmlCreateURLParserCtxt (const char *filename,
328 int options);
331 int size);
334 const xmlChar *ID,
335 const xmlChar *base);
338 xmlCharEncoding enc);
347
348#ifdef IN_LIBXML
349/* internal error reporting */
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);
376 const char *filename);
379
385 const xmlChar *name,
386 xmlChar **prefix);
387
397 xmlChar **orig);
406 int cdata);
409 xmlChar **publicID,
410 int strict);
423 xmlChar **value);
438 (xmlParserCtxtPtr ctxt,
439 int inputchk);
442 (xmlParserCtxtPtr ctxt,
443 int inputchk);
446 const xmlChar *name,
462#ifdef LIBXML_SAX1_ENABLED
464 xmlParseAttribute (xmlParserCtxtPtr ctxt,
465 xmlChar **value);
467 xmlParseStartTag (xmlParserCtxtPtr ctxt);
469 xmlParseEndTag (xmlParserCtxtPtr ctxt);
470#endif /* LIBXML_SAX1_ENABLED */
495 const xmlChar *ExternalID,
496 const xmlChar *SystemID);
502#define XML_SUBSTITUTE_NONE 0
508#define XML_SUBSTITUTE_REF 1
514#define XML_SUBSTITUTE_PEREF 2
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 */
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 */
579XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
580XMLPUBFUN 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
598typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
599 xmlNodePtr firstNode,
600 xmlNodePtr lastNode);
601
603XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
604
607 xmlParseQuotedString (xmlParserCtxtPtr ctxt);
610 xmlParseNamespace (xmlParserCtxtPtr ctxt);
613 xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
616 xmlScanName (xmlParserCtxtPtr ctxt);
619 xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
621XMLPUBFUN 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);
639 xmlHandleEntity (xmlParserCtxtPtr ctxt,
641
642#endif /* LIBXML_LEGACY_ENABLED */
643
644#ifdef IN_LIBXML
645/*
646 * internal only
647 */
650 const char *extra);
651#endif
652
653#ifdef __cplusplus
654}
655#endif
656#endif /* __XML_PARSER_INTERNALS_H__ */
#define msg(x)
Definition: auth_time.c:54
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
xmlCharEncoding
Definition: encoding.h:56
#define XMLCALL
FxCollectionEntry * cur
GLuint GLuint end
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLenum func
Definition: glext.h:6028
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLuint in
Definition: glext.h:9616
GLuint GLfloat * val
Definition: glext.h:7180
GLenum GLsizei len
Definition: glext.h:6722
GLenum GLenum GLenum input
Definition: glext.h:9031
GLuint64EXT * result
Definition: glext.h:11304
@ extra
Definition: id3.c:95
const char * filename
Definition: ioapi.h:137
static int strict
Definition: error.c:51
void __xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr, const char *msg, const xmlChar *str1, const xmlChar *str2)
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
XMLPUBFUN void XMLCALL xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5976
XMLPUBFUN const xmlChar *XMLCALL namePop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1981
XMLPUBVAR const xmlChar xmlStringComment[]
XMLPUBVAR unsigned int xmlParserMaxDepth
XMLPUBFUN int XMLCALL xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar *cur, int *len)
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt, int inputchk)
Definition: parser.c:6533
XMLPUBFUN int XMLCALL xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, xmlChar **value)
Definition: parser.c:5682
XMLPUBFUN void XMLCALL xmlParsePEReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:7912
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputStream(xmlParserCtxtPtr ctxt)
XMLPUBFUN int XMLCALL xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
Definition: parser.c:5934
XMLPUBFUN xmlChar *XMLCALL xmlParseSystemLiteral(xmlParserCtxtPtr ctxt)
Definition: parser.c:4199
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, const xmlChar *base)
Definition: parser.c:14027
XMLPUBFUN int XMLCALL xmlParseElementDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6598
XMLPUBFUN int XMLCALL nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
Definition: parser.c:1801
XMLPUBFUN int XMLCALL xmlCheckLanguageID(const xmlChar *lang)
Definition: parser.c:1474
XMLPUBFUN xmlChar *XMLCALL xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix)
Definition: parser.c:2946
XMLPUBFUN xmlChar *XMLCALL xmlParseAttValue(xmlParserCtxtPtr ctxt)
Definition: parser.c:4182
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewStringInputStream(xmlParserCtxtPtr ctxt, const xmlChar *buffer)
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseNotationType(xmlParserCtxtPtr ctxt)
Definition: parser.c:5732
XMLPUBFUN void XMLCALL xmlNextChar(xmlParserCtxtPtr ctxt)
XMLPUBFUN void XMLCALL xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, const xmlChar *SystemID)
Definition: parser.c:6998
XMLPUBFUN const xmlChar *XMLCALL xmlParseEncodingDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10358
XMLPUBFUN int XMLCALL xmlSkipBlankChars(xmlParserCtxtPtr ctxt)
Definition: parser.c:2184
XMLPUBFUN void XMLCALL xmlParseMarkupDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6866
XMLPUBFUN xmlChar XMLCALL xmlPopInput(xmlParserCtxtPtr ctxt)
Definition: parser.c:2265
XMLPUBFUN xmlEntityPtr XMLCALL xmlParseEntityRef(xmlParserCtxtPtr ctxt)
Definition: parser.c:7531
XMLPUBFUN void XMLCALL xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata)
Definition: parser.c:4425
XMLPUBFUN int XMLCALL xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
Definition: parser.c:5871
XMLPUBFUN int XMLCALL xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
XMLPUBFUN int XMLCALL inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
Definition: parser.c:1745
XMLPUBVAR const xmlChar xmlStringTextNoenc[]
XMLPUBFUN int XMLCALL xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input)
Definition: parser.c:2290
XMLPUBFUN xmlChar *XMLCALL xmlParseVersionInfo(xmlParserCtxtPtr ctxt)
Definition: parser.c:10249
XMLPUBFUN xmlChar *XMLCALL xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig)
Definition: parser.c:3767
XMLPUBFUN xmlChar *XMLCALL xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3)
Definition: parser.c:2643
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity)
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk)
Definition: parser.c:6104
XMLPUBFUN int XMLCALL xmlParseCharRef(xmlParserCtxtPtr ctxt)
Definition: parser.c:2332
XMLPUBFUN xmlChar *XMLCALL xmlParseEncName(xmlParserCtxtPtr ctxt)
Definition: parser.c:10293
XMLPUBFUN void XMLCALL xmlParseElement(xmlParserCtxtPtr ctxt)
Definition: parser.c:9987
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename)
XMLPUBFUN int XMLCALL xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler)
XMLPUBFUN void XMLCALL xmlParseEntityDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5409
XMLPUBFUN void XMLCALL xmlParserInputShrink(xmlParserInputPtr in)
XMLPUBFUN void XMLCALL xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:8282
XMLPUBFUN int XMLCALL namePush(xmlParserCtxtPtr ctxt, const xmlChar *value)
Definition: parser.c:1950
XMLPUBFUN xmlChar *XMLCALL xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3)
Definition: parser.c:2839
XMLPUBFUN void XMLCALL xmlParseTextDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:6915
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateFileParserCtxt(const char *filename)
Definition: parser.c:14093
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:2550
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseEnumerationType(xmlParserCtxtPtr ctxt)
Definition: parser.c:5802
XMLPUBFUN void XMLCALL xmlParseComment(xmlParserCtxtPtr ctxt)
Definition: parser.c:4888
XMLPUBFUN xmlChar *XMLCALL xmlParseNmtoken(xmlParserCtxtPtr ctxt)
Definition: parser.c:3662
XMLPUBFUN const xmlChar *XMLCALL xmlParsePITarget(xmlParserCtxtPtr ctxt)
Definition: parser.c:5066
XMLPUBFUN int XMLCALL xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len)
XMLPUBFUN void XMLCALL xmlParseMisc(xmlParserCtxtPtr ctxt)
Definition: parser.c:10667
XMLPUBFUN int XMLCALL xmlIsLetter(int c)
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1774
XMLPUBFUN void XMLCALL xmlParseContent(xmlParserCtxtPtr ctxt)
Definition: parser.c:9958
XMLPUBFUN xmlNodePtr XMLCALL nodePop(xmlParserCtxtPtr ctxt)
Definition: parser.c:1839
XMLPUBFUN xmlChar *XMLCALL xmlParsePubidLiteral(xmlParserCtxtPtr ctxt)
Definition: parser.c:4291
XMLPUBFUN void XMLCALL xmlParseCDSect(xmlParserCtxtPtr ctxt)
Definition: parser.c:9765
XMLPUBFUN void XMLCALL xmlParsePI(xmlParserCtxtPtr ctxt)
Definition: parser.c:5174
XMLPUBFUN void XMLCALL xmlParseXMLDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10552
XMLPUBFUN void XMLCALL xmlParseReference(xmlParserCtxtPtr ctxt)
Definition: parser.c:7078
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte(xmlChar *out, int val)
XMLPUBFUN xmlChar *XMLCALL xmlParseVersionNum(xmlParserCtxtPtr ctxt)
Definition: parser.c:10188
XMLPUBFUN const xmlChar *XMLCALL xmlParseName(xmlParserCtxtPtr ctxt)
Definition: parser.c:3344
XML_DEPRECATED XMLPUBFUN int XMLCALL xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler)
XMLPUBFUN int XMLCALL xmlCopyChar(int len, xmlChar *out, int val)
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateURLParserCtxt(const char *filename, int options)
Definition: parser.c:14051
XMLPUBFUN void XMLCALL xmlParseNotationDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:5331
XMLPUBVAR const xmlChar xmlStringText[]
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateMemoryParserCtxt(const char *buffer, int size)
Definition: parser.c:14339
XMLPUBFUN int XMLCALL xmlParseSDDecl(xmlParserCtxtPtr ctxt)
Definition: parser.c:10490
XMLPUBFUN void XMLCALL xmlFreeInputStream(xmlParserInputPtr input)
XMLPUBFUN xmlChar *XMLCALL xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict)
Definition: parser.c:4683
XMLPUBFUN int XMLCALL xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result)
Definition: parser.c:6553
static FILE * out
Definition: regtests2xml.c:44
const WCHAR * str
#define ID
Definition: ruserpass.c:36
Definition: tree.h:489
Definition: actctx.c:448
Definition: name.c:39
Definition: pdh_main.c:94
static const WCHAR lang[]
Definition: wbemdisp.c:287
xmlParserErrors
Definition: xmlerror.h:99
#define XMLPUBFUN
Definition: xmlexports.h:61
#define XMLPUBVAR
Definition: xmlexports.h:68
static char * encoding
Definition: xmllint.c:155
unsigned char xmlChar
Definition: xmlstring.h:28
#define LIBXML_ATTR_FORMAT(fmt, args)
Definition: xmlversion.h:486
#define XML_DEPRECATED
Definition: xmlversion.h:494