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