Exemplo n.º 1
0
Arquivo: clear.c Projeto: 42wim/ipxe
/**
 * Clear a window to the bottom from current cursor position
 *
 * @v *win	subject window
 * @ret rc	return status code
 */
int wclrtobot ( WINDOW *win ) {
	struct cursor_pos pos;

	_store_curs_pos( win, &pos );
	do {
		_wputc( win, ' ', WRAP );
	} while ( win->curs_y + win->curs_x );
	_restore_curs_pos( win, &pos );

	return OK;
}
Exemplo n.º 2
0
Arquivo: clear.c Projeto: 42wim/ipxe
/**
 * Clear a window to the end of the current line
 *
 * @v *win	subject window
 * @ret rc	return status code
 */
int wclrtoeol ( WINDOW *win ) {
	struct cursor_pos pos;

	_store_curs_pos( win, &pos );
	while ( ( win->curs_y - pos.y ) == 0 ) {
		_wputc( win, ' ', WRAP );
	}
	_restore_curs_pos( win, &pos );

	return OK;
}
Exemplo n.º 3
0
Arquivo: clear.c Projeto: 42wim/ipxe
/**
 * Delete character under the cursor in a window
 *
 * @v *win	subject window
 * @ret rc	return status code
 */
int wdelch ( WINDOW *win ) {
	_wputc( win, ' ', NOWRAP );
	_wcursback( win );

	return OK;
}
Exemplo n.º 4
0
/**
 * Write a standard c-style string to a window
 *
 * @v *win	window in which to write
 * @v *str	string
 * @v wrap	wrap "switch"
 * @v n		write at most n chars from *str
 */
void _wputstr ( WINDOW *win, const char *str, int wrap, int n ) {
	for ( ; *str && n-- ; str++ ) {
		_wputc ( win, *str, wrap );
	}
}