moved edit procedure here, changed it to use "sourcepath",
[unix-history] / usr / src / old / tbl / ti.c
CommitLineData
7e959822
BS
1/* ti.c 4.1 83/02/12 */
2
3 /* ti.c: classify line intersections */
4# include "t..c"
5/* determine local environment for intersections */
6interv(i,c)
7{
8int ku, kl;
9if (c>=ncol || c == 0)
10 {
11 if (dboxflg)
12 {
13 if (i==0) return(BOT);
14 if (i>=nlin) return(TOP);
15 return(THRU);
16 }
17 if (c>=ncol)
18 return(0);
19 }
20ku = i>0 ? lefdata(i-1,c) : 0;
21if (i+1 >= nlin)
22 kl=0;
23else
24kl = lefdata(allh(i) ? i+1 : i, c);
25if (ku==2 && kl==2) return(THRU);
26if (ku ==2) return(TOP);
27if (kl==BOT) return(2);
28return(0);
29}
30interh(i,c)
31{
32int kl, kr;
33if (fullbot[i]== '=' || (dboxflg && (i==0 || i>= nlin-1)))
34 {
35 if (c==ncol)
36 return(LEFT);
37 if (c==0)
38 return(RIGHT);
39 return(THRU);
40 }
41if (i>=nlin) return(0);
42kl = c>0 ? thish (i,c-1) : 0;
43if (kl<=1 && i>0 && allh(up1(i)))
44 kl = c>0 ? thish(up1(i),c-1) : 0;
45kr = thish(i,c);
46if (kr<=1 && i>0 && allh(up1(i)))
47 kr = c>0 ? thish(up1(i), c) : 0;
48if (kl== '=' && kr == '=') return(THRU);
49if (kl== '=') return(LEFT);
50if (kr== '=') return(RIGHT);
51return(0);
52}
53up1(i)
54{
55i--;
56while (instead[i] && i>0) i--;
57return(i);
58}