| 1 | /* |
| 2 | * Copyright (c) 1980 Regents of the University of California. |
| 3 | * All rights reserved. The Berkeley software License Agreement |
| 4 | * specifies the terms and conditions for redistribution. |
| 5 | */ |
| 6 | |
| 7 | #ifndef lint |
| 8 | static char sccsid[] = "@(#)clrtobot.c 5.2 (Berkeley) %G%"; |
| 9 | #endif not lint |
| 10 | |
| 11 | # include "curses.ext" |
| 12 | |
| 13 | /* |
| 14 | * This routine erases everything on the window. |
| 15 | * |
| 16 | */ |
| 17 | wclrtobot(win) |
| 18 | reg WINDOW *win; { |
| 19 | |
| 20 | reg int y; |
| 21 | reg char *sp, *end, *maxx; |
| 22 | reg int startx, minx; |
| 23 | |
| 24 | startx = win->_curx; |
| 25 | for (y = win->_cury; y < win->_maxy; y++) { |
| 26 | minx = _NOCHANGE; |
| 27 | end = &win->_y[y][win->_maxx]; |
| 28 | for (sp = &win->_y[y][startx]; sp < end; sp++) |
| 29 | if (*sp != ' ') { |
| 30 | maxx = sp; |
| 31 | if (minx == _NOCHANGE) |
| 32 | minx = sp - win->_y[y]; |
| 33 | *sp = ' '; |
| 34 | } |
| 35 | if (minx != _NOCHANGE) |
| 36 | touchline(win, y, minx, maxx - &win->_y[y][0]); |
| 37 | startx = 0; |
| 38 | } |
| 39 | } |