Commit | Line | Data |
---|---|---|
6e1c93d0 | 1 | /* |
2f14f200 KB |
2 | * Copyright (c) 1981 Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms are permitted | |
6 | * provided that this notice is preserved and that due credit is given | |
7 | * to the University of California at Berkeley. The name of the University | |
8 | * may not be used to endorse or promote products derived from this | |
9 | * software without specific prior written permission. This software | |
10 | * is provided ``as is'' without express or implied warranty. | |
6e1c93d0 DF |
11 | */ |
12 | ||
13 | #ifndef lint | |
2f14f200 KB |
14 | static char sccsid[] = "@(#)clrtobot.c 5.3 (Berkeley) %G%"; |
15 | #endif /* not lint */ | |
6e1c93d0 | 16 | |
88f211d0 KA |
17 | # include "curses.ext" |
18 | ||
19 | /* | |
20 | * This routine erases everything on the window. | |
21 | * | |
88f211d0 KA |
22 | */ |
23 | wclrtobot(win) | |
24 | reg WINDOW *win; { | |
25 | ||
26 | reg int y; | |
27 | reg char *sp, *end, *maxx; | |
28 | reg int startx, minx; | |
29 | ||
30 | startx = win->_curx; | |
31 | for (y = win->_cury; y < win->_maxy; y++) { | |
32 | minx = _NOCHANGE; | |
33 | end = &win->_y[y][win->_maxx]; | |
34 | for (sp = &win->_y[y][startx]; sp < end; sp++) | |
35 | if (*sp != ' ') { | |
36 | maxx = sp; | |
37 | if (minx == _NOCHANGE) | |
38 | minx = sp - win->_y[y]; | |
39 | *sp = ' '; | |
40 | } | |
26a29dea | 41 | if (minx != _NOCHANGE) |
2f73ccac | 42 | touchline(win, y, minx, maxx - &win->_y[y][0]); |
88f211d0 KA |
43 | startx = 0; |
44 | } | |
88f211d0 | 45 | } |