Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * parserInternals.h : internals routines exported by the parser. |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
Daniel Veillard | c5d6434 | 2001-06-24 12:13:24 +0000 | [diff] [blame] | 6 | * daniel@veillard.com |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 7 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __XML_PARSER_INTERNALS_H__ |
| 11 | #define __XML_PARSER_INTERNALS_H__ |
| 12 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 13 | #include <libxml/xmlversion.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 14 | #include <libxml/parser.h> |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 15 | #include <libxml/HTMLparser.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 21 | /** |
| 22 | * XML_MAX_NAMELEN: |
| 23 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 24 | * Identifiers can be longer, but this will be more costly |
| 25 | * at runtime. |
| 26 | */ |
| 27 | #define XML_MAX_NAMELEN 100 |
| 28 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 29 | /** |
| 30 | * INPUT_CHUNK: |
| 31 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 32 | * The parser tries to always have that amount of input ready. |
| 33 | * One of the point is providing context when reporting errors. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 34 | */ |
| 35 | #define INPUT_CHUNK 250 |
| 36 | |
| 37 | /************************************************************************ |
| 38 | * * |
| 39 | * UNICODE version of the macros. * |
| 40 | * * |
| 41 | ************************************************************************/ |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 42 | /** |
| 43 | * IS_CHAR: |
| 44 | * @c: an UNICODE value (int) |
| 45 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 46 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 47 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 48 | * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
| 49 | * | [#x10000-#x10FFFF] |
| 50 | * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. |
| 51 | */ |
| 52 | #define IS_CHAR(c) \ |
| 53 | ((((c) >= 0x20) && ((c) <= 0xD7FF)) || \ |
| 54 | ((c) == 0x09) || ((c) == 0x0A) || ((c) == 0x0D) || \ |
| 55 | (((c) >= 0xE000) && ((c) <= 0xFFFD)) || \ |
| 56 | (((c) >= 0x10000) && ((c) <= 0x10FFFF))) |
| 57 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 58 | /** |
| 59 | * IS_BLANK: |
| 60 | * @c: an UNICODE value (int) |
| 61 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 62 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 63 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 64 | * [3] S ::= (#x20 | #x9 | #xD | #xA)+ |
| 65 | */ |
| 66 | #define IS_BLANK(c) (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || \ |
| 67 | ((c) == 0x0D)) |
| 68 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 69 | /** |
| 70 | * IS_BASECHAR: |
| 71 | * @c: an UNICODE value (int) |
| 72 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 73 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 74 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 75 | * [85] BaseChar ::= ... long list see REC ... |
| 76 | */ |
| 77 | #define IS_BASECHAR(c) xmlIsBaseChar(c) |
| 78 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 79 | /** |
| 80 | * IS_DIGIT: |
| 81 | * @c: an UNICODE value (int) |
| 82 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 83 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 84 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 85 | * [88] Digit ::= ... long list see REC ... |
| 86 | */ |
| 87 | #define IS_DIGIT(c) xmlIsDigit(c) |
| 88 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 89 | /** |
| 90 | * IS_COMBINING: |
| 91 | * @c: an UNICODE value (int) |
| 92 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 93 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 94 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 95 | * [87] CombiningChar ::= ... long list see REC ... |
| 96 | */ |
| 97 | #define IS_COMBINING(c) xmlIsCombining(c) |
| 98 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 99 | /** |
| 100 | * IS_EXTENDER: |
| 101 | * @c: an UNICODE value (int) |
| 102 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 103 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 104 | * |
| 105 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 106 | * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | |
| 107 | * #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | |
| 108 | * [#x309D-#x309E] | [#x30FC-#x30FE] |
| 109 | */ |
| 110 | #define IS_EXTENDER(c) xmlIsExtender(c) |
| 111 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 112 | /** |
| 113 | * IS_IDEOGRAPHIC: |
| 114 | * @c: an UNICODE value (int) |
| 115 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 116 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 117 | * |
| 118 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 119 | * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] |
| 120 | */ |
| 121 | #define IS_IDEOGRAPHIC(c) xmlIsIdeographic(c) |
| 122 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 123 | /** |
| 124 | * IS_LETTER: |
| 125 | * @c: an UNICODE value (int) |
| 126 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 127 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 128 | * |
| 129 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 130 | * [84] Letter ::= BaseChar | Ideographic |
| 131 | */ |
| 132 | #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) |
| 133 | |
| 134 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 135 | /** |
| 136 | * IS_PUBIDCHAR: |
| 137 | * @c: an UNICODE value (int) |
| 138 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 139 | * Macro to check the following production in the XML spec: |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 140 | * |
| 141 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 142 | * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] |
| 143 | */ |
| 144 | #define IS_PUBIDCHAR(c) xmlIsPubidChar(c) |
| 145 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 146 | /** |
| 147 | * SKIP_EOL: |
| 148 | * @p: and UTF8 string pointer |
| 149 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 150 | * Skips the end of line chars. |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 151 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 152 | #define SKIP_EOL(p) \ |
| 153 | if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ |
| 154 | if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } |
| 155 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 156 | /** |
| 157 | * MOVETO_ENDTAG: |
| 158 | * @p: and UTF8 string pointer |
| 159 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 160 | * Skips to the next '>' char. |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 161 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 162 | #define MOVETO_ENDTAG(p) \ |
| 163 | while ((*p) && (*(p) != '>')) (p)++ |
| 164 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 165 | /** |
| 166 | * MOVETO_STARTTAG: |
| 167 | * @p: and UTF8 string pointer |
| 168 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 169 | * Skips to the next '<' char. |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 170 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 171 | #define MOVETO_STARTTAG(p) \ |
| 172 | while ((*p) && (*(p) != '<')) (p)++ |
| 173 | |
| 174 | /** |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 175 | * Global variables used for predefined strings. |
Daniel Veillard | 2209073 | 2001-07-16 00:06:07 +0000 | [diff] [blame] | 176 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 177 | XMLPUBVAR const xmlChar xmlStringText[]; |
| 178 | XMLPUBVAR const xmlChar xmlStringTextNoenc[]; |
| 179 | XMLPUBVAR const xmlChar xmlStringComment[]; |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 180 | |
| 181 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 182 | * Function to finish the work of the macros where needed. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 183 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 184 | XMLPUBFUN int XMLCALL xmlIsBaseChar (int c); |
| 185 | XMLPUBFUN int XMLCALL xmlIsBlank (int c); |
| 186 | XMLPUBFUN int XMLCALL xmlIsPubidChar (int c); |
| 187 | XMLPUBFUN int XMLCALL xmlIsLetter (int c); |
| 188 | XMLPUBFUN int XMLCALL xmlIsDigit (int c); |
| 189 | XMLPUBFUN int XMLCALL xmlIsIdeographic(int c); |
| 190 | XMLPUBFUN int XMLCALL xmlIsExtender (int c); |
| 191 | XMLPUBFUN int XMLCALL xmlIsCombining (int c); |
| 192 | XMLPUBFUN int XMLCALL xmlIsChar (int c); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 193 | |
| 194 | /** |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 195 | * Parser context. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 196 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 197 | XMLPUBFUN xmlParserCtxtPtr XMLCALL |
| 198 | xmlCreateFileParserCtxt (const char *filename); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 199 | XMLPUBFUN xmlParserCtxtPtr XMLCALL |
| 200 | xmlCreateMemoryParserCtxt(const char *buffer, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 201 | int size); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 202 | XMLPUBFUN xmlParserCtxtPtr XMLCALL |
| 203 | xmlNewParserCtxt (void); |
| 204 | XMLPUBFUN xmlParserCtxtPtr XMLCALL |
| 205 | xmlCreateEntityParserCtxt(const xmlChar *URL, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 206 | const xmlChar *ID, |
| 207 | const xmlChar *base); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 208 | XMLPUBFUN int XMLCALL |
| 209 | xmlSwitchEncoding (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 210 | xmlCharEncoding enc); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 211 | XMLPUBFUN int XMLCALL |
| 212 | xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 213 | xmlCharEncodingHandlerPtr handler); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 214 | |
| 215 | /** |
| 216 | * Entities |
| 217 | */ |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 218 | XMLPUBFUN void XMLCALL |
| 219 | xmlHandleEntity (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 220 | xmlEntityPtr entity); |
| 221 | |
| 222 | /** |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 223 | * Input Streams. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 224 | */ |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 225 | XMLPUBFUN xmlParserInputPtr XMLCALL |
| 226 | xmlNewStringInputStream (xmlParserCtxtPtr ctxt, |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 227 | const xmlChar *buffer); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 228 | XMLPUBFUN xmlParserInputPtr XMLCALL |
| 229 | xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 230 | xmlEntityPtr entity); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 231 | XMLPUBFUN void XMLCALL |
| 232 | xmlPushInput (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 233 | xmlParserInputPtr input); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 234 | XMLPUBFUN xmlChar XMLCALL |
| 235 | xmlPopInput (xmlParserCtxtPtr ctxt); |
| 236 | XMLPUBFUN void XMLCALL |
| 237 | xmlFreeInputStream (xmlParserInputPtr input); |
| 238 | XMLPUBFUN xmlParserInputPtr XMLCALL |
| 239 | xmlNewInputFromFile (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 240 | const char *filename); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 241 | XMLPUBFUN xmlParserInputPtr XMLCALL |
| 242 | xmlNewInputStream (xmlParserCtxtPtr ctxt); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 243 | |
| 244 | /** |
| 245 | * Namespaces. |
| 246 | */ |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 247 | XMLPUBFUN xmlChar * XMLCALL |
| 248 | xmlSplitQName (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 249 | const xmlChar *name, |
| 250 | xmlChar **prefix); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 251 | XMLPUBFUN xmlChar * XMLCALL |
| 252 | xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); |
| 253 | XMLPUBFUN xmlChar * XMLCALL |
| 254 | xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 255 | xmlChar **prefix); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 256 | XMLPUBFUN xmlChar * XMLCALL |
| 257 | xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); |
| 258 | XMLPUBFUN xmlChar * XMLCALL |
| 259 | xmlParseQuotedString (xmlParserCtxtPtr ctxt); |
| 260 | XMLPUBFUN void XMLCALL |
| 261 | xmlParseNamespace (xmlParserCtxtPtr ctxt); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 262 | |
| 263 | /** |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 264 | * Generic production rules. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 265 | */ |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 266 | XMLPUBFUN xmlChar * XMLCALL |
| 267 | xmlScanName (xmlParserCtxtPtr ctxt); |
| 268 | XMLPUBFUN const xmlChar * XMLCALL |
| 269 | xmlParseName (xmlParserCtxtPtr ctxt); |
| 270 | XMLPUBFUN xmlChar * XMLCALL |
| 271 | xmlParseNmtoken (xmlParserCtxtPtr ctxt); |
| 272 | XMLPUBFUN xmlChar * XMLCALL |
| 273 | xmlParseEntityValue (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 274 | xmlChar **orig); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 275 | XMLPUBFUN xmlChar * XMLCALL |
| 276 | xmlParseAttValue (xmlParserCtxtPtr ctxt); |
| 277 | XMLPUBFUN xmlChar * XMLCALL |
| 278 | xmlParseSystemLiteral (xmlParserCtxtPtr ctxt); |
| 279 | XMLPUBFUN xmlChar * XMLCALL |
| 280 | xmlParsePubidLiteral (xmlParserCtxtPtr ctxt); |
| 281 | XMLPUBFUN void XMLCALL |
| 282 | xmlParseCharData (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 283 | int cdata); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 284 | XMLPUBFUN xmlChar * XMLCALL |
| 285 | xmlParseExternalID (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 286 | xmlChar **publicID, |
| 287 | int strict); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 288 | XMLPUBFUN void XMLCALL |
| 289 | xmlParseComment (xmlParserCtxtPtr ctxt); |
| 290 | XMLPUBFUN const xmlChar * XMLCALL |
| 291 | xmlParsePITarget (xmlParserCtxtPtr ctxt); |
| 292 | XMLPUBFUN void XMLCALL |
| 293 | xmlParsePI (xmlParserCtxtPtr ctxt); |
| 294 | XMLPUBFUN void XMLCALL |
| 295 | xmlParseNotationDecl (xmlParserCtxtPtr ctxt); |
| 296 | XMLPUBFUN void XMLCALL |
| 297 | xmlParseEntityDecl (xmlParserCtxtPtr ctxt); |
| 298 | XMLPUBFUN int XMLCALL |
| 299 | xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 300 | xmlChar **value); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 301 | XMLPUBFUN xmlEnumerationPtr XMLCALL |
| 302 | xmlParseNotationType (xmlParserCtxtPtr ctxt); |
| 303 | XMLPUBFUN xmlEnumerationPtr XMLCALL |
| 304 | xmlParseEnumerationType (xmlParserCtxtPtr ctxt); |
| 305 | XMLPUBFUN int XMLCALL |
| 306 | xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 307 | xmlEnumerationPtr *tree); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 308 | XMLPUBFUN int XMLCALL |
| 309 | xmlParseAttributeType (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 310 | xmlEnumerationPtr *tree); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 311 | XMLPUBFUN void XMLCALL |
| 312 | xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt); |
| 313 | XMLPUBFUN xmlElementContentPtr XMLCALL |
| 314 | xmlParseElementMixedContentDecl |
Daniel Veillard | 8dc16a6 | 2002-02-19 21:08:48 +0000 | [diff] [blame] | 315 | (xmlParserCtxtPtr ctxt, |
| 316 | xmlParserInputPtr inputchk); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 317 | XMLPUBFUN xmlElementContentPtr XMLCALL |
| 318 | xmlParseElementChildrenContentDecl |
Daniel Veillard | 8dc16a6 | 2002-02-19 21:08:48 +0000 | [diff] [blame] | 319 | (xmlParserCtxtPtr ctxt, |
| 320 | xmlParserInputPtr inputchk); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 321 | XMLPUBFUN int XMLCALL |
| 322 | xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 323 | const xmlChar *name, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 324 | xmlElementContentPtr *result); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 325 | XMLPUBFUN int XMLCALL |
| 326 | xmlParseElementDecl (xmlParserCtxtPtr ctxt); |
| 327 | XMLPUBFUN void XMLCALL |
| 328 | xmlParseMarkupDecl (xmlParserCtxtPtr ctxt); |
| 329 | XMLPUBFUN int XMLCALL |
| 330 | xmlParseCharRef (xmlParserCtxtPtr ctxt); |
| 331 | XMLPUBFUN xmlEntityPtr XMLCALL |
| 332 | xmlParseEntityRef (xmlParserCtxtPtr ctxt); |
| 333 | XMLPUBFUN void XMLCALL |
| 334 | xmlParseReference (xmlParserCtxtPtr ctxt); |
| 335 | XMLPUBFUN void XMLCALL |
| 336 | xmlParsePEReference (xmlParserCtxtPtr ctxt); |
| 337 | XMLPUBFUN void XMLCALL |
| 338 | xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); |
| 339 | XMLPUBFUN const xmlChar * XMLCALL |
| 340 | xmlParseAttribute (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 341 | xmlChar **value); |
Igor Zlatkovic | 93f984a | 2003-08-25 10:34:41 +0000 | [diff] [blame^] | 342 | XMLPUBFUN const xmlChar * XMLCALL |
| 343 | xmlParseStartTag (xmlParserCtxtPtr ctxt); |
| 344 | XMLPUBFUN void XMLCALL |
| 345 | xmlParseEndTag (xmlParserCtxtPtr ctxt); |
| 346 | XMLPUBFUN void XMLCALL |
| 347 | xmlParseCDSect (xmlParserCtxtPtr ctxt); |
| 348 | XMLPUBFUN void XMLCALL |
| 349 | xmlParseContent (xmlParserCtxtPtr ctxt); |
| 350 | XMLPUBFUN void XMLCALL |
| 351 | xmlParseElement (xmlParserCtxtPtr ctxt); |
| 352 | XMLPUBFUN xmlChar * XMLCALL |
| 353 | xmlParseVersionNum (xmlParserCtxtPtr ctxt); |
| 354 | XMLPUBFUN xmlChar * XMLCALL |
| 355 | xmlParseVersionInfo (xmlParserCtxtPtr ctxt); |
| 356 | XMLPUBFUN xmlChar * XMLCALL |
| 357 | xmlParseEncName (xmlParserCtxtPtr ctxt); |
| 358 | XMLPUBFUN const xmlChar * XMLCALL |
| 359 | xmlParseEncodingDecl (xmlParserCtxtPtr ctxt); |
| 360 | XMLPUBFUN int XMLCALL |
| 361 | xmlParseSDDecl (xmlParserCtxtPtr ctxt); |
| 362 | XMLPUBFUN void XMLCALL |
| 363 | xmlParseXMLDecl (xmlParserCtxtPtr ctxt); |
| 364 | XMLPUBFUN void XMLCALL |
| 365 | xmlParseTextDecl (xmlParserCtxtPtr ctxt); |
| 366 | XMLPUBFUN void XMLCALL |
| 367 | xmlParseMisc (xmlParserCtxtPtr ctxt); |
| 368 | XMLPUBFUN void XMLCALL |
| 369 | xmlParseExternalSubset (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 370 | const xmlChar *ExternalID, |
| 371 | const xmlChar *SystemID); |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 372 | /** |
| 373 | * XML_SUBSTITUTE_NONE: |
| 374 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 375 | * If no entities need to be substituted. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 376 | */ |
| 377 | #define XML_SUBSTITUTE_NONE 0 |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 378 | /** |
| 379 | * XML_SUBSTITUTE_REF: |
| 380 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 381 | * Whether general entities need to be substituted. |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 382 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 383 | #define XML_SUBSTITUTE_REF 1 |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 384 | /** |
| 385 | * XML_SUBSTITUTE_PEREF: |
| 386 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 387 | * Whether parameter entities need to be substituted. |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 388 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 389 | #define XML_SUBSTITUTE_PEREF 2 |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 390 | /** |
| 391 | * XML_SUBSTITUTE_BOTH: |
| 392 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 393 | * Both general and parameter entities need to be substituted. |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 394 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 395 | #define XML_SUBSTITUTE_BOTH 3 |
| 396 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 397 | XMLPUBFUN xmlChar * XMLCALL xmlDecodeEntities (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 398 | int len, |
| 399 | int what, |
| 400 | xmlChar end, |
| 401 | xmlChar end2, |
| 402 | xmlChar end3); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 403 | XMLPUBFUN xmlChar * XMLCALL xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 404 | const xmlChar *str, |
| 405 | int what, |
| 406 | xmlChar end, |
| 407 | xmlChar end2, |
| 408 | xmlChar end3); |
| 409 | |
| 410 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 411 | * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 412 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 413 | XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 414 | xmlNodePtr value); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 415 | XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt); |
| 416 | XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 417 | xmlParserInputPtr value); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 418 | XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt); |
| 419 | XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt); |
| 420 | XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt, |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 421 | const xmlChar *value); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 422 | |
| 423 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 424 | * other commodities shared between parser.c and parserInternals. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 425 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 426 | XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt); |
| 427 | XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 428 | const xmlChar *cur, |
| 429 | int *len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 430 | XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt); |
| 431 | XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); |
| 432 | XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 433 | |
| 434 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 435 | * Really core function shared with HTML parser. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 436 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 437 | XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 438 | int *len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 439 | XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out, |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 440 | int val); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 441 | XMLPUBFUN int XMLCALL xmlCopyChar (int len, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 442 | xmlChar *out, |
| 443 | int val); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 444 | XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt); |
| 445 | XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 446 | |
| 447 | #ifdef LIBXML_HTML_ENABLED |
| 448 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 449 | * Actually comes from the HTML parser but launched from the init stuff. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 450 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 451 | XMLPUBFUN void XMLCALL htmlInitAutoClose (void); |
| 452 | XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename, |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 453 | const char *encoding); |
Daniel Veillard | 7839e16 | 2002-02-20 18:54:48 +0000 | [diff] [blame] | 454 | #endif |
Daniel Veillard | 8107a22 | 2002-01-13 14:10:10 +0000 | [diff] [blame] | 455 | |
| 456 | /* |
| 457 | * Specific function to keep track of entities references |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 458 | * and used by the XSLT debugger. |
Daniel Veillard | 8107a22 | 2002-01-13 14:10:10 +0000 | [diff] [blame] | 459 | */ |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 460 | /** |
| 461 | * xmlEntityReferenceFunc: |
| 462 | * @ent: the entity |
| 463 | * @firstNode: the fist node in the chunk |
| 464 | * @lastNode: the last nod in the chunk |
| 465 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 466 | * Callback function used when one needs to be able to track back the |
| 467 | * provenance of a chunk of nodes inherited from an entity replacement. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 468 | */ |
Daniel Veillard | 8107a22 | 2002-01-13 14:10:10 +0000 | [diff] [blame] | 469 | typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, |
| 470 | xmlNodePtr firstNode, |
| 471 | xmlNodePtr lastNode); |
| 472 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 473 | XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); |
Daniel Veillard | 8107a22 | 2002-01-13 14:10:10 +0000 | [diff] [blame] | 474 | |
| 475 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 476 | #ifdef __cplusplus |
| 477 | } |
| 478 | #endif |
| 479 | #endif /* __XML_PARSER_INTERNALS_H__ */ |