ncurses 4.1
[ncurses.git] / ncurses / lib_scrreg.c
1
2 /***************************************************************************
3 *                            COPYRIGHT NOTICE                              *
4 ****************************************************************************
5 *                ncurses is copyright (C) 1992-1995                        *
6 *                          Zeyd M. Ben-Halim                               *
7 *                          zmbenhal@netcom.com                             *
8 *                          Eric S. Raymond                                 *
9 *                          esr@snark.thyrsus.com                           *
10 *                                                                          *
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.                *
17 *                                                                          *
18 *        ncurses comes AS IS with no warranty, implied or expressed.       *
19 *                                                                          *
20 ***************************************************************************/
21
22
23
24 /*
25 **      lib_scrreg.c
26 **
27 **      The routine wsetscrreg().
28 **
29 */
30
31 #include <curses.priv.h>
32
33 MODULE_ID("$Id: lib_scrreg.c,v 1.5 1997/02/01 23:22:54 tom Exp $")
34
35 int wsetscrreg(WINDOW *win, int top, int bottom)
36 {
37         T((T_CALLED("wsetscrreg(%p,%d,%d)"), win, top, bottom));
38
39         if (top >= 0  && top <= win->_maxy &&
40                 bottom >= 0  &&  bottom <= win->_maxy &&
41                 bottom > top)
42         {
43                 win->_regtop    = (short)top;
44                 win->_regbottom = (short)bottom;
45
46                 returnCode(OK);
47         } else
48                 returnCode(ERR);
49 }