Annotation of 43BSD/usr.lib/libcurses/mvwin.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1980 Regents of the University of California.
                      3:  * All rights reserved.  The Berkeley software License Agreement
                      4:  * specifies the terms and conditions for redistribution.
                      5:  */
                      6: 
                      7: #ifndef lint
                      8: static char sccsid[] = "@(#)mvwin.c    5.1 (Berkeley) 6/7/85";
                      9: #endif not lint
                     10: 
                     11: # include      "curses.ext"
                     12: 
                     13: /*
                     14:  * relocate the starting position of a window
                     15:  *
                     16:  */
                     17: 
                     18: mvwin(win, by, bx)
                     19: reg WINDOW     *win;
                     20: reg int                by, bx; {
                     21: 
                     22:        register WINDOW *orig;
                     23:        register int    dy, dx;
                     24: 
                     25:        if (by + win->_maxy > LINES || bx + win->_maxx > COLS)
                     26:                return ERR;
                     27:        dy = by - win->_begy;
                     28:        dx = bx - win->_begx;
                     29:        orig = win->_orig;
                     30:        if (orig == NULL) {
                     31:                orig = win;
                     32:                do {
                     33:                        win->_begy += dy;
                     34:                        win->_begx += dx;
                     35:                        _swflags_(win);
                     36:                        win = win->_nextp;
                     37:                } while (win != orig);
                     38:        }
                     39:        else {
                     40:                if (by < orig->_begy || win->_maxy + dy > orig->_maxy)
                     41:                        return ERR;
                     42:                if (bx < orig->_begx || win->_maxx + dx > orig->_maxx)
                     43:                        return ERR;
                     44:                win->_begy = by;
                     45:                win->_begx = bx;
                     46:                _swflags_(win);
                     47:                _set_subwin_(orig, win);
                     48:        }
                     49:        touchwin(win);
                     50:        return OK;
                     51: }

unix.superglobalmegacorp.com

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