date and time created 81/01/26 17:02:57 by arnold
authorKen Arnold <arnold@ucbvax.Berkeley.EDU>
Tue, 27 Jan 1981 09:02:57 +0000 (01:02 -0800)
committerKen Arnold <arnold@ucbvax.Berkeley.EDU>
Tue, 27 Jan 1981 09:02:57 +0000 (01:02 -0800)
SCCS-vsn: lib/libcurses/insertln.c 1.1

usr/src/lib/libcurses/insertln.c [new file with mode: 0644]

diff --git a/usr/src/lib/libcurses/insertln.c b/usr/src/lib/libcurses/insertln.c
new file mode 100644 (file)
index 0000000..f05aed1
--- /dev/null
@@ -0,0 +1,27 @@
+# include      "curses.ext"
+
+/*
+ *     This routine performs an insert-line on the window, leaving
+ * (_cury,_curx) unchanged.
+ *
+ * %G% (Berkeley) @(#)insertln.c       1.1
+ */
+winsertln(win)
+reg WINDOW     *win; {
+
+       reg char        *temp;
+       reg int         y;
+       reg char        *end;
+
+       temp = win->_y[win->_cury];
+       win->_firstch[win->_cury] = 0;
+       win->_lastch[win->_cury] = win->_maxx - 1;
+       for (y = win->_maxy - 1; y > win->_cury; --y) {
+               win->_y[y] = win->_y[y-1];
+               win->_firstch[y] = 0;
+               win->_lastch[y] = win->_maxx - 1;
+       }
+       for (end = &temp[win->_maxx]; temp < end; )
+               *temp++ = ' ';
+       return OK;
+}