home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / TeXsource / beebe / h / machdefs < prev    next >
Encoding:
Text File  |  1990-05-18  |  29.9 KB  |  912 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.         OS_RISCOS       -- Acorn Archimedes running RISCOS
  97.  
  98. Device names (defined in each DVIxxx.C file):
  99.         APPLEIMAGEWRITER -- Apple ImageWriter printer
  100.         BBNBITGRAPH     -- BBN BitGraph terminal
  101.         CANON_A2        -- Canon LBP-8 A2 laser printer
  102.         DECLA75         -- DEC LA75 printer
  103.         DECLN03PLUS     -- DEC LN03-PLUS laser printer
  104.         EPSON           -- Epson 9-pin family dot-matrix printer
  105.         GOLDENDAWNGL100 -- Golden Dawn GL100 laser printer
  106.         HPJETPLUS       -- Hewlett-Packard Laser Jet Plus (downloaded fonts)
  107.         HPLASERJET      -- Hewlett-Packard Laser Jet (bitmap display)
  108.         IMPRESS         -- imPRESS (IMAGEN laser printer)
  109.         MPISPRINTER     -- MPI Sprinter printer
  110.         OKIDATA2410     -- OKIData 2410 printer
  111.         POSTSCRIPT      -- Adobe PostScript (Apple LaserWriter laser printer)
  112.         PRINTRONIX      -- Printronix (DEC LXY-11, C-Itoh) printer
  113.         TOSHIBAP1351    -- Toshiba P-1351 dot matrix printer
  114.  
  115. ***********************************************************************/
  116.  
  117. /**********************************************************************
  118. Define all symbols for devices, operating systems, and implementations
  119. to be explicitly 0, unless it is expected that they might be set at
  120. compile time.
  121. ***********************************************************************/
  122.  
  123. #define ALLOW_INTERRUPT 0
  124. #define ANSI_PROTOTYPES 0
  125.  
  126. #ifndef ANSI_LIBRARY            /* may be specified at compile time */
  127. #define ANSI_LIBRARY    0
  128. #endif
  129.  
  130. #if    ANSI_LIBRARY
  131. #undef ANSI_PROTOTYPES
  132. #define ANSI_PROTOTYPES 1       /* If library conforms, declarations do too */
  133. #endif
  134.  
  135. #define ARITHRSHIFT     1 /* most C compilers use arithmetic right shift */
  136. #define DISKFULL(fp)    (ferror(fp) && (errno == ENOSPC))
  137. #define DVIEXT          ".dvi"
  138. #define DVIPREFIX       "dvi-"
  139. #define EXIT            exit
  140. #define FASTZERO        0
  141.  
  142. /* The following definitions work for at least PCC-20, BSD 4.2 and  4.3,
  143. and HPUX;  VAX  VMS  has  an extra  level  of  indirection.   Check  the
  144. definition of fileno(fp) in stdio.h; on PCC-20, it is
  145.         #define fileno(p) ((p)->_file)
  146. */
  147. #define FILE_CNT(fp)    (fp)->_cnt
  148. #define FILE_BASE(fp)   (fp)->_base
  149. #define FILE_PTR(fp)    (fp)->_ptr
  150.  
  151. /* #define FONTLIST     0 -- can be set at compile time */
  152. /* #define FONTPATH     0 -- can be set at compile time */
  153.  
  154. #define FOPEN           fopen
  155. #define FSEEK           fseek
  156. #define FTELL           ftell
  157. #define GETENV          getenv
  158. #define HIRES           0
  159. #define MALLOC(n)       malloc(n)
  160. #define MAXDRIFT        2       /* we insist that
  161.                                 abs|(hh-pixel_round(h))<=MAXDRIFT| */
  162.  
  163. /* MAXOPEN  should  be 6  less  than the  system  limit on  open  files,
  164. allowing for  files  open  on stdin,  stdout,  stderr,  .dvi,  .dvi-log,
  165. .dvi-xxx, plus MAXOPEN font  files.  It may  be additionally limited  by
  166. the amount of memory available for buffers (e.g. IBM PC). */
  167. #define MAXOPEN         14
  168.  
  169. /* #define PS_MAXWIDTH  72 -- can be set at compile time */
  170.  
  171. /* #define PS_SHORTLINES 0 -- can be set at compile time */
  172.  
  173. #define PS_XONXOFFBUG   0
  174. #define PXLID           0
  175. #define RB_OPEN         "r"
  176.  
  177. /* For virtual font caching to succeed, read() must return the requested
  178. number of bytes, and  preferably do this  with one system   call  and no
  179. double buffering. */
  180.  
  181. #define READ            read
  182.  
  183. /* In  many  implementations, rewind(fp)  is  defined as  equivalent  to
  184. fseek(fp,0L,0).  In  some, however  (e.g.  PCC-20,  and probably  others
  185. based on PCC), it additionally discards input buffer contents, which may
  186. cause unnecessary I/O, and in the case of virtual font caching,   clears
  187. the cache.  Defining  it in  terms of fseek()  should be  okay, but  the
  188. implementation of fseek() should be checked. */
  189.  
  190. #define REWIND(fp)      FSEEK(fp,0L,0)
  191.  
  192. #define SEGMEM          0       /* may be reset by dvixxx for big bitmaps */
  193. #define STDRES          0
  194.  
  195. /* #define SUBPATH      0 -- can be set at compile time */
  196.  
  197. #define SUBEXT          ".sub"
  198. #define SUBNAME         "texfonts"
  199.  
  200. /* #define TEXFONTS     0 -- can be set at compile time */
  201. /* #define TEXINPUTS    0 -- can be set at compile time */
  202.  
  203. #define UNGETC          ungetc
  204. #define USEGLOBALMAG    0
  205. #define WB_OPEN         "w"
  206. #define ZAPTHISOUT      0
  207.  
  208.  
  209. /**********************************************************************/
  210. /* Clear all implementation/operating-system flags--reset later */
  211.  
  212. #define ATT             0       /* define zero or one of these */
  213. #define BSD41           0
  214. #define BSD42           0
  215. #define HPUX            0
  216. #define IBM_PC_LATTICE  0
  217. #define IBM_PC_MICROSOFT        0
  218. #define IBM_PC_WIZARD   0
  219. #define KCC_20          0
  220. #define PCC_20          0
  221.  
  222. #define OS_ATARI        0       /* define one of these */
  223. #define OS_PCDOS        0
  224. #define OS_TOPS20       0
  225. #define OS_UNIX         0
  226. #define OS_VAXVMS       0
  227. #define OS_RISCOS       0
  228.  
  229. #define APPLEIMAGEWRITER        0       /* one will be defined by DVIxxx */
  230. #define BBNBITGRAPH     0
  231. #define CANON_A2        0
  232. #define DECLA75         0
  233. #define DECLN03PLUS     0
  234. #define EPSON           0
  235. #define GOLDENDAWNGL100 0
  236. #define HPJETPLUS       0
  237. #define HPLASERJET      0
  238. #define IMPRESS         0
  239. #define MPISPRINTER     0
  240. #define OKIDATA2410     0
  241. #define POSTSCRIPT      0
  242. #define PRINTRONIX      0
  243. #define TOSHIBAP1351    0
  244. #define VIRTUAL_FONTS   0
  245.  
  246.  
  247. /***********************************************************************
  248. Define operating system and implementation  here.  Since these have  all
  249. been explicitly set  to 0  above, we  issue #undef's  to avoid  compiler
  250. macro redefinition warning messages.
  251. ***********************************************************************/
  252.  
  253. /*====================
  254. #undef PCC_20
  255. #undef OS_TOPS20
  256. #define PCC_20          1
  257. #define OS_TOPS20       1
  258. ====================*/
  259.  
  260. /*====================
  261. #undef KCC_20
  262. #undef OS_TOPS20
  263. #define KCC_20          1
  264. #define OS_TOPS20       1
  265. ====================*/
  266.  
  267. /*====================
  268. #undef  OS_ATARI
  269. #define OS_ATARI        1
  270. ====================*/
  271.  
  272. /*====================
  273. #undef  IBM_PC_LATTICE
  274. #undef  OS_PCDOS
  275. #define IBM_PC_LATTICE  1
  276. #define OS_PCDOS        1
  277. ====================*/
  278.  
  279. /*====================
  280. #undef  IBM_PC_MICROSOFT
  281. #undef  OS_PCDOS
  282. #define IBM_PC_MICROSOFT        1
  283. #define OS_PCDOS        1
  284. ====================*/
  285.  
  286.  
  287. /*====================
  288. #undef  IBM_PC_WIZARD
  289. #undef  OS_PCDOS
  290. #define IBM_PC_WIZARD   1
  291. #define OS_PCDOS        1
  292. ====================*/
  293.  
  294. /*====================
  295. #undef  OS_VAXVMS
  296. #define OS_VAXVMS       1
  297. ====================*/
  298.  
  299. /*====================*/
  300. #undef OS_RISCOS
  301. #define OS_RISCOS 1
  302. /*====================*/
  303.  
  304.  
  305. #if    (OS_ATARI | OS_PCDOS | OS_TOPS20 | OS_UNIX | OS_VAXVMS | OS_RISCOS)
  306. #else
  307. #undef  OS_UNIX
  308. #define OS_UNIX         1               /* provide default operating system */
  309. #endif
  310.  
  311.  
  312. /**********************************************************************/
  313.  
  314. #if    OS_ATARI
  315.  
  316. #undef  BSD42
  317. #define BSD42           1
  318.  
  319. #undef  DISKFULL
  320. #define DISKFULL(fp)    ferror(fp)
  321.  
  322. #define DVIHELP         "type e:\\tex\\dvi.hlp"
  323.  
  324. #ifdef  FONTLIST        /* can be set at compile time */
  325. #else
  326. #define FONTLIST        "PK-GF-PXL"     /* preferred search order */
  327. #endif /* FONTLIST */
  328.  
  329. #ifdef FONTPATH                 /* can be set at compile time */
  330. #else
  331. #define FONTPATH        "e:\\tex\\fonts\\"
  332. #endif
  333.  
  334. #define HOST_WORD_SIZE  32      /* must be 32 or larger -- used in */
  335.                                 /* signex to pack 8-bit bytes back */
  336.                                 /* into integer values, and in dispchar */
  337.                                 /* and fillrect for managing character */
  338.                                 /* raster storage. */
  339. #define MAXFNAME        64      /* longest host complete filename */
  340.  
  341. #ifndef PS_MAXWIDTH
  342. #define PS_MAXWIDTH     72
  343. #endif
  344.  
  345. #ifndef PS_SHORTLINES
  346. #define PS_SHORTLINES   1
  347. #endif
  348.  
  349. #ifdef SUBPATH                  /* can be set at compile time */
  350. #else
  351. #define SUBPATH         "e:\\tex\\inputs\\"
  352. #endif
  353.  
  354. #ifdef TEXINPUTS                /* can be set at compile time */
  355. #else
  356. #define TEXINPUTS       "TEXINPUTS"
  357. #endif
  358.  
  359. #define TEXFONTS        "TEXFONTS"
  360.  
  361. #endif /* OS_ATARI */
  362.  
  363.  
  364. /**********************************************************************/
  365.  
  366. #if    OS_PCDOS
  367.  
  368. #if    IBM_PC_MICROSOFT
  369. #undef ANSI_PROTOTYPES
  370. #define ANSI_PROTOTYPES 1
  371.  
  372. /*
  373. Argument type checking in MSC Version 4.0 is selected by LINT_ARGS.
  374. MSC Version 5.0 has it selected by default.  For Version 5.0,
  375. ANSI_LIBRARY should be defined at compile time so as to get
  376. ANSI-conformant library function declarations.
  377. Treating float as double eliminates lots of data conversion warnings with 
  378. 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_RISCOS
  753.  
  754. #undef ANSI_LIBRARY
  755. #define ANSI_LIBRARY 1
  756. #undef ANSI_PROTOTYPES
  757. #define ANSI_PROTOTYPES 1
  758.  
  759. #define DVIHELP         "help dvi."
  760.  
  761. #ifdef FONTLIST         /* can be set at compile time */
  762. #else
  763. #define FONTLIST        "PK-GF-PXL"     /* preferred search order */
  764. #endif /* FONTLIST */
  765.  
  766. #ifdef FONTPATH                 /* can be set at compile time */
  767. #else
  768. #define FONTPATH        "texfonts:"
  769. #endif
  770.  
  771. #undef  DISKFULL
  772. #define DISKFULL(fp)    ferror(fp)
  773.  
  774.  
  775. #define MAXFNAME        256     /* longest host complete filename */
  776.  
  777. #undef MAXOPEN
  778. #define MAXOPEN         3       /* This is abysmal but it works... */
  779.  
  780. #ifndef PS_MAXWIDTH
  781. #define PS_MAXWIDTH     72
  782. #endif
  783.  
  784. #ifndef PS_SHORTLINES
  785. #define PS_SHORTLINES   1       /* some Unix utilities fail with long lines */
  786. #endif
  787.  
  788. #ifdef SUBPATH                  /* can be set at compile time */
  789. #else
  790. #define SUBPATH         "texinputs:"
  791. #endif
  792.  
  793. #ifdef    TEXINPUTS                /* can be set at compile time */
  794. #else
  795. #define TEXINPUTS       "TEXINPUTS"
  796. #endif
  797.  
  798. #ifdef    TEXFONTS                 /* can be set at compile time */
  799. #else
  800. #define TEXFONTS        "TEXFONTS"
  801. #endif
  802.  
  803. #define HOST_WORD_SIZE  32      /* must be 32 or larger -- used in */
  804.                                 /* signex to pack 8-bit bytes back */
  805.                                 /* into integer values, and in dispchar */
  806.                                 /* and fillrect for managing character */
  807.                                 /* raster storage. */
  808.  
  809. #undef WB_OPEN
  810. #define WB_OPEN "wb"
  811.  
  812. #undef RB_OPEN
  813. #define RB_OPEN "rb"
  814.  
  815. #endif /* OS_RISCOS */
  816.  
  817.  
  818. /**********************************************************************/
  819.  
  820. #if    OS_VAXVMS
  821.  
  822. /***********************************************************************
  823. ** Several standard Unix library functions do not work properly with VMS
  824. ** C, or are not implemented:
  825. **
  826. **      exit()          -- wrong conventions for return code
  827. **      fseek()         -- fails on record-oriented files
  828. **      ftell()         -- fails on record-oriented files
  829. **      getchar()       -- waits for <CR> to be typed
  830. **      getenv()        -- colon- and case-sensitive
  831. **      getlogin()      -- not implemented
  832. **      qsort()         -- not implemented
  833. **      tell()          -- not implemented
  834. **      ungetc()        -- fails for any character with high-order bit set
  835. **      unlink()        -- not implemented (equivalent available)
  836. **
  837. ** The  file  VAXVMS.C  contains   workarounds;  it  must  be   compiled
  838. ** separately and loaded with each of the DVI drivers.
  839. ***********************************************************************/
  840.  
  841. #include <jpidef.h>             /* need for getjpi() in openfont() */
  842.  
  843. #define DVIHELP         "help dvi\nor\ntype tex_inputs:dvi.hlp"
  844. #define EXIT            vms_exit
  845.  
  846. #define FILE_CNT(fp)    (*fp)->_cnt
  847. #define FILE_BASE(fp)   (*fp)->_base
  848. #define FILE_PTR(fp)    (*fp)->_ptr
  849.  
  850. #ifndef FONTLIST                /* can be set at compile time */
  851. #define FONTLIST        "PK-GF-PXL"     /* preferred search order */
  852. #endif /* FONTLIST */
  853.  
  854. #ifndef FONTPATH                /* can be set at compile time */
  855. #define FONTPATH        "TEX_FONTS:" /* Kellerman & Smith VMS TeX */
  856. #endif /* FONTPATH */
  857.  
  858. #define FSEEK           vms_fseek
  859. #define FTELL           vms_ftell
  860. #define GETENV          vms_getenv
  861. #define HOST_WORD_SIZE  32      /* must be 32 or larger -- used in */
  862.                                 /* signex to pack 8-bit bytes back */
  863.                                 /* into integer values, and in dispchar */
  864.                                 /* and fillrect for managing character */
  865.                                 /* raster storage. */
  866.  
  867. #define MAXFNAME        256     /* longest host complete filename */
  868.  
  869. #undef MAXOPEN
  870. #define MAXOPEN         14
  871.  
  872. #undef  RB_OPEN
  873. #define RB_OPEN         "rb"
  874.  
  875. #ifndef PS_MAXWIDTH
  876. #define PS_MAXWIDTH     72
  877. #endif
  878.  
  879. #ifndef  PS_SHORTLINES
  880. #define PS_SHORTLINES   1       /* VMS has trouble with long lines */
  881. #endif
  882.  
  883. #define READ            vms_read /* ordinary read() returns only one disk */
  884.                                 /* at each call */
  885.  
  886. #ifndef SUBPATH                 /* can be set at compile time */
  887. #define SUBPATH         "TEX_INPUTS:" /* Kellerman & Smith VMS TeX */
  888. #endif
  889.  
  890. #ifndef TEXINPUTS               /* can be set at compile time */
  891. #define TEXINPUTS       "TEX_INPUTS:"
  892. #endif
  893.  
  894. #ifndef TEXFONTS                /* can be set at compile time */
  895. #define TEXFONTS        "TEX_FONTS:"
  896. #endif
  897.  
  898. #define UNGETC          vms_ungetc
  899.  
  900. /* VIRTUAL_FONTS cannot be implemented  yet.  The code  works, but the
  901. calls to FSEEK() (vms_seek) result in _filbuf() being called to refill
  902. the buffer, obviating the pre-buffering.  Additional code in case 0 of
  903. vms_seek() can probably be developed to avoid this, but I have run out
  904. of time for now. */
  905.  
  906. #undef  WB_OPEN
  907. #define WB_OPEN         "wb"
  908.  
  909. #endif /* OS_VAXVMS */
  910.  
  911. /**********************************************************************/
  912.