=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.231 retrieving revision 1.232 diff -u -p -r1.231 -r1.232 --- mandoc/mdoc_html.c 2015/04/18 16:06:40 1.231 +++ mandoc/mdoc_html.c 2015/04/18 17:53:21 1.232 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.231 2015/04/18 16:06:40 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.232 2015/04/18 17:53:21 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -48,7 +48,6 @@ struct htmlmdoc { void (*post)(MDOC_ARGS); }; -static void print_mdoc(MDOC_ARGS); static void print_mdoc_head(MDOC_ARGS); static void print_mdoc_node(MDOC_ARGS); static void print_mdoc_nodelist(MDOC_ARGS); @@ -264,15 +263,6 @@ static const char * const lists[LIST_MAX] = { }; -void -html_mdoc(void *arg, const struct roff_man *mdoc) -{ - - print_mdoc(mdoc_meta(mdoc), mdoc_node(mdoc)->child, - (struct html *)arg); - putchar('\n'); -} - /* * Calculate the scaling unit passed in a `-width' argument. This uses * either a native scaling unit (e.g., 1i, 2m) or the string length of @@ -331,29 +321,32 @@ synopsis_pre(struct html *h, const struct roff_node *n } } -static void -print_mdoc(MDOC_ARGS) +void +html_mdoc(void *arg, const struct roff_man *mdoc) { - struct tag *t, *tt; struct htmlpair tag; + struct html *h; + struct tag *t, *tt; PAIR_CLASS_INIT(&tag, "mandoc"); + h = (struct html *)arg; if ( ! (HTML_FRAGMENT & h->oflags)) { print_gen_decls(h); t = print_otag(h, TAG_HTML, 0, NULL); tt = print_otag(h, TAG_HEAD, 0, NULL); - print_mdoc_head(meta, n, h); + print_mdoc_head(&mdoc->meta, mdoc->first->child, h); print_tagq(h, tt); print_otag(h, TAG_BODY, 0, NULL); print_otag(h, TAG_DIV, 1, &tag); } else t = print_otag(h, TAG_DIV, 1, &tag); - mdoc_root_pre(meta, n, h); - print_mdoc_nodelist(meta, n, h); - mdoc_root_post(meta, n, h); + mdoc_root_pre(&mdoc->meta, mdoc->first->child, h); + print_mdoc_nodelist(&mdoc->meta, mdoc->first->child, h); + mdoc_root_post(&mdoc->meta, mdoc->first->child, h); print_tagq(h, t); + putchar('\n'); } static void