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

overwrite defined in line 10; never used

Defined macros

min defined in line 3; used 2 times
Last modified: 1983-05-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 647
Valid CSS Valid XHTML 1.0 Strict