blob: 23ff9afc3acd0aa1cb1bd564df6ac77b592749f7 [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 {
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 */
42typedef 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 */
51htmlEntityDescPtr
52htmlParseEntityRef(htmlParserCtxtPtr ctxt, CHAR **str);
Daniel Veillardbe70ff71999-07-05 16:50:46 +000053int htmlParseCharRef(htmlParserCtxtPtr ctxt);
54void htmlParseElement(htmlParserCtxtPtr ctxt);
55
56htmlDocPtr htmlSAXParseDoc(CHAR *cur, const char *encoding,
57 htmlSAXHandlerPtr sax, void *userData);
58htmlDocPtr htmlParseDoc(CHAR *cur, const char *encoding);
59htmlDocPtr htmlSAXParseFile(const char *filename, const char *encoding,
60 htmlSAXHandlerPtr sax, void *userData);
61htmlDocPtr htmlParseFile(const char *filename, const char *encoding);
62
63#endif /* __HTML_PARSER_H__ */