blob: ca9ee1467de3ade5843973d4bd6fd8f48675892a [file] [log] [blame]
Daniel Veillardbe70ff71999-07-05 16:50:46 +00001/*
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 Veillard5233ffc1999-07-06 22:25:25 +000013/*
14 * Most of the back-end structures from XML and HTML are shared
15 */
Daniel Veillardbe70ff71999-07-05 16:50:46 +000016typedef xmlParserCtxt htmlParserCtxt;
17typedef xmlParserCtxtPtr htmlParserCtxtPtr;
18typedef xmlParserNodeInfo htmlParserNodeInfo;
19typedef xmlSAXHandler htmlSAXHandler;
20typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;
21typedef xmlParserInput htmlParserInput;
22typedef xmlParserInputPtr htmlParserInputPtr;
23typedef xmlDocPtr htmlDocPtr;
24typedef xmlNodePtr htmlNodePtr;
25
Daniel Veillard5233ffc1999-07-06 22:25:25 +000026/*
27 * Internal description of an HTML element
28 */
29typedef struct htmlElemDesc {
Daniel Veillardb96e6431999-08-29 21:02:19 +000030 const char *name; /* The tag name */
Daniel Veillard5233ffc1999-07-06 22:25:25 +000031 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 */
42typedef struct htmlEntityDesc {
43 int value; /* the UNICODE value for the character */
Daniel Veillardb96e6431999-08-29 21:02:19 +000044 const char *name; /* The entity name */
Daniel Veillard5233ffc1999-07-06 22:25:25 +000045 const char *desc; /* the description */
46} htmlEntityDesc, *htmlEntityDescPtr;
47
48/*
49 * There is only few public functions.
50 */
Daniel Veillarddd6b3671999-09-23 22:19:22 +000051htmlElemDescPtr htmlTagLookup(const xmlChar *tag);
52htmlEntityDescPtr htmlEntityLookup(const xmlChar *name);
Daniel Veillard82150d81999-07-07 07:32:15 +000053
Daniel Veillarddd6b3671999-09-23 22:19:22 +000054htmlEntityDescPtr htmlParseEntityRef(htmlParserCtxtPtr ctxt, xmlChar **str);
Daniel Veillardbe70ff71999-07-05 16:50:46 +000055int htmlParseCharRef(htmlParserCtxtPtr ctxt);
56void htmlParseElement(htmlParserCtxtPtr ctxt);
57
Daniel Veillarddd6b3671999-09-23 22:19:22 +000058htmlDocPtr htmlSAXParseDoc(xmlChar *cur, const char *encoding,
Daniel Veillardbe70ff71999-07-05 16:50:46 +000059 htmlSAXHandlerPtr sax, void *userData);
Daniel Veillarddd6b3671999-09-23 22:19:22 +000060htmlDocPtr htmlParseDoc(xmlChar *cur, const char *encoding);
Daniel Veillardbe70ff71999-07-05 16:50:46 +000061htmlDocPtr htmlSAXParseFile(const char *filename, const char *encoding,
62 htmlSAXHandlerPtr sax, void *userData);
63htmlDocPtr htmlParseFile(const char *filename, const char *encoding);
64
65#endif /* __HTML_PARSER_H__ */