more error checking. cruft.
[unix-history] / usr / src / lib / libcurses / clrtobot.c
CommitLineData
6e1c93d0 1/*
2f14f200
KB
2 * Copyright (c) 1981 Regents of the University of California.
3 * All rights reserved.
4 *
c07973a2 5 * %sccs.include.redist.c%
6e1c93d0
DF
6 */
7
8#ifndef lint
c07973a2 9static char sccsid[] = "@(#)clrtobot.c 5.5 (Berkeley) %G%";
2f14f200 10#endif /* not lint */
6e1c93d0 11
88f211d0
KA
12# include "curses.ext"
13
14/*
15 * This routine erases everything on the window.
16 *
88f211d0
KA
17 */
18wclrtobot(win)
19reg WINDOW *win; {
20
21 reg int y;
22 reg char *sp, *end, *maxx;
23 reg int startx, minx;
24
25 startx = win->_curx;
26 for (y = win->_cury; y < win->_maxy; y++) {
27 minx = _NOCHANGE;
28 end = &win->_y[y][win->_maxx];
29 for (sp = &win->_y[y][startx]; sp < end; sp++)
30 if (*sp != ' ') {
31 maxx = sp;
32 if (minx == _NOCHANGE)
33 minx = sp - win->_y[y];
34 *sp = ' ';
35 }
26a29dea 36 if (minx != _NOCHANGE)
2f73ccac 37 touchline(win, y, minx, maxx - &win->_y[y][0]);
88f211d0
KA
38 startx = 0;
39 }
88f211d0 40}