Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/curses-v3]: src/lib/libcurses Add wscrl().
details: https://anonhg.NetBSD.org/src/rev/73bf15dd5658
branches: curses-v3
changeset: 479969:73bf15dd5658
user: jdc <jdc%NetBSD.org@localhost>
date: Sun Mar 05 23:26:50 2000 +0000
description:
Add wscrl().
diffstat:
lib/libcurses/scroll.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diffs (53 lines):
diff -r 5d03380d9edb -r 73bf15dd5658 lib/libcurses/scroll.c
--- a/lib/libcurses/scroll.c Sun Mar 05 23:26:33 2000 +0000
+++ b/lib/libcurses/scroll.c Sun Mar 05 23:26:50 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scroll.c,v 1.10 1999/04/13 14:08:19 mrg Exp $ */
+/* $NetBSD: scroll.c,v 1.10.6.1 2000/03/05 23:26:50 jdc Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)scroll.c 8.3 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: scroll.c,v 1.10 1999/04/13 14:08:19 mrg Exp $");
+__RCSID("$NetBSD: scroll.c,v 1.10.6.1 2000/03/05 23:26:50 jdc Exp $");
#endif
#endif /* not lint */
@@ -52,18 +52,32 @@
scroll(win)
WINDOW *win;
{
+ return(wscrl(win, 1));
+}
+
+/*
+ * wscrl --
+ * Scroll a window n lines - up if n is positive, down if n is negative.
+ */
+int
+wscrl(win, lines)
+ WINDOW *win;
+ int lines;
+{
int oy, ox;
#ifdef DEBUG
- __CTRACE("scroll: (%0.2o)\n", win);
+ __CTRACE("wscrl: (%0.2o) lines=%d\n", win, lines);
#endif
if (!(win->flags & __SCROLLOK))
return (ERR);
+ if (!lines)
+ return (OK);
getyx(win, oy, ox);
wmove(win, 0, 0);
- wdeleteln(win);
+ winsdelln(win, 0 - lines);
wmove(win, oy, ox);
if (win == curscr) {
Home |
Main Index |
Thread Index |
Old Index