home *** CD-ROM | disk | FTP | other *** search
- /*
- DCREATE.C: Program to create a Text file from an alias file
-
- By:
-
- James W. McMann
- San Jose, Calif.
-
-
- Inspired by the program ACREATE by Howard Cripe.
-
- */
-
- #include <bdscio.h>
-
- char ibuf[BUFSIZ], obuf[BUFSIZ], file_name[40], command[256];
- int c, i;
-
- main(argc, argv)
- char **argv;
-
- {
- if (argc != 3)
- {
- printf("Usage: A>dcreate <alias_file> <output_file> <cr> \n");
- exit();
- }
-
- if (fopen(argv[1], ibuf) == ERROR)
- {
- printf("Can't open alias file %s\n", argv[1]);
- exit();
- }
- for (i=0; i < 28; i++)
- getc(ibuf);
-
- for (i=0; i < 256; i++)
- command[i] = getc(ibuf);
-
- command[i]=0;
-
- fabort(ibuf);
-
-
- if (fcreat(argv[2], obuf) == ERROR)
- {
- printf("Can't create %s\n", argv[2]);
- exit();
- }
-
-
- for (i=0; i < 256; i++)
- {
- if (command[i] == 59)
- {
- putc(13, obuf);
- command[i]=10;
- }
- if (command[i] == 0)
- {
- i=256;
- command[i]=CPMEOF;
- }
-
- putc(command[i], obuf);
-
- }
-
- fclose(obuf);
- printf("\n** Done **\n\n");
-
- }
-
- [i]=CPMEOF;
- }
-
- putc(command[i], obuf);
-
- }
-
- fclose(obuf);
- printf("\n** Done