1: #ifndef lint
   2: static char sccsid[] = "@(#)wwadd.c	3.9 4/24/85";
   3: #endif
   4: 
   5: /*
   6:  * Copyright (c) 1983 Regents of the University of California,
   7:  * All rights reserved.  Redistribution permitted subject to
   8:  * the terms of the Berkeley Software License Agreement.
   9:  */
  10: 
  11: #include "ww.h"
  12: 
  13: /*
  14:  * Stick w1 behind w2.
  15:  */
  16: wwadd(w1, w2)
  17: register struct ww *w1;
  18: struct ww *w2;
  19: {
  20:     register i;
  21:     register struct ww *w;
  22: 
  23:     w1->ww_order = w2->ww_order + 1;
  24:     w1->ww_back = w2;
  25:     w1->ww_forw = w2->ww_forw;
  26:     w2->ww_forw->ww_back = w1;
  27:     w2->ww_forw = w1;
  28: 
  29:     for (w = w1->ww_forw; w != &wwhead; w = w->ww_forw)
  30:         w->ww_order++;
  31:     for (i = w1->ww_i.t; i < w1->ww_i.b; i++) {
  32:         register j;
  33:         register char *smap = wwsmap[i];
  34:         register char *win = w1->ww_win[i];
  35:         union ww_char *ns = wwns[i];
  36:         union ww_char *buf = w1->ww_buf[i];
  37:         int nvis = 0;
  38:         int nchanged = 0;
  39: 
  40:         for (j = w1->ww_i.l; j < w1->ww_i.r; j++) {
  41:             w = wwindex[smap[j]];
  42:             if (w1->ww_order > w->ww_order)
  43:                 continue;
  44:             if (win[j] & WWM_GLS)
  45:                 continue;
  46:             if (w != &wwnobody && w->ww_win[i][j] == 0)
  47:                 w->ww_nvis[i]--;
  48:             smap[j] = w1->ww_index;
  49:             if (win[j] == 0)
  50:                 nvis++;
  51:             ns[j].c_w = buf[j].c_w ^ win[j] << WWC_MSHIFT;
  52:             nchanged++;
  53:         }
  54:         if (nchanged > 4)
  55:             wwtouched[i] |= WWU_MAJOR|WWU_TOUCHED;
  56:         else if (nchanged > 0)
  57:             wwtouched[i] |= WWU_TOUCHED;
  58:         w1->ww_nvis[i] = nvis;
  59:     }
  60: }

Defined functions

Defined variables

sccsid defined in line 2; never used
Last modified: 1987-02-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 976
Valid CSS Valid XHTML 1.0 Strict