Annotation of 40BSD/lib/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: overwrite(win1, win2)
                      9: reg WINDOW     *win1, *win2; {
                     10: 
                     11:        reg int         x, y, minx, miny, starty;
                     12: 
                     13: # ifdef DEBUG
                     14:        fprintf(outf, "OVERWRITE(0%o, 0%o);\n", win1, win2);
                     15: # endif
                     16:        miny = min(win1->_maxy, win2->_maxy);
                     17:        minx = min(win1->_maxx, win2->_maxx);
                     18: # ifdef DEBUG
                     19:        fprintf(outf, "OVERWRITE:\tminx = %d,  miny = %d\n", minx, miny);
                     20: # endif
                     21:        starty = win1->_begy - win2->_begy;
                     22:        for (y = 0; y < miny; y++)
                     23:                if (wmove(win2, y + starty, 0) != ERR)
                     24:                        for (x = 0; x < minx; x++)
                     25:                                waddch(win2, win1->_y[y][x]);
                     26: }

unix.superglobalmegacorp.com

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