parserInternals.h 17 KB

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