home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / psroff / part02 / defs.h
Encoding:
C/C++ Source or Header  |  1989-10-17  |  3.0 KB  |  131 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:        defs.h
  10.     Author:     Chris Lewis
  11.     Specs:        Main header file - contains some customization
  12.  */
  13.  
  14. #ifndef    LIBDIR
  15. #define    LIBDIR    "/usr/lib/troff2"
  16. #endif
  17.  
  18. /*#define    BSD        /* Define if you are a V7 or BSD machine */
  19. #define ATT        /* Define if you are some sort of SIII or SV system */
  20. #define    SVR3        /* Define if you are System VR3 (ATT should also be
  21.                defined */
  22.  
  23. #ifdef    SVR3
  24. #ifndef    lint
  25. static char defid[] = "@(#)defs.h: 1.14 Copyright 89/06/14 17:39:59 Chris Lewis";
  26. #endif
  27. #else
  28. #ident  "@(#)defs.h: 1.14 Copyright 89/06/14 17:39:59 Chris Lewis"
  29. #endif
  30.  
  31.  
  32. /*#define UNSIGNEDCHAR    /* define if chars are unsigned on your machine */
  33.  
  34. /*    Supported backends */
  35. #define    PS    /* Postscript */
  36. #define    LJ    /* Laserjet */
  37. #define    LK    /* Laserjet with K cartridge */
  38. #define    DT    /* ditroff */
  39.  
  40. /* don't change anything below here */
  41. #include <stdio.h>
  42. #include <ctype.h>
  43.  
  44. #ifdef BSD
  45. #include <strings.h>
  46. #define    strchr    index
  47. #define    strrchr    rindex
  48. #else
  49. #include <string.h>
  50. #endif
  51.  
  52. #ifdef    UNSIGNEDCHAR
  53. /* Ah heck, and this is probably not ANSI C either... */
  54. #define    SIGNED(x) (((x)&0x80) ? ((x) - 256) : (x))
  55. #endif
  56.  
  57. #define    ESC    0x80
  58. #define    FLASH    0x00
  59. #define    CONTROL    0x40
  60. #define    LEAD    0x60
  61. #define    SIZE    0x50
  62.  
  63. #define    DOWN    0
  64. #define    UP    1
  65. #define    LOWER    2
  66. #define    UPPER    3
  67. #define    FORWARD    4
  68. #define    BACKWARD 5
  69.  
  70. #define    TROFFRESOLUTION    432
  71. /*#define    FONT8        /* 8 Font device */
  72. #define FONT4        /* 4 font device - should be possible to leave FONT8*/
  73. #define    DEBUGPRINTF    if (diagFile) debugprintf
  74.  
  75. #define    SPECIAL        /* define if you want to supports special directives */
  76. #define    FORM        /* define if you want the forms facility */
  77.  
  78. #define    DEBUG
  79. #define    DEBUGPRINTF    if (diagFile) debugprintf
  80. FILE    *diagFile;
  81.  
  82. typedef int(*FUNC)();
  83.  
  84. #define    FNULL    (FUNC) NULL
  85.  
  86. struct    troff2befont {
  87.     int    t2b_font;    /* font (troff nomenclature) S=don't change */
  88.     float    t2b_xc;        /* X-shift */
  89.     float    t2b_yc;        /* Y-shift */
  90.     float    t2b_scale;    /* point size scale adjust */
  91.     char     *t2b_charseq;    /* character sequence - may include PS */
  92.     char    *t2b_name;    /* name of character */
  93. };
  94.  
  95. struct backend {
  96.     char    *bename;
  97.     FUNC    beprolog,
  98.         beepilog,
  99.         beputchar,
  100.         bepage,
  101.         befontsel,    /* special function F */
  102.         beoverlay,    /* special function O */
  103.         bebin,        /* special function B */
  104.         bexlat;        /* Xlate function */
  105.     struct troff2befont
  106.         *bestdfont,    /* standard font translate table */
  107.         *besymfont;    /* symbol font translate table */
  108. };
  109.  
  110. struct backend *be;
  111. #define    BNULL    (struct backend *) NULL
  112.  
  113. extern char *progname;
  114. int metrics;
  115. extern char *skipblanks();
  116.  
  117. /*    Common Back-end definitions */
  118.  
  119. #define    U    (-1)        /* Use standard font */
  120. #define    S    (-2)        /* Use symbol font */
  121. #define    D    (-3)        /* Draw macro exists - use string directly */
  122.  
  123. #define    NOCODE    0
  124.  
  125. #define    SN(x) , x
  126.  
  127. int currentPage;
  128. int pagePending;
  129.  
  130. #define    T2VERSION    "R1.14 89/06/14"
  131.