FreeBSD/contrib/mdocml/tbl_term.c
/*
 * Kinds of horizontal rulers:
 * 0: inside the table (single or double line with crossings)
 * 1: inner frame (single line with crossings and ends)
 * 2: outer frame (single line without crossings with ends)
 */
Kinds of horizontal rulers:
0: inside the table (single or double line with crossings)
1: inner frame (single line with crossings and ends)
2: outer frame (single line without crossings with ends)
Kinds of horizontal rulers : 0 : inside the table ( single or double line with crossings ) 1 : inner frame ( single line with crossings and ends ) 2 : outer frame ( single line without crossings with ends )
static void
tbl_hrule(struct termp *tp, const struct tbl_span *sp, int kind)
{
	const struct tbl_cell *c1, *c2;
	int	 vert;
	char	 line, cross;
	line = (kind == 0 && TBL_SPAN_DHORIZ == sp->pos) ? '=' : '-';
	cross = (kind < 2) ? '+' : '-';
	if (kind)
		term_word(tp, "+");
	c1 = sp->layout->first;
	c2 = sp->prev == NULL ? NULL : sp->prev->layout->first;
	if (c2 == c1)
		c2 = NULL;
	for (;;) {
		tbl_char(tp, line, tp->tbl.cols[c1->col].width + 1);
		vert = c1->vert;
		if ((c1 = c1->next) == NULL)
			 break;
		if (c2 != NULL) {
			if (vert < c2->vert)
				vert = c2->vert;
			c2 = c2->next;
		}
		if (vert)
			tbl_char(tp, cross, vert);
		if (vert < 2)
			tbl_char(tp, line, 2 - vert);
	}
	if (kind) {
		term_word(tp, "+");
		term_flushln(tp);
	}
}
static void tbl_hrule ( struct termp * tp , const struct tbl_span * sp , int kind ) { const struct tbl_cell * c1 , * c2 ; int vert ; char line , cross ; line = ( kind == 0 && TBL_SPAN_DHORIZ == sp -> pos ) ? ' ' : ' ' ; cross = ( kind < 2 ) ? ' ' : ' ' ; if ( kind ) term_word ( tp , " " ) ; c1 = sp -> layout -> first ; c2 = sp -> prev == NULL ? NULL : sp -> prev -> layout -> first ; if ( c2 == c1 ) c2 = NULL ; for ( ; ; ) { tbl_char ( tp , line , tp -> tbl . cols [ c1 -> col ] . width + 1 ) ; vert = c1 -> vert ; if ( ( c1 = c1 -> next ) == NULL ) break ; if ( c2 != NULL ) { if ( vert < c2 -> vert ) vert = c2 -> vert ; c2 = c2 -> next ; } if ( vert ) tbl_char ( tp , cross , vert ) ; if ( vert < 2 ) tbl_char ( tp , line , 2 - vert ) ; } if ( kind ) { term_word ( tp , " " ) ; term_flushln ( tp ) ; } }
Kinds of horizontal rulers:
 0: inside the table (single or double line with crossings)
 1: inner frame (single line with crossings and ends)
 2: outer frame (single line without crossings with ends)
Kinds of horizontal rulers : 0 : inside the table ( single or double line with crossings ) 1 : inner frame ( single line with crossings and ends ) 2 : outer frame ( single line without crossings with ends )