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 / main.h < prev    next >
C/C++ Source or Header  |  1993-08-06  |  5KB  |  200 lines

  1. /* -*-C-*- main.h */
  2. /*-->main*/
  3. /**********************************************************************/
  4. /******************************** main ********************************/
  5. /**********************************************************************/
  6.  
  7. /**********************************************************************/
  8. /***********************  External Definitions  ***********************/
  9. /**********************************************************************/
  10.  
  11. #if    KCC_20
  12. #include <file.h>
  13. #endif /* KCC_20 */
  14.  
  15. #if    PCC_20                /* this stuff MUST be first */
  16.  
  17. #undef tops20                /* to keep definitions alive */
  18. #include <ioctl.h>            /* PCC-20 does not have this in */
  19.                     /* the others */
  20. #include <file.h>            /* need for f20open flags and */
  21.                     /* JSYS stuff */
  22. #define tops20  1            /* define for tops-20 */
  23. #endif /* PCC_20 */
  24.  
  25. #include "commands.h"
  26. #include <ctype.h>
  27. #include <math.h>
  28.  
  29. #if    BBNBITGRAPH
  30. #if    (OS_VAXVMS | IBM_PC_WIZARD | IBM_PC_LATTICE | IBM_PC_MICROSOFT)
  31.     /* not available */
  32. #else /* NOT (OS_VAXVMS | IBM_PC_WIZARD | IBM_PC_LATTICE | IBM_PC_MICROSOFT) */
  33. #include <signal.h>
  34. #endif /* (OS_VAXVMS | IBM_PC_WIZARD | IBM_PC_LATTICE | IBM_PC_MICROSOFT) */
  35. #endif /* BBNBITGRAPH */
  36.  
  37. #if    OS_UNIX
  38. #if    BSD42
  39.  
  40. #include <sys/ioctl.h>            /* need for DVISPOOL in dviterm.h */
  41.  
  42. #ifndef _NFILE
  43. /* VAX VMS, NMTCC, PCC-20, and HPUX have _NFILE in stdio.h.  V7 called
  44. it NFILE, and Posix calls it OPEN_MAX.  KCC-20 calls it SYS_OPEN.  VAX
  45. 4.3BSD and Gould UTX/32 don't define _NFILE in stdio.h; they use
  46. NOFILE from sys/param.h.  Sigh.... */
  47. #include <sys/param.h>
  48. #ifdef NOFILE
  49. #define _NFILE NOFILE            /* need for gblvars.h */
  50. #else
  51. #define _NFILE MAXOPEN            /* use our font limit value */
  52. #endif
  53. #endif
  54.  
  55. #endif /* BSD42 */
  56. #endif /* OS_UNIX */
  57.  
  58.  
  59.  
  60. #include "gendefs.h"
  61.  
  62. #if    DECLA75
  63. #undef STDMAG
  64.  
  65. #if    STDRES
  66. #define  STDMAG        720
  67. #else /* NOT STDRES */
  68. #define  STDMAG        720
  69. #endif /* STDRES */
  70.  
  71. #endif /* DECLA75 */
  72.  
  73. #if    DECLN03PLUS
  74. #undef STDMAG
  75.  
  76. #if    STDRES
  77. #define  STDMAG        1500
  78. #else /* NOT STDRES */
  79. #define  STDMAG        750
  80. #endif /* STDRES */
  81.  
  82. #endif /* DECLN03PLUS */
  83.  
  84. #if    EPSON
  85. #undef STDMAG
  86.  
  87. #if    STDRES
  88. #define  STDMAG        1200        /* use 240dpi fonts */
  89. #else /* NOT STDRES */
  90. #define  STDMAG        603        /* 1500 * 1.2**(-5) */
  91. #endif /* STDRES */
  92.  
  93. #endif /* EPSON */
  94.  
  95. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  96. #undef STDMAG
  97.  
  98. #if    STDRES
  99. #define  STDMAG        1500        /* 300 dpi Canon LBP-CX print engine */
  100. #else /* NOT STDRES */
  101. #define  STDMAG        1440        /* near value in 1000*1.2**n family */
  102. #endif /* STDRES */
  103.  
  104. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  105.  
  106. #if    TOSHIBAP1351            /* want to override STDMAG */
  107. #undef STDMAG
  108.  
  109. #if    STDRES
  110. #define  STDMAG        868        /* 1500 * 1.2**(-3) */
  111. #else /* NOT STDRES */
  112. #define  STDMAG        833        /* 1000 * 1.2**(-1) */
  113. #endif /* STDRES */
  114.  
  115. #endif /* TOSHIBAP1351 */
  116.  
  117. #include "gblprocs.h"
  118.  
  119. #include "gblvars.h"
  120.  
  121. #if    BBNBITGRAPH
  122. #include "keydef.h"
  123. #endif /* BBNBITGRAPH */
  124.  
  125. #if    OS_ATARI
  126. long _stksize = 20000L; /* make the stack a bit larger than 2KB */
  127.                         /* number must be even                  */
  128. #endif /* OS_ATARI */
  129.  
  130.  
  131. /**********************************************************************/
  132. /*******************************  main  *******************************/
  133. /**********************************************************************/
  134.  
  135. int
  136. main(argc, argv)
  137. int argc;
  138. char *argv[];
  139. {
  140.     register int k;        /* loop index */
  141.     register int file_args;    /* count of file arguments */
  142.  
  143.  
  144.     (void)strcpy(g_progname, argv[0]); /* save program name */
  145.  
  146.     (void)initglob();        /* do this before argc check! */
  147.  
  148. #if    OS_UNIX
  149.     /* On Unix, we allow filtering of stdin to stdout */
  150. #else /* NOT OS_UNIX */
  151.     if (argc < 2)
  152.     {
  153.     (void)usage(stderr);
  154.     (void)EXIT(1);
  155.     }
  156. #endif /* OS_UNIX */
  157.  
  158.     for (k = 1; k < argc; ++k)
  159.     {
  160.     if (*argv[k] == '-')    /* -switch */
  161.         (void)option(argv[k]);
  162.     }
  163.  
  164.     if (!quiet)
  165.     {
  166.     (void)fprintf(stderr,"[TeX82 DVI Translator Version %s]",VERSION_NO);
  167.     NEWLINE(stderr);
  168.     (void)fprintf(stderr,"[%s]",DEVICE_ID);
  169.     NEWLINE(stderr);
  170.     }
  171.  
  172.     if (npage == 0)        /* no page ranges given, make a large one */
  173.     {
  174.     page_begin[0] = 1;
  175.     page_end[0] = 32767;    /* arbitrary large integer */
  176.     page_step[0] = 1;
  177.     npage = 1;
  178.     }
  179.     else /* need font defs from postamble if only some pages to be output */
  180.     preload = TRUE;
  181.  
  182.     file_args = 0;
  183.     for (k = 1; k < argc; ++k)
  184.     {
  185.     if (*argv[k] != '-')     /* must be file argument */
  186.     {
  187.         file_args++;
  188.         (void)dvifile(argc,argv,argv[k]);
  189.     }
  190.     }
  191.  
  192. #if    OS_UNIX
  193.     if (file_args == 0)        /* use stdin/stdout instead */
  194.         (void)dvifile(argc,argv,"");
  195. #endif
  196.  
  197.     (void)alldone();        /* this will never return */
  198.     return (0);            /* never executed; avoid compiler warnings */
  199. }
  200.