2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
25 ** The routine wclrtobot().
29 #include <curses.priv.h>
31 MODULE_ID("$Id: lib_clrbot.c,v 1.9 1997/02/01 23:18:18 tom Exp $")
33 int wclrtobot(WINDOW *win)
35 chtype *ptr, *end, *maxx = NULL;
36 short y, startx, minx;
38 T((T_CALLED("wclrtobot(%p)"), win));
42 T(("clearing from y = %d to y = %d with maxx = %d", win->_cury, win->_maxy, win->_maxx));
44 for (y = win->_cury; y <= win->_maxy; y++) {
46 end = &win->_line[y].text[win->_maxx];
48 for (ptr = &win->_line[y].text[startx]; ptr <= end; ptr++) {
49 chtype blank = _nc_background(win);
53 if (minx == _NOCHANGE)
54 minx = ptr - win->_line[y].text;
59 if (minx != _NOCHANGE) {
60 if (win->_line[y].firstchar > minx
61 || win->_line[y].firstchar == _NOCHANGE)
62 win->_line[y].firstchar = minx;
64 if (win->_line[y].lastchar < maxx - win->_line[y].text)
65 win->_line[y].lastchar = maxx - win->_line[y].text;