+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)scroll.c 5.1 (Berkeley) 6/7/85";
+#endif not lint
+
# include "curses.ext"
/*
* This routine scrolls the window up a line.
*
- * 6/1/83 (Berkeley) @(#)scroll.c 1.3
*/
scroll(win)
-reg WINDOW *win; {
+register WINDOW *win;
+{
+ register int oy, ox;
- reg char *sp;
- reg int i;
- reg char *temp;
+# ifdef DEBUG
+ fprintf(outf, "SCROLL(%0.2o)\n", win);
+# endif
if (!win->_scroll)
return ERR;
- temp = win->_y[0];
- for (i = 1; i < win->_maxy; i++)
- win->_y[i - 1] = win->_y[i];
- for (sp = temp; sp < &temp[win->_maxx]; )
- *sp++ = ' ';
- win->_y[win->_maxy - 1] = temp;
- win->_cury--;
+
+ getyx(win, oy, ox);
+ wmove(win, 0, 0);
+ wdeleteln(win);
+ wmove(win, oy, ox);
+
if (win == curscr) {
- putchar('\n');
+ _putchar('\n');
if (!NONL)
win->_curx = 0;
# ifdef DEBUG
fprintf(outf, "SCROLL: win == curscr\n");
# endif
}
-# ifdef DEBUG
- else
- fprintf(outf, "SCROLL: win [0%o] != curscr [0%o]\n",win,curscr);
-# endif
- touchwin(win);
- return OK;
}