|
|
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_scrreg.c ! 27: ** ! 28: ** The routine wsetscrreg(). ! 29: ** ! 30: ** $Log: lib_scrreg.c,v $ ! 31: * Revision 1.11 93/04/12 14:14:05 bin ! 32: * Udo: third color update ! 33: * ! 34: * Revision 1.5 92/06/02 12:05:34 bin ! 35: * *** empty log message *** ! 36: * ! 37: * Revision 1.2 92/04/13 14:38:28 bin ! 38: * update by vlad ! 39: * ! 40: * Revision 2.2 91/04/20 21:42:05 munk ! 41: * Usage of register variables ! 42: * ! 43: * Revision 2.1 82/10/25 14:49:00 pavel ! 44: * Added Copyright Notice ! 45: * ! 46: * Revision 2.0 82/10/25 13:49:29 pavel ! 47: * Beta-one Test Release ! 48: * ! 49: ** ! 50: */ ! 51: ! 52: #ifdef RCSHDR ! 53: static char RCSid[] = ! 54: "$Header: /src386/usr/lib/ncurses/RCS/lib_scrreg.c,v 1.11 93/04/12 14:14:05 bin Exp Locker: bin $"; ! 55: #endif ! 56: ! 57: #include "curses.h" ! 58: #include "curses.priv.h" ! 59: ! 60: ! 61: wsetscrreg(win, top, bottom) ! 62: register WINDOW *win; ! 63: int top, bottom; ! 64: { ! 65: #ifdef TRACE ! 66: if (_tracing) ! 67: _tracef("wsetscrreg(%o,%d,%d) called", win, top, bottom); ! 68: #endif ! 69: ! 70: if ((0 <= top) && (bottom <= win->_maxy) && (top < bottom)) { ! 71: win->_regtop = top; ! 72: win->_regbottom = bottom; ! 73: ! 74: if (win->_cury > bottom) /* get cursor in scroll region */ ! 75: win->_cury = bottom; ! 76: else if (win->_cury < top) ! 77: win->_cury = top; ! 78: ! 79: return(OK); ! 80: } ! 81: else ! 82: return(ERR); ! 83: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.