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

1.1       root        1: /*     @(#) _dellines.c: 1.1 10/15/83  (1.21   2/11/83)        */
                      2: 
                      3: #include "curses.ext"
                      4: 
                      5: char *tparm();
                      6: 
                      7: extern int     _outch();
                      8: 
                      9: _dellines (n)
                     10: {
                     11:        register int i;
                     12: 
                     13: #ifdef DEBUG
                     14:        if(outf) fprintf(outf, "_dellines(%d).\n", n);
                     15: #endif
                     16:        if (lines - SP->phys_y <= n && (clr_eol && n == 1 || clr_eos)) {
                     17:                tputs(clr_eos, n, _outch);
                     18:        } else
                     19:        if (scroll_forward && SP->phys_y == SP->des_top_mgn /* &&costSF<costDL */) {
                     20:                /*
                     21:                 * Use forward scroll mode of the terminal, at
                     22:                 * the bottom of the window.  Linefeed works
                     23:                 * too, since we only use it from the bottom line.
                     24:                 */
                     25:                _setwind();
                     26:                for (i = n; i > 0; i--) {
                     27:                        _pos(SP->des_bot_mgn, 0);
                     28:                        tputs(scroll_forward, 1, _outch);
                     29:                        SP->ml_above++;
                     30:                }
                     31:                if (SP->ml_above + lines > lines_of_memory)
                     32:                        SP->ml_above = lines_of_memory - lines;
                     33:        } else if (parm_delete_line && (n>1 || *delete_line==0)) {
                     34:                tputs(tparm(parm_delete_line, n, SP->phys_y), lines-SP->phys_y, _outch);
                     35:        }
                     36:        else if (change_scroll_region && *delete_line==0) {
                     37:                /* vt100: fake delete_line by changing scrolling region */
                     38:                /* Save since change_scroll_region homes cursor */
                     39:                tputs(save_cursor, 1, _outch);
                     40:                tputs(tparm(change_scroll_region,
                     41:                        SP->phys_y, SP->des_bot_mgn), 1, _outch);
                     42:                /* go to bottom left corner.. */
                     43:                tputs(tparm(cursor_address, SP->des_bot_mgn, 0), 1, _outch);
                     44:                for (i=0; i<n; i++)     /* .. and scroll n times */
                     45:                        tputs(scroll_forward, 1, _outch);
                     46:                /* restore scrolling region */
                     47:                tputs(tparm(change_scroll_region,
                     48:                        SP->des_top_mgn, SP->des_bot_mgn), 1, _outch);
                     49:                tputs(restore_cursor, 1, _outch);       /* put SP->curptr back */
                     50:                SP->phys_top_mgn = SP->des_top_mgn;
                     51:                SP->phys_bot_mgn = SP->des_bot_mgn;
                     52:        }
                     53:        else {
                     54:                for (i = 0; i < n; i++)
                     55:                        tputs(delete_line, lines-SP->phys_y, _outch);
                     56:        }
                     57: }

unix.superglobalmegacorp.com

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