Lines Matching refs:tp

61 term_tbl(struct termp *tp, const struct tbl_span *sp)
69 rmargin = tp->rmargin;
70 maxrmargin = tp->maxrmargin;
72 tp->rmargin = tp->maxrmargin = TERM_MAXMARGIN;
76 tp->flags |= TERMP_NONOSPACE;
77 tp->flags |= TERMP_NOSPACE;
84 if (tp->tbl.cols == NULL) {
85 tp->tbl.len = term_tbl_len;
86 tp->tbl.slen = term_tbl_strlen;
87 tp->tbl.arg = tp;
89 tblcalc(&tp->tbl, sp, rmargin - tp->offset);
93 offset = tp->offset;
98 tsz += tp->tbl.cols[ic].width + 3;
102 tp->offset = (offset + rmargin > tsz) ?
109 tbl_hrule(tp, sp, 2);
111 tbl_hrule(tp, sp, 1);
121 term_word(tp, horiz ? "+" : "|");
123 tbl_char(tp, horiz ? '-' : ASCII_NBRSP, 1);
148 tbl_data(tp, sp->opts, dp, tp->tbl.cols + ic);
166 tbl_char(tp, ASCII_NBRSP, 1);
168 tbl_char(tp, '|', vert);
170 tbl_char(tp, ASCII_NBRSP, 2 - vert);
173 tbl_hrule(tp, sp, 0);
180 term_word(tp, horiz ? "+" : " |");
182 tbl_char(tp, horiz ? '-' : ASCII_NBRSP, 1);
183 term_flushln(tp);
192 tbl_hrule(tp, sp, 1);
193 tp->skipvsp = 1;
196 tbl_hrule(tp, sp, 2);
197 tp->skipvsp = 2;
199 assert(tp->tbl.cols);
200 free(tp->tbl.cols);
201 tp->tbl.cols = NULL;
202 tp->offset = offset;
205 tp->flags &= ~TERMP_NONOSPACE;
206 tp->rmargin = rmargin;
207 tp->maxrmargin = maxrmargin;
217 tbl_hrule(struct termp *tp, const struct tbl_span *sp, int kind)
227 term_word(tp, "+");
233 tbl_char(tp, line, tp->tbl.cols[c1->col].width + 1);
243 tbl_char(tp, cross, vert);
245 tbl_char(tp, line, 2 - vert);
248 term_word(tp, "+");
249 term_flushln(tp);
254 tbl_data(struct termp *tp, const struct tbl_opts *opts,
260 tbl_char(tp, ASCII_NBRSP, col->width);
266 tbl_char(tp, ASCII_NBRSP, col->width);
271 tbl_char(tp, '-', col->width);
276 tbl_char(tp, '=', col->width);
284 tbl_char(tp, '-', col->width);
287 tbl_char(tp, '=', col->width);
296 tbl_literal(tp, dp, col);
299 tbl_number(tp, opts, dp, col);
302 tbl_char(tp, ASCII_NBRSP, col->width);
311 tbl_char(struct termp *tp, char c, size_t len)
319 sz = term_strlen(tp, cp);
322 term_word(tp, cp);
326 tbl_literal(struct termp *tp, const struct tbl_dat *dp,
333 len = term_strlen(tp, dp->string);
338 width += tp->tbl.cols[++ic].width + 3;
345 padl = term_len(tp, 1);
362 tbl_char(tp, ASCII_NBRSP, padl);
363 tbl_word(tp, dp);
364 tbl_char(tp, ASCII_NBRSP, padr);
368 tbl_number(struct termp *tp, const struct tbl_opts *opts,
384 sz = term_strlen(tp, dp->string);
389 psz = term_strlen(tp, buf);
394 ssz += term_strlen(tp, buf);
404 tbl_char(tp, ASCII_NBRSP, padl);
407 tbl_word(tp, dp);
409 tbl_char(tp, ASCII_NBRSP, col->width - sz - padl);
413 tbl_word(struct termp *tp, const struct tbl_dat *dp)
417 prev_font = tp->fonti;
419 term_fontpush(tp, TERMFONT_BOLD);
421 term_fontpush(tp, TERMFONT_UNDER);
423 term_word(tp, dp->string);
425 term_fontpopq(tp, prev_font);