4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / lib / libcurses / overwrite.c
index 2d3aaae..04369b5 100644 (file)
@@ -6,11 +6,12 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)overwrite.c        5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)overwrite.c        5.14 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <ctype.h>
 #include <curses.h>
 #endif /* not lint */
 
 #include <ctype.h>
 #include <curses.h>
+#include <string.h>
 
 /*
  * overwrite --
 
 /*
  * overwrite --
@@ -21,26 +22,28 @@ overwrite(win1, win2)
        register WINDOW *win1, *win2;
 {
        register int x, y, endy, endx, starty, startx;
        register WINDOW *win1, *win2;
 {
        register int x, y, endy, endx, starty, startx;
-       register char *sp, *end;
 
 #ifdef DEBUG
 
 #ifdef DEBUG
-       __TRACE("overwrite: (%0.2o, %0.2o);\n", win1, win2);
+       __CTRACE("overwrite: (%0.2o, %0.2o);\n", win1, win2);
 #endif
 #endif
-       starty = max(win1->_begy, win2->_begy);
-       startx = max(win1->_begx, win2->_begx);
-       endy = min(win1->_maxy + win1->_begy, win2->_maxy + win2->_begx);
-       endx = min(win1->_maxx + win1->_begx, win2->_maxx + win2->_begx);
+       starty = max(win1->begy, win2->begy);
+       startx = max(win1->begx, win2->begx);
+       endy = min(win1->maxy + win1->begy, win2->maxy + win2->begx);
+       endx = min(win1->maxx + win1->begx, win2->maxx + win2->begx);
        if (starty >= endy || startx >= endx)
                return (OK);
 #ifdef DEBUG
        if (starty >= endy || startx >= endx)
                return (OK);
 #ifdef DEBUG
-       __TRACE("overwrite: from (%d, %d) to (%d, %d)\n",
+       __CTRACE("overwrite: from (%d, %d) to (%d, %d)\n",
            starty, startx, endy, endx);
 #endif
        x = endx - startx;
        for (y = starty; y < endy; y++) {
            starty, startx, endy, endx);
 #endif
        x = endx - startx;
        for (y = starty; y < endy; y++) {
-               bcopy(&win1->_y[y - win1->_begy][startx - win1->_begx],
-                   &win2->_y[y - win2->_begy][startx - win2->_begx], x);
-               touchline(win2, y, startx - win2->_begx, endx - win2->_begx);
+               (void)memcpy(
+                   &win2->lines[y - win2->begy]->line[startx - win2->begx], 
+                   &win1->lines[y - win1->begy]->line[startx - win1->begx],
+                   x * __LDATASIZE);
+               __touchline(win2, y, startx - win2->begx, endx - win2->begx,
+                   0);
        }
        return (OK);
 }
        }
        return (OK);
 }