Annotation of 43BSD/usr.bin/tbl/tc.c, revision 1.1.1.1

1.1       root        1: #ifndef lint
                      2: static char sccsid[] = "@(#)tc.c       4.2 8/11/83";
                      3: #endif
                      4: 
                      5:  /* tc.c: find character not in table to delimit fields */
                      6: # include "t..c"
                      7: choochar()
                      8: {
                      9: /* choose funny characters to delimit fields */
                     10: int had[128], ilin,icol, k;
                     11: char *s;
                     12: for(icol=0; icol<128; icol++)
                     13:        had[icol]=0;
                     14: F1 = F2 = 0;
                     15: for(ilin=0;ilin<nlin;ilin++)
                     16:        {
                     17:        if (instead[ilin]) continue;
                     18:        if (fullbot[ilin]) continue;
                     19:        for(icol=0; icol<ncol; icol++)
                     20:                {
                     21:                k = ctype(ilin, icol);
                     22:                if (k==0 || k == '-' || k == '=')
                     23:                        continue;
                     24:                s = table[ilin][icol].col;
                     25:                if (point(s))
                     26:                while (*s)
                     27:                        had[*s++]=1;
                     28:                s=table[ilin][icol].rcol;
                     29:                if (point(s))
                     30:                while (*s)
                     31:                        had[*s++]=1;
                     32:                }
                     33:        }
                     34: /* choose first funny character */
                     35: for(
                     36:        s="\002\003\005\006\007!%&#/?,:;<=>@`^~_{}+-*ABCDEFGHIJKMNOPQRSTUVWXYZabcdefgjkoqrstwxyz";
                     37:                *s; s++)
                     38:        {
                     39:        if (had[*s]==0)
                     40:                {
                     41:                F1= *s;
                     42:                had[F1]=1;
                     43:                break;
                     44:                }
                     45:        }
                     46: /* choose second funny character */
                     47: for(
                     48:        s="\002\003\005\006\007:_~^`@;,<=>#%&!/?{}+-*ABCDEFGHIJKMNOPQRSTUVWXZabcdefgjkoqrstuwxyz";
                     49:                *s; s++)
                     50:        {
                     51:        if (had[*s]==0)
                     52:                {
                     53:                F2= *s;
                     54:                break;
                     55:                }
                     56:        }
                     57: if (F1==0 || F2==0)
                     58:        error("couldn't find characters to use for delimiters");
                     59: return;
                     60: }
                     61: point(s)
                     62: {
                     63: return(s>= 128 || s<0);
                     64: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.