home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / psroff / part01 / t2conf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-17  |  1.9 KB  |  87 lines

  1. /*    Copyright 1985, 1986, 1987, 1988 Chris Lewis
  2.         All Rights Reserved
  3.  
  4.     Permission to copy and further distribute is freely given provided 
  5.     this copyright notice remains intact and that this software is not 
  6.     sold for profit.
  7.  
  8.     Project:    Generic Troff drivers
  9.     Module:        t2conf.c
  10.     Author:     Chris Lewis
  11.     Specs:        Switch for alternate backends.
  12.  */
  13.  
  14. #include "defs.h"
  15.  
  16. #ifndef    SVR3
  17. #ifndef    lint
  18. static char SCCSid[] = "@(#)t2conf.c: 1.7 Copyright 89/06/14 17:39:52 Chris Lewis";
  19. #endif
  20. #else
  21. #ident  "@(#)t2conf.c: 1.7 Copyright 89/06/14 17:39:52 Chris Lewis"
  22. #endif
  23.  
  24. #ifdef    PS
  25. #include "ps.h"
  26. #endif
  27.  
  28. #if    defined(LJ) || defined(LK)
  29. #include "lj.h"
  30. #endif
  31.  
  32. #ifdef    DT
  33. #include "dt.h"
  34. #endif
  35.  
  36. struct backend B[] = {
  37. /*   bename,    beprolog,    beepilog,    bechar,    bepage,    befontsel */
  38. /*        beoverlay,    bebin        bexlat, bestdfont, besymfont */
  39.  
  40. #ifdef    PS
  41.     { PSNAME,    psProlog,    psEpilog,    psChar,    psPage,    psFontSel,
  42.         psOverlay,    psBin,        psXlate, psStdFont, psSymFont },
  43. #endif
  44.  
  45. #ifdef    DT
  46.     { DTNAME,    dtProlog,    dtEpilog,    dtChar,    dtPage,    dtFontSel,
  47.         NULL,        NULL,        NULL, dtStdFont, dtSymFont },
  48. #endif
  49.  
  50. #ifdef    LJ
  51.     { LJNAME,    ljProlog,    ljEpilog,    ljChar,    ljPage,    ljFontSel,
  52.         NULL,        NULL,        NULL,   ljStdFont, ljSymFont },
  53. #endif
  54. #ifdef    LK
  55.     { LKNAME,    ljProlog,    ljEpilog,    ljChar, ljPage, ljFontSel,
  56.         NULL,        NULL,        NULL,   lkStdFont, lkSymFont },
  57. #endif
  58.  
  59.     { NULL }
  60. };
  61.  
  62.  
  63. getdriver(name)
  64. char *name; {
  65.  
  66.     be = BNULL;
  67.     if (B[0].bename == NULL) {
  68.     fprintf(stderr, "%s: No drivers configured!\n", progname);
  69.     exit(1);
  70.     }
  71.  
  72.     if (B[1].bename == NULL) {
  73.     if (strcmp(B[0].bename, name)) {
  74.         fprintf(stderr, "%s: Asked for driver '%s', only %s exists\n",
  75.         progname, name, B[0].bename);
  76.         exit(1);
  77.     }
  78.     be = &B[0];
  79.     return;
  80.     }
  81.     for (be = B; be->bename != NULL; be++)
  82.     if (strcmp(name, be->bename) == 0)
  83.         return;
  84.     fprintf(stderr, "%s: No driver called '%s' configured\n", progname, name);
  85.     exit(1);
  86. }
  87.