1 | /****************************************************************/
|
---|
2 | /* Wsetscrreg() routine of the PCcurses package */
|
---|
3 | /* */
|
---|
4 | /****************************************************************/
|
---|
5 | /* This version of curses is based on ncurses, a curses version */
|
---|
6 | /* Originally written by Pavel Curtis at Cornell University. */
|
---|
7 | /* I have made substantial changes to make it run on IBM PC's, */
|
---|
8 | /* And therefore consider myself free to make it public domain. */
|
---|
9 | /* Bjorn Larsson (...mcvax!enea!infovax!bl) */
|
---|
10 | /****************************************************************/
|
---|
11 | /* 1.0: Release: 870515 */
|
---|
12 | /****************************************************************/
|
---|
13 | /* Modified to run under the MINIX operating system by Don Cope */
|
---|
14 | /* These changes are also released into the public domain. */
|
---|
15 | /* 900906 */
|
---|
16 | /****************************************************************/
|
---|
17 |
|
---|
18 | #include <curses.h>
|
---|
19 | #include "curspriv.h"
|
---|
20 |
|
---|
21 | /****************************************************************/
|
---|
22 | /* Wsetscrreg() set the scrolling region of window 'win' to in- */
|
---|
23 | /* Clude all lines between 'top' and 'bottom'. */
|
---|
24 | /****************************************************************/
|
---|
25 |
|
---|
26 | int wsetscrreg(win, top, bottom)
|
---|
27 | WINDOW *win;
|
---|
28 | int top;
|
---|
29 | int bottom;
|
---|
30 | {
|
---|
31 | if ((0 <= top) &&
|
---|
32 | (top <= win->_cury)
|
---|
33 | &&
|
---|
34 | (win->_cury <= bottom)
|
---|
35 | &&
|
---|
36 | (bottom <= win->_maxy)
|
---|
37 | ) {
|
---|
38 | win->_regtop = top;
|
---|
39 | win->_regbottom = bottom;
|
---|
40 | return(OK);
|
---|
41 | }
|
---|
42 |
|
---|
43 | /* If */
|
---|
44 | else
|
---|
45 | return(ERR);
|
---|
46 | } /* wsetscrreg */
|
---|
47 |
|
---|
48 | /****************************************************************/
|
---|
49 | /* Setscrreg() set the scrolling region of stdscr to include */
|
---|
50 | /* All lines between 'top' and 'bottom'. */
|
---|
51 | /****************************************************************/
|
---|
52 |
|
---|
53 | int setscrreg(top, bottom)
|
---|
54 | int top;
|
---|
55 | int bottom;
|
---|
56 | {
|
---|
57 | return(wsetscrreg(stdscr, top, bottom));
|
---|
58 | } /* setscrreg */
|
---|