Annotation of researchv10no/libcurses/overwrite.c, revision 1.1.1.1

1.1       root        1: # include      "curses.h"
                      2: 
                      3: # define       min(a,b)        (a < b ? a : b)
                      4: 
                      5: /*
                      6:  *     This routine writes win1 on win2 destructively.
                      7:  *
                      8:  * 1/26/81 (Berkeley) @(#)overwrite.c  1.1
                      9:  */
                     10: overwrite(win1, win2)
                     11: reg WINDOW     *win1, *win2; {
                     12: 
                     13:        reg int         x, y, minx, miny, 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:        for (y = 0; y < miny; y++)
                     25:                if (wmove(win2, y + starty, 0) != ERR)
                     26:                        for (x = 0; x < minx; x++)
                     27:                                waddch(win2, win1->_y[y][x]);
                     28: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.