Annotation of XML/HTMLparser.h, revision 1.4
1.1 daniel 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:
1.4 ! daniel 13: #ifdef __cplusplus
! 14: #define extern "C" {
! 15: #endif
! 16:
1.1 daniel 17: /*
18: * Most of the back-end structures from XML and HTML are shared
19: */
20: typedef xmlParserCtxt htmlParserCtxt;
21: typedef xmlParserCtxtPtr htmlParserCtxtPtr;
22: typedef xmlParserNodeInfo htmlParserNodeInfo;
23: typedef xmlSAXHandler htmlSAXHandler;
24: typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;
25: typedef xmlParserInput htmlParserInput;
26: typedef xmlParserInputPtr htmlParserInputPtr;
27: typedef xmlDocPtr htmlDocPtr;
28: typedef xmlNodePtr htmlNodePtr;
29:
30: /*
31: * Internal description of an HTML element
32: */
33: typedef struct htmlElemDesc {
1.2 daniel 34: const char *name; /* The tag name */
1.1 daniel 35: int startTag; /* Whether the start tag can be implied */
36: int endTag; /* Whether the end tag can be implied */
37: int empty; /* Is this an empty element ? */
38: int depr; /* Is this a deprecated element ? */
39: int dtd; /* 1: only in Loose DTD, 2: only Frameset one */
40: const char *desc; /* the description */
41: } htmlElemDesc, *htmlElemDescPtr;
42:
43: /*
44: * Internal description of an HTML entity
45: */
46: typedef struct htmlEntityDesc {
47: int value; /* the UNICODE value for the character */
1.2 daniel 48: const char *name; /* The entity name */
1.1 daniel 49: const char *desc; /* the description */
50: } htmlEntityDesc, *htmlEntityDescPtr;
51:
52: /*
53: * There is only few public functions.
54: */
1.3 daniel 55: htmlElemDescPtr htmlTagLookup(const xmlChar *tag);
56: htmlEntityDescPtr htmlEntityLookup(const xmlChar *name);
1.1 daniel 57:
1.3 daniel 58: htmlEntityDescPtr htmlParseEntityRef(htmlParserCtxtPtr ctxt, xmlChar **str);
1.1 daniel 59: int htmlParseCharRef(htmlParserCtxtPtr ctxt);
60: void htmlParseElement(htmlParserCtxtPtr ctxt);
61:
1.3 daniel 62: htmlDocPtr htmlSAXParseDoc(xmlChar *cur, const char *encoding,
1.1 daniel 63: htmlSAXHandlerPtr sax, void *userData);
1.3 daniel 64: htmlDocPtr htmlParseDoc(xmlChar *cur, const char *encoding);
1.1 daniel 65: htmlDocPtr htmlSAXParseFile(const char *filename, const char *encoding,
66: htmlSAXHandlerPtr sax, void *userData);
67: htmlDocPtr htmlParseFile(const char *filename, const char *encoding);
1.4 ! daniel 68:
! 69: #ifdef __cplusplus
! 70: }
! 71: #endif
1.1 daniel 72:
73: #endif /* __HTML_PARSER_H__ */
Webmaster