Lines Matching refs:tp

63 term_tbl(struct termp *tp, const struct tbl_span *sp)
71 rmargin = tp->rmargin;
72 maxrmargin = tp->maxrmargin;
74 tp->rmargin = tp->maxrmargin = TERM_MAXMARGIN;
78 tp->flags |= TERMP_NONOSPACE;
79 tp->flags |= TERMP_NOSPACE;
87 term_flushln(tp);
89 tp->tbl.len = term_tbl_len;
90 tp->tbl.slen = term_tbl_strlen;
91 tp->tbl.arg = tp;
93 tblcalc(&tp->tbl, sp);
100 tbl_hframe(tp, sp, 1);
103 tbl_hframe(tp, sp, 0);
109 term_word(tp, TBL_SPAN_HORIZ == sp->pos ||
122 tbl_hrule(tp, sp);
139 tbl_vrule(tp, hp);
154 tbl_char(tp, ASCII_NBRSP, 1);
156 col = &tp->tbl.cols[hp->ident];
157 tbl_data(tp, sp->tbl, dp, col);
169 tbl_char(tp, ASCII_NBRSP,
189 term_word(tp, TBL_SPAN_HORIZ == sp->pos ||
191 term_flushln(tp);
201 tbl_hframe(tp, sp, 0);
203 tbl_hframe(tp, sp, 1);
204 assert(tp->tbl.cols);
205 free(tp->tbl.cols);
206 tp->tbl.cols = NULL;
209 tp->flags &= ~TERMP_NONOSPACE;
210 tp->rmargin = rmargin;
211 tp->maxrmargin = maxrmargin;
220 tbl_rulewidth(struct termp *tp, const struct tbl_head *hp)
224 width = tp->tbl.cols[hp->ident].width;
244 tbl_hrule(struct termp *tp, const struct tbl_span *sp)
254 tbl_char(tp,
256 tbl_rulewidth(tp, hp));
266 tbl_hframe(struct termp *tp, const struct tbl_span *sp, int outer)
270 term_word(tp, "+");
272 tbl_char(tp,
274 tbl_rulewidth(tp, hp));
275 term_word(tp, "+");
276 term_flushln(tp);
280 tbl_data(struct termp *tp, const struct tbl *tbl,
286 tbl_char(tp, ASCII_NBRSP, col->width);
293 tbl_char(tp, ASCII_NBRSP, col->width);
298 tbl_char(tp, '-', col->width);
303 tbl_char(tp, '=', col->width);
311 tbl_char(tp, '-', col->width);
314 tbl_char(tp, '=', col->width);
323 tbl_literal(tp, dp, col);
326 tbl_number(tp, tbl, dp, col);
329 tbl_char(tp, ASCII_NBRSP, col->width);
338 tbl_vrule(struct termp *tp, const struct tbl_head *hp)
343 term_word(tp, "|");
346 term_word(tp, "||");
354 tbl_char(struct termp *tp, char c, size_t len)
362 sz = term_strlen(tp, cp);
365 term_word(tp, cp);
369 tbl_literal(struct termp *tp, const struct tbl_dat *dp,
375 len = term_strlen(tp, dp->string);
381 padl = term_len(tp, 1);
398 tbl_char(tp, ASCII_NBRSP, padl);
399 term_word(tp, dp->string);
400 tbl_char(tp, ASCII_NBRSP, padr);
404 tbl_number(struct termp *tp, const struct tbl *tbl,
420 sz = term_strlen(tp, dp->string);
425 psz = term_strlen(tp, buf);
431 ssz += term_strlen(tp, buf);
439 tbl_char(tp, ASCII_NBRSP, padl);
440 term_word(tp, dp->string);
442 tbl_char(tp, ASCII_NBRSP, col->width - sz - padl);