|
|
1.1 ! root 1: /********************************************************************* ! 2: * COPYRIGHT NOTICE * ! 3: ********************************************************************** ! 4: * This software is copyright (C) 1982 by Pavel Curtis * ! 5: * * ! 6: * Permission is granted to reproduce and distribute * ! 7: * this file by any means so long as no fee is charged * ! 8: * above a nominal handling fee and so long as this * ! 9: * notice is always included in the copies. * ! 10: * * ! 11: * Other rights are reserved except as explicitly granted * ! 12: * by written permission of the author. * ! 13: * Pavel Curtis * ! 14: * Computer Science Dept. * ! 15: * 405 Upson Hall * ! 16: * Cornell University * ! 17: * Ithaca, NY 14853 * ! 18: * * ! 19: * Ph- (607) 256-4934 * ! 20: * * ! 21: * Pavel.Cornell@Udel-Relay (ARPAnet) * ! 22: * decvax!cornell!pavel (UUCPnet) * ! 23: *********************************************************************/ ! 24: ! 25: /* ! 26: ** lib_clrbot.c ! 27: ** ! 28: ** The routine wclrtobot(). ! 29: ** ! 30: ** $Log: lib_clrbot.c,v $ ! 31: * Revision 1.8 93/04/12 14:13:25 bin ! 32: * Udo: third color update ! 33: * ! 34: * Revision 1.2 92/04/13 14:37:13 bin ! 35: * update by vlad ! 36: * ! 37: * Revision 2.2 91/04/20 18:07:38 munk ! 38: * Usage of register variables ! 39: * ! 40: * Revision 2.1 82/10/25 14:46:37 pavel ! 41: * Added Copyright Notice ! 42: * ! 43: * Revision 2.0 82/10/24 15:20:24 pavel ! 44: * Beta-one Test Release ! 45: * ! 46: ** ! 47: */ ! 48: ! 49: #ifdef RCSHDR ! 50: static char RCSid[] = ! 51: "$Header: /src386/usr/lib/ncurses/RCS/lib_clrbot.c,v 1.8 93/04/12 14:13:25 bin Exp Locker: bin $"; ! 52: #endif ! 53: ! 54: #include "curses.h" ! 55: #include "curses.priv.h" ! 56: ! 57: ! 58: wclrtobot(win) ! 59: register WINDOW *win; ! 60: { ! 61: chtype *ptr, *end, *maxx; ! 62: register int y; ! 63: int startx, minx; ! 64: chtype blank = ' ' | win->_attrs; ! 65: ! 66: #ifdef TRACE ! 67: if (_tracing) ! 68: _tracef("wclrtobot(%o) called", win); ! 69: #endif ! 70: ! 71: startx = win->_curx; ! 72: ! 73: for (y = win->_cury; y <= win->_regbottom; y++) ! 74: { ! 75: minx = _NOCHANGE; ! 76: end = &win->_line[y][win->_maxx]; ! 77: ! 78: for (ptr = &win->_line[y][startx]; ptr <= end; ptr++) ! 79: { ! 80: if (*ptr != blank) ! 81: { ! 82: maxx = ptr; ! 83: if (minx == _NOCHANGE) ! 84: minx = ptr - win->_line[y]; ! 85: *ptr = blank; ! 86: } ! 87: } ! 88: ! 89: if (minx != _NOCHANGE) ! 90: { ! 91: win->_numchngd[y] = (maxx - win->_line[y]) - minx; ! 92: if (win->_firstchar[y] > minx ! 93: || win->_firstchar[y] == _NOCHANGE) ! 94: win->_firstchar[y] = minx; ! 95: ! 96: if (win->_lastchar[y] < maxx - win->_line[y]) ! 97: win->_lastchar[y] = maxx - win->_line[y]; ! 98: } ! 99: ! 100: startx = 0; ! 101: } ! 102: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.