Annotation of mandoc/html.h, Revision 1.7
1.7 ! kristaps 1: /* $Id: html.h,v 1.6 2009/09/21 14:56:56 kristaps Exp $ */
1.1 kristaps 2: /*
1.6 kristaps 3: * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
1.1 kristaps 4: *
5: * Permission to use, copy, modify, and distribute this software for any
1.6 kristaps 6: * purpose with or without fee is hereby granted, provided that the above
7: * copyright notice and this permission notice appear in all copies.
1.1 kristaps 8: *
1.6 kristaps 9: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1 kristaps 16: */
17: #ifndef HTML_H
18: #define HTML_H
19:
1.6 kristaps 20: __BEGIN_DECLS
21:
22: enum htmltag {
23: TAG_HTML,
24: TAG_HEAD,
25: TAG_BODY,
26: TAG_META,
27: TAG_TITLE,
28: TAG_DIV,
29: TAG_H1,
30: TAG_H2,
31: TAG_P,
32: TAG_SPAN,
33: TAG_LINK,
34: TAG_BR,
35: TAG_A,
36: TAG_TABLE,
37: TAG_COL,
38: TAG_TR,
39: TAG_TD,
40: TAG_LI,
41: TAG_UL,
42: TAG_OL,
43: TAG_BASE,
44: TAG_MAX
45: };
46:
47: enum htmlattr {
48: ATTR_HTTPEQUIV,
49: ATTR_CONTENT,
50: ATTR_NAME,
51: ATTR_REL,
52: ATTR_HREF,
53: ATTR_TYPE,
54: ATTR_MEDIA,
55: ATTR_CLASS,
56: ATTR_STYLE,
57: ATTR_WIDTH,
58: ATTR_VALIGN,
59: ATTR_MAX
60: };
61:
62: struct tag {
63: enum htmltag tag;
64: SLIST_ENTRY(tag) entry;
65: };
66:
67: struct ord {
68: int pos;
69: const void *cookie;
70: SLIST_ENTRY(ord) entry;
71: };
1.1 kristaps 72:
1.6 kristaps 73: SLIST_HEAD(tagq, tag);
74: SLIST_HEAD(ordq, ord);
75:
76: struct htmlpair {
77: enum htmlattr key;
78: char *val;
1.1 kristaps 79: };
80:
1.6 kristaps 81: struct html {
82: int flags;
83: #define HTML_NOSPACE (1 << 0)
84: #define HTML_NEWLINE (1 << 1)
1.7 ! kristaps 85: #define HTML_IGNDELIM (1 << 2)
1.6 kristaps 86: struct tagq tags;
87: struct ordq ords;
88: void *symtab;
89: char *base;
90: char *style;
91: };
1.1 kristaps 92:
1.6 kristaps 93: void print_gen_doctype(struct html *);
94: void print_gen_head(struct html *);
95: struct tag *print_otag(struct html *, enum htmltag,
96: int, const struct htmlpair *);
97: void print_tagq(struct html *, const struct tag *);
98: void print_stagq(struct html *, const struct tag *);
99: void print_text(struct html *, const char *);
1.1 kristaps 100:
101: __END_DECLS
102:
103: #endif /*!HTML_H*/
CVSweb