1 /* $Id: html.h,v 1.1 2009/10/21 19:13:50 schwarze Exp $ */
3 * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
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.
66 SLIST_ENTRY(tag) entry;
72 SLIST_ENTRY(ord) entry;
75 SLIST_HEAD(tagq, tag);
76 SLIST_HEAD(ordq, ord);
83 #define PAIR_CLASS_INIT(p, v) \
84 do { (p)->key = ATTR_CLASS; \
85 (p)->val = (v); } while (/* CONSTCOND */ 0)
86 #define PAIR_HREF_INIT(p, v) \
87 do { (p)->key = ATTR_HREF; \
88 (p)->val = (v); } while (/* CONSTCOND */ 0)
89 #define PAIR_STYLE_INIT(p, h) \
90 do { (p)->key = ATTR_STYLE; \
91 (p)->val = (h)->buf; } while (/* CONSTCOND */ 0)
95 #define HTML_NOSPACE (1 << 0)
96 #define HTML_NEWLINE (1 << 1)
97 #define HTML_IGNDELIM (1 << 2)
111 void print_gen_doctype(struct html *);
112 void print_gen_head(struct html *);
113 struct tag *print_otag(struct html *, enum htmltag,
114 int, const struct htmlpair *);
115 void print_tagq(struct html *, const struct tag *);
116 void print_stagq(struct html *, const struct tag *);
117 void print_text(struct html *, const char *);
119 void bufcat_su(struct html *, const char *,
120 const struct roffsu *);
121 void buffmt_man(struct html *,
122 const char *, const char *);
123 void buffmt_includes(struct html *, const char *);
124 void buffmt(struct html *, const char *, ...);
125 void bufcat(struct html *, const char *);
126 void bufcat_style(struct html *,
127 const char *, const char *);
128 void bufncat(struct html *, const char *, size_t);
129 void bufinit(struct html *);