=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.90 retrieving revision 1.93 diff -u -p -r1.90 -r1.93 --- mandoc/mdoc_man.c 2015/04/02 22:48:17 1.90 +++ mandoc/mdoc_man.c 2015/04/18 17:53:21 1.93 @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.90 2015/04/02 22:48:17 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.93 2015/04/18 17:53:21 schwarze Exp $ */ /* * Copyright (c) 2011-2015 Ingo Schwarze * @@ -30,7 +30,7 @@ #include "out.h" #include "main.h" -#define DECL_ARGS const struct mdoc_meta *meta, struct roff_node *n +#define DECL_ARGS const struct roff_meta *meta, struct roff_node *n struct manact { int (*cond)(DECL_ARGS); /* DON'T run actions */ @@ -532,7 +532,7 @@ print_count(int *count) } void -man_man(void *arg, const struct man *man) +man_man(void *arg, const struct roff_man *man) { /* @@ -545,18 +545,14 @@ man_man(void *arg, const struct man *man) } void -man_mdoc(void *arg, const struct mdoc *mdoc) +man_mdoc(void *arg, const struct roff_man *mdoc) { - const struct mdoc_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 mdoc *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'); }