=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.217 retrieving revision 1.220 diff -u -p -r1.217 -r1.220 --- mandoc/term.c 2014/03/13 19:23:50 1.217 +++ mandoc/term.c 2014/04/05 21:18:19 1.220 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.217 2014/03/13 19:23:50 schwarze Exp $ */ +/* $Id: term.c,v 1.220 2014/04/05 21:18:19 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -23,12 +23,12 @@ #include #include -#include #include #include #include #include "mandoc.h" +#include "mandoc_aux.h" #include "out.h" #include "term.h" #include "main.h" @@ -621,6 +621,36 @@ encode(struct termp *p, const char *word, size_t sz) else p->buf[p->col++] = word[i]; } +} + +void +term_setwidth(struct termp *p, const char *wstr) +{ + struct roffsu su; + size_t width; + int iop; + + iop = 0; + width = 0; + if (NULL != wstr) { + switch (*wstr) { + case ('+'): + iop = 1; + wstr++; + break; + case ('-'): + iop = -1; + wstr++; + break; + default: + break; + } + if (a2roffsu(wstr, &su, SCALE_MAX)) + width = term_hspan(p, &su); + else + iop = 0; + } + (*p->setwidth)(p, iop, width); } size_t