home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <dir.h>
- #include <dos.h>
-
- void main()
- {
- unsigned n;
- printf("unsigned char filename_character[256] = \n{\n");
- for (n=0; n<256; n++)
- {
- static char name[] = "(?).&X&";
- int h;
- name[1] = n;
- h = _creat(name, 0);
- if (h<0) printf(" 0");
- else
- {
- struct ffblk f;
- unsigned c;
- _close(h);
- findfirst("(?).&X&", &f, 0);
- c = f.ff_name[1]&0xFF;
- printf(c=='\\' || c=='\'' ? " '\\%c'" : ' '<=c && c<='~' ?
- " '%c'" : " %d", c);
- unlink(name);
- }
- if (n!=255) putchar(',');
- putchar('\n');
- }
- printf("};\n");
- }