1: #ifndef lint
   2: static char sccsid[] = "@(#)tv.c	4.3 8/11/83";
   3: #endif
   4: 
   5:  /* tv.c: draw vertical lines */
   6: # include "t..c"
   7: drawvert(start,end, c, lwid)
   8: {
   9: char *exb=0, *ext=0;
  10: int tp=0, sl, ln, pos, epb, ept, vm;
  11: end++;
  12: vm='v';
  13: /* note: nr 35 has value of 1m outside of linesize */
  14: while (instead[end]) end++;
  15: for(ln=0; ln<lwid; ln++)
  16:     {
  17:     epb=ept=0;
  18:     pos = 2*ln-lwid+1;
  19:     if (pos!=tp) fprintf(tabout, "\\h'%dp'", pos-tp);
  20:     tp = pos;
  21:     if (end<nlin)
  22:         {
  23:         if (fullbot[end]|| (!instead[end] && allh(end)))
  24:             epb=2;
  25:         else
  26:         switch (midbar(end,c))
  27:             {
  28:             case '-':
  29:             exb = "1v-.5m"; break;
  30:             case '=':
  31:             exb = "1v-.5m";
  32:             epb = 1; break;
  33:             }
  34:         }
  35:     if (lwid>1)
  36:     switch(interh(end, c))
  37:         {
  38:         case THRU: epb -= 1; break;
  39:         case RIGHT: epb += (ln==0 ? 1 : -1); break;
  40:         case LEFT: epb += (ln==1 ? 1 : -1); break;
  41:         }
  42:     if (lwid==1)
  43:     switch(interh(end,c))
  44:         {
  45:         case THRU: epb -= 1; break;
  46:         case RIGHT: case LEFT: epb += 1; break;
  47:         }
  48:     if (start>0)
  49:         {
  50:         sl = start-1;
  51:         while (sl>=0 && instead[sl]) sl--;
  52:         if (sl>=0 && (fullbot[sl] || allh(sl)))
  53:             ept=0;
  54:         else
  55:         if (sl>=0)
  56:         switch(midbar(sl,c))
  57:             {
  58:             case '-':
  59:             ext = ".5m"; break;
  60:             case '=':
  61:             ext= ".5m"; ept = -1; break;
  62:             default:
  63:                 vm = 'm'; break;
  64:             }
  65:         else
  66:             ept = -4;
  67:         }
  68:     else if (start==0 && allh(0))
  69:         {
  70:         ept=0;
  71:         vm = 'm';
  72:         }
  73:     if (lwid>1)
  74:         switch(interh(start,c))
  75:             {
  76:             case THRU: ept += 1; break;
  77:             case LEFT: ept += (ln==0 ? 1 : -1); break;
  78:             case RIGHT: ept += (ln==1 ? 1 : -1); break;
  79:             }
  80:     else if (lwid==1)
  81:         switch(interh(start,c))
  82:             {
  83:             case THRU: ept += 1; break;
  84:             case LEFT: case RIGHT: ept -= 1; break;
  85:             }
  86:     if (exb)
  87:         fprintf(tabout, "\\v'%s'", exb);
  88:     if (epb)
  89:         fprintf(tabout, "\\v'%dp'", epb);
  90:     fprintf(tabout, "\\s\\n(%d",LSIZE);
  91:     if (linsize)
  92:         fprintf(tabout, "\\v'-\\n(%dp/6u'", LSIZE);
  93:     fprintf(tabout, "\\h'-\\n(#~u'"); /* adjustment for T450 nroff boxes */
  94:     fprintf(tabout, "\\L'|\\n(#%cu-%s", linestop[start]+'a'-1, vm=='v'? "1v" : "\\n(35u");
  95:     if (ext)
  96:         fprintf(tabout, "-(%s)",ext);
  97:     if (exb)
  98:         fprintf(tabout, "-(%s)", exb);
  99:     pos = ept-epb;
 100:     if (pos)
 101:         fprintf(tabout, "%s%dp", pos>=0? "+" : "", pos);
 102:     /* the string #d is either "nl" or ".d" depending
 103: 	   on diversions; on GCOS not the same */
 104:     fprintf(tabout, "'\\s0\\v'\\n(\\*(#du-\\n(#%cu+%s", linestop[start]+'a'-1,vm=='v' ? "1v" : "\\n(35u");
 105:     if (ext)
 106:         fprintf(tabout, "+%s",ext);
 107:     if (ept)
 108:         fprintf(tabout, "%s%dp", (-ept)>0 ? "+" : "", (-ept));
 109:     fprintf(tabout, "'");
 110:     if (linsize)
 111:         fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE);
 112:     }
 113: }
 114: 
 115: 
 116: midbar(i,c)
 117: {
 118: int k;
 119: k = midbcol(i,c);
 120: if (k==0 && c>0)
 121:     k = midbcol(i, c-1);
 122: return(k);
 123: }
 124: midbcol(i,c)
 125: {
 126: int ct;
 127: while ( (ct=ctype(i,c)) == 's')
 128:     c--;
 129: if (ct=='-' || ct == '=')
 130:     return(ct);
 131: if (ct=barent(table[i][c].col))
 132:     return(ct);
 133: return(0);
 134: }
 135: 
 136: barent(s)
 137:     char *s;
 138: {
 139: if (s==0) return (1);
 140: if (!point(s)) return(1);
 141: if (s[0]== '\\') s++;
 142: if (s[1]!= 0)
 143:     return(0);
 144: switch(s[0])
 145:     {
 146:     case '_':
 147:         return('-');
 148:     case '=':
 149:         return('=');
 150:     }
 151: return(0);
 152: }

Defined functions

barent defined in line 136; used 4 times
drawvert defined in line 7; used 4 times
midbar defined in line 116; used 2 times
midbcol defined in line 124; used 2 times

Defined variables

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