|
|
1.1 ! root 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 ! 8: static char sccsid[] = "@(#)touchwin.c 5.1 (Berkeley) 6/7/85"; ! 9: #endif not lint ! 10: ! 11: # include "curses.ext" ! 12: ! 13: /* ! 14: * make it look like the whole window has been changed. ! 15: * ! 16: */ ! 17: touchwin(win) ! 18: register WINDOW *win; ! 19: { ! 20: register int y, maxy; ! 21: ! 22: # ifdef DEBUG ! 23: fprintf(outf, "TOUCHWIN(%0.2o)\n", win); ! 24: # endif ! 25: maxy = win->_maxy; ! 26: for (y = 0; y < maxy; y++) ! 27: touchline(win, y, 0, win->_maxx - 1); ! 28: } ! 29: ! 30: /* ! 31: * touch a given line ! 32: */ ! 33: touchline(win, y, sx, ex) ! 34: register WINDOW *win; ! 35: register int y, sx, ex; ! 36: { ! 37: # ifdef DEBUG ! 38: fprintf(outf, "TOUCHLINE(%0.2o, %d, %d, %d)\n", win, y, sx, ex); ! 39: fprintf(outf, "TOUCHLINE:first = %d, last = %d\n", win->_firstch[y], win->_lastch[y]); ! 40: # endif ! 41: sx += win->_ch_off; ! 42: ex += win->_ch_off; ! 43: if (win->_firstch[y] == _NOCHANGE) { ! 44: win->_firstch[y] = sx; ! 45: win->_lastch[y] = ex; ! 46: } ! 47: else { ! 48: if (win->_firstch[y] > sx) ! 49: win->_firstch[y] = sx; ! 50: if (win->_lastch[y] < ex) ! 51: win->_lastch[y] = ex; ! 52: } ! 53: # ifdef DEBUG ! 54: fprintf(outf, "TOUCHLINE:first = %d, last = %d\n", win->_firstch[y], win->_lastch[y]); ! 55: # endif ! 56: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.