summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-30 21:28:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-30 21:28:01 +0000
commit0e54067b69058241ae1471784ca76be3ce54c96e (patch)
tree4b6fb50f0cba7ca839deda52f839efd76e5ebc35 /term.c
parentb0b643c847c8a9530fc19fc081c52b9b6f5159dd (diff)
downloadmandoc-0e54067b69058241ae1471784ca76be3ce54c96e.tar.gz
Support relative arguments to .ll (increase or decrease line length).
Diffstat (limited to 'term.c')
-rw-r--r--term.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/term.c b/term.c
index 39dbf2e1..a8f2d3f0 100644
--- a/term.c
+++ b/term.c
@@ -623,6 +623,36 @@ encode(struct termp *p, const char *word, size_t sz)
}
}
+void
+term_setwidth(struct termp *p, const char *wstr)
+{
+ struct roffsu su;
+ size_t width;
+ int iop;
+
+ if (NULL != wstr) {
+ switch (*wstr) {
+ case ('+'):
+ iop = 1;
+ wstr++;
+ break;
+ case ('-'):
+ iop = -1;
+ wstr++;
+ break;
+ default:
+ iop = 0;
+ break;
+ }
+ if ( ! a2roffsu(wstr, &su, SCALE_MAX)) {
+ wstr = NULL;
+ iop = 0;
+ }
+ }
+ width = (NULL != wstr) ? term_hspan(p, &su) : 0;
+ (*p->setwidth)(p, iop, width);
+}
+
size_t
term_len(const struct termp *p, size_t sz)
{