From: Tom London Date: Sun, 10 Dec 1978 23:54:58 +0000 (-0500) Subject: Bell 32V development X-Git-Tag: Bell-32V~447 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/fbaebb8969da467301db34fb51827f7d7f201532?hp=2df7e96a77e9b581491b601241ab92cf030eebb9 Bell 32V development Work on file usr/src/cmd/tbl/tv.c Co-Authored-By: John Reiser Synthesized-from: 32v --- diff --git a/usr/src/cmd/tbl/tv.c b/usr/src/cmd/tbl/tv.c new file mode 100644 index 0000000000..eaf0c8b058 --- /dev/null +++ b/usr/src/cmd/tbl/tv.c @@ -0,0 +1,147 @@ + /* tv.c: draw vertical lines */ +# include "t..c" +drawvert(start,end, c, lwid) +{ +char *exb=0, *ext=0; +int tp=0, sl, ln, pos, epb, ept, vm; +end++; +vm='v'; +/* note: nr 35 has value of 1m outside of linesize */ +while (instead[end]) end++; +for(ln=0; ln1) + switch(interh(start,c)) + { + case THRU: ept += 1; break; + case LEFT: ept += (ln==0 ? 1 : -1); break; + case RIGHT: ept += (ln==1 ? 1 : -1); break; + } + else if (lwid==1) + switch(interh(start,c)) + { + case THRU: ept += 1; break; + case LEFT: case RIGHT: ept -= 1; break; + } + if (exb) + fprintf(tabout, "\\v'%s'", exb); + if (epb) + fprintf(tabout, "\\v'%dp'", epb); + fprintf(tabout, "\\s\\n(%d",LSIZE); + if (linsize) + fprintf(tabout, "\\v'-\\n(%dp/6u'", LSIZE); + fprintf(tabout, "\\h'-\\n(#~u'"); /* adjustment for T450 nroff boxes */ + fprintf(tabout, "\\L'|\\n(#%cu-%s", linestop[start]+'a'-1, vm=='v'? "1v" : "\\n(35u"); + if (ext) + fprintf(tabout, "-(%s)",ext); + if (exb) + fprintf(tabout, "-(%s)", exb); + pos = ept-epb; + if (pos) + fprintf(tabout, "%s%dp", pos>=0? "+" : "", pos); + /* the string #d is either "nl" or ".d" depending + on diversions; on GCOS not the same */ + fprintf(tabout, "'\\s0\\v'\\n(\\*(#du-\\n(#%cu+%s", linestop[start]+'a'-1,vm=='v' ? "1v" : "\\n(35u"); + if (ext) + fprintf(tabout, "+%s",ext); + if (ept) + fprintf(tabout, "%s%dp", (-ept)>0 ? "+" : "", (-ept)); + fprintf(tabout, "'"); + if (linsize) + fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE); + } +} + + +midbar(i,c) +{ +int k; +k = midbcol(i,c); +if (k==0 && c>0) + k = midbcol(i, c-1); +return(k); +} +midbcol(i,c) +{ +int ct; +while ( (ct=ctype(i,c)) == 's') + c--; +if (ct=='-' || ct == '=') + return(ct); +if (ct=barent(table[i][c].col)) + return(ct); +return(0); +} + +barent(s) + char *s; +{ +if (s==0) return (1); +if (s[0]== '\\') s++; +if (s[1]!= 0) + return(0); +switch(s[0]) + { + case '_': + return('-'); + case '=': + return('='); + } +return(0); +}