diff options
author | 2015-04-18 17:50:02 +0000 | |
---|---|---|
committer | 2015-04-18 17:50:02 +0000 | |
commit | 6d0e9b63214a57d2a8d4601ae6d64f62e423da8e (patch) | |
tree | eee7efbc5bd98f8b0732368ef1fe23a587089815 /usr.bin/mandoc/man_term.c | |
parent | Unify {mdoc,man}_{alloc,reset,free}() into roff_man_{alloc,reset,free}(). (diff) | |
download | wireguard-openbsd-6d0e9b63214a57d2a8d4601ae6d64f62e423da8e.tar.xz wireguard-openbsd-6d0e9b63214a57d2a8d4601ae6d64f62e423da8e.zip |
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 'usr.bin/mandoc/man_term.c')
-rw-r--r-- | usr.bin/mandoc/man_term.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index d45ae873258..a0cec2a8ad2 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_term.c,v 1.133 2015/04/18 16:04:40 schwarze Exp $ */ +/* $OpenBSD: man_term.c,v 1.134 2015/04/18 17:50:02 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -139,25 +139,20 @@ void terminal_man(void *arg, const struct roff_man *man) { struct termp *p; - const struct roff_meta *meta; struct roff_node *n; struct mtermp mt; p = (struct termp *)arg; - p->overstep = 0; p->rmargin = p->maxrmargin = p->defrmargin; p->tabwidth = term_len(p, 5); - n = man_node(man)->child; - meta = man_meta(man); - memset(&mt, 0, sizeof(struct mtermp)); - mt.lmargin[mt.lmargincur] = term_len(p, p->defindent); mt.offset = term_len(p, p->defindent); mt.pardist = 1; + n = man->first->child; if (p->synopsisonly) { while (n != NULL) { if (n->tok == MAN_SH && @@ -165,7 +160,8 @@ terminal_man(void *arg, const struct roff_man *man) !strcmp(n->child->child->string, "SYNOPSIS")) { if (n->child->next->child != NULL) print_man_nodelist(p, &mt, - n->child->next->child, meta); + n->child->next->child, + &man->meta); term_newln(p); break; } @@ -174,10 +170,10 @@ terminal_man(void *arg, const struct roff_man *man) } else { if (p->defindent == 0) p->defindent = 7; - term_begin(p, print_man_head, print_man_foot, meta); + term_begin(p, print_man_head, print_man_foot, &man->meta); p->flags |= TERMP_NOSPACE; if (n != NULL) - print_man_nodelist(p, &mt, n, meta); + print_man_nodelist(p, &mt, n, &man->meta); term_end(p); } } |