home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / DVI_MGR / dvimgr_s.lzh / dvimgr / gendefs.h < prev    next >
Text File  |  1993-08-06  |  4KB  |  120 lines

  1. /* -*-C-*- gendefs.h */
  2. /*-->gendefs*/
  3. /*  bug in PIXROUND fixed   rz 08-mar-90 */
  4. /**********************************************************************/
  5. /****************************** gendefs *******************************/
  6. /**********************************************************************/
  7.  
  8. /**********************************************************************/
  9. /************************  General Definitions  ***********************/
  10. /**********************************************************************/
  11.  
  12. /***********************************************************************
  13. This section should not require modification for either new hosts or new
  14. output devices.
  15. ***********************************************************************/
  16.  
  17. #define  ABS(x)        ((x) < 0 ? -(x) : (x))
  18. #define  DBGOPT(flag)    (debug_code & (flag))
  19. #define  DBG_PAGE_DUMP    0x0001
  20. #define  DBG_CHAR_DUMP    0x0002
  21. #define  DBG_POS_CHAR    0x0004
  22. #define  DBG_OKAY_OPEN    0x0008
  23. #define  DBG_FAIL_OPEN    0x0010
  24. #define  DBG_OFF_PAGE    0x0020
  25. #define  DBG_FONT_CACHE    0x0040
  26. #define  DBG_SET_TEXT    0x0080
  27. #define  DEBUG_OPEN(fp,fname,openmode) dbgopen(fp,fname,openmode)
  28. #define  DVIFORMAT      2
  29. #define  FIRSTPXLCHAR      0
  30. #define  FT_GF        0
  31. #define  FT_PK        1
  32. #define  FT_PXL        2
  33. #define  IN(a,b,c)    (((a) <= (b)) && ((b) <= (c)))
  34.  
  35. /* Computer Modern has 128 characters (0..127), but Japanese fonts and
  36. extended European Computer Moderns may have up to 256 (0..255)
  37. characters */
  38. #define  LASTPXLCHAR    255
  39.  
  40. #define  MAGSIZE(f)    ((UNSIGN32)(1000.0*(f) + 0.5))
  41.  
  42. #ifdef MAX
  43. #undef MAX
  44. #endif
  45.  
  46. #define  MAX(a,b)    ((a) > (b) ? (a) : (b))
  47. #define  MAXFONTS       32   /* number of fonts per job (HPLJ, Canon A2) */
  48. #define  MAXMSG        1024 /* message[] size--big enough for 2 file names*/
  49. #define  MAXPAGE    999  /* limit on number of pages in a DVI file */
  50. #define  MAXREQUEST    256  /* limit on number of explicit page print
  51.                 requests */
  52. #define  MAXSPECIAL    500  /* limit on \special{} string size; it need not
  53.                 be larger than TeX's compile-time parameter
  54.                 buf_siz, which is 500 in Standard TeX-82 */
  55. #define  MAXSTR        257  /* DVI file text string size */
  56.  
  57. #define  MAXFORMATS     12  /* number of font file naming formats */
  58. #define  MIN_M        -500 /* GF character image extents */
  59. #define  MAX_M        1500
  60. #define  MIN_N        -500
  61. #define  MAX_N        1500
  62.  
  63. #ifdef MIN
  64. #undef MIN
  65. #endif
  66.  
  67. #define  MIN(a,b)    ((a) < (b) ? (a) : (b))
  68.  
  69. #if    (OS_ATARI | OS_PCDOS | OS_TOPS20)
  70. #define NEWLINE(fp) {(void)putc((char)'\r',fp);(void)putc((char)'\n',fp);}
  71.                     /* want <CR><LF> for these systems */
  72. #else
  73. #define NEWLINE(fp) (void)putc((char)'\n',fp)    /* want bare <LF> */
  74. #endif
  75.  
  76. #define  NPXLCHARS    256
  77. #define  ONES         ~0  /* a word of all one bits */
  78. #define  OUTC(c)    (void)putc((char)(c),plotfp)
  79. #define  OUTF(fmt,v)    (void)fprintf(plotfp,fmt,v)
  80. #define  OUTF2(fmt,u,v)    (void)fprintf(plotfp,fmt,u,v)
  81. #define  OUTF3(fmt,u,v,w)    (void)fprintf(plotfp,fmt,u,v,w)
  82. #define  OUTS(s)    (void)fputs(s,plotfp)
  83.  
  84. #if    CANON_A2
  85.  
  86. #ifdef CANON_TEST
  87. #define  FOUTC(c)    (void)putc((char)(c),savefp);
  88. #define  FOUTS(s)    (void)fputs(s,savefp)
  89. #endif /* CANON_TEST */
  90.  
  91. #endif
  92.  
  93. /*
  94. #define  PIXROUND(n,c)  ((COORDINATE)(((float)(n))*(c) + 0.5))
  95. */
  96. #define  PIXROUND(n,c)  (((n) > 0) ? \
  97.                (COORDINATE)(((float)(n))*(c) + 0.5) : \
  98.                -(COORDINATE)(((float)(-n))*(c) + 0.5))
  99.   
  100. #undef     PXLID
  101. #define  PXLID           1001
  102.  
  103. #define  SETBIT(m) img_row[(m-min_m) >> 5] |= img_mask[(m-min_m) & 0x1f]
  104. #define  TESTBIT(m) img_row[(m-min_m) >> 5] & img_mask[(m-min_m) & 0x1f]
  105.  
  106. #if    STDRES
  107. #define  STDMAG        1000
  108. #else
  109. #define  STDMAG        603  /* 1500/(1.2**5) to stay in magstep family */
  110. #endif
  111.  
  112. #define  RESOLUTION    (((float)STDMAG)/5.0)    /* dots per inch */
  113. #define  STACKSIZE    100
  114.  
  115. #undef     USEGLOBALMAG
  116. #define  USEGLOBALMAG      1        /* allow dvi global magnification */
  117.  
  118. #define  VISIBLE(t) ((t->wp > 0) && (t->hp > 0))
  119.         /* true if both pixel height and width are non-zero */
  120.