2 * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
17 /* tv.c: draw vertical lines */
21 drawvert(int start
, int end
, int c
, int lwid
)
24 int tp
=0, sl
, ln
, pos
, epb
, ept
, vm
;
27 /* note: nr 35 has value of 1m outside of linesize */
28 while (instead
[end
]) end
++;
29 for(ln
=0; ln
<lwid
; ln
++)
33 if (pos
!=tp
) fprintf(tabout
, "\\h'%dp'", pos
-tp
);
37 if (fullbot
[end
]|| (!instead
[end
] && allh(end
)))
40 switch (midbar(end
,c
))
43 exb
= "1v-.5m"; break;
50 switch(interh(end
, c
))
52 case THRU
: epb
-= 1; break;
53 case RIGHT
: epb
+= (ln
==0 ? 1 : -1); break;
54 case LEFT
: epb
+= (ln
==1 ? 1 : -1); break;
59 case THRU
: epb
-= 1; break;
60 case RIGHT
: case LEFT
: epb
+= 1; break;
65 while (sl
>=0 && instead
[sl
]) sl
--;
66 if (sl
>=0 && (fullbot
[sl
] || allh(sl
)))
75 ext
= ".5m"; ept
= -1; break;
82 else if (start
==0 && allh(0))
88 switch(interh(start
,c
))
90 case THRU
: ept
+= 1; break;
91 case LEFT
: ept
+= (ln
==0 ? 1 : -1); break;
92 case RIGHT
: ept
+= (ln
==1 ? 1 : -1); break;
95 switch(interh(start
,c
))
97 case THRU
: ept
+= 1; break;
98 case LEFT
: case RIGHT
: ept
-= 1; break;
101 fprintf(tabout
, "\\v'%s'", exb
);
103 fprintf(tabout
, "\\v'%dp'", epb
);
104 fprintf(tabout
, "\\s\\n(%d",LSIZE
);
106 fprintf(tabout
, "\\v'-\\n(%dp/6u'", LSIZE
);
107 fprintf(tabout
, "\\h'-\\n(#~u'"); /* adjustment for T450 nroff boxes */
108 fprintf(tabout
, "\\L'|\\n(#%cu-%s", linestop
[start
]+'a'-1, vm
=='v'? "1v" : "\\n(35u");
110 fprintf(tabout
, "-(%s)",ext
);
112 fprintf(tabout
, "-(%s)", exb
);
115 fprintf(tabout
, "%s%dp", pos
>=0? "+" : "", pos
);
116 /* the string #d is either "nl" or ".d" depending
117 on diversions; on GCOS not the same */
118 fprintf(tabout
, "'\\s0\\v'\\n(\\*(#du-\\n(#%cu+%s", linestop
[start
]+'a'-1,vm
=='v' ? "1v" : "\\n(35u");
120 fprintf(tabout
, "+%s",ext
);
122 fprintf(tabout
, "%s%dp", (-ept
)>0 ? "+" : "", (-ept
));
123 fprintf(tabout
, "'");
125 fprintf(tabout
, "\\v'\\n(%dp/6u'", LSIZE
);
140 midbcol(int i
, int c
)
143 while ( (ct
=ctype(i
,c
)) == 's')
145 if (ct
=='-' || ct
== '=')
147 if (ct
=barent(table
[i
][c
].col
))
155 if (s
==0) return (1);
156 if (!point(s
)) return(1);
157 if (s
[0]== '\\') s
++;