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 / initglob.h < prev    next >
Text File  |  1993-08-06  |  4KB  |  123 lines

  1. /* -*-C-*- initglob.h */
  2. /*-->initglob*/
  3. /**********************************************************************/
  4. /****************************** initglob ******************************/
  5. /**********************************************************************/
  6.  
  7. void
  8. initglob()            /* initialize global variables */
  9. {
  10.     register INT16 i;        /* loop index */
  11.     register char* tcp;        /* temporary character pointer */
  12.  
  13. /***********************************************************************
  14.     Set up masks such that rightones[k]  has 1-bits at the right end  of
  15.     the word from k ..     HOST_WORD_SIZE-1, where bits are numbered  from
  16.     left (high-order) to right (lower-order), 0 .. HOST_WORD_SIZE-1.
  17.  
  18.     img_mask[k] has  a 1-bit  in  position k,  bits numbered  as  above.
  19.     power[k] is  1  <<  k,  and gpower[k]  is  2**k-1  (i.e.  1-bits  in
  20.     low-order k positions).  These 3 require only 32 entries each  since
  21.     they deal with 32-bit words from the PK and GF font files.
  22.  
  23.     These are set  at run-time, rather  than compile time  to avoid  (a)
  24.     problems with C  preprocessors which sometimes  do not handle  large
  25.     constants correctly, and (b) host byte-order dependence.
  26. ***********************************************************************/
  27.  
  28.     rightones[HOST_WORD_SIZE-1] = 1;
  29.     for (i = HOST_WORD_SIZE-2; (i >= 0); --i)
  30.     rightones[i] = (rightones[i+1] << 1) | 1;
  31.  
  32.     img_mask[31] = 1;
  33.     for (i = 30; i >= 0; --i)
  34.     img_mask[i] = img_mask[i+1] << 1;
  35.  
  36.     power[0] = 1;
  37.     for (i = 1; i <= 31; ++i)
  38.     power[i] = power[i-1] << 1;
  39.  
  40.     gpower[0] = 0;        /* NB: we have gpower[0..32], not [0..31] */
  41.     for (i = 1; i <= 32; ++i)
  42.     gpower[i] = power[i-1] | gpower[i-1];
  43.  
  44.     debug_code = 0;
  45.     runmag = STDMAG;            /* default runtime magnification */
  46.  
  47. #if    HPLASERJET
  48.     hpres = DEFAULT_RESOLUTION;        /* default output resolution */
  49. #endif /* HPLASERJET */
  50.  
  51. #if    HPJETPLUS
  52.     size_limit = 255;            /* largest character size */
  53. #endif
  54.  
  55.  
  56. #if    CANON_A2
  57.     /*
  58.     This should really be  64, but there are  serious problems with  the
  59.     Canon A2 downloaded font mechanism--characters are randomly  dropped
  60.     from the output.  Setting the size limit to 0 forces each  character
  61.     to be loaded as a raster bitmap, which blows the output file size up
  62.     by more than a factor of 10, sigh....
  63.     */
  64.     size_limit = 0;
  65.  
  66. #ifdef CANON_TEST
  67.     size_limit = 64;            /* largest character size */
  68.     stor_limit = STOR_LIMIT;
  69.     merit_fact = MERIT_FACT;
  70.     stor_fonts = STOR_FONTS;
  71. #endif /* CANON_TEST */
  72.  
  73. #endif
  74.  
  75.  
  76. #if    POSTSCRIPT
  77.     size_limit = PS_SIZELIMIT;        /* characters larger than this */
  78.                     /* get loaded each time with */
  79.                     /* surrounding save/restore to */
  80.                     /* get around PostScript bugs */
  81.     ps_vmbug = FALSE;            /* do not reload fonts on each page */
  82. #endif /* POSTSCRIPT */
  83.  
  84.     npage = 0;
  85.     copies = 1;                /* number of copies of each page */
  86.     topmargin = 1.0;            /* DVI driver standard default */
  87.     leftmargin = 1.0;            /* DVI driver standard default */
  88.  
  89.     subfile[0] = '\0';
  90.  
  91. #if    VIRTUAL_FONTS
  92.     virt_font = FALSE;
  93. #endif
  94.  
  95.     /*
  96.     Copy default file fields into global  variables, then replace by any
  97.     runtime environment  variable definitions.  We need not  do this for
  98.     TOPS-20   and  VAX  VMS,  since   SUBPATH and  FONTPATH are  already
  99.     initialized to logical  names  which   the  operating  system   will
  100.     translate at file open time.
  101.     */
  102.  
  103.     (void)strcpy(helpcmd,DVIHELP);
  104.     (void)strcpy(subpath,SUBPATH);
  105.     (void)strcpy(subname,SUBNAME);
  106.     (void)strcpy(subext,SUBEXT);
  107.     (void)strcpy(fontpath,FONTPATH);
  108.     (void)strcpy(fontlist,FONTLIST);
  109.  
  110.     if ((tcp = GETENV("DVIHELP")) != (char *)NULL)
  111.     (void)strcpy(helpcmd,tcp);
  112.  
  113. #if    (OS_ATARI | OS_PCDOS | OS_UNIX)
  114.     if ((tcp = GETENV(TEXINPUTS)) != (char *)NULL)
  115.     (void)strcpy(subpath,tcp);
  116.     if ((tcp = GETENV(TEXFONTS)) != (char *)NULL)
  117.     (void)strcpy(fontpath,tcp);
  118. #endif
  119.  
  120.     if ((tcp = GETENV("FONTLIST")) != (char *)NULL)
  121.     (void)strcpy(fontlist,tcp);
  122. }
  123.