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

1.1       root        1: /*     @(#) _scrdown.c: 1.1 10/15/83   (1.9    10/27/82)       */
                      2: 
                      3: #include "curses.ext"
                      4: 
                      5: /*
                      6:  * Scroll the screen down (e.g. in the normal direction of text) one line
                      7:  * physically, and update the internal notion of what's on the screen
                      8:  * (SP->cur_body) to know about this.  Do it in such a way that we will
                      9:  * realize this has been done later and take advantage of it.
                     10:  */
                     11: _scrdown()
                     12: {
                     13:        struct line *old_d, *old_p;
                     14:        register int i, l=lines;
                     15: 
                     16: #ifdef DEBUG
                     17:        if(outf)
                     18:        {
                     19:                fprintf(outf, "_scrdown()\n");
                     20:                fprintf( outf, "\tDoing _pos( %d, 0 )\n", lines - 1 );
                     21:                fprintf( outf, "\tDoing _scrollf(1)\n" );
                     22:        }
                     23: #endif
                     24: 
                     25:        /* physically... */
                     26:        _pos(lines-1, 0);
                     27:        _scrollf(1);
                     28: 
                     29:        /* internally */
                     30:        old_d = SP->std_body[1];
                     31:        old_p = SP->cur_body[1];
                     32: #ifdef DEBUG
                     33:        if(outf)
                     34:        {
                     35:                fprintf( outf, "lines = l = %d\n", l );
                     36:        }
                     37: #endif DEBUG
                     38: 
                     39:        for( i=1; i<=l; i++ )
                     40:        {
                     41:                SP->std_body[i] = SP->std_body[i+1];
                     42:                SP->cur_body[i] = SP->cur_body[i+1];
                     43:        }
                     44:        SP->std_body[1] = NULL;
                     45:        SP->cur_body[1] = NULL;
                     46:        _line_free(old_d);
                     47:        if( old_d != old_p )
                     48:        {
                     49:                _line_free(old_p);
                     50:        }
                     51: }

unix.superglobalmegacorp.com

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