home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / DVI_MGR / dvimgr_s.lzh / dvimgr / machdefs.beebe < prev    next >
Text File  |  1993-08-06  |  25KB  |  833 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    1
  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. #undef PCC_20
  253. #undef OS_TOPS20
  254. #define PCC_20        1
  255. #define OS_TOPS20    1
  256. ====================*/
  257.  
  258. /*====================
  259. #undef KCC_20
  260. #undef OS_TOPS20
  261. #define KCC_20        1
  262. #define OS_TOPS20    1
  263. ====================*/
  264.  
  265. /*====================
  266. #undef  OS_ATARI
  267. #define OS_ATARI    1
  268. ====================*/
  269.  
  270. /*====================
  271. #undef  IBM_PC_LATTICE
  272. #undef  OS_PCDOS
  273. #define IBM_PC_LATTICE    1
  274. #define OS_PCDOS    1
  275. ====================*/
  276.  
  277. /*
  278. #undef  IBM_PC_MICROSOFT
  279. #undef  OS_PCDOS
  280. #define IBM_PC_MICROSOFT    1
  281. #define OS_PCDOS    1
  282. */
  283.  
  284. /*====================
  285. #undef  IBM_PC_WIZARD
  286. #undef  OS_PCDOS
  287. #define IBM_PC_WIZARD    1
  288. #define OS_PCDOS    1
  289. ====================*/
  290.  
  291. #undef  OS_VAXVMS
  292. #define OS_VAXVMS    1
  293.  
  294. #if    (OS_ATARI | OS_PCDOS | OS_TOPS20 | OS_UNIX | OS_VAXVMS)
  295. #else
  296. #undef  OS_UNIX
  297. #define OS_UNIX        1        /* provide default operating system */
  298. #endif
  299.  
  300.  
  301. /**********************************************************************/
  302.  
  303. #if    OS_ATARI
  304.  
  305. #undef  BSD42
  306. #define BSD42        1
  307.  
  308. #undef  DISKFULL
  309. #define DISKFULL(fp)    ferror(fp)
  310.  
  311. #define DVIHELP     "type e:\\tex\\dvi.hlp"
  312.  
  313. #ifdef  FONTLIST     /* can be set at compile time */
  314. #else
  315. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  316. #endif /* FONTLIST */
  317.  
  318. #ifdef FONTPATH         /* can be set at compile time */
  319. #else
  320. #define FONTPATH    "e:\\tex\\fonts\\"
  321. #endif
  322.  
  323. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  324.                 /* signex to pack 8-bit bytes back */
  325.                 /* into integer values, and in dispchar */
  326.                 /* and fillrect for managing character */
  327.                 /* raster storage. */
  328. #define MAXFNAME    64    /* longest host complete filename */
  329.  
  330. #ifndef PS_MAXWIDTH
  331. #define PS_MAXWIDTH    72
  332. #endif
  333.  
  334. #ifndef PS_SHORTLINES
  335. #define PS_SHORTLINES    1
  336. #endif
  337.  
  338. #ifdef SUBPATH            /* can be set at compile time */
  339. #else
  340. #define SUBPATH     "e:\\tex\\inputs\\"
  341. #endif
  342.  
  343. #ifdef TEXINPUTS        /* can be set at compile time */
  344. #else
  345. #define TEXINPUTS    "TEXINPUTS"
  346. #endif
  347.  
  348. #define TEXFONTS    "TEXFONTS"
  349.  
  350. #endif /* OS_ATARI */
  351.  
  352.  
  353. /**********************************************************************/
  354.  
  355. #if    OS_PCDOS
  356.  
  357. #if    IBM_PC_MICROSOFT
  358. #undef ANSI_PROTOTYPES
  359. #define ANSI_PROTOTYPES    1
  360.  
  361. /*
  362. Argument type checking in MSC Version 4.0 is selected by LINT_ARGS.
  363. MSC Version 5.0 has it selected by default.  For Version 5.0,
  364. ANSI_LIBRARY should be defined at compile time so as to get
  365. ANSI-conformant library function declarations.
  366. Treating float as double eliminates lots of data conversion warnings with 
  367. both Versions 4.0 and 5.0.
  368. */
  369. #define float double    
  370. #define LINT_ARGS    1
  371.  
  372. #undef MALLOC
  373. #define MALLOC(n)    calloc(n,1)
  374. #endif /* IBM_PC_MICROSOFT */
  375.  
  376. #define DVIHELP        "type d:\\tex\\dvi.hlp"
  377.  
  378. #undef DVIPREFIX
  379. #define DVIPREFIX    ""
  380.  
  381. #ifdef FONTLIST        /* can be set at compile time */
  382. #else
  383. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  384. #endif /* FONTLIST */
  385.  
  386. #ifdef FONTPATH            /* can be set at compile time */
  387. #else
  388. #define FONTPATH    "d:\\tex\\fonts\\"
  389. #endif /* FONTPATH */
  390.  
  391. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  392.                 /* signex to pack 8-bit bytes back */
  393.                 /* into integer values, and in dispchar */
  394.                 /* and fillrect for managing character */
  395.                 /* raster storage. */
  396. #define MAXFNAME    64    /* longest host complete filename */
  397.  
  398. #undef MAXOPEN
  399. #define MAXOPEN        5    /* limit on number of open font files */
  400.  
  401. #ifndef PS_MAXWIDTH
  402. #define PS_MAXWIDTH    72
  403. #endif
  404.  
  405. #ifndef PS_SHORTLINES
  406. #define PS_SHORTLINES    1
  407. #endif
  408.  
  409. #undef  RB_OPEN
  410. #define RB_OPEN        "rb"
  411.  
  412. #ifdef SUBPATH            /* can be set at compile time */
  413. #else
  414. #define SUBPATH        "d:\\tex\\inputs\\"
  415. #endif
  416.  
  417. #if    TEXINPUTS        /* can be set at compile time */
  418. #else
  419. #define TEXINPUTS    "TEXINPUTS"
  420. #endif
  421.  
  422. #define TEXFONTS    "TEXFONTS"
  423.  
  424. #if    IBM_PC_MICROSOFT
  425. #undef VIRTUAL_FONTS
  426. #define VIRTUAL_FONTS    1
  427. #endif
  428.  
  429. #undef  WB_OPEN
  430. #define WB_OPEN        "wb"
  431.  
  432. #endif /* OS_PCDOS */
  433.  
  434.  
  435. /***********************************************************************/
  436. #if    OS_TOPS20
  437.  
  438. /************************************************************************
  439. **
  440. **  Adapted for the DEC-20 TOPS-20  operating system with Jay  Lepreau's
  441. **  PCC-20  by  Nelson  H.F.    Beebe,  College  of  Science   Computer,
  442. **  University of Utah, Salt Lake City, UT 84112, Tel: (801) 581-5254.
  443. **
  444. **  The PCC_20 switch is  used to get around  variations on the  DEC-20.
  445. **  The major one is  that text files have  7-bit bytes, while the  .DVI
  446. **  file and the font files have 8-bit bytes.  For the latter, we use  a
  447. **  routine f20open which provides  the necessary interface for  opening
  448. **  with a ddifferent byte size.  PCC-20 follows many other C  compilers
  449. **  in that only the first 8 characters of identifiers are looked at, so
  450. **  massive substitutions  were  necessary  in the  file  commands.h  to
  451. **  shorten the long names there.
  452. **
  453. **  The PCC_20 switch is also used  to get variant font directory  names
  454. **  and to select TOPS-20 jsys  code.  TOPS-20 is a wonderous  operating
  455. **  system with  capabilities far  beyond  most of  its  contemporaries.
  456. **  Like Topsy, it  just grew, and  consequently, its many  capabilities
  457. **  are not  well  integrated.     The terminal  control  jsys'es  (MTOPR,
  458. **  RFMOD, SFMOD, STPAR, RFCOC, SFCOC and TLINK) are particularly poorly
  459. **  done -- RFMOD returns  the JFN mode word,  particular bits of  which
  460. **  must be set by SFMOD,  STPAR, and TLINK.  Why  could there not be  a
  461. **  "return  the  terminal  state"  and  "restore  the  terminal  state"
  462. **  jsys'es?  Some of this  may in fact be  already integrated into  the
  463. **  PCC-20 C run-time library, but since it is totally undocumented  (an
  464. **  all-too common problem with C),  it is essentially unusable in  that
  465. **  form.
  466. **
  467. **  The OS_TOPS20 switch is used in one place to get ioctl.h included at
  468. **  the right point, and in several places to get error messages  output
  469. **  with Tops-20 conventions in  column 1: query  (?)  causes batch  job
  470. **  abort, percent (%) flags a warning.
  471. **
  472. ***********************************************************************/
  473.  
  474. #if    KCC_20
  475. /* KCC wants all #if symbols defined before use. */
  476. #ifndef FONTLIST
  477. #define FONTLIST "PK-GF-PXL"
  478. #endif
  479.  
  480. #ifndef FONTPATH
  481. #define FONTPATH "TEXFONTS:"
  482. #endif
  483.  
  484. #ifndef SUBPATH
  485. #define SUBPATH "TEXINPUTS:"
  486. #endif
  487.  
  488. #ifndef TEXFONTS
  489. #define TEXFONTS "TEXFONTS:"
  490. #endif
  491.  
  492. #ifndef TEXINPUTS
  493. #define TEXINPUTS "TEXINPUTS:"
  494. #endif
  495.  
  496. #undef VIRTUAL_FONTS
  497. #define VIRTUAL_FONTS 0        /* cannot support this yet */
  498.  
  499. #endif
  500.  
  501. #if    KCC_20
  502. #include <jsys.h>
  503. /* KCC-20 and PCC-20  have similar enough JSYS  interfaces that we  just
  504. define values for KCC-20 using PCC-20 names. */
  505. #define JSchfdb    CHFDB
  506. #define JSmtopr    MTOPR
  507. #define JSrfcoc    RFCOC
  508. #define JSrfmod    RFMOD
  509. #define JSsfcoc    SFCOC
  510. #define JSsfmod    SFMOD
  511. #define JSsti    STI
  512. #define JSstpar    STPAR
  513. #define JStlink    TLINK
  514. #define Getmask(name)      ( 1?name )
  515. #define Getshift(name)     ( 0?name )
  516. #define Absmask(name) ( (1?name) << (0?name) )    /* maybe use this one */
  517. #define Value(name)   ( (1?name) << (0?name) )    /* maybe use this one */
  518. #define makefield(name, value)    ( ((value) & Getmask(name)) << Getshift(name) )
  519. #define getfield(var, name)    ( (var) >> Getshift(name) & Getmask(name) )
  520. #define setfield(var, name, value) ( (var) = ((var) & ~Absmask(name)) |\
  521.     makefield(name, value) )
  522. #endif
  523.  
  524. #if    PCC_20
  525. #undef  ARITHRSHIFT
  526. #define ARITHRSHIFT    0    /* PCC-20 uses logical right shift */
  527. #undef  DISKFULL
  528. #define DISKFULL(fp)    ferror(fp)    /* PCC-20 does not always set errno */
  529. #endif
  530.  
  531. #define DVIHELP    "help dvi\nor\ntype hlp:dvi.hlp\nor\nxinfo local clsc dvi"
  532.  
  533. #if    PCC_20
  534. #undef FASTZERO
  535. #define FASTZERO    1    /* for fast assembly language memory zeroing */
  536. #endif
  537.  
  538. #ifdef FONTLIST        /* can be set at compile time */
  539. #else
  540. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  541. #endif /* FONTLIST */
  542.  
  543. #ifdef FONTPATH            /* can be set at compile time */
  544. #else
  545. #define FONTPATH    "/texfonts/"
  546. #endif
  547.  
  548. #undef FOPEN
  549. #define FOPEN        f20open    /* private version for 8-bit binary */
  550.  
  551. #define HOST_WORD_SIZE    36
  552.  
  553. #undef MAXFNAME
  554. #define MAXFNAME    256    /* longest host complete filename */
  555.  
  556. #ifdef KCC_20
  557. #undef MAXOPEN
  558. #define MAXOPEN        26
  559. #endif
  560.  
  561. #ifdef PCC_20
  562. #undef MAXOPEN
  563. #define MAXOPEN        14
  564. #endif
  565.  
  566. #ifndef PS_MAXWIDTH
  567. #define PS_MAXWIDTH    72
  568. #endif
  569.  
  570. #ifndef PS_SHORTLINES
  571. #define PS_SHORTLINES    1
  572. #endif
  573.  
  574. #undef  RB_OPEN
  575. #define RB_OPEN        "rb"
  576.  
  577. #ifdef PCC_20
  578. #undef READ
  579. #define READ        _read    /* fast version with one system call */
  580. #endif
  581.                 /* and single buffering */
  582. #ifdef SUBPATH
  583. #else
  584. #define SUBPATH        "/texinputs/"
  585. #endif
  586.  
  587. #ifdef TEXFONTS            /* can be set at compile time */
  588. #else
  589. #define TEXFONTS    "TEXFONTS"
  590. #endif
  591.  
  592. #ifdef TEXINPUTS        /* can be set at compile time */
  593. #else
  594. #define TEXINPUTS    "TEXINPUTS"
  595. #endif
  596.  
  597. #if    PCC_20
  598. #undef VIRTUAL_FONTS
  599. #define VIRTUAL_FONTS    1
  600. #endif
  601.  
  602. #undef  WB_OPEN
  603. #define WB_OPEN        "wb"
  604.  
  605. /**********************************************************************/
  606. /* The following definitions (down to the endif) are taken from */
  607. /* monsym.h.   It is too big for CPP to handle, so this kludge is */
  608. /* necessary until CPP's tables can be enlarged. */
  609.  
  610. /* selected fields for CHFDB% */
  611. #define CF_nud        01:35-0        /* no update directory */
  612. #define CF_dsp        0777:35-17    /* fdb displacement */
  613. #define CF_jfn        0777777:35-35    /* jfn */
  614.  
  615. #define FBbyv        011        /* retention+bytesize+mode,,# of pages*/
  616. #define FB_ret        077:35-5    /* retention count */
  617.  
  618.  
  619. /* tty mode definitions */
  620.  
  621. #define MOrlw        030        /* read width */
  622. #define MOslw        031        /* set width */
  623. #define MOrll        032        /* read length */
  624. #define MOsll        033        /* set length */
  625.  
  626. #define MOsnt        034        /* set tty non-terminal status */
  627. #define MOsmn        01        /* no system messages(i.e. suppress) */
  628. #define MOsmy        00        /* yes system messages(default) */
  629. #define MOrnt        035        /* read tty non-terminal status */
  630.  
  631. /* fields of jfn mode word */
  632.  
  633. #define TT_osp        01:35-0        /* output suppress */
  634. #define TT_mff        01:35-1        /* mechanical formfeed present */
  635. #define TT_tab        01:35-2        /* mechanical tab present */
  636. #define TT_lca        01:35-3        /* lower case capabilities present */
  637. #define TT_len        0177:35-10    /* page length */
  638. #define TT_wid        0177:35-17    /* page width */
  639. #define TT_wak        017:35-23    /* wakeup field */
  640. #define TT_wk0        01:35-18    /* wakeup class 0 (unused) */
  641. #define TT_ign        01:35-19    /* ignore tt_wak on sfmod */
  642. #define TT_wkf        01:35-20    /* wakeup on formating control chars */
  643. #define TT_wkn        01:35-21    /* wakeup on non-formatting controls */
  644. #define TT_wkp        01:35-22    /* wakeup on punctuation */
  645. #define TT_wka        01:35-23    /* wakeup on alphanumerics */
  646. #define TT_eco        01:35-24    /* echos on */
  647. #define TT_ecm        01:35-25    /* echo mode */
  648. #define TT_alk        01:35-26    /* allow links */
  649. #define TT_aad        01:35-27    /* allow advice (not implemented) */
  650. #define TT_dam        03:35-29    /* data mode */
  651. #define TTbin        00        /* binary */
  652. #define TTasc        01        /* ascii */
  653. #define TTato        02        /* ascii and translate output only */
  654. #define TTate        03        /* ascii and translate echos only */
  655. #define TT_uoc        01:35-30    /* upper case output control */
  656. #define TT_lic        01:35-31    /* lower case input control */
  657. #define TT_dum        03:35-33    /* duplex mode */
  658. #define TTfdx        00        /* full duplex */
  659. #define TT0dx        01        /* not used, reserved */
  660. #define TThdx        02        /* half duplex (character) */
  661. #define TTldx        03        /* line half duplex */
  662. #define TT_pgm        01:35-34    /* page mode */
  663. #define TT_car        01:35-35    /* carrier state */
  664.  
  665. /* tlink */
  666.  
  667. #define TL_cro        01:35-0        /* clear remote to object link */
  668. #define TL_cor        01:35-1        /* clear object to remote link */
  669. #define TL_eor        01:35-2        /* establist object to remote link */
  670. #define TL_ero        01:35-3        /* establish remote to object link */
  671. #define TL_sab        01:35-4        /* set accept bit for object */
  672. #define TL_abs        01:35-5        /* accept bit state */
  673. #define TL_sta        01:35-6        /* set or clear advice */
  674. #define TL_aad        01:35-7        /* accept advice */
  675. #define TL_obj        0777777:35-35    /* object designator */
  676.  
  677. #endif /* OS_TOPS20 */
  678.  
  679. /**********************************************************************/
  680.  
  681. #if    OS_UNIX
  682.  
  683. #undef BSD42
  684. #define BSD42        1        /* want DVISPOOL code in dviterm.h */
  685.  
  686. #define DVIHELP        "man dvi\nor\napropos dvi"
  687.  
  688. #ifdef FONTLIST        /* can be set at compile time */
  689. #else
  690. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  691. #endif /* FONTLIST */
  692.  
  693. #ifdef FONTPATH            /* can be set at compile time */
  694. #else
  695. #define FONTPATH    "/usr/lib/tex/fonts/"
  696. #endif
  697.  
  698. #undef MAXOPEN
  699.  
  700. #if    HPUX
  701. #define MAXFNAME    1024    /* longest host complete filename */
  702. #define MAXOPEN        50
  703. #else  /* NOT HPUX */
  704. #define MAXFNAME    256    /* longest host complete filename */
  705. #define MAXOPEN        14
  706. #endif /* HPUX */
  707.  
  708. #ifndef PS_MAXWIDTH
  709. #define PS_MAXWIDTH    72
  710. #endif
  711.  
  712. #ifndef PS_SHORTLINES
  713. #define PS_SHORTLINES    1       /* some Unix utilities fail with long lines */
  714. #endif
  715.  
  716. #ifdef SUBPATH            /* can be set at compile time */
  717. #else
  718. #define SUBPATH        "/usr/lib/tex/macros/"
  719. #endif
  720.  
  721. #if    TEXINPUTS        /* can be set at compile time */
  722. #else
  723. #define TEXINPUTS    "TEXINPUTS"
  724. #endif
  725.  
  726. #if    TEXFONTS            /* can be set at compile time */
  727. #else
  728. #define TEXFONTS    "TEXFONTS"
  729. #endif
  730.  
  731. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  732.                 /* signex to pack 8-bit bytes back */
  733.                 /* into integer values, and in dispchar */
  734.                 /* and fillrect for managing character */
  735.                 /* raster storage. */
  736. #endif /* OS_UNIX */
  737.  
  738.  
  739. /**********************************************************************/
  740.  
  741. #if    OS_VAXVMS
  742.  
  743. /***********************************************************************
  744. ** Several standard Unix library functions do not work properly with VMS
  745. ** C, or are not implemented:
  746. **
  747. **    exit()        -- wrong conventions for return code
  748. **    fseek()        -- fails on record-oriented files
  749. **    ftell()        -- fails on record-oriented files
  750. **    getchar()    -- waits for <CR> to be typed
  751. **    getenv()    -- colon- and case-sensitive
  752. **    getlogin()    -- not implemented
  753. **    qsort()        -- not implemented
  754. **    tell()        -- not implemented
  755. **    ungetc()    -- fails for any character with high-order bit set
  756. **    unlink()    -- not implemented (equivalent available)
  757. **
  758. ** The  file  VAXVMS.C  contains   workarounds;  it  must  be   compiled
  759. ** separately and loaded with each of the DVI drivers.
  760. ***********************************************************************/
  761.  
  762. #include <jpidef.h>        /* need for getjpi() in openfont() */
  763.  
  764. #define DVIHELP        "type tex$doc:DVIXXX.hlp"
  765. #define EXIT        vms_exit
  766.  
  767. #define FILE_CNT(fp)    (*fp)->_cnt
  768. #define FILE_BASE(fp)    (*fp)->_base
  769. #define FILE_PTR(fp)    (*fp)->_ptr
  770.  
  771. #ifndef FONTLIST        /* can be set at compile time */
  772. #define FONTLIST    "PK"    /* preferred search order */
  773. #endif /* FONTLIST */
  774.  
  775. #ifndef FONTPATH        /* can be set at compile time */
  776. #define FONTPATH    "TEX_FONTS:" /* Kellerman & Smith VMS TeX */
  777. #endif /* FONTPATH */
  778.  
  779. #define FSEEK        vms_fseek
  780. #define FTELL        vms_ftell
  781. #define GETENV        vms_getenv
  782. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  783.                 /* signex to pack 8-bit bytes back */
  784.                 /* into integer values, and in dispchar */
  785.                 /* and fillrect for managing character */
  786.                 /* raster storage. */
  787.  
  788. #define MAXFNAME    256    /* longest host complete filename */
  789.  
  790. #undef MAXOPEN
  791. #define MAXOPEN        14
  792.  
  793. #undef  RB_OPEN
  794. #define RB_OPEN        "rb"
  795.  
  796. #ifndef PS_MAXWIDTH
  797. #define PS_MAXWIDTH    72
  798. #endif
  799.  
  800. #ifndef  PS_SHORTLINES
  801. #define PS_SHORTLINES    1       /* VMS has trouble with long lines */
  802. #endif
  803.  
  804. #define READ        vms_read /* ordinary read() returns only one disk */
  805.                 /* at each call */
  806.  
  807. #ifndef SUBPATH            /* can be set at compile time */
  808. #define SUBPATH        "TEX_INPUTS:" /* Kellerman & Smith VMS TeX */
  809. #endif
  810.  
  811. #ifndef TEXINPUTS        /* can be set at compile time */
  812. #define TEXINPUTS    "TEX_INPUTS:"
  813. #endif
  814.  
  815. #ifndef TEXFONTS        /* can be set at compile time */
  816. #define TEXFONTS    "TEX_FONTS:"
  817. #endif
  818.  
  819. #define UNGETC        vms_ungetc
  820.  
  821. /* VIRTUAL_FONTS cannot be implemented  yet.  The code  works, but the
  822. calls to FSEEK() (vms_seek) result in _filbuf() being called to refill
  823. the buffer, obviating the pre-buffering.  Additional code in case 0 of
  824. vms_seek() can probably be developed to avoid this, but I have run out
  825. of time for now. */
  826.  
  827. #undef  WB_OPEN
  828. #define WB_OPEN        "wb"
  829.  
  830. #endif /* OS_VAXVMS */
  831.  
  832. /**********************************************************************/
  833.