X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_scrreg.c;h=546fbc183a3c3cb9b173e971f73be1035bbd16ae;hp=ddeab2498bfdcceaa78f4d9a626a02668b043e3f;hb=4573ed8af000c7a7907a59ec750da29c46c15498;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce diff --git a/ncurses/base/lib_scrreg.c b/ncurses/base/lib_scrreg.c index ddeab249..546fbc18 100644 --- a/ncurses/base/lib_scrreg.c +++ b/ncurses/base/lib_scrreg.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -31,8 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - - /* ** lib_scrreg.c ** @@ -42,21 +40,21 @@ #include -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.11 2009/10/24 22:35:28 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); }