8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / tbl / tc.c
blob85a583c6363e400863fec23e10a9cf7edccae011
1 /*
2 * Copyright 1991 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
9 /*
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 /* tc.c: find character not in table to delimit fields */
18 # include "t..c"
20 void
21 choochar(void)
23 /* choose funny characters to delimit fields */
24 int had[128], ilin,icol, k;
25 char *s;
26 for(icol=0; icol<128; icol++)
27 had[icol]=0;
28 F1 = F2 = 0;
29 for(ilin=0;ilin<nlin;ilin++)
31 if (instead[ilin]) continue;
32 if (fullbot[ilin]) continue;
33 for(icol=0; icol<ncol; icol++)
35 k = ctype(ilin, icol);
36 if (k==0 || k == '-' || k == '=')
37 continue;
38 s = table[ilin][icol].col;
39 if (point(s))
40 while (*s)
42 if (*s > 0 && (unsigned char)*s <= 127)
43 had[*s++]=1;
44 else
45 s++;
47 s=table[ilin][icol].rcol;
48 if (point(s))
49 while (*s)
51 if (*s > 0 && (unsigned char)*s <= 127)
52 had[*s++]=1;
53 else
54 s++;
58 /* choose first funny character */
59 for(
60 s="\002\003\005\006\007!%&#/?,:;<=>@`^~_{}+-*ABCDEFGHIJKMNOPQRSTUVWXYZabcdefgjkoqrstwxyz";
61 *s; s++)
63 if (had[*s]==0)
65 F1= *s;
66 had[F1]=1;
67 break;
70 /* choose second funny character */
71 for(
72 s="\002\003\005\006\007:_~^`@;,<=>#%&!/?{}+-*ABCDEFGHIJKMNOPQRSTUVWXZabcdefgjkoqrstuwxyz";
73 *s; s++)
75 if (had[*s]==0)
77 F2= *s;
78 break;
81 if (F1==0 || F2==0)
82 error(gettext("couldn't find characters to use for delimiters"));
83 return;
86 int
87 point(int s)
89 return(s>= 128 || s<0);