home *** CD-ROM | disk | FTP | other *** search
- /* Copyright 1985, 1986, 1987, 1988 Chris Lewis
- All Rights Reserved
-
- Permission to copy and further distribute is freely given provided
- this copyright notice remains intact and that this software is not
- sold for profit.
-
- Project: Generic Troff drivers
- Module: t2conf.c
- Author: Chris Lewis
- Specs: Switch for alternate backends.
- */
-
- #include "defs.h"
-
- #ifndef SVR3
- #ifndef lint
- static char SCCSid[] = "@(#)t2conf.c: 1.7 Copyright 89/06/14 17:39:52 Chris Lewis";
- #endif
- #else
- #ident "@(#)t2conf.c: 1.7 Copyright 89/06/14 17:39:52 Chris Lewis"
- #endif
-
- #ifdef PS
- #include "ps.h"
- #endif
-
- #if defined(LJ) || defined(LK)
- #include "lj.h"
- #endif
-
- #ifdef DT
- #include "dt.h"
- #endif
-
- struct backend B[] = {
- /* bename, beprolog, beepilog, bechar, bepage, befontsel */
- /* beoverlay, bebin bexlat, bestdfont, besymfont */
-
- #ifdef PS
- { PSNAME, psProlog, psEpilog, psChar, psPage, psFontSel,
- psOverlay, psBin, psXlate, psStdFont, psSymFont },
- #endif
-
- #ifdef DT
- { DTNAME, dtProlog, dtEpilog, dtChar, dtPage, dtFontSel,
- NULL, NULL, NULL, dtStdFont, dtSymFont },
- #endif
-
- #ifdef LJ
- { LJNAME, ljProlog, ljEpilog, ljChar, ljPage, ljFontSel,
- NULL, NULL, NULL, ljStdFont, ljSymFont },
- #endif
- #ifdef LK
- { LKNAME, ljProlog, ljEpilog, ljChar, ljPage, ljFontSel,
- NULL, NULL, NULL, lkStdFont, lkSymFont },
- #endif
-
- { NULL }
- };
-
-
- getdriver(name)
- char *name; {
-
- be = BNULL;
- if (B[0].bename == NULL) {
- fprintf(stderr, "%s: No drivers configured!\n", progname);
- exit(1);
- }
-
- if (B[1].bename == NULL) {
- if (strcmp(B[0].bename, name)) {
- fprintf(stderr, "%s: Asked for driver '%s', only %s exists\n",
- progname, name, B[0].bename);
- exit(1);
- }
- be = &B[0];
- return;
- }
- for (be = B; be->bename != NULL; be++)
- if (strcmp(name, be->bename) == 0)
- return;
- fprintf(stderr, "%s: No driver called '%s' configured\n", progname, name);
- exit(1);
- }
-