summaryrefslogtreecommitdiffstats
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-18 17:53:21 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-18 17:53:21 +0000
commitd4d5d006d52687c2882e89b913c70967626da0e1 (patch)
treebc16a6725a85bb2b430e2ac2de6f2a83721bb6a8 /mdoc_man.c
parentafd3f3a3f381e6bd5e6803a730f57302dd9234d2 (diff)
downloadmandoc-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_man.c')
-rw-r--r--mdoc_man.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 66f4d1bd..5fdd495a 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -547,16 +547,12 @@ man_man(void *arg, const struct roff_man *man)
void
man_mdoc(void *arg, const struct roff_man *mdoc)
{
- const struct roff_meta *meta;
struct roff_node *n;
- meta = mdoc_meta(mdoc);
- n = mdoc_node(mdoc)->child;
-
printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n",
- meta->title,
- (meta->msec == NULL ? "" : meta->msec),
- meta->date, meta->os, meta->vol);
+ mdoc->meta.title,
+ (mdoc->meta.msec == NULL ? "" : mdoc->meta.msec),
+ mdoc->meta.date, mdoc->meta.os, mdoc->meta.vol);
/* Disable hyphenation and if nroff, disable justification. */
printf(".nh\n.if n .ad l");
@@ -567,10 +563,8 @@ man_mdoc(void *arg, const struct roff_man *mdoc)
fontqueue.head = fontqueue.tail = mandoc_malloc(8);
*fontqueue.tail = 'R';
}
- while (n != NULL) {
- print_node(meta, n);
- n = n->next;
- }
+ for (n = mdoc->first->child; n != NULL; n = n->next)
+ print_node(&mdoc->meta, n);
putchar('\n');
}