7 * MuCurses clearing functions
12 * Clear a window to the bottom from current cursor position
14 * @v *win subject window
15 * @ret rc return status code
17 int wclrtobot ( WINDOW
*win
) {
18 struct cursor_pos pos
;
20 _store_curs_pos( win
, &pos
);
22 _wputc( win
, ' ', WRAP
);
23 } while ( win
->curs_y
+ win
->curs_x
);
24 _restore_curs_pos( win
, &pos
);
30 * Clear a window to the end of the current line
32 * @v *win subject window
33 * @ret rc return status code
35 int wclrtoeol ( WINDOW
*win
) {
36 struct cursor_pos pos
;
38 _store_curs_pos( win
, &pos
);
39 while ( ( win
->curs_y
- pos
.y
) == 0 ) {
40 _wputc( win
, ' ', WRAP
);
42 _restore_curs_pos( win
, &pos
);
48 * Delete character under the cursor in a window
50 * @v *win subject window
51 * @ret rc return status code
53 int wdelch ( WINDOW
*win
) {
54 _wputc( win
, ' ', NOWRAP
);
61 * Delete line under a window's cursor
63 * @v *win subject window
64 * @ret rc return status code
66 int wdeleteln ( WINDOW
*win
) {
67 struct cursor_pos pos
;
69 _store_curs_pos( win
, &pos
);
70 /* let's just set the cursor to the beginning of the line and
71 let wclrtoeol do the work :) */
72 wmove( win
, win
->curs_y
, 0 );
74 _restore_curs_pos( win
, &pos
);
79 * Completely clear a window
81 * @v *win subject window
82 * @ret rc return status code
84 int werase ( WINDOW
*win
) {