parserInternals.h 16 KB

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