home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / printing / ghostscrip / source / _gs / c / gsconfig < prev    next >
Encoding:
Text File  |  1991-06-21  |  1.0 KB  |  43 lines

  1. /* This program does the same as the shell script "gsconfig" */
  2. /* It is written for the Acorn Archimedes version of GhostScript */
  3. /* It does *not* handle .dev files at present */
  4. /* Nor does it do sorting or uniq-ing */
  5. /* Why this couldn't have been built into GS, rather than using
  6.    system specific scripts, I don't know. */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11.  
  12. int main(int argc, char *argv[])
  13. {
  14.     FILE *out;
  15.     int i;
  16.  
  17.     if ((out = fopen("h.gconfig", "w")) == NULL)
  18.     {
  19.         printf("Failed to open h.gconfig");
  20.         exit(1);
  21.     }
  22.  
  23.     for (i = 1 ; argv[i] != NULL && strcmp(argv[i],"+") != 00 ; i++)
  24.         fprintf(out, "d(gs_%s_device)\n", argv[i]);
  25.  
  26.     fclose(out);
  27.  
  28.     if (strcmp(argv[i], "+") == 0)
  29.     {
  30.         if ((out = fopen("ps.gconfig", "w")) == NULL)
  31.         {
  32.             printf("Failed to open ps.gconfig");
  33.             exit(1);
  34.         }
  35.  
  36.         for (i += 1 ; argv[i] != NULL ; i++)
  37.             fprintf(out, "gs_%s.ps)\n", argv[i]);
  38.         fclose(out);
  39.     }
  40.  
  41.     return 0;
  42. }
  43.