d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy/* $Id: man_html.c,v 1.120 2016/01/08 17:48:09 schwarze Exp $ */
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Permission to use, copy, modify, and distribute this software for any
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * purpose with or without fee is hereby granted, provided that the above
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * copyright notice and this permission notice appear in all copies.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy/* TODO: preserve ident widths. */
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy/* FIXME: have PD set the default vspace width. */
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy#define MAN_ARGS const struct roff_meta *man, \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy const struct roff_node *n, \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy#define MANH_LITERAL (1 << 0) /* literal context */
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy const struct roff_node *);
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedystatic int a2width(const struct roff_node *,
print_paragraph(h);
struct html *h;
print_gen_decls(h);
print_tagq(h, t);
print_gen_head(h);
while (n != NULL) {
n = n->next;
struct tag *t;
switch (n->type) {
case ROFFT_ROOT:
case ROFFT_TEXT:
print_paragraph(h);
case ROFFT_EQN:
case ROFFT_TBL:
if (h->tblt) {
print_tblclose(h);
print_stagq(h, t);
switch (n->type) {
case ROFFT_ROOT:
case ROFFT_EQN:
print_tagq(h, t);
print_tagq(h, t);
bufinit(h);
struct tag *t;
t = NULL;
switch (n->tok) {
case MAN_BI:
case MAN_IB:
case MAN_RI:
case MAN_IR:
case MAN_BR:
case MAN_RB:
abort();
print_tagq(h, t);
if (savelit)
print_bvspace(h, n);
bufinit(h);
print_bvspace(h, n);
bufinit(h);
n = n->child;
n = n->next;