]> git.cameronkatri.com Git - mandoc.git/blob - html.h
Prettier HTML.
[mandoc.git] / html.h
1 /* $Id: html.h,v 1.4 2008/12/10 17:40:56 kristaps Exp $ */
2 /*
3 * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
8 * copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19 #ifndef HTML_H
20 #define HTML_H
21
22 #include "ml.h"
23
24 enum html_tag {
25 HTML_TAG_SPAN = 0,
26 HTML_TAG_HTML = 1,
27 HTML_TAG_HEAD = 2,
28 HTML_TAG_META = 3,
29 HTML_TAG_TITLE = 4,
30 HTML_TAG_STYLE = 5,
31 HTML_TAG_LINK = 6,
32 HTML_TAG_BODY = 7,
33 HTML_TAG_DIV = 8,
34 HTML_TAG_TABLE = 9,
35 HTML_TAG_TD = 10,
36 HTML_TAG_TR = 11,
37 HTML_TAG_OL = 12,
38 HTML_TAG_UL = 13,
39 HTML_TAG_LI = 14,
40 HTML_TAG_H1 = 15,
41 HTML_TAG_H2 = 16,
42 HTML_TAG_A = 17
43 };
44
45 enum html_attr {
46 HTML_ATTR_CLASS = 0,
47 HTML_ATTR_HTTP_EQUIV = 1,
48 HTML_ATTR_CONTENT = 2,
49 HTML_ATTR_NAME = 3,
50 HTML_ATTR_TYPE = 4,
51 HTML_ATTR_REL = 5,
52 HTML_ATTR_HREF = 6,
53 HTML_ATTR_WIDTH = 7,
54 HTML_ATTR_ALIGN = 8,
55 HTML_ATTR_VALIGN = 9,
56 HTML_ATTR_NOWRAP = 10
57 };
58
59 enum html_type {
60 HTML_TYPE_4_01_STRICT = 0
61 };
62
63 struct html_pair {
64 enum html_attr attr;
65 char *val;
66 };
67
68 __BEGIN_DECLS
69
70 int html_typeput(struct md_mbuf *,
71 enum html_type, size_t *);
72 int html_commentput(struct md_mbuf *,
73 enum ml_scope, size_t *);
74 int html_tput(struct md_mbuf *,
75 enum ml_scope, enum html_tag, size_t *);
76 int html_aput(struct md_mbuf *, enum ml_scope,
77 enum html_tag, size_t *,
78 int, const struct html_pair *);
79 int html_stput(struct md_mbuf *,
80 enum html_tag, size_t *);
81 int html_saput(struct md_mbuf *, enum html_tag,
82 size_t *, int, const struct html_pair *);
83
84 __END_DECLS
85
86 #endif /*!HTML_H*/