!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This file should contain definitions for symbols used for all operating
system / implementation dependencies, and if the driver family has
already been implemented on you machine, this should be the only file
requiring changes.
How to change this file:
* locate the operating system and implementation definitions;
they are surrounded by "=====" comment strings.
* comment out the definitions you do not want, and select the
ones for your system
* if adding a new operating system, create a new symbol OS_xxx
for it and add a new #if OS_xxx ... #endif section for its
changes.
* if adding a new implementation for an existing operating
system, create a new symbol for it and add appropriate
conditionals inside its #if OS_xxx ... #end section.
* if you must replace a standard C library function, replace
instances of its use in the source code with an upper-case
equivalent (e.g. ungetc --> UNGETC), then define the
upper-case name below in the generic section, plus the
operating-system section.
List of symbols actually used for #if's [14-Aug-87]
Flags and strings:
ALLOW_INTERRUPT -- allow interactive interrupt
ANSI_PROTOTYPES -- draft ANSI C function prototype declarations are
supported
ANSI_LIBRARY -- draft ANSI C library functions conformance
ARITHRSHIFT -- implementation uses arithmetic (not logical) right
shift
DVIHELP -- how to find documentation (for usage())
DVIPREFIX -- prefix to standard 3-character extension of output
and log files
FASTZERO -- fast bitmap zeroing by external assembly language
routine
FONTLIST -- font type search list (PK, GF, PXL)
FONTPATH -- font directory path
HIRES -- high resolution variant of bitmap output
HOST_WORD_SIZE -- host integer word size in bits
PS_MAXWIDTH -- approximate line width limit for PostScript output
PS_SHORTLINES -- shorter output lines in PostScript
PS_XONXOFFBUG -- PostScript version 23.0 Xon/Xoff bug workaround
PXLID -- TeX PXL file ID
RB_OPEN -- fopen() mode flags for binary read
SEGMEM -- segmented memory (Intel); bitmap is raster vector
STDRES -- standard resolution (200 dpi)
SUBPATH -- substitution font file path
TEXFONTS -- TeX font file path environment variable
TEXINPUTS -- TeX input file path environment variable
USEGLOBALMAG -- allow runtime global magnification scaling
VIRTUAL_FONTS -- implement virtual font caching
WB_OPEN -- fopen() mode flags for binary write
ZAPTHISOUT -- remove some obsolete code
Alternate library routines for misfeature workarounds (these have the
same names as standard library routines, but upper-cased):
EXIT
FOPEN
FSEEK
FTELL
GETENV
MALLOC(n)
READ
REWIND(fp)
UNGETC
C Implementations:
ATT -- AT&T Unix (System III, V)
BSD41 -- Berkeley 4.1BSD
BSD42 -- Berkeley 4.2BSD
HPUX -- HP 9000 series Unix (System V based)
IBM_PC_LATTICE -- IBM PC Lattice C compiler
IBM_PC_MICROSOFT-- IBM PC Microsoft Version 3.x or later C compiler
IBM_PC_WIZARD -- IBM PC Wizard C compiler
KCC_20 -- SRI's KCC Compiler on TOPS-20
PCC_20 -- Portable C Compiler on TOPS-20
Operating systems:
OS_ATARI -- Atari 520ST+ TOS (similar to MS DOS)
OS_PCDOS -- IBM (and clones) PC DOS and MS DOS
OS_IBMOS2 -- IBM (and clones) IBM OS/2 and MS OS/2
OS_TOPS20 -- DEC-20 TOPS-20
OS_UNIX -- Unix (almost any variant)
OS_VAXVMS -- VAX VMS
/**********************************************************************
Define all symbols for devices, operating systems, and implementations
to be explicitly 0, unless it is expected that they might be set at
compile time.
***********************************************************************/
#ifndef ANSI_LIBRARY /* may be specified at compile time */
#define ANSI_LIBRARY 0
#endif
#if ANSI_LIBRARY
#undef ANSI_PROTOTYPES
#define ANSI_PROTOTYPES 1 /* If library conforms, declarations do too */
#endif
#define ARITHRSHIFT 1 /* most C compilers use arithmetic right shift */
#define DISKFULL(fp) (ferror(fp) && (errno == ENOSPC))
#define DVIEXT ".dvi"
#define DVIPREFIX "dvi-"
#define EXIT exit
#define FASTZERO 0
/* The following definitions work for at least PCC-20, BSD 4.2 and 4.3,
and HPUX; VAX VMS has an extra level of indirection. Check the
definition of fileno(fp) in stdio.h; on PCC-20, it is
#define fileno(p) ((p)->_file)
*/
#define FILE_CNT(fp) (fp)->_cnt
#define FILE_BASE(fp) (fp)->_base
#define FILE_PTR(fp) (fp)->_ptr
/* #define FONTLIST 0 -- can be set at compile time */
/* #define FONTPATH 0 -- can be set at compile time */
/* MAXOPEN should be 6 less than the system limit on open files,
allowing for files open on stdin, stdout, stderr, .dvi, .dvi-log,
dvi-xxx, plus MAXOPEN font files. It may be additionally limited by
the amount of memory available for buffers (e.g. IBM PC). */
#define MAXOPEN 14
/* #define PS_MAXWIDTH 72 -- can be set at compile time */
/* #define PS_SHORTLINES 0 -- can be set at compile time */
/* For virtual font caching to succeed, read() must return the requested
number of bytes, and preferably do this with one system call and no
double buffering. */
#define READ read
/* In many implementations, rewind(fp) is defined as equivalent to
fseek(fp,0L,0). In some, however (e.g. PCC-20, and probably others
based on PCC), it additionally discards input buffer contents, which may
cause unnecessary I/O, and in the case of virtual font caching, clears
the cache. Defining it in terms of fseek() should be okay, but the
implementation of fseek() should be checked. */
#define REWIND(fp) FSEEK(fp,0L,0)
#define SEGMEM 0 /* may be reset by dvixxx for big bitmaps */
#define STDRES 0
/* #define SUBPATH 0 -- can be set at compile time */
#define SUBEXT ".sub"
#define SUBNAME "texfonts"
/* #define TEXFONTS 0 -- can be set at compile time */
/* #define TEXINPUTS 0 -- can be set at compile time */
/***********************************************************************
Define operating system and implementation here. Since these have all
been explicitly set to 0 above, we issue #undef's to avoid compiler
macro redefinition warning messages.
***********************************************************************/
#ifdef FONTLIST /* can be set at compile time */
#else
#define FONTLIST "PK-GF-PXL" /* preferred search order */
#endif /* FONTLIST */
#ifdef FONTPATH /* can be set at compile time */
#else
#define FONTPATH "e:\\tex\\fonts\\"
#endif
#define HOST_WORD_SIZE 32 /* must be 32 or larger -- used in */
/* signex to pack 8-bit bytes back */
/* into integer values, and in dispchar */
/* and fillrect for managing character */
/* raster storage. */
#define MAXFNAME 64 /* longest host complete filename */
/*
Argument type checking in MSC Version 4.0 is selected by LINT_ARGS.
MSC Version 5.0 has it selected by default. For Version 5.0,
ANSI_LIBRARY should be defined at compile time so as to get
ANSI-conformant library function declarations.
Treating float as double eliminates lots of data conversion warnings with
both Versions 4.0 and 5.0.
*/
#define float double
#define LINT_ARGS 1
#ifdef FONTLIST /* can be set at compile time */
#else
#define FONTLIST "PK-GF-PXL" /* preferred search order */
#endif /* FONTLIST */
#ifdef FONTPATH /* can be set at compile time */
#else
#define FONTPATH "d:\\tex\\fonts\\"
#endif /* FONTPATH */
#define HOST_WORD_SIZE 32 /* must be 32 or larger -- used in */
/* signex to pack 8-bit bytes back */
/* into integer values, and in dispchar */
/* and fillrect for managing character */
/* raster storage. */
#define MAXFNAME 64 /* longest host complete filename */
#undef MAXOPEN
#define MAXOPEN 5 /* limit on number of open font files */
/************************************************************************
**
** Adapted for the DEC-20 TOPS-20 operating system with Jay Lepreau's
** PCC-20 by Nelson H.F. Beebe, College of Science Computer,
** University of Utah, Salt Lake City, UT 84112, Tel: (801) 581-5254.
**
** The PCC_20 switch is used to get around variations on the DEC-20.
** The major one is that text files have 7-bit bytes, while the .DVI
** file and the font files have 8-bit bytes. For the latter, we use a
** routine f20open which provides the necessary interface for opening
** with a ddifferent byte size. PCC-20 follows many other C compilers
** in that only the first 8 characters of identifiers are looked at, so
** massive substitutions were necessary in the file commands.h to
** shorten the long names there.
**
** The PCC_20 switch is also used to get variant font directory names
** and to select TOPS-20 jsys code. TOPS-20 is a wonderous operating
** system with capabilities far beyond most of its contemporaries.
** Like Topsy, it just grew, and consequently, its many capabilities
** are not well integrated. The terminal control jsys'es (MTOPR,
** RFMOD, SFMOD, STPAR, RFCOC, SFCOC and TLINK) are particularly poorly
** done -- RFMOD returns the JFN mode word, particular bits of which
** must be set by SFMOD, STPAR, and TLINK. Why could there not be a
** "return the terminal state" and "restore the terminal state"
** jsys'es? Some of this may in fact be already integrated into the
** PCC-20 C run-time library, but since it is totally undocumented (an
** all-too common problem with C), it is essentially unusable in that
** form.
**
** The OS_TOPS20 switch is used in one place to get ioctl.h included at
** the right point, and in several places to get error messages output
** with Tops-20 conventions in column 1: query (?) causes batch job
** abort, percent (%) flags a warning.
**
***********************************************************************/
#if KCC_20
/* KCC wants all #if symbols defined before use. */
#ifndef FONTLIST
#define FONTLIST "PK-GF-PXL"
#endif
#ifdef PCC_20
#undef READ
#define READ _read /* fast version with one system call */
#endif
/* and single buffering */
#ifdef SUBPATH
#else
#define SUBPATH "/texinputs/"
#endif
#ifdef TEXFONTS /* can be set at compile time */
#else
#define TEXFONTS "TEXFONTS"
#endif
#ifdef TEXINPUTS /* can be set at compile time */
#else
#define TEXINPUTS "TEXINPUTS"
#endif
/**********************************************************************/
/* The following definitions (down to the endif) are taken from */
/* monsym.h. It is too big for CPP to handle, so this kludge is */
/* necessary until CPP's tables can be enlarged. */
#ifndef PS_SHORTLINES
#define PS_SHORTLINES 1 /* some Unix utilities fail with long lines */
#endif
#ifdef SUBPATH /* can be set at compile time */
#else
#define SUBPATH "/usr/lib/tex/macros/"
#endif
#if TEXINPUTS /* can be set at compile time */
#else
#define TEXINPUTS "TEXINPUTS"
#endif
#if TEXFONTS /* can be set at compile time */
#else
#define TEXFONTS "TEXFONTS"
#endif
#define HOST_WORD_SIZE 32 /* must be 32 or larger -- used in */
/* signex to pack 8-bit bytes back */
/* into integer values, and in dispchar */
/* and fillrect for managing character */
/* raster storage. */
#endif /* OS_UNIX */
/***********************************************************************
** Several standard Unix library functions do not work properly with VMS
** C, or are not implemented:
**
** exit() -- wrong conventions for return code
** fseek() -- fails on record-oriented files
** ftell() -- fails on record-oriented files
** getchar() -- waits for <CR> to be typed
** getenv() -- colon- and case-sensitive
** getlogin() -- not implemented
** qsort() -- not implemented
** tell() -- not implemented
** ungetc() -- fails for any character with high-order bit set
** unlink() -- not implemented (equivalent available)
**
** The file VAXVMS.C contains workarounds; it must be compiled
** separately and loaded with each of the DVI drivers.
***********************************************************************/
#include <jpidef.h> /* need for getjpi() in openfont() */
#ifndef FONTLIST /* can be set at compile time */
#define FONTLIST "PK-GF-PXL" /* preferred search order */
#endif /* FONTLIST */
#ifndef FONTPATH /* can be set at compile time */
#define FONTPATH "TEX_FONTS:" /* Kellerman & Smith VMS TeX */
#endif /* FONTPATH */
#define FSEEK vms_fseek
#define FTELL vms_ftell
#define GETENV vms_getenv
#define HOST_WORD_SIZE 32 /* must be 32 or larger -- used in */
/* signex to pack 8-bit bytes back */
/* into integer values, and in dispchar */
/* and fillrect for managing character */
/* raster storage. */
#ifndef PS_SHORTLINES
#define PS_SHORTLINES 1 /* VMS has trouble with long lines */
#endif
#define READ vms_read /* ordinary read() returns only one disk */
/* at each call */
#ifndef SUBPATH /* can be set at compile time */
#define SUBPATH "TEX_INPUTS:" /* Kellerman & Smith VMS TeX */
#endif
#ifndef TEXINPUTS /* can be set at compile time */
#define TEXINPUTS "TEX_INPUTS:"
#endif
#ifndef TEXFONTS /* can be set at compile time */
#define TEXFONTS "TEX_FONTS:"
#endif
#define UNGETC vms_ungetc
/* VIRTUAL_FONTS cannot be implemented yet. The code works, but the
calls to FSEEK() (vms_seek) result in _filbuf() being called to refill
the buffer, obviating the pre-buffering. Additional code in case 0 of
vms_seek() can probably be developed to avoid this, but I have run out
of time for now. */