parserInternals.h 17 KB

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