]> git.cameronkatri.com Git - mandoc.git/blobdiff - mdoc_term.c
Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),
[mandoc.git] / mdoc_term.c
index 44b03b5c4e524b7efa4bb9206a3f8002574dc0e3..be170bf549885902d9a0c7e823ce3cc4ff0050d1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_term.c,v 1.316 2015/04/02 23:48:20 schwarze Exp $ */
+/*     $Id: mdoc_term.c,v 1.319 2015/04/18 17:53:21 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -251,27 +251,24 @@ static    const struct termact termacts[MDOC_MAX] = {
 
 
 void
-terminal_mdoc(void *arg, const struct mdoc *mdoc)
+terminal_mdoc(void *arg, const struct roff_man *mdoc)
 {
-       const struct roff_meta  *meta;
        struct roff_node        *n;
        struct termp            *p;
 
        p = (struct termp *)arg;
-
        p->overstep = 0;
        p->rmargin = p->maxrmargin = p->defrmargin;
        p->tabwidth = term_len(p, 5);
 
-       n = mdoc_node(mdoc)->child;
-       meta = mdoc_meta(mdoc);
-
+       n = mdoc->first->child;
        if (p->synopsisonly) {
                while (n != NULL) {
                        if (n->tok == MDOC_Sh && n->sec == SEC_SYNOPSIS) {
                                if (n->child->next->child != NULL)
                                        print_mdoc_nodelist(p, NULL,
-                                           meta, n->child->next->child);
+                                           &mdoc->meta,
+                                           n->child->next->child);
                                term_newln(p);
                                break;
                        }
@@ -280,11 +277,12 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc)
        } else {
                if (p->defindent == 0)
                        p->defindent = 5;
-               term_begin(p, print_mdoc_head, print_mdoc_foot, meta);
+               term_begin(p, print_mdoc_head, print_mdoc_foot,
+                   &mdoc->meta);
                if (n != NULL) {
                        if (n->tok != MDOC_Sh)
                                term_vspace(p);
-                       print_mdoc_nodelist(p, NULL, meta, n);
+                       print_mdoc_nodelist(p, NULL, &mdoc->meta, n);
                }
                term_end(p);
        }
@@ -533,7 +531,7 @@ a2width(const struct termp *p, const char *v)
                SCALE_HS_INIT(&su, term_strlen(p, v));
                su.scale /= term_strlen(p, "0");
        }
-       return(term_hspan(p, &su));
+       return(term_hspan(p, &su) / 24);
 }
 
 /*