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