home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Dvi / dvieps.arc / MACHDEFS.H < prev    next >
Text File  |  1988-10-30  |  26KB  |  844 lines

  1. /* -*-C-*- machdefs.h */
  2. /*-->machdefs*/
  3. /**********************************************************************/
  4. /****************************** machdefs ******************************/
  5. /**********************************************************************/
  6.  
  7. /***********************************************************************
  8.  
  9. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  10. This file should contain definitions for symbols used for all  operating
  11. system /  implementation  dependencies, and  if  the driver  family  has
  12. already been implemented on  you machine, this should  be the only  file
  13. requiring changes.
  14.  
  15. How to change this file:
  16.     * locate the operating system and implementation definitions;
  17.       they are surrounded by "=====" comment strings.
  18.     * comment out the definitions you do not want, and select the
  19.       ones for your system
  20.     * if adding a new operating system, create a new symbol OS_xxx
  21.       for it and add a new #if OS_xxx ... #endif section for its
  22.       changes.
  23.         * if adding a new implementation for an existing operating
  24.       system, create a new symbol for it and add appropriate
  25.       conditionals inside its #if OS_xxx ... #end section.
  26.     * if you must replace a standard C library function, replace
  27.       instances of its use in the source code with an upper-case
  28.       equivalent (e.g. ungetc --> UNGETC), then define the
  29.       upper-case name below in the generic section, plus the
  30.       operating-system section.
  31.  
  32. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  33.  
  34. List of symbols actually used for #if's [14-Aug-87]
  35.  
  36. Flags and strings:
  37.     ALLOW_INTERRUPT    -- allow interactive interrupt
  38.     ANSI_PROTOTYPES    -- draft ANSI C function prototype declarations are
  39.                supported
  40.     ANSI_LIBRARY    -- draft ANSI C library functions conformance
  41.     ARITHRSHIFT    -- implementation uses arithmetic (not logical) right
  42.                shift
  43.     DVIHELP        -- how to find documentation (for usage())
  44.     DVIPREFIX    -- prefix to standard 3-character extension of output
  45.                and log files
  46.     FASTZERO    -- fast bitmap zeroing by external assembly language
  47.                routine
  48.     FONTLIST    -- font type search list (PK, GF, PXL)
  49.     FONTPATH    -- font directory path
  50.     HIRES        -- high resolution variant of bitmap output
  51.     HOST_WORD_SIZE    -- host integer word size in bits
  52.         PS_MAXWIDTH    -- approximate line width limit for PostScript output
  53.     PS_SHORTLINES    -- shorter output lines in PostScript
  54.     PS_XONXOFFBUG    -- PostScript version 23.0 Xon/Xoff bug workaround
  55.     PXLID        -- TeX PXL file ID
  56.     RB_OPEN        -- fopen() mode flags for binary read
  57.     SEGMEM        -- segmented memory (Intel); bitmap is raster vector
  58.     STDRES        -- standard resolution (200 dpi)
  59.     SUBPATH        -- substitution font file path
  60.     TEXFONTS    -- TeX font file path environment variable
  61.     TEXINPUTS    -- TeX input file path environment variable
  62.     USEGLOBALMAG    -- allow runtime global magnification scaling
  63.     VIRTUAL_FONTS    -- implement virtual font caching
  64.     WB_OPEN        -- fopen() mode flags for binary write
  65.     ZAPTHISOUT    -- remove some obsolete code
  66.  
  67. Alternate library routines  for misfeature workarounds  (these have  the
  68. same names as standard library routines, but upper-cased):
  69.     EXIT
  70.     FOPEN
  71.     FSEEK
  72.     FTELL
  73.     GETENV
  74.     MALLOC(n)
  75.     READ
  76.     REWIND(fp)
  77.     UNGETC
  78.  
  79. C Implementations:
  80.     ATT        -- AT&T Unix (System III, V)
  81.     BSD41        -- Berkeley 4.1BSD
  82.     BSD42        -- Berkeley 4.2BSD
  83.     HPUX        -- HP 9000 series Unix (System V based)
  84.     IBM_PC_LATTICE    -- IBM PC Lattice C compiler
  85.     IBM_PC_MICROSOFT-- IBM PC Microsoft Version 3.x or later C compiler
  86.     IBM_PC_WIZARD    -- IBM PC Wizard C compiler
  87.     KCC_20        -- SRI's KCC Compiler on TOPS-20
  88.     PCC_20        -- Portable C Compiler on TOPS-20
  89.  
  90. Operating systems:
  91.     OS_ATARI    -- Atari 520ST+ TOS (similar to MS DOS)
  92.     OS_PCDOS    -- IBM (and clones) PC DOS and MS DOS
  93.     OS_TOPS20    -- DEC-20 TOPS-20
  94.     OS_UNIX        -- Unix (almost any variant)
  95.     OS_VAXVMS    -- VAX VMS
  96.  
  97. Device names (defined in each DVIxxx.C file):
  98.     APPLEIMAGEWRITER -- Apple ImageWriter printer
  99.     BBNBITGRAPH    -- BBN BitGraph terminal
  100.     CANON_A2    -- Canon LBP-8 A2 laser printer
  101.     DECLA75        -- DEC LA75 printer
  102.     DECLN03PLUS    -- DEC LN03-PLUS laser printer
  103.     EPSON        -- Epson 9-pin family dot-matrix printer
  104.     GOLDENDAWNGL100    -- Golden Dawn GL100 laser printer
  105.     HPJETPLUS    -- Hewlett-Packard Laser Jet Plus (downloaded fonts)
  106.     HPLASERJET    -- Hewlett-Packard Laser Jet (bitmap display)
  107.     IMPRESS        -- imPRESS (IMAGEN laser printer)
  108.     MPISPRINTER    -- MPI Sprinter printer
  109.     OKIDATA2410    -- OKIData 2410 printer
  110.     POSTSCRIPT    -- Adobe PostScript (Apple LaserWriter laser printer)
  111.     PRINTRONIX    -- Printronix (DEC LXY-11, C-Itoh) printer
  112.     TOSHIBAP1351    -- Toshiba P-1351 dot matrix printer
  113.  
  114. ***********************************************************************/
  115.  
  116. /**********************************************************************
  117. Define all symbols for devices, operating systems, and implementations
  118. to be explicitly 0, unless it is expected that they might be set at
  119. compile time.
  120. ***********************************************************************/
  121.  
  122. #define ALLOW_INTERRUPT    0
  123. #define ANSI_PROTOTYPES    0
  124.  
  125. #ifndef ANSI_LIBRARY        /* may be specified at compile time */
  126. #define ANSI_LIBRARY    0
  127. #endif
  128.  
  129. #if    ANSI_LIBRARY
  130. #undef ANSI_PROTOTYPES
  131. #define ANSI_PROTOTYPES    1    /* If library conforms, declarations do too */
  132. #endif
  133.  
  134. #define ARITHRSHIFT    1 /* most C compilers use arithmetic right shift */
  135. #define DISKFULL(fp)    (ferror(fp) && (errno == ENOSPC))
  136. #define DVIEXT        ".dvi"
  137. #define DVIPREFIX    "dvi-"
  138. #define EXIT        exit
  139. #define FASTZERO    0
  140.  
  141. /* The following definitions work for at least PCC-20, BSD 4.2 and  4.3,
  142. and HPUX;  VAX  VMS  has  an extra  level  of  indirection.   Check  the
  143. definition of fileno(fp) in stdio.h; on PCC-20, it is
  144.     #define fileno(p) ((p)->_file)
  145. */
  146. #define FILE_CNT(fp)    (fp)->_cnt
  147. #define FILE_BASE(fp)    (fp)->_base
  148. #define FILE_PTR(fp)    (fp)->_ptr
  149.  
  150. /* #define FONTLIST    0 -- can be set at compile time */
  151. /* #define FONTPATH    0 -- can be set at compile time */
  152.  
  153. #define FOPEN        fopen
  154. #define FSEEK        fseek
  155. #define FTELL        ftell
  156. #define GETENV        getenv
  157. #define HIRES        0
  158. #define MALLOC(n)    malloc(n)
  159. #define MAXDRIFT    2    /* we insist that
  160.                 abs|(hh-pixel_round(h))<=MAXDRIFT| */
  161.  
  162. /* MAXOPEN  should  be 6  less  than the  system  limit on  open  files,
  163. allowing for  files  open  on stdin,  stdout,  stderr,  .dvi,  .dvi-log,
  164. .dvi-xxx, plus MAXOPEN font  files.  It may  be additionally limited  by
  165. the amount of memory available for buffers (e.g. IBM PC). */
  166. #define MAXOPEN        14
  167.  
  168. /* #define PS_MAXWIDTH  72 -- can be set at compile time */
  169.  
  170. /* #define PS_SHORTLINES 0 -- can be set at compile time */
  171.  
  172. #define PS_XONXOFFBUG    0
  173. #define PXLID        0
  174. #define RB_OPEN        "r"
  175.  
  176. /* For virtual font caching to succeed, read() must return the requested
  177. number of bytes, and  preferably do this  with one system   call  and no
  178. double buffering. */
  179.  
  180. #define READ        read
  181.  
  182. /* In  many  implementations, rewind(fp)  is  defined as  equivalent  to
  183. fseek(fp,0L,0).  In  some, however  (e.g.  PCC-20,  and probably  others
  184. based on PCC), it additionally discards input buffer contents, which may
  185. cause unnecessary I/O, and in the case of virtual font caching,   clears
  186. the cache.  Defining  it in  terms of fseek()  should be  okay, but  the
  187. implementation of fseek() should be checked. */
  188.  
  189. #define REWIND(fp)    FSEEK(fp,0L,0)
  190.  
  191. #define SEGMEM        0    /* may be reset by dvixxx for big bitmaps */
  192. #define STDRES        0
  193.  
  194. /* #define SUBPATH    0 -- can be set at compile time */
  195.  
  196. #define SUBEXT        ".sub"
  197. #define SUBNAME        "texfonts"
  198.  
  199. /* #define TEXFONTS    0 -- can be set at compile time */
  200. /* #define TEXINPUTS    0 -- can be set at compile time */
  201.  
  202. #define UNGETC        ungetc
  203. #define USEGLOBALMAG    0
  204. #define WB_OPEN        "w"
  205. #define ZAPTHISOUT    0
  206.  
  207.  
  208. /**********************************************************************/
  209. /* Clear all implementation/operating-system flags--reset later */
  210.  
  211. #define ATT        0    /* define zero or one of these */
  212. #define BSD41        0
  213. #define BSD42        0
  214. #define HPUX        0
  215. #define IBM_PC_LATTICE    0
  216. #define IBM_PC_MICROSOFT    0
  217. #define IBM_PC_WIZARD    0
  218. #define KCC_20        0
  219. #define PCC_20        0
  220.  
  221. #define OS_ATARI    0    /* define one of these */
  222. #define OS_PCDOS    0
  223. #define OS_TOPS20    0
  224. #define OS_UNIX        0
  225. #define OS_VAXVMS    0
  226.  
  227. #define APPLEIMAGEWRITER    0    /* one will be defined by DVIxxx */
  228. #define BBNBITGRAPH    0
  229. #define CANON_A2    0
  230. #define DECLA75        0
  231. #define DECLN03PLUS    0
  232. #define EPSON        0
  233. #define GOLDENDAWNGL100    0
  234. #define HPJETPLUS    0
  235. #define HPLASERJET    0
  236. #define IMPRESS        0
  237. #define MPISPRINTER    0
  238. #define OKIDATA2410    0
  239. #define POSTSCRIPT    0
  240. #define PRINTRONIX    0
  241. #define TOSHIBAP1351    0
  242. #define VIRTUAL_FONTS    0
  243.  
  244.  
  245. /***********************************************************************
  246. Define operating system and implementation  here.  Since these have  all
  247. been explicitly set  to 0  above, we  issue #undef's  to avoid  compiler
  248. macro redefinition warning messages.
  249. ***********************************************************************/
  250.  
  251.  
  252. /*====================
  253. #undef PCC_20
  254. #undef OS_TOPS20
  255. #define PCC_20        1
  256. #define OS_TOPS20    1
  257. ====================*/
  258.  
  259. /*====================
  260. #undef KCC_20
  261. #undef OS_TOPSd0
  262. #define KCC_20        1
  263. #define OS_TOPS20    1
  264. ====================*/
  265.  
  266. #undef  OS_ATARI
  267. #define OS_ATARI    1
  268.  
  269. /*====================
  270. #undef  IBM_PC_LATTICE
  271. #undef  OS_PCDOS
  272. #define IBM_PC_LATTICE    1
  273. #define OS_PCDOS    1
  274. ====================*/
  275.  
  276. /*====================
  277. #undef  IBM_PC_MICROSOFT
  278. #undef  OS_PCDOS
  279. #define IBM_PC_MICROSOFT    1
  280. #define OS_PCDOS    1
  281. ====================*/
  282.  
  283. /*====================
  284. #undef  IBM_PC_WIZARD
  285. #undef  OS_PCDOS
  286. #define IBM_PC_WIZARD    1
  287. #define OS_PCDOS    1
  288. ====================*/
  289.  
  290. /*====================
  291. #undef  OS_VAXVMS
  292. #define OS_VAXVMS    1
  293. ====================*/
  294.  
  295. #if    (OS_ATARI | OS_PCDOS | OS_TOPS20 | OS_UNIX | OS_VAXVMS)
  296. #else
  297. #undef  OS_UNIX
  298. #define OS_UNIX        1        /* provide default operating system */
  299. #endif
  300.  
  301.  
  302. /**********************************************************************/
  303.  
  304. #if    OS_ATARI
  305.  
  306. /* this is completely brain-dead.  Ataris do NOT run BSD 4.2, or any
  307.    other eunuchs.
  308. #undef  BSD42
  309. #define BSD42        1
  310. */
  311.  
  312. #define float double
  313.  
  314. #undef  DISKFULL
  315. #define DISKFULL(fp)    ferror(fp)
  316.  
  317. #undef WB_OPEN
  318. #define WB_OPEN "wb"
  319.  
  320. #define DVIHELP     "type d:\\tex\\dvi.hlp"
  321.  
  322. #undef DVIPREFIX
  323. #define DVIPREFIX    ""
  324.  
  325. #ifdef  FONTLIST     /* can be set at compile time */
  326. #else
  327. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  328. #endif /* FONTLIST */
  329.  
  330. #ifdef FONTPATH         /* can be set at compile time */
  331. #else
  332. #define FONTPATH    "d:\\tex\\fonts\\"
  333. #endif
  334.  
  335. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  336.                 /* signex to pack 8-bit bytes back */
  337.                 /* into integer values, and in dispchar */
  338.                 /* and fillrect for managing character */
  339.                 /* raster storage. */
  340. #define MAXFNAME    64    /* longest host complete filename */
  341.  
  342. #ifndef PS_MAXWIDTH
  343. #define PS_MAXWIDTH    72
  344. #endif
  345.  
  346. #ifndef PS_SHORTLINES
  347. #define PS_SHORTLINES    1
  348. #endif
  349.  
  350. #ifdef SUBPATH            /* can be set at compile time */
  351. #else
  352. #define SUBPATH     "d:\\tex\\inputs\\"
  353. #endif
  354.  
  355. #ifdef TEXINPUTS        /* can be set at compile time */
  356. #else
  357. #define TEXINPUTS    "TEXINPUTS"
  358. #endif
  359.  
  360. #define TEXFONTS    "TEXFONTS"
  361.  
  362. #endif /* OS_ATARI */
  363.  
  364.  
  365. /**********************************************************************/
  366.  
  367. #if    OS_PCDOS
  368.  
  369. #if    IBM_PC_MICROSOFT
  370. #undef ANSI_PROTOTYPES
  371. #define ANSI_PROTOTYPES    1
  372.  
  373. /*
  374. Argument type checking in MSC Version 4.0 is selected by LINT_ARGS.  MSC
  375. Version 5.0 has itselected  by default.  For Version 5.0,  ANSI_LIBRARY
  376. should be defined at compile time  so as to get ANSI-conformant  library
  377. function declarations.  Treating float as double eliminates lots of data
  378. conversion warnings with both Versions 4.0 and 5.0.
  379. */
  380. #define float double    
  381. #define LINT_ARGS    1
  382.  
  383. #undef MALLOC
  384. #define MALLOC(n)    calloc(n,1)
  385. #endif /* IBM_PC_MICROSOFT */
  386.  
  387. #define DVIHELP        "type d:\\tex\\dvi.hlp"
  388.  
  389. #undef DVIPREFIX
  390. #define DVIPREFIX    ""
  391.  
  392. #ifdef FONTLIST        /* can be set at compile time */
  393. #else
  394. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  395. #endif /* FONTLIST */
  396.  
  397. #ifdef FONTPATH            /* can be set at compile time */
  398. #else
  399. #define FONTPATH    "d:\\tex\\fonts\\"
  400. #endif /* FONTPATH */
  401.  
  402. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  403.                 /* signex to pack 8-bit bytes back */
  404.                 /* into integer values, and in dispchar */
  405.                 /* and fillrect for managing character */
  406.                 /* raster storage. */
  407. #define MAXFNAME    64    /* longest host complete filename */
  408.  
  409. #undef MAXOPEN
  410. #define MAXOPEN        5    /* limit on number of open font files */
  411.  
  412. #ifndef PS_MAXWIDTH
  413. #define PS_MAXWIDTH    72
  414. #endif
  415.  
  416. #ifndef PS_SHORTLINES
  417. #define PS_SHORTLINES    1
  418. #endif
  419.  
  420. #undef  RB_OPEN
  421. #define RB_OPEN        "rb"
  422.  
  423. #ifdef SUBPATH            /* can be set at compile time */
  424. #else
  425. #define SUBPATH        "d:\\tex\\inputs\\"
  426. #endif
  427.  
  428. #if    TEXINPUTS        /* can be set at compile time */
  429. #else
  430. #define TEXINPUTS    "TEXINPUTS"
  431. #endif
  432.  
  433. #define TEXFONTS    "TEXFONTS"
  434.  
  435. #if    IBM_PC_MICROSOFT
  436. #undef VIRTUAL_FONTS
  437. #define VIRTUAL_FONTS    1
  438. #endif
  439.  
  440. #undef  WB_OPEN
  441. #define WB_OPEN        "wb"
  442.  
  443. #endif /* OS_PCDOS */
  444.  
  445.  
  446. /***********************************************************************/
  447. #if    OS_TOPS20
  448.  
  449. /************************************************************************
  450. **
  451. **  Adapted for the DEC-20 TOPS-20  operating system with Jay  Lepreau's
  452. **  PCC-20  by  Nelson  H.F.    Beebe,  College  of  Science   Computer,
  453. **  University of Utah, Salt Lake City, UT 84112, Tel: (801) 581-5254.
  454. **
  455. **  The PCC_20 switch is  used to get around  variations on the  DEC-20.
  456. **  The major one is  that text files have  7-bit bytes, while the  .DVI
  457. **  file and the font files have 8-bit bytes.  For the latter, we use  a
  458. **  routine f20open which provides  the necessary interface for  opening
  459. **  with a ddifferent byte size.  PCC-20 follows many other C  compilers
  460. **  in that only the first 8 characters of identifiers are looked at, so
  461. **  massive substitutions  were  necessary  in the  file  commands.h  to
  462. **  shorten the long names there.
  463. **
  464. **  The PCC_20 switch is also used  to get variant font directory  names
  465. **  and to select TOPS-20 jsys  code.  TOPS-20 is a wonderous  operating
  466. **  system with  capabilities far  beyond  most of  its  contemporaries.
  467. **  Like Topsy, it  just grew, and  consequently, its many  capabilities
  468. **  are not  well  integrated.     The terminal  control  jsys'es  (MTOPR,
  469. **  RFMOD, SFMOD, STPAR, RFCOC, SFCOC and TLINK) are particularly poorly
  470. **  done -- RFMOD returns  the JFN mode word,  particular bits of  which
  471. **  must be set by SFMOD,  STPAR, and TLINK.  Why  could there not be  a
  472. **  "return  the  terminal  state"  and  "restore  the  terminal  state"
  473. **  jsys'es?  Some of this  may in fact be  already integrated into  the
  474. **  PCC-20 C run-time library, but since it is totally undocumented  (an
  475. **  all-too common problem with C),  it is essentially unusable in  that
  476. **  form.
  477. **
  478. **  The OS_TOPS20 switch is used in one place to get ioctl.h included at
  479. **  the right point, and in several places to get error messages  output
  480. **  with Tops-20 conventions in  column 1: query  (?)  causes batch  job
  481. **  abort, percent (%) flags a warning.
  482. **
  483. ***********************************************************************/
  484.  
  485. #if    KCC_20
  486. /* KCC wants all #if symbols defined before use. */
  487. #ifndef FONTLIST
  488. #define FONTLIST "PK-GF-PXL"
  489. #endif
  490.  
  491. #ifndef FONTPATH
  492. #define FONTPATH "TEXFONTS:"
  493. #endif
  494.  
  495. #ifndef SUBPATH
  496. #define SUBPATH "TEXINPUTS:"
  497. #endif
  498.  
  499. #ifndef TEXFONTS
  500. #define TEXFONTS "TEXFONTS:"
  501. #endif
  502.  
  503. #ifndef TEXINPUTS
  504. #define TEXINPUTS "TEXINPUTS:"
  505. #endif
  506.  
  507. #undef VIRTUAL_FONTS
  508. #define VIRTUAL_FONTS 0        /* cannot support this yet */
  509.  
  510. #endif
  511.  
  512. #if    KCC_20
  513. #include <jsys.h>
  514. /* KCC-20 and PCC-20  have similar enough JSYS  interfaces that we  just
  515. define values for KCC-20 using PCC-20 names. */
  516. #define JSchfdb    CHFDB
  517. #define JSmtopr    MTOPR
  518. #define JSrfcoc    RFCOC
  519. #define JSrfmod    RFMOD
  520. #define JSsfcoc    SFCOC
  521. #define JSsfmod    SFMOD
  522. #define JSsti    STI
  523. #define JSstpar    STPAR
  524. #define JStlink    TLINK
  525. #define Getmask(name)      ( 1?name )
  526. #define Getshift(name)     ( 0?name )
  527. #define Absmask(name) ( (1?name) << (0?name) )    /* maybe use this one */
  528. #define Value(name)   ( (1?name) << (0?name) )    /* maybe use this one */
  529. #define makefield(name, value)    ( ((value) & Getmask(name)) << Getshift(name) )
  530. #define getfield(var, name)    ( (var) >> Getshift(name) & Getmask(name) )
  531. #define setfield(var, name, value) ( (var) = ((var) & ~Absmask(name)) |\
  532.     makefield(name, value) )
  533. #endif
  534.  
  535. #if    PCC_20
  536. #undef  ARITHRSHIFT
  537. #define ARITHRSHIFT    0    /* PCC-20 uses logical right shift */
  538. #undef  DISKFULL
  539. #define DISKFULL(fp)    ferror(fp)    /* PCC-20 does not always set errno */
  540. #endif
  541.  
  542. #define DVIHELP    "help dvi\nor\ntype hlp:dvi.hlp\nor\nxinfo local clsc dvi"
  543.  
  544. #if    PCC_20
  545. #undef FASTZERO
  546. #define FASTZERO    1    /* for fast assembly language memory zeroing */
  547. #endif
  548.  
  549. #ifdef FONTLIST        /* can be set at compile time */
  550. #else
  551. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  552. #endif /* FONTLIST */
  553.  
  554. #ifdef FONTPATH            /* can be set at compile time */
  555. #else
  556. #define FONTPATH    "/texfonts/"
  557. #endif
  558.  
  559. #undef FOPEN
  560. #define FOPEN        f20open    /* private version for 8-bit binary */
  561.  
  562. #define HOST_WORD_SIZE    36
  563.  
  564. #undef MAXFNAME
  565. #define MAXFNAME    256    /* longest host complete filename */
  566.  
  567. #ifdef KCC_20
  568. #undef MAXOPEN
  569. #define MAXOPEN        26
  570. #endif
  571.  
  572. #ifdef PCC_20
  573. #undef MAXOPEN
  574. #define MAXOPEN        14
  575. #endif
  576.  
  577. #ifndef PS_MAXWIDTH
  578. #define PS_MAXWIDTH    72
  579. #endif
  580.  
  581. #ifndef PS_SHORTLINES
  582. #define PS_SHORTLINES    1
  583. #endif
  584.  
  585. #undef  RB_OPEN
  586. #define RB_OPEN        "rb"
  587.  
  588. #ifdef PCC_20
  589. #undef READ
  590. #define READ        _read    /* fast version with one system call */
  591. #endif
  592.                 /* and single buffering */
  593. #ifdef SUBPATH
  594. #else
  595. #define SUBPATH        "/texinputs/"
  596. #endif
  597.  
  598. #ifdef TEXFONTS            /* can be set at compile time */
  599. #else
  600. #define TEXFONTS    "TEXFONTS"
  601. #endif
  602.  
  603. #ifdef TEXINPUTS        /* can be set at compile time */
  604. #else
  605. #define TEXINPUTS    "TEXINPUTS"
  606. #endif
  607.  
  608. #if    PCC_20
  609. #undef VIRTUAL_FONTS
  610. #define VIRTUAL_FONTS    1
  611. #endif
  612.  
  613. #undef  WB_OPEN
  614. #define WB_OPEN        "wb"
  615.  
  616. /**********************************************************************/
  617. /* The following definitions (down to the endif) are taken from */
  618. /* monsym.h.   It is too big for CPP to handle, so this kludge is */
  619. /* necessary until CPP's tables can be enlarged. */
  620.  
  621. /* selected fields for CHFDB% */
  622. #define CF_nud        01:35-0        /* no update directory */
  623. #define CF_dsp        0777:35-17    /* fdb displacement */
  624. #define CF_jfn        0777777:35-35    /* jfn */
  625.  
  626. #define FBbyv        011        /* retention+bytesize+mode,,# of pages*/
  627. #define FB_ret        077:35-5    /* retention count */
  628.  
  629.  
  630. /* tty mode definitions */
  631.  
  632. #define MOrlw        030        /* read width */
  633. #define MOslw        031        /* set width */
  634. #define MOrll        032        /* read length */
  635. #define MOsll        033        /* set length */
  636.  
  637. #define MOsnt        034        /* set tty non-terminal status */
  638. #define MOsmn        01        /* no system messages(i.e. suppress) */
  639. #define MOsmy        00        /* yes system messages(default) */
  640. #define MOrnt        035        /* read tty non-terminal status */
  641.  
  642. /* fields of jfn mode word */
  643.  
  644. #define TT_osp        01:35-0        /* output suppress */
  645. #define TT_mff        01:35-1        /* mechanical formfeed present */
  646. #define TT_tab        01:35-2        /* mechanical tab present */
  647. #define TT_lca        01:35-3        /* lower case capabilities present */
  648. #define TT_len        0177:35-10    /* page length */
  649. #define TT_wid        0177:35-17    /* page width */
  650. #define TT_wak        017:35-23    /* wakeup field */
  651. #define TT_wk0        01:35-18    /* wakeup class 0 (unused) */
  652. #define TT_ign        01:35-19    /* ignore tt_wak on sfmod */
  653. #define TT_wkf        01:35-20    /* wakeup on formating control chars */
  654. #define TT_wkn        01:35-21    /* wakeup on non-formatting controls */
  655. #define TT_wkp        01:35-22    /* wakeup on punctuation */
  656. #define TT_wka        01:35-23    /* wakeup on alphanumerics */
  657. #define TT_eco        01:35-24    /* echos on */
  658. #define TT_ecm        01:35-25    /* echo mode */
  659. #define TT_alk        01:35-26    /* allow links */
  660. #define TT_aad        01:35-27    /* allow advice (not implemented) */
  661. #define TT_dam        03:35-29    /* data mode */
  662. #define TTbin        00        /* binary */
  663. #define TTasc        01        /* ascii */
  664. #define TTato        02        /* ascii and translate output only */
  665. #define TTate        03        /* ascii and translate echos only */
  666. #define TT_uoc        01:35-30    /* upper case output control */
  667. #define TT_lic        01:35-31    /* lower case input control */
  668. #define TT_dum        03:35-33    /* duplex mode */
  669. #define TTfdx        00        /* full duplex */
  670. #define TT0dx        01        /* not used, reserved */
  671. #define TThdx        02        /* half duplex (character) */
  672. #define TTldx        03        /* line half duplex */
  673. #define TT_pgm        01:35-34    /* page mode */
  674. #define TT_car        01:35-35    /* carrier state */
  675.  
  676. /* tlink */
  677.  
  678. #define TL_cro        01:35-0        /* clear remote to object link */
  679. #define TL_cor        01:35-1        /* clear object to remote link */
  680. #define TL_eor        01:35-2        /* establist object to remote link */
  681. #define TL_ero        01:35-3        /* establish remote to object link */
  682. #define TL_sab        01:35-4        /* set accept bit for object */
  683. #define TL_abs        01:35-5        /* accept bit state */
  684. #define TL_sta        01:35-6        /* set or clear advice */
  685. #define TL_aad        01:35-7        /* accept advice */
  686. #define TL_obj        0777777:35-35    /* object designator */
  687.  
  688. #endif /* OS_TOPS20 */
  689.  
  690. /**********************************************************************/
  691.  
  692. #if    OS_UNIX
  693.  
  694. #undef BSD42
  695. #define BSD42        1        /* want DVISPOOL code in dviterm.h */
  696.  
  697. #define DVIHELP        "man dvi\nor\napropos dvi"
  698.  
  699. #ifdef FONTLIST        /* can be set at compile time */
  700. #else
  701. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  702. #endif /* FONTLIST */
  703.  
  704. #ifdef FONTPATH            /* can be set at compile time */
  705. #else
  706. #define FONTPATH    "/usr/lib/tex/fonts/"
  707. #endif
  708.  
  709. #undef MAXOPEN
  710.  
  711. #if    HPUX
  712. #define MAXFNAME    1024    /* longest host complete filename */
  713. #define MAXOPEN        50
  714. #else  /* NOT HPUX */
  715. #define MAXFNAME    256    /* longest host complete filename */
  716. #define MAXOPEN        14
  717. #endif /* HPUX */
  718.  
  719. #ifndef PS_MAXWIDTH
  720. #define PS_MAXWIDTH    72
  721. #endif
  722.  
  723. #ifndef PS_SHORTLINES
  724. #define PS_SHORTLINES    1       /* some Unix utilities fail with long lines */
  725. #endif
  726.  
  727. #ifdef SUBPATH            /* can be set at compile time */
  728. #else
  729. #define SUBPATH        "/usr/lib/tex/macros/"
  730. #endif
  731.  
  732. #if    TEXINPUTS        /* can be set at compile time */
  733. #else
  734. #define TEXINPUTS    "TEXINPUTS"
  735. #endif
  736.  
  737. #if    TEXFONTS            /* can be set at compile time */
  738. #else
  739. #define TEXFONTS    "TEXFONTS"
  740. #endif
  741.  
  742. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  743.                 /* signex to pack 8-bit bytes back */
  744.                 /* into integer values, and in dispchar */
  745.                 /* and fillrect for managing character */
  746.                 /* raster storage. */
  747. #endif /* OS_UNIX */
  748.  
  749.  
  750. /**********************************************************************/
  751.  
  752. #if    OS_VAXVMS
  753.  
  754. /***********************************************************************
  755. ** Several standard Unix library functions do not work properly with VMS
  756. ** C, or are not implemented:
  757. **
  758. **    exit()        -- wrong conventions for return code
  759. **    fseek()        -- fails on record-oriented files
  760. **    ftell()        -- fails on record-oriented files
  761. **    getchar()    -- waits for <CR> to be typed
  762. **    getenv()    -- colon- and case-sensitive
  763. **    getlogin()    -- not implemented
  764. **    qsort()        -- not implemented
  765. **    tell()        -- not implemented
  766. **    ungetc()    -- fails for any character with high-order bit set
  767. **    unlink()    -- not implemented (equivalent available)
  768. **
  769. ** The  file  VAXVMS.C  contains   workarounds;  it  must  be   compiled
  770. ** separately and loaded with each of the DVI drivers.
  771. ***********************************************************************/
  772.  
  773. #include <jpidef.h>        /* need for getjpi() in openfont() */
  774.  
  775. #define DVIHELP        "help dvi\nor\ntype tex_inputs:dvi.hlp"
  776. #define EXIT        vms_exit
  777.  
  778. #define FILE_CNT(fp)    (*fp)->_cnt
  779. #define FILE_BASE(fp)    (*fp)->_base
  780. #define FILE_PTR(fp)    (*fp)->_ptr
  781.  
  782. #ifndef FONTLIST        /* can be set at compile time */
  783. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  784. #endif /* FONTLIST */
  785.  
  786. #ifndef FONTPATH        /* can be set at compile time */
  787. #define FONTPATH    "TEX_FONTS:" /* Kellerman & Smith VMS TeX */
  788. #endif /* FONTPATH */
  789.  
  790. #define FSEEK        vms_fseek
  791. #define FTELL        vms_ftell
  792. #define GETENV        vms_getenv
  793. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  794.                 /* signex to pack 8-bit bytes back */
  795.                 /* into integer values, and in dispchar */
  796.                 /* and fillrect for managing character */
  797.                 /* raster storage. */
  798.  
  799. #define MAXFNAME    256    /* longest host complete filename */
  800.  
  801. #undef MAXOPEN
  802. #define MAXOPEN        14
  803.  
  804. #undef  RB_OPEN
  805. #define RB_OPEN        "rb"
  806.  
  807. #ifndef PS_MAXWIDTH
  808. #define PS_MAXWIDTH    72
  809. #endif
  810.  
  811. #ifndef  PS_SHORTLINES
  812. #define PS_SHORTLINES    1       /* VMS has trouble with long lines */
  813. #endif
  814.  
  815. #define READ        vms_read /* ordinary read() returns only one disk */
  816.                 /* at each call */
  817.  
  818. #ifndef SUBPATH            /* can be set at compile time */
  819. #define SUBPATH        "TEX_INPUTS:" /* Kellerman & Smith VMS TeX */
  820. #endif
  821.  
  822. #ifndef TEXINPUTS        /* can be set at compile time */
  823. #define TEXINPUTS    "TEX_INPUTS:"
  824. #endif
  825.  
  826. #ifndef TEXFONTS        /* can be set at compile time */
  827. #define TEXFONTS    "TEX_FONTS:"
  828. #endif
  829.  
  830. #define UNGETC        vms_ungetc
  831.  
  832. /* VIRTUAL_FONTS cannot be implemented  yet.  The code  works, but the
  833. calls to FSEEK() (vms_seek) result in _filbuf() being called to refill
  834. the buffer, obviating the pre-buffering.  Additional code in case 0 of
  835. vms_seek() can probably be developed to avoid this, but I have run out
  836. of time for now. */
  837.  
  838. #undef  WB_OPEN
  839. #define WB_OPEN        "wb"
  840.  
  841. #endif /* OS_VAXVMS */
  842.  
  843. /**********************************************************************/
  844.