From ce3e2d5316637284d4e520cd554cd6ac728f4e49 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 7 Jun 2017 17:38:26 +0000 Subject: 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. --- term_ps.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'term_ps.c') diff --git a/term_ps.c b/term_ps.c index 26e117e0..f66a8cbd 100644 --- a/term_ps.c +++ b/term_ps.c @@ -538,12 +538,15 @@ pspdf_alloc(const struct manoutput *outopts) size_t marginx, marginy, lineheight; const char *pp; - p = mandoc_calloc(1, sizeof(struct termp)); + p = mandoc_calloc(1, sizeof(*p)); + p->tcol = p->tcols = mandoc_calloc(1, sizeof(*p->tcol)); + p->maxtcol = 1; + p->enc = TERMENC_ASCII; p->fontq = mandoc_reallocarray(NULL, - (p->fontsz = 8), sizeof(enum termfont)); + (p->fontsz = 8), sizeof(*p->fontq)); p->fontq[0] = p->fontl = TERMFONT_NONE; - p->ps = mandoc_calloc(1, sizeof(struct termp_ps)); + p->ps = mandoc_calloc(1, sizeof(*p->ps)); p->advance = ps_advance; p->begin = ps_begin; @@ -1220,7 +1223,7 @@ ps_endline(struct termp *p) ps_closepage(p); - p->offset -= p->ti; + p->tcol->offset -= p->ti; p->ti = 0; } -- cgit