add mpool
[unix-history] / usr / src / lib / libcurses / scroll.c
CommitLineData
87c6fcf8 1/*
2f14f200
KB
2 * Copyright (c) 1981 Regents of the University of California.
3 * All rights reserved.
4 *
7e3eac84 5 * %sccs.include.redist.c%
87c6fcf8
DF
6 */
7
8#ifndef lint
7e3eac84 9static char sccsid[] = "@(#)scroll.c 5.4 (Berkeley) %G%";
2f14f200 10#endif /* not lint */
87c6fcf8 11
064c6fd5
KA
12# include "curses.ext"
13
14/*
15 * This routine scrolls the window up a line.
16 *
064c6fd5
KA
17 */
18scroll(win)
9a23ad49
JB
19register WINDOW *win;
20{
21 register int oy, ox;
064c6fd5 22
9a23ad49
JB
23# ifdef DEBUG
24 fprintf(outf, "SCROLL(%0.2o)\n", win);
25# endif
064c6fd5
KA
26
27 if (!win->_scroll)
28 return ERR;
9a23ad49
JB
29
30 getyx(win, oy, ox);
31 wmove(win, 0, 0);
32 wdeleteln(win);
33 wmove(win, oy, ox);
34
064c6fd5 35 if (win == curscr) {
b1e78d21 36 _putchar('\n');
064c6fd5
KA
37 if (!NONL)
38 win->_curx = 0;
39# ifdef DEBUG
40 fprintf(outf, "SCROLL: win == curscr\n");
064c6fd5 41# endif
a26deb78 42 }
064c6fd5 43}