1: # include   "curses.ext"
   2: 
   3: /*
   4:  *	This routine erases everything on the window.
   5:  *
   6:  * 1/27/81 (Berkeley) @(#)erase.c	1.2
   7:  */
   8: werase(win)
   9: reg WINDOW  *win; {
  10: 
  11:     reg int     y;
  12:     reg char    *sp, *end, *start, *maxx;
  13:     reg int     minx;
  14: 
  15: # ifdef DEBUG
  16:     fprintf(outf, "WERASE(%0.2o)\n", win);
  17: # endif
  18:     for (y = 0; y < win->_maxy; y++) {
  19:         minx = _NOCHANGE;
  20:         start = win->_y[y];
  21:         end = &start[win->_maxx];
  22:         for (sp = start; sp < end; sp++)
  23:             if (*sp != ' ') {
  24:                 maxx = sp;
  25:                 if (minx == _NOCHANGE)
  26:                     minx = sp - start;
  27:                 *sp = ' ';
  28:             }
  29:         if (minx != _NOCHANGE) {
  30:             if (win->_firstch[y] > minx
  31:                  || win->_firstch[y] == _NOCHANGE)
  32:                 win->_firstch[y] = minx;
  33:             if (win->_lastch[y] < maxx - win->_y[y])
  34:                 win->_lastch[y] = maxx - win->_y[y];
  35:         }
  36:     }
  37:     win->_curx = win->_cury = 0;
  38: }

Defined functions

Last modified: 1983-05-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 672
Valid CSS Valid XHTML 1.0 Strict