]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_scrreg.c
ncurses 6.2 - patch 20210213
[ncurses.git] / ncurses / base / lib_scrreg.c
index ddeab2498bfdcceaa78f4d9a626a02668b043e3f..5207f6f801bc3aa85666349d29da7a5b86aa5d72 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-2000,2009 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -31,8 +32,6 @@
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  ****************************************************************************/
 
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  ****************************************************************************/
 
-
-
 /*
 **     lib_scrreg.c
 **
 /*
 **     lib_scrreg.c
 **
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_scrreg.c,v 1.7 1998/02/11 12:13:53 tom Exp $")
+MODULE_ID("$Id: lib_scrreg.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
 
 
-int wsetscrreg(WINDOW *win, int top, int bottom)
+NCURSES_EXPORT(int)
+wsetscrreg(WINDOW *win, int top, int bottom)
 {
 {
-       T((T_CALLED("wsetscrreg(%p,%d,%d)"), win, top, bottom));
-
-       if (win &&
-           top >= 0  && top <= win->_maxy &&
-           bottom >= 0  &&  bottom <= win->_maxy &&
-           bottom > top)
-         {
-           win->_regtop        = (short)top;
-           win->_regbottom = (short)bottom;
-           
-           returnCode(OK);
-         } else
-           returnCode(ERR);
+    T((T_CALLED("wsetscrreg(%p,%d,%d)"), (void *) win, top, bottom));
+
+    if (win &&
+       top >= 0 && top <= win->_maxy &&
+       bottom >= 0 && bottom <= win->_maxy &&
+       bottom > top) {
+       win->_regtop = (NCURSES_SIZE_T) top;
+       win->_regbottom = (NCURSES_SIZE_T) bottom;
+
+       returnCode(OK);
+    } else
+       returnCode(ERR);
 }
 }