diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-18 17:53:21 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-18 17:53:21 +0000 |
commit | d4d5d006d52687c2882e89b913c70967626da0e1 (patch) | |
tree | bc16a6725a85bb2b430e2ac2de6f2a83721bb6a8 /mdoc_html.c | |
parent | afd3f3a3f381e6bd5e6803a730f57302dd9234d2 (diff) | |
download | mandoc-d4d5d006d52687c2882e89b913c70967626da0e1.tar.gz |
Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),
man_node() from the mandoc(3) semi-public interface and the internal
wrapper functions print_mdoc() and print_man() from the HTML formatters.
Minus 60 lines of code, no functional change.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index eec5361f..42fe218b 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -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 |