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 / dvi_fbi_hh / INCLUDES / machdefs.h < prev    next >
Text File  |  1993-05-06  |  25KB  |  839 lines

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