Commit | Line | Data |
---|---|---|
6e1c93d0 DF |
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 | |
2f73ccac | 8 | static char sccsid[] = "@(#)clrtobot.c 5.2 (Berkeley) %G%"; |
6e1c93d0 DF |
9 | #endif not lint |
10 | ||
88f211d0 KA |
11 | # include "curses.ext" |
12 | ||
13 | /* | |
14 | * This routine erases everything on the window. | |
15 | * | |
88f211d0 KA |
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 | } | |
26a29dea | 35 | if (minx != _NOCHANGE) |
2f73ccac | 36 | touchline(win, y, minx, maxx - &win->_y[y][0]); |
88f211d0 KA |
37 | startx = 0; |
38 | } | |
88f211d0 | 39 | } |