make __cputchar visible, the back compatibility stuff uses it
[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
32d9c6ee 9static char sccsid[] = "@(#)scroll.c 5.11 (Berkeley) %G%";
2f14f200 10#endif /* not lint */
87c6fcf8 11
4569b94e 12#include <curses.h>
73405ee7 13#include <termios.h>
064c6fd5
KA
14
15/*
4569b94e
KB
16 * scroll --
17 * Scroll the window up a line.
064c6fd5 18 */
4569b94e 19int
064c6fd5 20scroll(win)
4569b94e 21 register WINDOW *win;
9a23ad49 22{
4569b94e 23 register int oy, ox;
064c6fd5 24
4569b94e
KB
25#ifdef DEBUG
26 __TRACE("scroll: (%0.2o)\n", win);
27#endif
064c6fd5 28
0c5c5188 29 if (!(win->flags & __SCROLLOK))
79ec5a07 30 return (ERR);
9a23ad49
JB
31
32 getyx(win, oy, ox);
33 wmove(win, 0, 0);
34 wdeleteln(win);
35 wmove(win, oy, ox);
36
064c6fd5 37 if (win == curscr) {
4569b94e 38 putchar('\n');
32d9c6ee 39 if (__orig_termios.c_oflag & ONLCR)
0c5c5188 40 win->curx = 0;
4569b94e
KB
41#ifdef DEBUG
42 __TRACE("scroll: win == curscr\n");
43#endif
a26deb78 44 }
79ec5a07 45 return (OK);
064c6fd5 46}