blob: 7ac0ce6eb777014bc3e24fd340c694cc22f4ab93 [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * 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.
Owen Taylor3473f882001-02-23 17:55:21 +00006 *
Daniel Veillardbe586972003-11-18 20:56:51 +00007 * Copy: See Copyright for the status of this software.
Owen Taylor3473f882001-02-23 17:55:21 +00008 *
Daniel Veillardbe586972003-11-18 20:56:51 +00009 * Author: Daniel Veillard
Owen Taylor3473f882001-02-23 17:55:21 +000010 */
11
12#ifndef __XML_PARSER_INTERNALS_H__
13#define __XML_PARSER_INTERNALS_H__
14
Igor Zlatkovic76874e42003-08-25 09:05:12 +000015#include <libxml/xmlversion.h>
Owen Taylor3473f882001-02-23 17:55:21 +000016#include <libxml/parser.h>
Daniel Veillard56a4cb82001-03-24 17:00:36 +000017#include <libxml/HTMLparser.h>
William M. Brack68aca052003-10-11 15:22:13 +000018#include <libxml/chvalid.h>
Owen Taylor3473f882001-02-23 17:55:21 +000019
20#ifdef __cplusplus
21extern "C" {
22#endif
23
Daniel Veillard4aede2e2003-10-17 12:43:59 +000024/**
25 * xmlParserMaxDepth:
26 *
27 * arbitrary depth limit for the XML documents that we allow to
28 * process. This is not a limitation of the parser but a safety
29 * boundary feature.
30 */
31XMLPUBVAR unsigned int xmlParserMaxDepth;
32
Daniel Veillardbed7b052001-05-19 14:59:49 +000033 /**
34 * XML_MAX_NAMELEN:
35 *
Owen Taylor3473f882001-02-23 17:55:21 +000036 * Identifiers can be longer, but this will be more costly
37 * at runtime.
38 */
39#define XML_MAX_NAMELEN 100
40
Daniel Veillardbed7b052001-05-19 14:59:49 +000041/**
42 * INPUT_CHUNK:
43 *
Daniel Veillard61f26172002-03-12 18:46:39 +000044 * The parser tries to always have that amount of input ready.
45 * One of the point is providing context when reporting errors.
Owen Taylor3473f882001-02-23 17:55:21 +000046 */
47#define INPUT_CHUNK 250
48
49/************************************************************************
50 * *
51 * UNICODE version of the macros. *
52 * *
53 ************************************************************************/
Daniel Veillardbed7b052001-05-19 14:59:49 +000054/**
Daniel Veillard73b013f2003-09-30 12:36:01 +000055 * IS_BYTE_CHAR:
56 * @c: an byte value (int)
57 *
58 * Macro to check the following production in the XML spec:
59 *
60 * [2] Char ::= #x9 | #xA | #xD | [#x20...]
61 * any byte character in the accepted range
62 */
William M. Brack68aca052003-10-11 15:22:13 +000063#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
Daniel Veillard73b013f2003-09-30 12:36:01 +000064
65/**
Daniel Veillardbed7b052001-05-19 14:59:49 +000066 * IS_CHAR:
67 * @c: an UNICODE value (int)
68 *
Daniel Veillard61f26172002-03-12 18:46:39 +000069 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +000070 *
Owen Taylor3473f882001-02-23 17:55:21 +000071 * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
72 * | [#x10000-#x10FFFF]
73 * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
74 */
William M. Brack871611b2003-10-18 04:53:14 +000075#define IS_CHAR(c) xmlIsCharQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +000076
Daniel Veillardbed7b052001-05-19 14:59:49 +000077/**
William M. Brack76e95df2003-10-18 16:20:14 +000078 * IS_CHAR_CH:
79 * @c: an xmlChar (usually an unsigned char)
80 *
81 * Behaves like IS_CHAR on single-byte value
82 */
83#define IS_CHAR_CH(c) xmlIsChar_ch(c)
84
85/**
Daniel Veillardbed7b052001-05-19 14:59:49 +000086 * IS_BLANK:
87 * @c: an UNICODE value (int)
88 *
Daniel Veillard61f26172002-03-12 18:46:39 +000089 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +000090 *
Owen Taylor3473f882001-02-23 17:55:21 +000091 * [3] S ::= (#x20 | #x9 | #xD | #xA)+
92 */
William M. Brack871611b2003-10-18 04:53:14 +000093#define IS_BLANK(c) xmlIsBlankQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +000094
Daniel Veillardbed7b052001-05-19 14:59:49 +000095/**
William M. Brack76e95df2003-10-18 16:20:14 +000096 * IS_BLANK_CH:
97 * @c: an xmlChar value (normally unsigned char)
98 *
99 * Behaviour same as IS_BLANK
100 */
101#define IS_BLANK_CH(c) xmlIsBlank_ch(c)
102
103/**
Daniel Veillardbed7b052001-05-19 14:59:49 +0000104 * IS_BASECHAR:
105 * @c: an UNICODE value (int)
106 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000107 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +0000108 *
Owen Taylor3473f882001-02-23 17:55:21 +0000109 * [85] BaseChar ::= ... long list see REC ...
110 */
William M. Brack871611b2003-10-18 04:53:14 +0000111#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +0000112
Daniel Veillardbed7b052001-05-19 14:59:49 +0000113/**
114 * IS_DIGIT:
115 * @c: an UNICODE value (int)
116 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000117 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +0000118 *
Owen Taylor3473f882001-02-23 17:55:21 +0000119 * [88] Digit ::= ... long list see REC ...
120 */
William M. Brack871611b2003-10-18 04:53:14 +0000121#define IS_DIGIT(c) xmlIsDigitQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +0000122
Daniel Veillardbed7b052001-05-19 14:59:49 +0000123/**
William M. Brack76e95df2003-10-18 16:20:14 +0000124 * IS_DIGIT_CH:
125 * @c: an xmlChar value (usually an unsigned char)
126 *
127 * Behaves like IS_DIGIT but with a single byte argument
128 */
129#define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
130
131/**
Daniel Veillardbed7b052001-05-19 14:59:49 +0000132 * IS_COMBINING:
133 * @c: an UNICODE value (int)
134 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000135 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +0000136 *
Owen Taylor3473f882001-02-23 17:55:21 +0000137 * [87] CombiningChar ::= ... long list see REC ...
138 */
William M. Brack871611b2003-10-18 04:53:14 +0000139#define IS_COMBINING(c) xmlIsCombiningQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +0000140
Daniel Veillardbed7b052001-05-19 14:59:49 +0000141/**
William M. Brack76e95df2003-10-18 16:20:14 +0000142 * IS_COMBINING_CH:
143 * @c: an xmlChar (usually an unsigned char)
144 *
145 * Always false (all combining chars > 0xff)
146 */
147#define IS_COMBINING_CH(c) 0
148
149/**
Daniel Veillardbed7b052001-05-19 14:59:49 +0000150 * IS_EXTENDER:
151 * @c: an UNICODE value (int)
152 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000153 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +0000154 *
155 *
Owen Taylor3473f882001-02-23 17:55:21 +0000156 * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
157 * #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
158 * [#x309D-#x309E] | [#x30FC-#x30FE]
159 */
William M. Brack871611b2003-10-18 04:53:14 +0000160#define IS_EXTENDER(c) xmlIsExtenderQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +0000161
Daniel Veillardbed7b052001-05-19 14:59:49 +0000162/**
William M. Brack76e95df2003-10-18 16:20:14 +0000163 * IS_EXTENDER_CH:
164 * @c: an xmlChar value (usually an unsigned char)
165 *
166 * Behaves like IS_EXTENDER but with a single-byte argument
167 */
168#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
169
170/**
Daniel Veillardbed7b052001-05-19 14:59:49 +0000171 * IS_IDEOGRAPHIC:
172 * @c: an UNICODE value (int)
173 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000174 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +0000175 *
176 *
Owen Taylor3473f882001-02-23 17:55:21 +0000177 * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
178 */
William M. Brack871611b2003-10-18 04:53:14 +0000179#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +0000180
Daniel Veillardbed7b052001-05-19 14:59:49 +0000181/**
182 * IS_LETTER:
183 * @c: an UNICODE value (int)
184 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000185 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +0000186 *
187 *
Owen Taylor3473f882001-02-23 17:55:21 +0000188 * [84] Letter ::= BaseChar | Ideographic
189 */
190#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
191
William M. Brack76e95df2003-10-18 16:20:14 +0000192/**
193 * IS_LETTER_CH:
194 * @c: an xmlChar value (normally unsigned char)
195 *
196 * Macro behaves like IS_LETTER, but only check base chars
197 *
198 */
199#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
William M. Brackd1757ab2004-10-02 22:07:48 +0000200
201/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000202 * IS_ASCII_LETTER:
William M. Brackd1757ab2004-10-02 22:07:48 +0000203 * @c: an xmlChar value
204 *
205 * Macro to check [a-zA-Z]
206 *
207 */
208#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
209 ((0x61 <= (c)) && ((c) <= 0x7a)))
210
211/**
William M. Brack21e4ef22005-01-02 09:53:13 +0000212 * IS_ASCII_DIGIT:
William M. Brackd1757ab2004-10-02 22:07:48 +0000213 * @c: an xmlChar value
214 *
215 * Macro to check [0-9]
216 *
217 */
218#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
219
Daniel Veillardbed7b052001-05-19 14:59:49 +0000220/**
221 * IS_PUBIDCHAR:
222 * @c: an UNICODE value (int)
223 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000224 * Macro to check the following production in the XML spec:
Daniel Veillardbed7b052001-05-19 14:59:49 +0000225 *
226 *
Owen Taylor3473f882001-02-23 17:55:21 +0000227 * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
228 */
William M. Brack871611b2003-10-18 04:53:14 +0000229#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
Owen Taylor3473f882001-02-23 17:55:21 +0000230
Daniel Veillardbed7b052001-05-19 14:59:49 +0000231/**
William M. Brack76e95df2003-10-18 16:20:14 +0000232 * IS_PUBIDCHAR_CH:
233 * @c: an xmlChar value (normally unsigned char)
234 *
235 * Same as IS_PUBIDCHAR but for single-byte value
236 */
237#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
238
239/**
Daniel Veillardbed7b052001-05-19 14:59:49 +0000240 * SKIP_EOL:
241 * @p: and UTF8 string pointer
242 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000243 * Skips the end of line chars.
Daniel Veillardbed7b052001-05-19 14:59:49 +0000244 */
Owen Taylor3473f882001-02-23 17:55:21 +0000245#define SKIP_EOL(p) \
246 if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \
247 if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
248
Daniel Veillardbed7b052001-05-19 14:59:49 +0000249/**
250 * MOVETO_ENDTAG:
251 * @p: and UTF8 string pointer
252 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000253 * Skips to the next '>' char.
Daniel Veillardbed7b052001-05-19 14:59:49 +0000254 */
Owen Taylor3473f882001-02-23 17:55:21 +0000255#define MOVETO_ENDTAG(p) \
256 while ((*p) && (*(p) != '>')) (p)++
257
Daniel Veillardbed7b052001-05-19 14:59:49 +0000258/**
259 * MOVETO_STARTTAG:
260 * @p: and UTF8 string pointer
261 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000262 * Skips to the next '<' char.
Daniel Veillardbed7b052001-05-19 14:59:49 +0000263 */
Owen Taylor3473f882001-02-23 17:55:21 +0000264#define MOVETO_STARTTAG(p) \
265 while ((*p) && (*(p) != '<')) (p)++
266
267/**
Daniel Veillard61f26172002-03-12 18:46:39 +0000268 * Global variables used for predefined strings.
Daniel Veillard22090732001-07-16 00:06:07 +0000269 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000270XMLPUBVAR const xmlChar xmlStringText[];
271XMLPUBVAR const xmlChar xmlStringTextNoenc[];
272XMLPUBVAR const xmlChar xmlStringComment[];
Owen Taylor3473f882001-02-23 17:55:21 +0000273
274/*
Daniel Veillard61f26172002-03-12 18:46:39 +0000275 * Function to finish the work of the macros where needed.
Owen Taylor3473f882001-02-23 17:55:21 +0000276 */
William M. Brack68aca052003-10-11 15:22:13 +0000277XMLPUBFUN int XMLCALL xmlIsLetter (int c);
Owen Taylor3473f882001-02-23 17:55:21 +0000278
279/**
Daniel Veillard61f26172002-03-12 18:46:39 +0000280 * Parser context.
Owen Taylor3473f882001-02-23 17:55:21 +0000281 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000282XMLPUBFUN xmlParserCtxtPtr XMLCALL
283 xmlCreateFileParserCtxt (const char *filename);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000284XMLPUBFUN xmlParserCtxtPtr XMLCALL
Daniel Veillard61b93382003-11-03 14:28:31 +0000285 xmlCreateURLParserCtxt (const char *filename,
286 int options);
287XMLPUBFUN xmlParserCtxtPtr XMLCALL
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000288 xmlCreateMemoryParserCtxt(const char *buffer,
Owen Taylor3473f882001-02-23 17:55:21 +0000289 int size);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000290XMLPUBFUN xmlParserCtxtPtr XMLCALL
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000291 xmlCreateEntityParserCtxt(const xmlChar *URL,
Owen Taylor3473f882001-02-23 17:55:21 +0000292 const xmlChar *ID,
293 const xmlChar *base);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000294XMLPUBFUN int XMLCALL
295 xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000296 xmlCharEncoding enc);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000297XMLPUBFUN int XMLCALL
298 xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
Daniel Veillarda840b692003-10-19 13:35:37 +0000299 xmlCharEncodingHandlerPtr handler);
300XMLPUBFUN int XMLCALL
301 xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
302 xmlParserInputPtr input,
303 xmlCharEncodingHandlerPtr handler);
Owen Taylor3473f882001-02-23 17:55:21 +0000304
Daniel Veillarda840b692003-10-19 13:35:37 +0000305#ifdef IN_LIBXML
306/* internal error reporting */
307XMLPUBFUN void XMLCALL
308 __xmlErrEncoding (xmlParserCtxtPtr ctxt,
Daniel Veillard29b17482004-08-16 00:39:03 +0000309 xmlParserErrors xmlerr,
Daniel Veillarda840b692003-10-19 13:35:37 +0000310 const char *msg,
311 const xmlChar * str1,
312 const xmlChar * str2);
313#endif
Owen Taylor3473f882001-02-23 17:55:21 +0000314
315/**
Daniel Veillard61f26172002-03-12 18:46:39 +0000316 * Input Streams.
Owen Taylor3473f882001-02-23 17:55:21 +0000317 */
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000318XMLPUBFUN xmlParserInputPtr XMLCALL
319 xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000320 const xmlChar *buffer);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000321XMLPUBFUN xmlParserInputPtr XMLCALL
322 xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000323 xmlEntityPtr entity);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000324XMLPUBFUN void XMLCALL
325 xmlPushInput (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000326 xmlParserInputPtr input);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000327XMLPUBFUN xmlChar XMLCALL
328 xmlPopInput (xmlParserCtxtPtr ctxt);
329XMLPUBFUN void XMLCALL
330 xmlFreeInputStream (xmlParserInputPtr input);
331XMLPUBFUN xmlParserInputPtr XMLCALL
332 xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000333 const char *filename);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000334XMLPUBFUN xmlParserInputPtr XMLCALL
335 xmlNewInputStream (xmlParserCtxtPtr ctxt);
Owen Taylor3473f882001-02-23 17:55:21 +0000336
337/**
338 * Namespaces.
339 */
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000340XMLPUBFUN xmlChar * XMLCALL
341 xmlSplitQName (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000342 const xmlChar *name,
343 xmlChar **prefix);
Owen Taylor3473f882001-02-23 17:55:21 +0000344
345/**
Daniel Veillard61f26172002-03-12 18:46:39 +0000346 * Generic production rules.
Owen Taylor3473f882001-02-23 17:55:21 +0000347 */
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000348XMLPUBFUN const xmlChar * XMLCALL
349 xmlParseName (xmlParserCtxtPtr ctxt);
350XMLPUBFUN xmlChar * XMLCALL
351 xmlParseNmtoken (xmlParserCtxtPtr ctxt);
352XMLPUBFUN xmlChar * XMLCALL
353 xmlParseEntityValue (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000354 xmlChar **orig);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000355XMLPUBFUN xmlChar * XMLCALL
356 xmlParseAttValue (xmlParserCtxtPtr ctxt);
357XMLPUBFUN xmlChar * XMLCALL
358 xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
359XMLPUBFUN xmlChar * XMLCALL
360 xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
361XMLPUBFUN void XMLCALL
362 xmlParseCharData (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000363 int cdata);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000364XMLPUBFUN xmlChar * XMLCALL
365 xmlParseExternalID (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000366 xmlChar **publicID,
367 int strict);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000368XMLPUBFUN void XMLCALL
369 xmlParseComment (xmlParserCtxtPtr ctxt);
370XMLPUBFUN const xmlChar * XMLCALL
371 xmlParsePITarget (xmlParserCtxtPtr ctxt);
372XMLPUBFUN void XMLCALL
373 xmlParsePI (xmlParserCtxtPtr ctxt);
374XMLPUBFUN void XMLCALL
375 xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
376XMLPUBFUN void XMLCALL
377 xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
378XMLPUBFUN int XMLCALL
379 xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000380 xmlChar **value);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000381XMLPUBFUN xmlEnumerationPtr XMLCALL
382 xmlParseNotationType (xmlParserCtxtPtr ctxt);
383XMLPUBFUN xmlEnumerationPtr XMLCALL
384 xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
385XMLPUBFUN int XMLCALL
386 xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000387 xmlEnumerationPtr *tree);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000388XMLPUBFUN int XMLCALL
389 xmlParseAttributeType (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000390 xmlEnumerationPtr *tree);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000391XMLPUBFUN void XMLCALL
392 xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
393XMLPUBFUN xmlElementContentPtr XMLCALL
394 xmlParseElementMixedContentDecl
Daniel Veillard8dc16a62002-02-19 21:08:48 +0000395 (xmlParserCtxtPtr ctxt,
Daniel Veillardbdbe0d42003-09-14 19:56:14 +0000396 int inputchk);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000397XMLPUBFUN xmlElementContentPtr XMLCALL
398 xmlParseElementChildrenContentDecl
Daniel Veillard8dc16a62002-02-19 21:08:48 +0000399 (xmlParserCtxtPtr ctxt,
Daniel Veillardbdbe0d42003-09-14 19:56:14 +0000400 int inputchk);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000401XMLPUBFUN int XMLCALL
402 xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000403 const xmlChar *name,
Owen Taylor3473f882001-02-23 17:55:21 +0000404 xmlElementContentPtr *result);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000405XMLPUBFUN int XMLCALL
406 xmlParseElementDecl (xmlParserCtxtPtr ctxt);
407XMLPUBFUN void XMLCALL
408 xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
409XMLPUBFUN int XMLCALL
410 xmlParseCharRef (xmlParserCtxtPtr ctxt);
411XMLPUBFUN xmlEntityPtr XMLCALL
412 xmlParseEntityRef (xmlParserCtxtPtr ctxt);
413XMLPUBFUN void XMLCALL
414 xmlParseReference (xmlParserCtxtPtr ctxt);
415XMLPUBFUN void XMLCALL
416 xmlParsePEReference (xmlParserCtxtPtr ctxt);
417XMLPUBFUN void XMLCALL
418 xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
William M. Brack21e4ef22005-01-02 09:53:13 +0000419#ifdef LIBXML_SAX1_ENABLED
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000420XMLPUBFUN const xmlChar * XMLCALL
421 xmlParseAttribute (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000422 xmlChar **value);
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000423XMLPUBFUN const xmlChar * XMLCALL
424 xmlParseStartTag (xmlParserCtxtPtr ctxt);
425XMLPUBFUN void XMLCALL
426 xmlParseEndTag (xmlParserCtxtPtr ctxt);
William M. Brack21e4ef22005-01-02 09:53:13 +0000427#endif /* LIBXML_SAX1_ENABLED */
Igor Zlatkovic93f984a2003-08-25 10:34:41 +0000428XMLPUBFUN void XMLCALL
429 xmlParseCDSect (xmlParserCtxtPtr ctxt);
430XMLPUBFUN void XMLCALL
431 xmlParseContent (xmlParserCtxtPtr ctxt);
432XMLPUBFUN void XMLCALL
433 xmlParseElement (xmlParserCtxtPtr ctxt);
434XMLPUBFUN xmlChar * XMLCALL
435 xmlParseVersionNum (xmlParserCtxtPtr ctxt);
436XMLPUBFUN xmlChar * XMLCALL
437 xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
438XMLPUBFUN xmlChar * XMLCALL
439 xmlParseEncName (xmlParserCtxtPtr ctxt);
440XMLPUBFUN const xmlChar * XMLCALL
441 xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
442XMLPUBFUN int XMLCALL
443 xmlParseSDDecl (xmlParserCtxtPtr ctxt);
444XMLPUBFUN void XMLCALL
445 xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
446XMLPUBFUN void XMLCALL
447 xmlParseTextDecl (xmlParserCtxtPtr ctxt);
448XMLPUBFUN void XMLCALL
449 xmlParseMisc (xmlParserCtxtPtr ctxt);
450XMLPUBFUN void XMLCALL
451 xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000452 const xmlChar *ExternalID,
453 const xmlChar *SystemID);
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000454/**
455 * XML_SUBSTITUTE_NONE:
456 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000457 * If no entities need to be substituted.
Owen Taylor3473f882001-02-23 17:55:21 +0000458 */
459#define XML_SUBSTITUTE_NONE 0
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000460/**
461 * XML_SUBSTITUTE_REF:
462 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000463 * Whether general entities need to be substituted.
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000464 */
Owen Taylor3473f882001-02-23 17:55:21 +0000465#define XML_SUBSTITUTE_REF 1
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000466/**
467 * XML_SUBSTITUTE_PEREF:
468 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000469 * Whether parameter entities need to be substituted.
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000470 */
Owen Taylor3473f882001-02-23 17:55:21 +0000471#define XML_SUBSTITUTE_PEREF 2
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000472/**
473 * XML_SUBSTITUTE_BOTH:
474 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000475 * Both general and parameter entities need to be substituted.
Daniel Veillard5e2dace2001-07-18 19:30:27 +0000476 */
Owen Taylor3473f882001-02-23 17:55:21 +0000477#define XML_SUBSTITUTE_BOTH 3
478
Daniel Veillard07cb8222003-09-10 10:51:05 +0000479XMLPUBFUN xmlChar * XMLCALL
Daniel Veillard07cb8222003-09-10 10:51:05 +0000480 xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000481 const xmlChar *str,
482 int what,
483 xmlChar end,
484 xmlChar end2,
485 xmlChar end3);
Daniel Veillard07cb8222003-09-10 10:51:05 +0000486XMLPUBFUN xmlChar * XMLCALL
487 xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
488 const xmlChar *str,
489 int len,
490 int what,
491 xmlChar end,
492 xmlChar end2,
493 xmlChar end3);
Owen Taylor3473f882001-02-23 17:55:21 +0000494
495/*
Daniel Veillard61f26172002-03-12 18:46:39 +0000496 * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
Owen Taylor3473f882001-02-23 17:55:21 +0000497 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000498XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000499 xmlNodePtr value);
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000500XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
501XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000502 xmlParserInputPtr value);
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000503XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
504XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
505XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
Daniel Veillard2fdbd322003-08-18 12:15:38 +0000506 const xmlChar *value);
Owen Taylor3473f882001-02-23 17:55:21 +0000507
508/*
Daniel Veillard61f26172002-03-12 18:46:39 +0000509 * other commodities shared between parser.c and parserInternals.
Owen Taylor3473f882001-02-23 17:55:21 +0000510 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000511XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
512XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000513 const xmlChar *cur,
514 int *len);
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000515XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000516XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
Owen Taylor3473f882001-02-23 17:55:21 +0000517
518/*
Daniel Veillard61f26172002-03-12 18:46:39 +0000519 * Really core function shared with HTML parser.
Owen Taylor3473f882001-02-23 17:55:21 +0000520 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000521XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
Owen Taylor3473f882001-02-23 17:55:21 +0000522 int *len);
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000523XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out,
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000524 int val);
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000525XMLPUBFUN int XMLCALL xmlCopyChar (int len,
Owen Taylor3473f882001-02-23 17:55:21 +0000526 xmlChar *out,
527 int val);
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000528XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
529XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
Owen Taylor3473f882001-02-23 17:55:21 +0000530
531#ifdef LIBXML_HTML_ENABLED
532/*
Daniel Veillard61f26172002-03-12 18:46:39 +0000533 * Actually comes from the HTML parser but launched from the init stuff.
Owen Taylor3473f882001-02-23 17:55:21 +0000534 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000535XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
536XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000537 const char *encoding);
Daniel Veillard7839e162002-02-20 18:54:48 +0000538#endif
Daniel Veillard8107a222002-01-13 14:10:10 +0000539
540/*
541 * Specific function to keep track of entities references
Daniel Veillard61f26172002-03-12 18:46:39 +0000542 * and used by the XSLT debugger.
Daniel Veillard8107a222002-01-13 14:10:10 +0000543 */
William M. Brack21e4ef22005-01-02 09:53:13 +0000544#ifdef LIBXML_LEGACY_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000545/**
546 * xmlEntityReferenceFunc:
547 * @ent: the entity
548 * @firstNode: the fist node in the chunk
549 * @lastNode: the last nod in the chunk
550 *
Daniel Veillard61f26172002-03-12 18:46:39 +0000551 * Callback function used when one needs to be able to track back the
552 * provenance of a chunk of nodes inherited from an entity replacement.
Daniel Veillard9d06d302002-01-22 18:15:52 +0000553 */
Daniel Veillard8107a222002-01-13 14:10:10 +0000554typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
555 xmlNodePtr firstNode,
556 xmlNodePtr lastNode);
557
Igor Zlatkovic76874e42003-08-25 09:05:12 +0000558XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
Daniel Veillard8107a222002-01-13 14:10:10 +0000559
William M. Brack21e4ef22005-01-02 09:53:13 +0000560XMLPUBFUN xmlChar * XMLCALL
561 xmlParseQuotedString (xmlParserCtxtPtr ctxt);
562XMLPUBFUN void XMLCALL
563 xmlParseNamespace (xmlParserCtxtPtr ctxt);
564XMLPUBFUN xmlChar * XMLCALL
565 xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
566XMLPUBFUN xmlChar * XMLCALL
567 xmlScanName (xmlParserCtxtPtr ctxt);
568XMLPUBFUN xmlChar * XMLCALL
569 xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
570XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
571XMLPUBFUN xmlChar * XMLCALL
572 xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
573 xmlChar **prefix);
574/**
575 * Entities
576 */
577XMLPUBFUN xmlChar * XMLCALL
578 xmlDecodeEntities (xmlParserCtxtPtr ctxt,
579 int len,
580 int what,
581 xmlChar end,
582 xmlChar end2,
583 xmlChar end3);
584XMLPUBFUN void XMLCALL
585 xmlHandleEntity (xmlParserCtxtPtr ctxt,
586 xmlEntityPtr entity);
587
588#endif /* LIBXML_LEGACY_ENABLED */
589
Daniel Veillardce9457f2003-10-05 21:33:18 +0000590#ifdef IN_LIBXML
591/*
592 * internal only
593 */
594XMLPUBFUN void XMLCALL
595 xmlErrMemory (xmlParserCtxtPtr ctxt,
596 const char *extra);
597#endif
Daniel Veillard8107a222002-01-13 14:10:10 +0000598
Owen Taylor3473f882001-02-23 17:55:21 +0000599#ifdef __cplusplus
600}
601#endif
602#endif /* __XML_PARSER_INTERNALS_H__ */