=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- src/usr.bin/mandoc/term.c 2010/06/26 17:56:43 1.38 +++ src/usr.bin/mandoc/term.c 2010/06/26 19:08:00 1.39 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.38 2010/06/26 17:56:43 schwarze Exp $ */ +/* $Id: term.c,v 1.39 2010/06/26 19:08:00 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -83,9 +83,7 @@ exit(EXIT_FAILURE); } - p->tabwidth = 5; p->enc = enc; - p->defrmargin = 78; return(p); } @@ -622,8 +620,28 @@ size_t -term_vspan(const struct roffsu *su) +term_len(const struct termp *p, size_t sz) { + + return((*p->width)(p, ' ') * sz); +} + + +size_t +term_strlen(const struct termp *p, const char *cp) +{ + size_t sz; + + for (sz = 0; *cp; cp++) + sz += (*p->width)(p, *cp); + + return(sz); +} + + +size_t +term_vspan(const struct termp *p, const struct roffsu *su) +{ double r; switch (su->unit) { @@ -658,7 +676,7 @@ size_t -term_hspan(const struct roffsu *su) +term_hspan(const struct termp *p, const struct roffsu *su) { double r;