]> git.cameronkatri.com Git - mandoc.git/blob - html.h
*** empty log message ***
[mandoc.git] / html.h
1 /* $Id: html.h,v 1.1 2008/12/10 00:52:46 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 };
55
56 enum html_type {
57 HTML_TYPE_4_01_STRICT = 0
58 };
59
60 struct html_pair {
61 enum html_attr attr;
62 char *val;
63 };
64
65 __BEGIN_DECLS
66
67 int html_typeput(struct md_mbuf *,
68 enum html_type, size_t *);
69 int html_commentput(struct md_mbuf *,
70 enum ml_scope, size_t *);
71 int html_tput(struct md_mbuf *,
72 enum ml_scope, enum html_tag, size_t *);
73 int html_aput(struct md_mbuf *, enum ml_scope,
74 enum html_tag, size_t *,
75 int, const struct html_pair *);
76 int html_stput(struct md_mbuf *,
77 enum html_tag, size_t *);
78 int html_saput(struct md_mbuf *, enum html_tag,
79 size_t *, int, const struct html_pair *);
80
81 __END_DECLS
82
83 #endif /*!HTML_H*/