Daniel Veillard | be70ff7 | 1999-07-05 16:50:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | * HTMLparser.h : inf=terface for an HTML 4.0 non-verifying parser |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * Daniel.Veillard@w3.org |
| 7 | */ |
| 8 | |
| 9 | #ifndef __HTML_PARSER_H__ |
| 10 | #define __HTML_PARSER_H__ |
| 11 | #include "parser.h" |
| 12 | |
Daniel Veillard | 5233ffc | 1999-07-06 22:25:25 +0000 | [diff] [blame] | 13 | /* |
| 14 | * Most of the back-end structures from XML and HTML are shared |
| 15 | */ |
Daniel Veillard | be70ff7 | 1999-07-05 16:50:46 +0000 | [diff] [blame] | 16 | typedef xmlParserCtxt htmlParserCtxt; |
| 17 | typedef xmlParserCtxtPtr htmlParserCtxtPtr; |
| 18 | typedef xmlParserNodeInfo htmlParserNodeInfo; |
| 19 | typedef xmlSAXHandler htmlSAXHandler; |
| 20 | typedef xmlSAXHandlerPtr htmlSAXHandlerPtr; |
| 21 | typedef xmlParserInput htmlParserInput; |
| 22 | typedef xmlParserInputPtr htmlParserInputPtr; |
| 23 | typedef xmlDocPtr htmlDocPtr; |
| 24 | typedef xmlNodePtr htmlNodePtr; |
| 25 | |
Daniel Veillard | 5233ffc | 1999-07-06 22:25:25 +0000 | [diff] [blame] | 26 | /* |
| 27 | * Internal description of an HTML element |
| 28 | */ |
| 29 | typedef struct htmlElemDesc { |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 30 | const char *name; /* The tag name */ |
Daniel Veillard | 5233ffc | 1999-07-06 22:25:25 +0000 | [diff] [blame] | 31 | int startTag; /* Whether the start tag can be implied */ |
| 32 | int endTag; /* Whether the end tag can be implied */ |
| 33 | int empty; /* Is this an empty element ? */ |
| 34 | int depr; /* Is this a deprecated element ? */ |
| 35 | int dtd; /* 1: only in Loose DTD, 2: only Frameset one */ |
| 36 | const char *desc; /* the description */ |
| 37 | } htmlElemDesc, *htmlElemDescPtr; |
| 38 | |
| 39 | /* |
| 40 | * Internal description of an HTML entity |
| 41 | */ |
| 42 | typedef struct htmlEntityDesc { |
| 43 | int value; /* the UNICODE value for the character */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 44 | const char *name; /* The entity name */ |
Daniel Veillard | 5233ffc | 1999-07-06 22:25:25 +0000 | [diff] [blame] | 45 | const char *desc; /* the description */ |
| 46 | } htmlEntityDesc, *htmlEntityDescPtr; |
| 47 | |
| 48 | /* |
| 49 | * There is only few public functions. |
| 50 | */ |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 51 | htmlElemDescPtr htmlTagLookup(const xmlChar *tag); |
| 52 | htmlEntityDescPtr htmlEntityLookup(const xmlChar *name); |
Daniel Veillard | 82150d8 | 1999-07-07 07:32:15 +0000 | [diff] [blame] | 53 | |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 54 | htmlEntityDescPtr htmlParseEntityRef(htmlParserCtxtPtr ctxt, xmlChar **str); |
Daniel Veillard | be70ff7 | 1999-07-05 16:50:46 +0000 | [diff] [blame] | 55 | int htmlParseCharRef(htmlParserCtxtPtr ctxt); |
| 56 | void htmlParseElement(htmlParserCtxtPtr ctxt); |
| 57 | |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 58 | htmlDocPtr htmlSAXParseDoc(xmlChar *cur, const char *encoding, |
Daniel Veillard | be70ff7 | 1999-07-05 16:50:46 +0000 | [diff] [blame] | 59 | htmlSAXHandlerPtr sax, void *userData); |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 60 | htmlDocPtr htmlParseDoc(xmlChar *cur, const char *encoding); |
Daniel Veillard | be70ff7 | 1999-07-05 16:50:46 +0000 | [diff] [blame] | 61 | htmlDocPtr htmlSAXParseFile(const char *filename, const char *encoding, |
| 62 | htmlSAXHandlerPtr sax, void *userData); |
| 63 | htmlDocPtr htmlParseFile(const char *filename, const char *encoding); |
| 64 | |
| 65 | #endif /* __HTML_PARSER_H__ */ |