1 /*
2  * $LynxId: HTMLDTD.h,v 1.32 2008/07/06 17:38:13 tom Exp $
3  *
4 			      The HTML DTD -- software interface in libwww
5 			      HTML DTD - SOFTWARE INTERFACE
6 
7    SGML purists should excuse the use of the term "DTD" in this file to
8    represent DTD-related information which is not exactly a DTD itself.
9 
10    The C modular structure doesn't work very well here, as the dtd is
11    partly in the .h and partly in the .c which are not very independent.
12    Tant pis.
13 
14  */
15 #ifndef HTMLDTD_H
16 #define HTMLDTD_H
17 
18 #include <SGML.h>
19 #include <HTFont.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 /*
25  *  Valid name chars for tag parsing.
26  */
27 #define IsNmStart(c) (isalpha(UCH(c)))
28 #define IsNmChar(c) (isalnum(UCH(c)) || \
29 		      c == '_' || c=='-' || c == '.' || c==':')
30 #define ReallyEmptyTagNum(e) ((HTML_dtd.tags[e].contents == SGML_EMPTY) && \
31 			      !(HTML_dtd.tags[e].flags & Tgf_nreie))
32 #define ReallyEmptyTag(t) ((t->contents == SGML_EMPTY) && \
33 			   !(t->flags & Tgf_nreie))
34 
35 #include <hdr_HTMLDTD.h>
36 
37 #ifdef USE_PRETTYSRC
38 /* values of HTML attributes' types */
39 #define HTMLA_NORMAL 0		/* nothing specific */
40 #define HTMLA_ANAME  1		/* anchor name - 'id' or a's 'name' */
41 #define HTMLA_HREF   2		/* href */
42 #define HTMLA_CLASS  4		/* class name.  */
43 #define HTMLA_AUXCLASS 8	/* attribute, the value of which also designates
44 				   a class name */
45 #endif
46     extern const SGML_dtd HTML_dtd;
47 
48     extern void HTSwitchDTD(int new_flag);
49 
50     extern HTTag HTTag_unrecognized;
51     extern HTTag HTTag_mixedObject;
52 
53 /*
54 
55 Start anchor element
56 
57    It is kinda convenient to have a particular routine for starting an anchor
58    element, as everything else for HTML is simple anyway.
59 
60   ON ENTRY
61 
62    targetstream points to a structured stream object.
63 
64    name and href point to attribute strings or are NULL if the attribute is
65    to be omitted.
66 
67  */
68     extern void HTStartAnchor(HTStructured * targetstream, const char *name,
69 			      const char *href);
70 
71     extern void HTStartAnchor5(HTStructured * targetstream, const char *name,
72 			       const char *href,
73 			       const char *linktype,
74 			       int tag_charset);
75 
76 /*
77 
78 Start IsIndex element - FM
79 
80    It is kinda convenient to have a particular routine for starting an IsIndex
81    element with the prompt and/or href (action) attributes specified.
82 
83   ON ENTRY
84 
85    targetstream points to a structured stream object.
86 
87    prompt and href point to attribute strings or are NULL if the attribute is
88    to be omitted.
89 
90  */
91     extern void HTStartIsIndex(HTStructured * targetstream, const char *prompt,
92 			       const char *href);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 #endif				/* HTMLDTD_H */
98