Commit | Line | Data |
---|---|---|
87c6fcf8 DF |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | */ | |
6 | ||
7 | #ifndef lint | |
8 | static char sccsid[] = "@(#)scroll.c 5.1 (Berkeley) %G%"; | |
9 | #endif not lint | |
10 | ||
064c6fd5 KA |
11 | # include "curses.ext" |
12 | ||
13 | /* | |
14 | * This routine scrolls the window up a line. | |
15 | * | |
064c6fd5 KA |
16 | */ |
17 | scroll(win) | |
9a23ad49 JB |
18 | register WINDOW *win; |
19 | { | |
20 | register int oy, ox; | |
064c6fd5 | 21 | |
9a23ad49 JB |
22 | # ifdef DEBUG |
23 | fprintf(outf, "SCROLL(%0.2o)\n", win); | |
24 | # endif | |
064c6fd5 KA |
25 | |
26 | if (!win->_scroll) | |
27 | return ERR; | |
9a23ad49 JB |
28 | |
29 | getyx(win, oy, ox); | |
30 | wmove(win, 0, 0); | |
31 | wdeleteln(win); | |
32 | wmove(win, oy, ox); | |
33 | ||
064c6fd5 | 34 | if (win == curscr) { |
b1e78d21 | 35 | _putchar('\n'); |
064c6fd5 KA |
36 | if (!NONL) |
37 | win->_curx = 0; | |
38 | # ifdef DEBUG | |
39 | fprintf(outf, "SCROLL: win == curscr\n"); | |
064c6fd5 | 40 | # endif |
a26deb78 | 41 | } |
064c6fd5 | 42 | } |