parserInternals.h 16 KB

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