|
|
1.1 ! root 1: # include "curses.ext" ! 2: /* @(#) overwrite.c: 1.1 10/15/83 (1.2 4/7/82) */ ! 3: ! 4: # define min(a,b) (a < b ? a : b) ! 5: ! 6: /* ! 7: * This routine writes win1 on win2 destructively. ! 8: * ! 9: * 1/26/81 (Berkeley) @(#)overwrite.c 1.1 ! 10: */ ! 11: overwrite(win1, win2) ! 12: reg WINDOW *win1, *win2; { ! 13: ! 14: reg int x, y, minx, miny, starty; ! 15: ! 16: # ifdef DEBUG ! 17: if(outf) fprintf(outf, "OVERWRITE(0%o, 0%o);\n", win1, win2); ! 18: # endif ! 19: miny = min(win1->_maxy, win2->_maxy); ! 20: minx = min(win1->_maxx, win2->_maxx); ! 21: # ifdef DEBUG ! 22: if(outf) fprintf(outf, "OVERWRITE:\tminx = %d, miny = %d\n", minx, miny); ! 23: # endif ! 24: starty = win1->_begy - win2->_begy; ! 25: for (y = 0; y < miny; y++) ! 26: if (wmove(win2, y + starty, 0) != ERR) ! 27: for (x = 0; x < minx; x++) ! 28: waddch(win2, win1->_y[y][x]); ! 29: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.