1 /* by tino@augsburg.net
\r
16 if ((dir=opendir("."))==0)
\r
22 while ((dp=readdir(dir))!=0)
\r
26 len = strlen(dp->d_name);
\r
29 if (strcmp(dp->d_name+len-4, ".TST"))
\r
33 fprintf(stderr, "warning: %s\n", dp->d_name);
\r
38 printf(" double%d\n", c);
\r
50 unsigned char map[256], upper[256], lower[256];
\r
56 printf("There are *.TST files, please remove\n");
\r
59 for (i=0; ++i<256; )
\r
67 strcpy(name, "..TST");
\r
70 if ((fd=fopen(name, "w"))==0)
\r
90 /* Uppercase characters are detected above on:
\r
91 * The character is mapped to itself and there is a
\r
92 * character which maps to it.
\r
93 * Lowercase characters are the lowest character pointing to another one.
\r
94 * Else it is a one way character.
\r
96 * For this reason we have to process the list
\r
97 * 1) for 'one way' characters
\r
98 * 'one way' is something which is no upper and no lower character.
\r
99 * This is an awful, crude and ugly hack due to missing Samba support.
\r
100 * 2) for true uppercase/lowercase characters
\r
101 * 3) for standalone characters
\r
102 * Note that there might be characters which do not fall into 1 to 3.
\r
104 printf("\n valid chars =");
\r
105 for (i=0; ++i<256; )
\r
106 if (map[i] && map[i]!=i && lower[map[i]]!=i)
\r
109 printf(" %d:%d %d:%d %d:%d", /*1*/
\r
110 map[i], i, i, map[i], map[i], map[i]);
\r
112 fprintf(stderr, "ignoring map %d->%d because of %d->%d\n",
\r
113 lower[i], i, i, map[i]);
\r
115 for (i=0; ++i<256; )
\r
116 if (map[i] && map[i]==i)
\r
118 printf(" %d:%d", lower[i], i); /*2*/
\r
120 printf(" %d", i); /*3*/
\r