=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.143 retrieving revision 1.146 diff -u -p -r1.143 -r1.146 --- mandoc/mdoc_term.c 2010/06/07 11:01:15 1.143 +++ mandoc/mdoc_term.c 2010/06/10 23:24:37 1.146 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.143 2010/06/07 11:01:15 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.146 2010/06/10 23:24:37 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -65,9 +65,9 @@ static void print_bvspace(struct termp *, const struct mdoc_node *, const struct mdoc_node *); static void print_mdoc_node(DECL_ARGS); -static void print_mdoc_head(DECL_ARGS); static void print_mdoc_nodelist(DECL_ARGS); -static void print_foot(DECL_ARGS); +static void print_mdoc_head(struct termp *, const void *); +static void print_mdoc_foot(struct termp *, const void *); static void synopsis_pre(struct termp *, const struct mdoc_node *); @@ -289,10 +289,12 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc) n = mdoc_node(mdoc); m = mdoc_meta(mdoc); - print_mdoc_head(p, NULL, m, n); + term_begin(p, print_mdoc_head, print_mdoc_foot, m); + if (n->child) print_mdoc_nodelist(p, NULL, m, n->child); - print_foot(p, NULL, m, n); + + term_end(p); } @@ -346,12 +348,14 @@ print_mdoc_node(DECL_ARGS) } -/* ARGSUSED */ static void -print_foot(DECL_ARGS) +print_mdoc_foot(struct termp *p, const void *arg) { char buf[DATESIZ], os[BUFSIZ]; + const struct mdoc_meta *m; + m = (const struct mdoc_meta *)arg; + term_fontrepl(p, TERMFONT_NONE); /* @@ -395,11 +399,13 @@ print_foot(DECL_ARGS) } -/* ARGSUSED */ static void -print_mdoc_head(DECL_ARGS) +print_mdoc_head(struct termp *p, const void *arg) { char buf[BUFSIZ], title[BUFSIZ]; + const struct mdoc_meta *m; + + m = (const struct mdoc_meta *)arg; p->rmargin = p->maxrmargin; p->offset = 0;