diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-30 21:28:01 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-30 21:28:01 +0000 |
commit | 0e54067b69058241ae1471784ca76be3ce54c96e (patch) | |
tree | 4b6fb50f0cba7ca839deda52f839efd76e5ebc35 /term.c | |
parent | b0b643c847c8a9530fc19fc081c52b9b6f5159dd (diff) | |
download | mandoc-0e54067b69058241ae1471784ca76be3ce54c96e.tar.gz |
Support relative arguments to .ll (increase or decrease line length).
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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) { |