summaryrefslogtreecommitdiffstats
path: root/roff_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-07 17:38:26 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-07 17:38:26 +0000
commitce3e2d5316637284d4e520cd554cd6ac728f4e49 (patch)
treea707ab0b13feb76229c9d84fcfa42b26bc3c293b /roff_term.c
parent955d8c0b01f8bcb2337da16b09f839e0f9cfd8b6 (diff)
downloadmandoc-ce3e2d5316637284d4e520cd554cd6ac728f4e49.tar.gz
Prepare the terminal driver for filling multiple columns in parallel,
first step: split column data out of the terminal state struct into a new column state struct and use an array of such column state structs. No functional change.
Diffstat (limited to 'roff_term.c')
-rw-r--r--roff_term.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/roff_term.c b/roff_term.c
index 2eb72dcc..17c1f043 100644
--- a/roff_term.c
+++ b/roff_term.c
@@ -60,8 +60,8 @@ roff_term_pre_br(ROFF_TERM_ARGS)
{
term_newln(p);
if (p->flags & TERMP_BRIND) {
- p->offset = p->rmargin;
- p->rmargin = p->maxrmargin;
+ p->tcol->offset = p->tcol->rmargin;
+ p->tcol->rmargin = p->maxrmargin;
p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
}
}
@@ -73,7 +73,7 @@ roff_term_pre_ce(ROFF_TERM_ARGS)
size_t len, lm;
roff_term_pre_br(p, n);
- lm = p->offset;
+ lm = p->tcol->offset;
n = n->child->next;
while (n != NULL) {
nch = n;
@@ -87,9 +87,9 @@ roff_term_pre_ce(ROFF_TERM_ARGS)
nch = nch->next;
} while (nch != NULL && (n->type != ROFFT_TEXT ||
(n->flags & NODE_LINE) == 0));
- p->offset = len >= p->rmargin ? 0 :
- lm + len >= p->rmargin ? p->rmargin - len :
- (lm + p->rmargin - len) / 2;
+ p->tcol->offset = len >= p->tcol->rmargin ? 0 :
+ lm + len >= p->tcol->rmargin ? p->tcol->rmargin - len :
+ (lm + p->tcol->rmargin - len) / 2;
while (n != nch) {
if (n->type == ROFFT_TEXT)
term_word(p, n->string);
@@ -100,7 +100,7 @@ roff_term_pre_ce(ROFF_TERM_ARGS)
p->flags |= TERMP_NOSPACE;
term_flushln(p);
}
- p->offset = lm;
+ p->tcol->offset = lm;
}
static void
@@ -206,16 +206,16 @@ roff_term_pre_ti(ROFF_TERM_ARGS)
len = term_hspan(p, &su) / 24;
if (sign == 0) {
- p->ti = len - p->offset;
- p->offset = len;
+ p->ti = len - p->tcol->offset;
+ p->tcol->offset = len;
} else if (sign == 1) {
p->ti = len;
- p->offset += len;
- } else if ((size_t)len < p->offset) {
+ p->tcol->offset += len;
+ } else if ((size_t)len < p->tcol->offset) {
p->ti = -len;
- p->offset -= len;
+ p->tcol->offset -= len;
} else {
- p->ti = -p->offset;
- p->offset = 0;
+ p->ti = -p->tcol->offset;
+ p->tcol->offset = 0;
}
}