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 /* ti.c: classify line intersections */
19 /* determine local environment for intersections */
25 if (c
>=ncol
|| c
== 0)
29 if (i
==0) return(BOT
);
30 if (i
>=nlin
) return(TOP
);
36 ku
= i
>0 ? lefdata(i
-1,c
) : 0;
40 kl
= lefdata(allh(i
) ? i
+1 : i
, c
);
41 if (ku
==2 && kl
==2) return(THRU
);
42 if (ku
==2) return(TOP
);
43 if (kl
==BOT
) return(2);
51 if (fullbot
[i
]== '=' || (dboxflg
&& (i
==0 || i
>= nlin
-1)))
59 if (i
>=nlin
) return(0);
60 kl
= c
>0 ? thish (i
,c
-1) : 0;
61 if (kl
<=1 && i
>0 && allh(up1(i
)))
62 kl
= c
>0 ? thish(up1(i
),c
-1) : 0;
64 if (kr
<=1 && i
>0 && allh(up1(i
)))
65 kr
= c
>0 ? thish(up1(i
), c
) : 0;
66 if (kl
== '=' && kr
== '=') return(THRU
);
67 if (kl
== '=') return(LEFT
);
68 if (kr
== '=') return(RIGHT
);
76 while (instead
[i
] && i
>0) i
--;