Annotation of researchv10no/ncurses/screen/wnoutrfrsh.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * make the current screen look like "win" over the area covered by
                      3:  * win.
                      4:  *
                      5:  * 7/9/81 (Berkeley) @(#)refresh.c     1.6
                      6:  */
                      7: 
                      8: /*     @(#) wnoutrfrsh.c: 1.1 10/15/83 (1.14   3/6/83) */
                      9: #include       "curses.ext"
                     10: 
                     11: extern WINDOW *lwin;
                     12: 
                     13: /* Put out window but don't actually update screen. */
                     14: wnoutrefresh(win)
                     15: register WINDOW        *win;
                     16: {
                     17:        register int wy, y;
                     18:        register chtype *nsp, *lch;
                     19: 
                     20: # ifdef DEBUG
                     21:        if( win == stdscr )
                     22:        {
                     23:                if(outf) fprintf(outf, "REFRESH(stdscr %x)", win);
                     24:        }
                     25:        else
                     26:        {
                     27:                if( win == curscr )
                     28:                {
                     29:                        if(outf) fprintf(outf, "REFRESH(curscr %x)", win);
                     30:                }
                     31:                else
                     32:                {
                     33:                        if(outf) fprintf(outf, "REFRESH(%d)", win);
                     34:                }
                     35:        }
                     36:        if(outf) fprintf(outf, " (win == curscr) = %d, maxy %d\n", win, (win == curscr), win->_maxy);
                     37:        if( win != curscr )
                     38:        {
                     39:                _dumpwin( win );
                     40:        }
                     41:        if(outf) fprintf(outf, "REFRESH:\n\tfirstch\tlastch\n");
                     42: # endif        DEBUG
                     43:        /*
                     44:         * initialize loop parameters
                     45:         */
                     46: 
                     47:        if( win->_clear || win == curscr || SP->doclear )
                     48:        {
                     49: # ifdef DEBUG
                     50:                if (outf) fprintf(outf, "refresh clears, win->_clear %d, curscr %d\n", win->_clear, win == curscr);
                     51: # endif        DEBUG
                     52:                SP->doclear = 1;
                     53:                win->_clear = FALSE;
                     54:                if( win != curscr )
                     55:                {
                     56:                        touchwin( win );
                     57:                }
                     58:        }
                     59: 
                     60:        if( win == curscr )
                     61:        {
                     62: #ifdef DEBUG
                     63:        if(outf) fprintf(outf, "Calling _ll_refresh(FALSE)\n" );
                     64: #endif DEBUG
                     65:                _ll_refresh(FALSE);
                     66:                return OK;
                     67:        }
                     68: #ifdef DEBUG
                     69:        if(outf) fprintf(outf, "Didn't do _ll_refresh(FALSE)\n" );
                     70: #endif DEBUG
                     71: 
                     72:        for( wy = 0; wy < win->_maxy; wy++ )
                     73:        {
                     74:                if( win->_firstch[wy] != _NOCHANGE )
                     75:                {
                     76:                        y = wy + win->_begy;
                     77:                        lch = &win->_y[wy][win->_maxx-1];
                     78:                        nsp = &win->_y[wy][0];
                     79:                        _ll_move(y, win->_begx);
                     80:                        while( nsp <= lch )
                     81:                        {
                     82:                                if( SP->virt_x++ < columns )
                     83:                                {
                     84:                                        *SP->curptr++ = *nsp++;
                     85:                                }
                     86:                                else
                     87:                                {
                     88:                                        break;
                     89:                                }
                     90:                        }
                     91:                        win->_firstch[wy] = _NOCHANGE;
                     92:                }
                     93:        }
                     94:        lwin = win;
                     95:        return OK;
                     96: }

unix.superglobalmegacorp.com

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