parserInternals.h 16 KB

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