1: # include "curses.ext"
2:
3: # define min(a,b) (a < b ? a : b)
4:
5: /*
6: * This routine writes win1 on win2 destructively.
7: *
8: * 3/27/83 (Berkeley) @(#)overwrite.c 1.3
9: */
10: overwrite(win1, win2)
11: reg WINDOW *win1, *win2; {
12:
13: reg int x, y, minx, miny, startx, starty;
14:
15: # ifdef DEBUG
16: fprintf(outf, "OVERWRITE(0%o, 0%o);\n", win1, win2);
17: # endif
18: miny = min(win1->_maxy, win2->_maxy);
19: minx = min(win1->_maxx, win2->_maxx);
20: # ifdef DEBUG
21: fprintf(outf, "OVERWRITE:\tminx = %d, miny = %d\n", minx, miny);
22: # endif
23: starty = win1->_begy - win2->_begy;
24: startx = win1->_begx - win2->_begx;
25: if (startx < 0)
26: startx = 0;
27: for (y = 0; y < miny; y++)
28: if (wmove(win2, y + starty, startx) != ERR)
29: for (x = 0; x < minx; x++)
30: waddch(win2, win1->_y[y][x]);
31: }
Defined functions
Defined macros
min
defined in line
3; used 2 times