makeline(i,c,lintype) { int cr, type, shortl; type = thish(i,c); if (type==0) return; cr=c; shortl = (table[i][c].col[0]=='\\'); if (c>0 && !shortl && thish(i,c-1) == type)return; if (shortl==0) for(cr=c; cr < ncol && (ctype(i,cr)=='s'||type==thish(i,cr)); cr++); else for(cr=c+1; cr<ncol && ctype(i,cr)=='s'; cr++); drawline(i, c, cr-1, lintype, 0, shortl); }
int thish(int i, int c) { int t; char *s; struct colstr *pc; if (c<0)return(0); if (i<0) return(0); t = ctype(i,c); if (t=='_' || t == '-') return('-'); if (t=='=')return('='); if (t=='^') return(1); if (fullbot[i] ) return(fullbot[i]); if (t=='s') return(thish(i,c-1)); if (t==0) return(1); pc = &table[i][c]; s = (t=='a' ? pc->rcol : pc->col); if (s==0 || (point(s) && *s==0)) return(1); if (vspen(s)) return(1); if (t=barent( s)) return(t); return(0); }
int lefdata(int i, int c) { int ck; if (i >= nlin) i = nlin - 1; if (ctype(i, c) == 's') { for (ck = c; ctype(i, ck) == 's'; ck--) ; if (thish(i, ck) == 0) return(0); } i = stynum[i]; i = lefline[c][i]; if (i > 0) return(i); if (dboxflg && c == 0) return(2); if (allflg) return(1); if (boxflg && c == 0) return(1); return(0); }
interh(i,c) { int kl, kr; if (fullbot[i]== '=' || (dboxflg && (i==0 || i>= nlin-1))) { if (c==ncol) return(LEFT); if (c==0) return(RIGHT); return(THRU); } if (i>=nlin) return(0); kl = c>0 ? thish (i,c-1) : 0; if (kl<=1 && i>0 && allh(up1(i))) kl = c>0 ? thish(up1(i),c-1) : 0; kr = thish(i,c); if (kr<=1 && i>0 && allh(up1(i))) kr = c>0 ? thish(up1(i), c) : 0; if (kl== '=' && kr == '=') return(THRU); if (kl== '=') return(LEFT); if (kr== '=') return(RIGHT); return(0); }
int allh(int i) { /* return true if every element in line i is horizontal */ /* also at least one must be horizontl */ int c, one, k; if (fullbot[i]) return(1); for(one=c=0; c<ncol; c++) { k = thish(i,c); if (k==0) return(0); if (k==1) continue; one=1; } return(one); }