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 
24 /**
25  * xmlParserMaxDepth:
26  *
27  * arbitrary depth limit for the XML documents that we allow to
28  * process. This is not a limitation of the parser but a safety
29  * boundary feature, use XML_PARSE_HUGE option to override it.
30  */
31 XMLPUBVAR unsigned int xmlParserMaxDepth;
32 
33 /**
34  * XML_MAX_TEXT_LENGTH:
35  *
36  * Maximum size allowed for a single text node when building a tree.
37  * This is not a limitation of the parser but a safety boundary feature,
38  * use XML_PARSE_HUGE option to override it.
39  * Introduced in 2.9.0
40  */
41 #define XML_MAX_TEXT_LENGTH 10000000
42 
43 /**
44  * XML_MAX_NAME_LENGTH:
45  *
46  * Maximum size allowed for a markup identifier.
47  * This is not a limitation of the parser but a safety boundary feature,
48  * use XML_PARSE_HUGE option to override it.
49  * Note that with the use of parsing dictionaries overriding the limit
50  * may result in more runtime memory usage in face of "unfriendly' content
51  * Introduced in 2.9.0
52  */
53 #define XML_MAX_NAME_LENGTH 50000
54 
55 /**
56  * XML_MAX_DICTIONARY_LIMIT:
57  *
58  * Maximum size allowed by the parser for a dictionary by default
59  * This is not a limitation of the parser but a safety boundary feature,
60  * use XML_PARSE_HUGE option to override it.
61  * Introduced in 2.9.0
62  */
63 #define XML_MAX_DICTIONARY_LIMIT 10000000
64 
65 /**
66  * XML_MAX_LOOKUP_LIMIT:
67  *
68  * Maximum size allowed by the parser for ahead lookup
69  * This is an upper boundary enforced by the parser to avoid bad
70  * behaviour on "unfriendly' content
71  * Introduced in 2.9.0
72  */
73 #define XML_MAX_LOOKUP_LIMIT 10000000
74 
75 /**
76  * XML_MAX_NAMELEN:
77  *
78  * Identifiers can be longer, but this will be more costly
79  * at runtime.
80  */
81 #define XML_MAX_NAMELEN 100
82 
83 /**
84  * INPUT_CHUNK:
85  *
86  * The parser tries to always have that amount of input ready.
87  * One of the point is providing context when reporting errors.
88  */
89 #define INPUT_CHUNK	250
90 
91 /************************************************************************
92  *									*
93  * UNICODE version of the macros.					*
94  *									*
95  ************************************************************************/
96 /**
97  * IS_BYTE_CHAR:
98  * @c:  an byte value (int)
99  *
100  * Macro to check the following production in the XML spec:
101  *
102  * [2] Char ::= #x9 | #xA | #xD | [#x20...]
103  * any byte character in the accepted range
104  */
105 #define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
106 
107 /**
108  * IS_CHAR:
109  * @c:  an UNICODE value (int)
110  *
111  * Macro to check the following production in the XML spec:
112  *
113  * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
114  *                  | [#x10000-#x10FFFF]
115  * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
116  */
117 #define IS_CHAR(c)   xmlIsCharQ(c)
118 
119 /**
120  * IS_CHAR_CH:
121  * @c: an xmlChar (usually an unsigned char)
122  *
123  * Behaves like IS_CHAR on single-byte value
124  */
125 #define IS_CHAR_CH(c)  xmlIsChar_ch(c)
126 
127 /**
128  * IS_BLANK:
129  * @c:  an UNICODE value (int)
130  *
131  * Macro to check the following production in the XML spec:
132  *
133  * [3] S ::= (#x20 | #x9 | #xD | #xA)+
134  */
135 #define IS_BLANK(c)  xmlIsBlankQ(c)
136 
137 /**
138  * IS_BLANK_CH:
139  * @c:  an xmlChar value (normally unsigned char)
140  *
141  * Behaviour same as IS_BLANK
142  */
143 #define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
144 
145 /**
146  * IS_BASECHAR:
147  * @c:  an UNICODE value (int)
148  *
149  * Macro to check the following production in the XML spec:
150  *
151  * [85] BaseChar ::= ... long list see REC ...
152  */
153 #define IS_BASECHAR(c) xmlIsBaseCharQ(c)
154 
155 /**
156  * IS_DIGIT:
157  * @c:  an UNICODE value (int)
158  *
159  * Macro to check the following production in the XML spec:
160  *
161  * [88] Digit ::= ... long list see REC ...
162  */
163 #define IS_DIGIT(c) xmlIsDigitQ(c)
164 
165 /**
166  * IS_DIGIT_CH:
167  * @c:  an xmlChar value (usually an unsigned char)
168  *
169  * Behaves like IS_DIGIT but with a single byte argument
170  */
171 #define IS_DIGIT_CH(c)  xmlIsDigit_ch(c)
172 
173 /**
174  * IS_COMBINING:
175  * @c:  an UNICODE value (int)
176  *
177  * Macro to check the following production in the XML spec:
178  *
179  * [87] CombiningChar ::= ... long list see REC ...
180  */
181 #define IS_COMBINING(c) xmlIsCombiningQ(c)
182 
183 /**
184  * IS_COMBINING_CH:
185  * @c:  an xmlChar (usually an unsigned char)
186  *
187  * Always false (all combining chars > 0xff)
188  */
189 #define IS_COMBINING_CH(c) 0
190 
191 /**
192  * IS_EXTENDER:
193  * @c:  an UNICODE value (int)
194  *
195  * Macro to check the following production in the XML spec:
196  *
197  *
198  * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
199  *                   #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
200  *                   [#x309D-#x309E] | [#x30FC-#x30FE]
201  */
202 #define IS_EXTENDER(c) xmlIsExtenderQ(c)
203 
204 /**
205  * IS_EXTENDER_CH:
206  * @c:  an xmlChar value (usually an unsigned char)
207  *
208  * Behaves like IS_EXTENDER but with a single-byte argument
209  */
210 #define IS_EXTENDER_CH(c)  xmlIsExtender_ch(c)
211 
212 /**
213  * IS_IDEOGRAPHIC:
214  * @c:  an UNICODE value (int)
215  *
216  * Macro to check the following production in the XML spec:
217  *
218  *
219  * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
220  */
221 #define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
222 
223 /**
224  * IS_LETTER:
225  * @c:  an UNICODE value (int)
226  *
227  * Macro to check the following production in the XML spec:
228  *
229  *
230  * [84] Letter ::= BaseChar | Ideographic
231  */
232 #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
233 
234 /**
235  * IS_LETTER_CH:
236  * @c:  an xmlChar value (normally unsigned char)
237  *
238  * Macro behaves like IS_LETTER, but only check base chars
239  *
240  */
241 #define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
242 
243 /**
244  * IS_ASCII_LETTER:
245  * @c: an xmlChar value
246  *
247  * Macro to check [a-zA-Z]
248  *
249  */
250 #define IS_ASCII_LETTER(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
251 				 ((0x61 <= (c)) && ((c) <= 0x7a)))
252 
253 /**
254  * IS_ASCII_DIGIT:
255  * @c: an xmlChar value
256  *
257  * Macro to check [0-9]
258  *
259  */
260 #define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
261 
262 /**
263  * IS_PUBIDCHAR:
264  * @c:  an UNICODE value (int)
265  *
266  * Macro to check the following production in the XML spec:
267  *
268  *
269  * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
270  */
271 #define IS_PUBIDCHAR(c)	xmlIsPubidCharQ(c)
272 
273 /**
274  * IS_PUBIDCHAR_CH:
275  * @c:  an xmlChar value (normally unsigned char)
276  *
277  * Same as IS_PUBIDCHAR but for single-byte value
278  */
279 #define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
280 
281 /**
282  * SKIP_EOL:
283  * @p:  and UTF8 string pointer
284  *
285  * Skips the end of line chars.
286  */
287 #define SKIP_EOL(p)							\
288     if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; }			\
289     if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
290 
291 /**
292  * MOVETO_ENDTAG:
293  * @p:  and UTF8 string pointer
294  *
295  * Skips to the next '>' char.
296  */
297 #define MOVETO_ENDTAG(p)						\
298     while ((*p) && (*(p) != '>')) (p)++
299 
300 /**
301  * MOVETO_STARTTAG:
302  * @p:  and UTF8 string pointer
303  *
304  * Skips to the next '<' char.
305  */
306 #define MOVETO_STARTTAG(p)						\
307     while ((*p) && (*(p) != '<')) (p)++
308 
309 /**
310  * Global variables used for predefined strings.
311  */
312 XMLPUBVAR const xmlChar xmlStringText[];
313 XMLPUBVAR const xmlChar xmlStringTextNoenc[];
314 XMLPUBVAR const xmlChar xmlStringComment[];
315 
316 /*
317  * Function to finish the work of the macros where needed.
318  */
319 XMLPUBFUN int XMLCALL                   xmlIsLetter     (int c);
320 
321 /**
322  * Parser context.
323  */
324 XMLPUBFUN xmlParserCtxtPtr XMLCALL
325 			xmlCreateFileParserCtxt	(const char *filename);
326 XMLPUBFUN xmlParserCtxtPtr XMLCALL
327 			xmlCreateURLParserCtxt	(const char *filename,
328 						 int options);
329 XMLPUBFUN xmlParserCtxtPtr XMLCALL
330 			xmlCreateMemoryParserCtxt(const char *buffer,
331 						 int size);
332 XMLPUBFUN xmlParserCtxtPtr XMLCALL
333 			xmlCreateEntityParserCtxt(const xmlChar *URL,
334 						 const xmlChar *ID,
335 						 const xmlChar *base);
336 XMLPUBFUN int XMLCALL
337 			xmlSwitchEncoding	(xmlParserCtxtPtr ctxt,
338 						 xmlCharEncoding enc);
339 XMLPUBFUN int XMLCALL
340 			xmlSwitchToEncoding	(xmlParserCtxtPtr ctxt,
341 					 xmlCharEncodingHandlerPtr handler);
342 XML_DEPRECATED
343 XMLPUBFUN int XMLCALL
344 			xmlSwitchInputEncoding	(xmlParserCtxtPtr ctxt,
345 						 xmlParserInputPtr input,
346 					 xmlCharEncodingHandlerPtr handler);
347 
348 #ifdef IN_LIBXML
349 /* internal error reporting */
350 XMLPUBFUN void XMLCALL
351 			__xmlErrEncoding	(xmlParserCtxtPtr ctxt,
352 						 xmlParserErrors xmlerr,
353 						 const char *msg,
354 						 const xmlChar * str1,
355 						 const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0);
356 #endif
357 
358 /**
359  * Input Streams.
360  */
361 XMLPUBFUN xmlParserInputPtr XMLCALL
362 			xmlNewStringInputStream	(xmlParserCtxtPtr ctxt,
363 						 const xmlChar *buffer);
364 XMLPUBFUN xmlParserInputPtr XMLCALL
365 			xmlNewEntityInputStream	(xmlParserCtxtPtr ctxt,
366 						 xmlEntityPtr entity);
367 XMLPUBFUN int XMLCALL
368 			xmlPushInput		(xmlParserCtxtPtr ctxt,
369 						 xmlParserInputPtr input);
370 XMLPUBFUN xmlChar XMLCALL
371 			xmlPopInput		(xmlParserCtxtPtr ctxt);
372 XMLPUBFUN void XMLCALL
373 			xmlFreeInputStream	(xmlParserInputPtr input);
374 XMLPUBFUN xmlParserInputPtr XMLCALL
375 			xmlNewInputFromFile	(xmlParserCtxtPtr ctxt,
376 						 const char *filename);
377 XMLPUBFUN xmlParserInputPtr XMLCALL
378 			xmlNewInputStream	(xmlParserCtxtPtr ctxt);
379 
380 /**
381  * Namespaces.
382  */
383 XMLPUBFUN xmlChar * XMLCALL
384 			xmlSplitQName		(xmlParserCtxtPtr ctxt,
385 						 const xmlChar *name,
386 						 xmlChar **prefix);
387 
388 /**
389  * Generic production rules.
390  */
391 XMLPUBFUN const xmlChar * XMLCALL
392 			xmlParseName		(xmlParserCtxtPtr ctxt);
393 XMLPUBFUN xmlChar * XMLCALL
394 			xmlParseNmtoken		(xmlParserCtxtPtr ctxt);
395 XMLPUBFUN xmlChar * XMLCALL
396 			xmlParseEntityValue	(xmlParserCtxtPtr ctxt,
397 						 xmlChar **orig);
398 XMLPUBFUN xmlChar * XMLCALL
399 			xmlParseAttValue	(xmlParserCtxtPtr ctxt);
400 XMLPUBFUN xmlChar * XMLCALL
401 			xmlParseSystemLiteral	(xmlParserCtxtPtr ctxt);
402 XMLPUBFUN xmlChar * XMLCALL
403 			xmlParsePubidLiteral	(xmlParserCtxtPtr ctxt);
404 XMLPUBFUN void XMLCALL
405 			xmlParseCharData	(xmlParserCtxtPtr ctxt,
406 						 int cdata);
407 XMLPUBFUN xmlChar * XMLCALL
408 			xmlParseExternalID	(xmlParserCtxtPtr ctxt,
409 						 xmlChar **publicID,
410 						 int strict);
411 XMLPUBFUN void XMLCALL
412 			xmlParseComment		(xmlParserCtxtPtr ctxt);
413 XMLPUBFUN const xmlChar * XMLCALL
414 			xmlParsePITarget	(xmlParserCtxtPtr ctxt);
415 XMLPUBFUN void XMLCALL
416 			xmlParsePI		(xmlParserCtxtPtr ctxt);
417 XMLPUBFUN void XMLCALL
418 			xmlParseNotationDecl	(xmlParserCtxtPtr ctxt);
419 XMLPUBFUN void XMLCALL
420 			xmlParseEntityDecl	(xmlParserCtxtPtr ctxt);
421 XMLPUBFUN int XMLCALL
422 			xmlParseDefaultDecl	(xmlParserCtxtPtr ctxt,
423 						 xmlChar **value);
424 XMLPUBFUN xmlEnumerationPtr XMLCALL
425 			xmlParseNotationType	(xmlParserCtxtPtr ctxt);
426 XMLPUBFUN xmlEnumerationPtr XMLCALL
427 			xmlParseEnumerationType	(xmlParserCtxtPtr ctxt);
428 XMLPUBFUN int XMLCALL
429 			xmlParseEnumeratedType	(xmlParserCtxtPtr ctxt,
430 						 xmlEnumerationPtr *tree);
431 XMLPUBFUN int XMLCALL
432 			xmlParseAttributeType	(xmlParserCtxtPtr ctxt,
433 						 xmlEnumerationPtr *tree);
434 XMLPUBFUN void XMLCALL
435 			xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
436 XMLPUBFUN xmlElementContentPtr XMLCALL
437 			xmlParseElementMixedContentDecl
438 						(xmlParserCtxtPtr ctxt,
439 						 int inputchk);
440 XMLPUBFUN xmlElementContentPtr XMLCALL
441 			xmlParseElementChildrenContentDecl
442 						(xmlParserCtxtPtr ctxt,
443 						 int inputchk);
444 XMLPUBFUN int XMLCALL
445 			xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
446 						 const xmlChar *name,
447 						 xmlElementContentPtr *result);
448 XMLPUBFUN int XMLCALL
449 			xmlParseElementDecl	(xmlParserCtxtPtr ctxt);
450 XMLPUBFUN void XMLCALL
451 			xmlParseMarkupDecl	(xmlParserCtxtPtr ctxt);
452 XMLPUBFUN int XMLCALL
453 			xmlParseCharRef		(xmlParserCtxtPtr ctxt);
454 XMLPUBFUN xmlEntityPtr XMLCALL
455 			xmlParseEntityRef	(xmlParserCtxtPtr ctxt);
456 XMLPUBFUN void XMLCALL
457 			xmlParseReference	(xmlParserCtxtPtr ctxt);
458 XMLPUBFUN void XMLCALL
459 			xmlParsePEReference	(xmlParserCtxtPtr ctxt);
460 XMLPUBFUN void XMLCALL
461 			xmlParseDocTypeDecl	(xmlParserCtxtPtr ctxt);
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
472 			xmlParseCDSect		(xmlParserCtxtPtr ctxt);
473 XMLPUBFUN void XMLCALL
474 			xmlParseContent		(xmlParserCtxtPtr ctxt);
475 XMLPUBFUN void XMLCALL
476 			xmlParseElement		(xmlParserCtxtPtr ctxt);
477 XMLPUBFUN xmlChar * XMLCALL
478 			xmlParseVersionNum	(xmlParserCtxtPtr ctxt);
479 XMLPUBFUN xmlChar * XMLCALL
480 			xmlParseVersionInfo	(xmlParserCtxtPtr ctxt);
481 XMLPUBFUN xmlChar * XMLCALL
482 			xmlParseEncName		(xmlParserCtxtPtr ctxt);
483 XMLPUBFUN const xmlChar * XMLCALL
484 			xmlParseEncodingDecl	(xmlParserCtxtPtr ctxt);
485 XMLPUBFUN int XMLCALL
486 			xmlParseSDDecl		(xmlParserCtxtPtr ctxt);
487 XMLPUBFUN void XMLCALL
488 			xmlParseXMLDecl		(xmlParserCtxtPtr ctxt);
489 XMLPUBFUN void XMLCALL
490 			xmlParseTextDecl	(xmlParserCtxtPtr ctxt);
491 XMLPUBFUN void XMLCALL
492 			xmlParseMisc		(xmlParserCtxtPtr ctxt);
493 XMLPUBFUN void XMLCALL
494 			xmlParseExternalSubset	(xmlParserCtxtPtr ctxt,
495 						 const xmlChar *ExternalID,
496 						 const xmlChar *SystemID);
497 /**
498  * XML_SUBSTITUTE_NONE:
499  *
500  * If no entities need to be substituted.
501  */
502 #define XML_SUBSTITUTE_NONE	0
503 /**
504  * XML_SUBSTITUTE_REF:
505  *
506  * Whether general entities need to be substituted.
507  */
508 #define XML_SUBSTITUTE_REF	1
509 /**
510  * XML_SUBSTITUTE_PEREF:
511  *
512  * Whether parameter entities need to be substituted.
513  */
514 #define XML_SUBSTITUTE_PEREF	2
515 /**
516  * XML_SUBSTITUTE_BOTH:
517  *
518  * Both general and parameter entities need to be substituted.
519  */
520 #define XML_SUBSTITUTE_BOTH	3
521 
522 XMLPUBFUN xmlChar * XMLCALL
523 		xmlStringDecodeEntities		(xmlParserCtxtPtr ctxt,
524 						 const xmlChar *str,
525 						 int what,
526 						 xmlChar end,
527 						 xmlChar  end2,
528 						 xmlChar end3);
529 XMLPUBFUN xmlChar * XMLCALL
530 		xmlStringLenDecodeEntities	(xmlParserCtxtPtr ctxt,
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  */
541 XMLPUBFUN int XMLCALL			nodePush		(xmlParserCtxtPtr ctxt,
542 						 xmlNodePtr value);
543 XMLPUBFUN xmlNodePtr XMLCALL		nodePop			(xmlParserCtxtPtr ctxt);
544 XMLPUBFUN int XMLCALL			inputPush		(xmlParserCtxtPtr ctxt,
545 						 xmlParserInputPtr value);
546 XMLPUBFUN xmlParserInputPtr XMLCALL	inputPop		(xmlParserCtxtPtr ctxt);
547 XMLPUBFUN const xmlChar * XMLCALL	namePop			(xmlParserCtxtPtr ctxt);
548 XMLPUBFUN int XMLCALL			namePush		(xmlParserCtxtPtr ctxt,
549 						 const xmlChar *value);
550 
551 /*
552  * other commodities shared between parser.c and parserInternals.
553  */
554 XMLPUBFUN int XMLCALL			xmlSkipBlankChars	(xmlParserCtxtPtr ctxt);
555 XMLPUBFUN int XMLCALL			xmlStringCurrentChar	(xmlParserCtxtPtr ctxt,
556 						 const xmlChar *cur,
557 						 int *len);
558 XMLPUBFUN void XMLCALL			xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
559 XMLPUBFUN int XMLCALL			xmlCheckLanguageID	(const xmlChar *lang);
560 
561 /*
562  * Really core function shared with HTML parser.
563  */
564 XMLPUBFUN int XMLCALL			xmlCurrentChar		(xmlParserCtxtPtr ctxt,
565 						 int *len);
566 XMLPUBFUN int XMLCALL		xmlCopyCharMultiByte	(xmlChar *out,
567 						 int val);
568 XMLPUBFUN int XMLCALL			xmlCopyChar		(int len,
569 						 xmlChar *out,
570 						 int val);
571 XMLPUBFUN void XMLCALL			xmlNextChar		(xmlParserCtxtPtr ctxt);
572 XMLPUBFUN void XMLCALL			xmlParserInputShrink	(xmlParserInputPtr in);
573 
574 #ifdef LIBXML_HTML_ENABLED
575 /*
576  * Actually comes from the HTML parser but launched from the init stuff.
577  */
578 XML_DEPRECATED
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 /**
590  * xmlEntityReferenceFunc:
591  * @ent: the entity
592  * @firstNode:  the fist node in the chunk
593  * @lastNode:  the last nod in the chunk
594  *
595  * Callback function used when one needs to be able to track back the
596  * provenance of a chunk of nodes inherited from an entity replacement.
597  */
598 typedef	void	(*xmlEntityReferenceFunc)	(xmlEntityPtr ent,
599 						 xmlNodePtr firstNode,
600 						 xmlNodePtr lastNode);
601 
602 XML_DEPRECATED
603 XMLPUBFUN void XMLCALL		xmlSetEntityReferenceFunc	(xmlEntityReferenceFunc func);
604 
605 XML_DEPRECATED
606 XMLPUBFUN xmlChar * XMLCALL
607 			xmlParseQuotedString	(xmlParserCtxtPtr ctxt);
608 XML_DEPRECATED
609 XMLPUBFUN void XMLCALL
610                         xmlParseNamespace       (xmlParserCtxtPtr ctxt);
611 XML_DEPRECATED
612 XMLPUBFUN xmlChar * XMLCALL
613 			xmlNamespaceParseNSDef	(xmlParserCtxtPtr ctxt);
614 XML_DEPRECATED
615 XMLPUBFUN xmlChar * XMLCALL
616 			xmlScanName		(xmlParserCtxtPtr ctxt);
617 XML_DEPRECATED
618 XMLPUBFUN xmlChar * XMLCALL
619 			xmlNamespaceParseNCName	(xmlParserCtxtPtr ctxt);
620 XML_DEPRECATED
621 XMLPUBFUN void XMLCALL	xmlParserHandleReference(xmlParserCtxtPtr ctxt);
622 XML_DEPRECATED
623 XMLPUBFUN xmlChar * XMLCALL
624 			xmlNamespaceParseQName	(xmlParserCtxtPtr ctxt,
625 						 xmlChar **prefix);
626 /**
627  * Entities
628  */
629 XML_DEPRECATED
630 XMLPUBFUN xmlChar * XMLCALL
631 		xmlDecodeEntities		(xmlParserCtxtPtr ctxt,
632 						 int len,
633 						 int what,
634 						 xmlChar end,
635 						 xmlChar  end2,
636 						 xmlChar end3);
637 XML_DEPRECATED
638 XMLPUBFUN void XMLCALL
639 			xmlHandleEntity		(xmlParserCtxtPtr ctxt,
640 						 xmlEntityPtr entity);
641 
642 #endif /* LIBXML_LEGACY_ENABLED */
643 
644 #ifdef IN_LIBXML
645 /*
646  * internal only
647  */
648 XMLPUBFUN void XMLCALL
649 	xmlErrMemory		(xmlParserCtxtPtr ctxt,
650 				 const char *extra);
651 #endif
652 
653 #ifdef __cplusplus
654 }
655 #endif
656 #endif /* __XML_PARSER_INTERNALS_H__ */
657