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 { |
| 30 | const CHAR *name; /* The tag name */ |
| 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 */ |
| 44 | const CHAR *name; /* The entity name */ |
| 45 | const char *desc; /* the description */ |
| 46 | } htmlEntityDesc, *htmlEntityDescPtr; |
| 47 | |
| 48 | /* |
| 49 | * There is only few public functions. |
| 50 | */ |
| 51 | htmlEntityDescPtr |
| 52 | htmlParseEntityRef(htmlParserCtxtPtr ctxt, CHAR **str); |
Daniel Veillard | be70ff7 | 1999-07-05 16:50:46 +0000 | [diff] [blame] | 53 | int htmlParseCharRef(htmlParserCtxtPtr ctxt); |
| 54 | void htmlParseElement(htmlParserCtxtPtr ctxt); |
| 55 | |
| 56 | htmlDocPtr htmlSAXParseDoc(CHAR *cur, const char *encoding, |
| 57 | htmlSAXHandlerPtr sax, void *userData); |
| 58 | htmlDocPtr htmlParseDoc(CHAR *cur, const char *encoding); |
| 59 | htmlDocPtr htmlSAXParseFile(const char *filename, const char *encoding, |
| 60 | htmlSAXHandlerPtr sax, void *userData); |
| 61 | htmlDocPtr htmlParseFile(const char *filename, const char *encoding); |
| 62 | |
| 63 | #endif /* __HTML_PARSER_H__ */ |