Beispiel #1
0
/*
 * Rules above and below the table are always single
 * and have an additional plus at the beginning and end.
 * For double frames, this function is called twice,
 * and the outer one does not have crossings.
 */
static void
tbl_hframe(struct termp *tp, const struct tbl_span *sp, int outer)
{
	const struct tbl_head *hp;

	term_word(tp, "+");
	for (hp = sp->head; hp; hp = hp->next)
		tbl_char(tp,
		    outer || TBL_HEAD_DATA == hp->pos ? '-' : '+',
		    tbl_rulewidth(tp, hp));
	term_word(tp, "+");
	term_flushln(tp);
}
Beispiel #2
0
/*
 * Rules above and below the table are always single
 * and have an additional plus at the beginning and end.
 * For double frames, this function is called twice,
 * and the outer one does not have crossings.
 */
static void
tbl_hframe(struct termp *tp, const struct tbl_span *sp, int outer)
{
	const struct tbl_head *hp;

	term_word(tp, "+");
	for (hp = sp->head; hp; hp = hp->next) {
		if (hp->prev && hp->vert)
			tbl_char(tp, (outer ? '-' : '+'), hp->vert);
		tbl_char(tp, '-', tbl_rulewidth(tp, hp));
	}
	term_word(tp, "+");
	term_flushln(tp);
}
Beispiel #3
0
/*
 * Rules inside the table can be single or double
 * and have crossings with vertical rules marked with pluses.
 */
static void
tbl_hrule(struct termp *tp, const struct tbl_span *sp)
{
	const struct tbl_head *hp;
	char		 c;

	c = '-';
	if (TBL_SPAN_DHORIZ == sp->pos)
		c = '=';

	for (hp = sp->head; hp; hp = hp->next)
		tbl_char(tp,
		    TBL_HEAD_DATA == hp->pos ? c : '+',
		    tbl_rulewidth(tp, hp));
}
Beispiel #4
0
/*
 * Rules inside the table can be single or double
 * and have crossings with vertical rules marked with pluses.
 */
static void
tbl_hrule(struct termp *tp, const struct tbl_span *sp)
{
	const struct tbl_head *hp;
	char		 c;

	c = '-';
	if (TBL_SPAN_DHORIZ == sp->pos)
		c = '=';

	for (hp = sp->head; hp; hp = hp->next) {
		if (hp->prev && hp->vert)
			tbl_char(tp, '+', hp->vert);
		tbl_char(tp, c, tbl_rulewidth(tp, hp));
	}
}