home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / texmf / source / dvips / amiga / chfiles / dvips.ch < prev    next >
Encoding:
Text File  |  1995-01-07  |  5.2 KB  |  202 lines

  1. @x
  2. #ifdef AMIGA
  3. #include "amigapaths.h"
  4. #endif
  5. @y
  6. #ifdef AMIGA
  7. #include "amigapaths.h"
  8. #include "evpaths.h"
  9. #include <signal.h>
  10. void Free_EnvVars(void);
  11. void amiga_safexit(int);
  12. #endif
  13. @z
  14.  
  15. @x
  16. char *configpath = CONFIGPATH ; /* where to find config files */
  17. char *infont ;                /* is the file we are downloading a font? */
  18. @y
  19. char *configpath = CONFIGPATH ; /* where to find config files */
  20. char *infont ;                /* is the file we are downloading a font? */
  21.  
  22. struct EnvVarPath     *tfm_var    = NULL,    /* for tfm files */
  23.             *vf_var     = NULL,    /* for vf files */
  24.             *fig_var    = NULL,    /* for figure files */
  25.             *pict_var   = NULL,    /* for IFF/etc. files */
  26.             *header_var = NULL,    /* for header files */
  27.             *config_var = NULL;    /* for config files */
  28.  
  29. #ifdef FONTLIB
  30. struct EnvVarPath    *fli_var    = NULL;    /* for font libraries */
  31. #endif
  32.  
  33. @z
  34.  
  35. @x
  36.    if (*s=='!') {
  37.       if (bitfile != NULL) {
  38.          cleanprinter() ;
  39.       }
  40. @y
  41.    if (*s=='!') {
  42.       if (bitfile != NULL) {
  43.          cleanprinter() ;
  44.       }
  45.       Free_EnvVars();
  46. @z
  47.  
  48. @x
  49.    initialize() ;
  50.    checkenv(0) ;
  51. @y
  52.    config_var = Alloc_EnvVarPath("TEXCONFIG"   , 4096L);
  53.    tfm_var    = Alloc_EnvVarPath("TEXFONTS"    , 4096L);
  54.    vf_var     = Alloc_EnvVarPath("VFFONTS"     , 4096L);
  55.    pict_var   = Alloc_EnvVarPath("TEXPICTS"    , 4096L);
  56.    fig_var    = Alloc_EnvVarPath("TEXINPUTS"   , 4096L);
  57.    header_var = Alloc_EnvVarPath("DVIPSHEADERS", 4096L);
  58. #ifdef FONTLIB
  59.    fli_var    = Alloc_EnvVarPath("DVIPSFLIB", 2048L);
  60. #endif
  61.  
  62.    if (signal(SIGINT, &amiga_safexit) == SIG_ERR)
  63.       exit(EXIT_FAILURE);
  64.  
  65.    initialize() ;
  66.    checkenv(0) ;
  67. @z
  68.  
  69. @x
  70.    if (dd(D_PATHS)) {
  71. #ifdef SHORTINT
  72.         (void)fprintf(stderr,"input file %s output file %s swmem %ld\n",
  73. #else /* ~SHORTINT */
  74.            (void)fprintf(stderr,"input file %s output file %s swmem %d\n",
  75. #endif /* ~SHORTINT */
  76.            iname, oname, swmem) ;
  77.    (void)fprintf(stderr,"tfm path %s\npk path %s\n", tfmpath, pkpath) ;
  78.    (void)fprintf(stderr,"fig path %s\nvf path %s\n", figpath, vfpath) ;
  79.    (void)fprintf(stderr,"config path %s\nheader path %s\n",
  80.                   configpath, headerpath) ;
  81. #ifdef AMIGA
  82.    (void)fprintf(stderr,"pict path %s\n", pictpath);
  83. #endif
  84.  
  85. #ifdef FONTLIB
  86.    (void)fprintf(stderr,"fli path %s\nfli names %s\n", flipath, fliname) ;
  87. #endif
  88. @y
  89.    if (dd(D_PATHS)) {
  90.     int i;
  91.  
  92.         (void)fprintf(stderr,"input file %s output file %s swmem %d\n", iname, oname, swmem);
  93.  
  94.         i = 0;
  95.         (void)fprintf(stderr,"tfm path ");
  96.     while (tfm_var->storage.strings[i]) {
  97.            fprintf(stderr,"%s%s", (i==0?"":","),(tfm_var->storage.strings[i][0] == '\0' ? (unsigned char *)"." : tfm_var->storage.strings[i]));
  98.            i++;
  99.         }
  100.  
  101.         (void)fprintf(stderr,"\npk path %s", pkpath);
  102.  
  103.         i = 0;
  104.         (void)fprintf(stderr,"\nfig path ");
  105.         while (fig_var->storage.strings[i]) {
  106.            fprintf(stderr,"%s%s", (i==0?"":","),(fig_var->storage.strings[i][0] == '\0' ? (unsigned char *)"." : fig_var->storage.strings[i]));
  107.            i++;
  108.         }
  109.  
  110.         i = 0;
  111.         (void)fprintf(stderr,"\nvf path ");
  112.         while (vf_var->storage.strings[i]) {
  113.            fprintf(stderr,"%s%s", (i==0?"":","),(vf_var->storage.strings[i][0] == '\0' ? (unsigned char *)"." : vf_var->storage.strings[i]));
  114.            i++;
  115.         }
  116.  
  117.         i = 0;
  118.         (void)fprintf(stderr,"\nconfig path ");
  119.         while (config_var->storage.strings[i]) {
  120.            fprintf(stderr,"%s%s", (i==0?"":","),(config_var->storage.strings[i][0] == '\0' ? (unsigned char *)"." : config_var->storage.strings[i]));
  121.            i++;
  122.         }
  123.  
  124.         i = 0;
  125.         (void)fprintf(stderr,"\nheader path ");
  126.         while (header_var->storage.strings[i]) {
  127.            fprintf(stderr,"%s%s", (i==0?"":","),(header_var->storage.strings[i][0] == '\0' ? (unsigned char *)"." : header_var->storage.strings[i]));
  128.            i++;
  129.         }
  130.  
  131.         i = 0;
  132.         (void)fprintf(stderr,"\npict path ");
  133.         while (pict_var->storage.strings[i]) {
  134.            fprintf(stderr,"%s%s", (i==0?"":","),(pict_var->storage.strings[i][0] == '\0' ? (unsigned char *)"." : pict_var->storage.strings[i]));
  135.            i++;
  136.         }
  137.  
  138. #ifdef FONTLIB
  139.         i = 0;
  140.         (void)fprintf(stderr,"\nfli path ");
  141.         while (fli_var->storage.strings[i]) {
  142.            fprintf(stderr,"%s%s", (i==0?"":","),(fli_var->storage.strings[i][0] == '\0' ? (unsigned char *)"." : fli_var->storage.strings[i]));
  143.            i++;
  144.         }
  145.  
  146.         (void)fprintf(stderr,"\nfli names %s", fliname);
  147. #endif
  148.         (void)fprintf(stderr,"\n");
  149. @z
  150.  
  151. @x
  152.       dvifile = stdin;
  153.    else {
  154.       help() ;
  155.       exit(0) ;
  156. @y
  157.       dvifile = stdin;
  158.    else {
  159.       help() ;
  160.       Free_EnvVars();
  161.       exit(0) ;
  162. @z
  163.  
  164. @x
  165.    exit(0) ;
  166.    /*NOTREACHED*/
  167. @y
  168.    Free_EnvVars();
  169.    exit(0) ;
  170.    /*NOTREACHED*/
  171. @z
  172.  
  173. @x
  174. #ifdef MVSXA  /* IBM: MVS/XA */
  175. #include "dvipsmvs.h"
  176. #endif
  177. @y
  178.  
  179. void Free_EnvVars(void)
  180. {
  181.     Free_EnvVarPath(config_var);
  182.     Free_EnvVarPath(tfm_var);
  183.     Free_EnvVarPath(vf_var);
  184.     Free_EnvVarPath(pict_var);
  185.     Free_EnvVarPath(fig_var);
  186.     Free_EnvVarPath(header_var);
  187. #ifdef FONTLIB
  188.     Free_EnvVarPath(fli_var);
  189. #endif
  190. }
  191.  
  192. void amiga_safexit(int dummy)
  193. {
  194.     extern char *_ProgramName;
  195.  
  196.     Free_EnvVars();
  197.     fprintf(stderr,"*** Break: %s\n",_ProgramName);
  198.     fflush(stderr);
  199.     exit(EXIT_FAILURE);
  200. }
  201. @z
  202.