home *** CD-ROM | disk | FTP | other *** search
- /* This program does the same as the shell script "gsconfig" */
- /* It is written for the Acorn Archimedes version of GhostScript */
- /* It does *not* handle .dev files at present */
- /* Nor does it do sorting or uniq-ing */
- /* Why this couldn't have been built into GS, rather than using
- system specific scripts, I don't know. */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- int main(int argc, char *argv[])
- {
- FILE *out;
- int i;
-
- if ((out = fopen("h.gconfig", "w")) == NULL)
- {
- printf("Failed to open h.gconfig");
- exit(1);
- }
-
- for (i = 1 ; argv[i] != NULL && strcmp(argv[i],"+") != 00 ; i++)
- fprintf(out, "d(gs_%s_device)\n", argv[i]);
-
- fclose(out);
-
- if (strcmp(argv[i], "+") == 0)
- {
- if ((out = fopen("ps.gconfig", "w")) == NULL)
- {
- printf("Failed to open ps.gconfig");
- exit(1);
- }
-
- for (i += 1 ; argv[i] != NULL ; i++)
- fprintf(out, "gs_%s.ps)\n", argv[i]);
- fclose(out);
- }
-
- return 0;
- }
-