00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __XML_PARSER_INTERNALS_H__
00011 #define __XML_PARSER_INTERNALS_H__
00012
00013 #include <libxml/xmlversion.h>
00014 #include <libxml/parser.h>
00015 #include <libxml/HTMLparser.h>
00016 #include <libxml/chvalid.h>
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00029 XMLPUBVAR unsigned int xmlParserMaxDepth;
00030
00037 #define XML_MAX_NAMELEN 100
00038
00045 #define INPUT_CHUNK 250
00046
00047
00048
00049
00050
00051
00061 #define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
00062
00073 #define IS_CHAR(c) xmlIsCharQ(c)
00074
00081 #define IS_CHAR_CH(c) xmlIsChar_ch(c)
00082
00091 #define IS_BLANK(c) xmlIsBlankQ(c)
00092
00099 #define IS_BLANK_CH(c) xmlIsBlank_ch(c)
00100
00109 #define IS_BASECHAR(c) xmlIsBaseCharQ(c)
00110
00119 #define IS_DIGIT(c) xmlIsDigitQ(c)
00120
00127 #define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
00128
00137 #define IS_COMBINING(c) xmlIsCombiningQ(c)
00138
00145 #define IS_COMBINING_CH(c) 0
00146
00158 #define IS_EXTENDER(c) xmlIsExtenderQ(c)
00159
00166 #define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
00167
00177 #define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
00178
00188 #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
00189
00197 #define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
00198
00207 #define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
00208
00215 #define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
00216
00223 #define SKIP_EOL(p) \
00224 if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \
00225 if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
00226
00233 #define MOVETO_ENDTAG(p) \
00234 while ((*p) && (*(p) != '>')) (p)++
00235
00242 #define MOVETO_STARTTAG(p) \
00243 while ((*p) && (*(p) != '<')) (p)++
00244
00248 XMLPUBVAR const xmlChar xmlStringText[];
00249 XMLPUBVAR const xmlChar xmlStringTextNoenc[];
00250 XMLPUBVAR const xmlChar xmlStringComment[];
00251
00252
00253
00254
00255 XMLPUBFUN int XMLCALL xmlIsLetter (int c);
00256
00260 XMLPUBFUN xmlParserCtxtPtr XMLCALL
00261 xmlCreateFileParserCtxt (const char *filename);
00262 XMLPUBFUN xmlParserCtxtPtr XMLCALL
00263 xmlCreateURLParserCtxt (const char *filename,
00264 int options);
00265 XMLPUBFUN xmlParserCtxtPtr XMLCALL
00266 xmlCreateMemoryParserCtxt(const char *buffer,
00267 int size);
00268 XMLPUBFUN xmlParserCtxtPtr XMLCALL
00269 xmlCreateEntityParserCtxt(const xmlChar *URL,
00270 const xmlChar *ID,
00271 const xmlChar *base);
00272 XMLPUBFUN int XMLCALL
00273 xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
00274 xmlCharEncoding enc);
00275 XMLPUBFUN int XMLCALL
00276 xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
00277 xmlCharEncodingHandlerPtr handler);
00278 XMLPUBFUN int XMLCALL
00279 xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
00280 xmlParserInputPtr input,
00281 xmlCharEncodingHandlerPtr handler);
00282
00283 #ifdef IN_LIBXML
00284
00285 XMLPUBFUN void XMLCALL
00286 __xmlErrEncoding (xmlParserCtxtPtr ctxt,
00287 xmlParserErrors error,
00288 const char *msg,
00289 const xmlChar * str1,
00290 const xmlChar * str2);
00291 #endif
00292
00295 XMLPUBFUN void XMLCALL
00296 xmlHandleEntity (xmlParserCtxtPtr ctxt,
00297 xmlEntityPtr entity);
00298
00302 XMLPUBFUN xmlParserInputPtr XMLCALL
00303 xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
00304 const xmlChar *buffer);
00305 XMLPUBFUN xmlParserInputPtr XMLCALL
00306 xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
00307 xmlEntityPtr entity);
00308 XMLPUBFUN void XMLCALL
00309 xmlPushInput (xmlParserCtxtPtr ctxt,
00310 xmlParserInputPtr input);
00311 XMLPUBFUN xmlChar XMLCALL
00312 xmlPopInput (xmlParserCtxtPtr ctxt);
00313 XMLPUBFUN void XMLCALL
00314 xmlFreeInputStream (xmlParserInputPtr input);
00315 XMLPUBFUN xmlParserInputPtr XMLCALL
00316 xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
00317 const char *filename);
00318 XMLPUBFUN xmlParserInputPtr XMLCALL
00319 xmlNewInputStream (xmlParserCtxtPtr ctxt);
00320
00324 XMLPUBFUN xmlChar * XMLCALL
00325 xmlSplitQName (xmlParserCtxtPtr ctxt,
00326 const xmlChar *name,
00327 xmlChar **prefix);
00328 XMLPUBFUN xmlChar * XMLCALL
00329 xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
00330 XMLPUBFUN xmlChar * XMLCALL
00331 xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
00332 xmlChar **prefix);
00333 XMLPUBFUN xmlChar * XMLCALL
00334 xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
00335 XMLPUBFUN xmlChar * XMLCALL
00336 xmlParseQuotedString (xmlParserCtxtPtr ctxt);
00337 XMLPUBFUN void XMLCALL
00338 xmlParseNamespace (xmlParserCtxtPtr ctxt);
00339
00343 XMLPUBFUN xmlChar * XMLCALL
00344 xmlScanName (xmlParserCtxtPtr ctxt);
00345 XMLPUBFUN const xmlChar * XMLCALL
00346 xmlParseName (xmlParserCtxtPtr ctxt);
00347 XMLPUBFUN xmlChar * XMLCALL
00348 xmlParseNmtoken (xmlParserCtxtPtr ctxt);
00349 XMLPUBFUN xmlChar * XMLCALL
00350 xmlParseEntityValue (xmlParserCtxtPtr ctxt,
00351 xmlChar **orig);
00352 XMLPUBFUN xmlChar * XMLCALL
00353 xmlParseAttValue (xmlParserCtxtPtr ctxt);
00354 XMLPUBFUN xmlChar * XMLCALL
00355 xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
00356 XMLPUBFUN xmlChar * XMLCALL
00357 xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
00358 XMLPUBFUN void XMLCALL
00359 xmlParseCharData (xmlParserCtxtPtr ctxt,
00360 int cdata);
00361 XMLPUBFUN xmlChar * XMLCALL
00362 xmlParseExternalID (xmlParserCtxtPtr ctxt,
00363 xmlChar **publicID,
00364 int strict);
00365 XMLPUBFUN void XMLCALL
00366 xmlParseComment (xmlParserCtxtPtr ctxt);
00367 XMLPUBFUN const xmlChar * XMLCALL
00368 xmlParsePITarget (xmlParserCtxtPtr ctxt);
00369 XMLPUBFUN void XMLCALL
00370 xmlParsePI (xmlParserCtxtPtr ctxt);
00371 XMLPUBFUN void XMLCALL
00372 xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
00373 XMLPUBFUN void XMLCALL
00374 xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
00375 XMLPUBFUN int XMLCALL
00376 xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
00377 xmlChar **value);
00378 XMLPUBFUN xmlEnumerationPtr XMLCALL
00379 xmlParseNotationType (xmlParserCtxtPtr ctxt);
00380 XMLPUBFUN xmlEnumerationPtr XMLCALL
00381 xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
00382 XMLPUBFUN int XMLCALL
00383 xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
00384 xmlEnumerationPtr *tree);
00385 XMLPUBFUN int XMLCALL
00386 xmlParseAttributeType (xmlParserCtxtPtr ctxt,
00387 xmlEnumerationPtr *tree);
00388 XMLPUBFUN void XMLCALL
00389 xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
00390 XMLPUBFUN xmlElementContentPtr XMLCALL
00391 xmlParseElementMixedContentDecl
00392 (xmlParserCtxtPtr ctxt,
00393 int inputchk);
00394 XMLPUBFUN xmlElementContentPtr XMLCALL
00395 xmlParseElementChildrenContentDecl
00396 (xmlParserCtxtPtr ctxt,
00397 int inputchk);
00398 XMLPUBFUN int XMLCALL
00399 xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
00400 const xmlChar *name,
00401 xmlElementContentPtr *result);
00402 XMLPUBFUN int XMLCALL
00403 xmlParseElementDecl (xmlParserCtxtPtr ctxt);
00404 XMLPUBFUN void XMLCALL
00405 xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
00406 XMLPUBFUN int XMLCALL
00407 xmlParseCharRef (xmlParserCtxtPtr ctxt);
00408 XMLPUBFUN xmlEntityPtr XMLCALL
00409 xmlParseEntityRef (xmlParserCtxtPtr ctxt);
00410 XMLPUBFUN void XMLCALL
00411 xmlParseReference (xmlParserCtxtPtr ctxt);
00412 XMLPUBFUN void XMLCALL
00413 xmlParsePEReference (xmlParserCtxtPtr ctxt);
00414 XMLPUBFUN void XMLCALL
00415 xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
00416 XMLPUBFUN const xmlChar * XMLCALL
00417 xmlParseAttribute (xmlParserCtxtPtr ctxt,
00418 xmlChar **value);
00419 XMLPUBFUN const xmlChar * XMLCALL
00420 xmlParseStartTag (xmlParserCtxtPtr ctxt);
00421 XMLPUBFUN void XMLCALL
00422 xmlParseEndTag (xmlParserCtxtPtr ctxt);
00423 XMLPUBFUN void XMLCALL
00424 xmlParseCDSect (xmlParserCtxtPtr ctxt);
00425 XMLPUBFUN void XMLCALL
00426 xmlParseContent (xmlParserCtxtPtr ctxt);
00427 XMLPUBFUN void XMLCALL
00428 xmlParseElement (xmlParserCtxtPtr ctxt);
00429 XMLPUBFUN xmlChar * XMLCALL
00430 xmlParseVersionNum (xmlParserCtxtPtr ctxt);
00431 XMLPUBFUN xmlChar * XMLCALL
00432 xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
00433 XMLPUBFUN xmlChar * XMLCALL
00434 xmlParseEncName (xmlParserCtxtPtr ctxt);
00435 XMLPUBFUN const xmlChar * XMLCALL
00436 xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
00437 XMLPUBFUN int XMLCALL
00438 xmlParseSDDecl (xmlParserCtxtPtr ctxt);
00439 XMLPUBFUN void XMLCALL
00440 xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
00441 XMLPUBFUN void XMLCALL
00442 xmlParseTextDecl (xmlParserCtxtPtr ctxt);
00443 XMLPUBFUN void XMLCALL
00444 xmlParseMisc (xmlParserCtxtPtr ctxt);
00445 XMLPUBFUN void XMLCALL
00446 xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
00447 const xmlChar *ExternalID,
00448 const xmlChar *SystemID);
00454 #define XML_SUBSTITUTE_NONE 0
00455
00460 #define XML_SUBSTITUTE_REF 1
00461
00466 #define XML_SUBSTITUTE_PEREF 2
00467
00472 #define XML_SUBSTITUTE_BOTH 3
00473
00474 XMLPUBFUN xmlChar * XMLCALL
00475 xmlDecodeEntities (xmlParserCtxtPtr ctxt,
00476 int len,
00477 int what,
00478 xmlChar end,
00479 xmlChar end2,
00480 xmlChar end3);
00481 XMLPUBFUN xmlChar * XMLCALL
00482 xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
00483 const xmlChar *str,
00484 int what,
00485 xmlChar end,
00486 xmlChar end2,
00487 xmlChar end3);
00488 XMLPUBFUN xmlChar * XMLCALL
00489 xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
00490 const xmlChar *str,
00491 int len,
00492 int what,
00493 xmlChar end,
00494 xmlChar end2,
00495 xmlChar end3);
00496
00497
00498
00499
00500 XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
00501 xmlNodePtr value);
00502 XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
00503 XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
00504 xmlParserInputPtr value);
00505 XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
00506 XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
00507 XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
00508 const xmlChar *value);
00509
00510
00511
00512
00513 XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
00514 XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
00515 const xmlChar *cur,
00516 int *len);
00517 XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
00518 XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
00519 XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
00520
00521
00522
00523
00524 XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
00525 int *len);
00526 XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out,
00527 int val);
00528 XMLPUBFUN int XMLCALL xmlCopyChar (int len,
00529 xmlChar *out,
00530 int val);
00531 XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
00532 XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
00533
00534 #ifdef LIBXML_HTML_ENABLED
00535
00536
00537
00538 XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
00539 XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
00540 const char *encoding);
00541 #endif
00542
00543
00544
00545
00546
00556 typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
00557 xmlNodePtr firstNode,
00558 xmlNodePtr lastNode);
00559
00560 XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
00561
00562 #ifdef IN_LIBXML
00563
00564
00565
00566 XMLPUBFUN void XMLCALL
00567 xmlErrMemory (xmlParserCtxtPtr ctxt,
00568 const char *extra);
00569 #endif
00570
00571 #ifdef __cplusplus
00572 }
00573 #endif
00574 #endif
00575