/* Erase line, 3 different cases: Esc [ 0 K Erase from current position to end of line inclusive Esc [ 1 K Erase from beginning of line to current position inclusive Esc [ 2 K Erase entire line (without moving cursor)  */
static void tty3270_erase_line(struct tty3270 *tp, int mode)
/* Erase line, 3 different cases: Esc [ 0 K Erase from current position to end of line inclusive Esc [ 1 K Erase from beginning of line to current position inclusive Esc [ 2 K Erase entire line (without moving cursor)  */
static void tty3270_erase_line(struct tty3270 *tp, int mode)
{
	struct tty3270_line *line;
	struct tty3270_cell *cell;
	int i;
	line = tp->screen + tp->cy;
	if (mode == 0)
		line->len = tp->cx;
	else if (mode == 1) {
		for (i = 0; i < tp->cx; i++) {
			cell = line->cells + i;
			cell->character = ' ';
			cell->highlight = TAX_RESET;
			cell->f_color = TAC_RESET;
		}
		if (line->len <= tp->cx)
			line->len = tp->cx + 1;
	} else if (mode == 2)
		line->len = 0;
	tty3270_convert_line(tp, tp->cy);
}