Back to index

tetex-bin  3.0
config.h
Go to the documentation of this file.
00001 /* $Id: config.h,v 2.1 1996/05/20 11:05:07 neumann Exp $ */
00002 
00003 /* gcc -ansi doesn't predefine `unix', since ANSI forbids it.  And AIX
00004    generally doesn't predefine unix, who knows why.  HP-UX is, of course,
00005    also different.  Apple's MacOsX is also unix-like.  */
00006 #ifndef unix
00007 #if defined (__unix__) || defined (_AIX) || defined (_HPUX_SOURCE)
00008 #define unix
00009 #elif defined (__APPLE__) && defined (__MACH__)
00010 #define unix
00011 #elif defined (__NetBSD__)
00012 #define unix
00013 #endif
00014 #endif
00015 
00016 #define USEPXL
00017 
00018 #ifdef __riscos
00019 /* #define RISC_USE_OSL */        /* use file functions of OSlib */
00020 /* #define RISC_BUFFER  */        /* buffer output */
00021 #endif
00022 
00023 /*
00024  *  default font path
00025  *  can be overridden by environment variable TEXPXL
00026  *  or -a command line option
00027  *  popular choice:
00028  * #define  FONTAREA       "/usr/local/lib/tex/fonts/pk"
00029  */
00030 #ifndef FONTAREA
00031 # ifdef __riscos
00032 #  define FONTAREA    "TeXFonts:"
00033 # else
00034 #  ifdef vms
00035 #   define FONTAREA    "tex$pkdir:"
00036 #  else
00037 #   ifdef _AMIGA
00038 #    define FONTAREA    "TeXMF:pk"
00039 #   else
00040 #    define FONTAREA    "/usr/local/lib/tex/fonts/pk"
00041 #   endif
00042 #  endif
00043 # endif
00044 #endif
00045 
00046 /* if DO_SUBDIRECTORIES is specified, search to this depth */
00047 #ifndef MAX_SUBDIR_SEARCH_DEPTH
00048 #define MAX_SUBDIR_SEARCH_DEPTH 10
00049 #endif
00050 
00051 /*
00052  * if your LaserJet II P or LaserJet III or LaserJet 2000
00053  * complains about not enough memory, you might try to reduce
00054  * the value below or uncomment to use the default settings
00055  */
00056 #if defined (LJ2P) || defined (LJ4)
00057 #define  MAX_FONTS_PER_PAGE 255         /* maximum number of fonts per page */
00058 #endif
00059 
00060 
00061 /* Timing is not very portable.... if you have troubles, use
00062  * -DNO_TIMING in the Makefile
00063  */
00064 
00065 #ifdef u3b2
00066 #define NO_TIMING
00067 #endif
00068 #ifdef _AMIGA
00069 #define NO_TIMING
00070 #endif
00071 #ifdef KPATHSEA
00072 #define NO_TIMING
00073 #define MAKETEXPK
00074 #endif
00075 #ifdef __riscos
00076 #define NO_TIMING
00077 #endif
00078 
00079 #ifndef NO_TIMING
00080 #define TIMING
00081 #endif
00082 
00083 /*
00084  * per default use mktexpk in unix environments unless it is not wanted
00085  */
00086 #ifdef unix
00087 #ifndef MAKETEXPK
00088 /* name of the program which is called to generate missing pk files
00089  */
00090 #define MAKETEXPK "mktexpk"
00091 #endif
00092 #endif
00093 
00094 #ifdef _AMIGA
00095 #ifndef MAKETEXPK
00096 /* name of the program which is called to generate missing pk files
00097  */
00098 #define MAKETEXPK "mktexpk"
00099 #endif
00100 #endif
00101 
00102 #ifdef __riscos
00103 #ifndef MAKETEXPK
00104 #define MAKETEXPK "mktexpk"
00105 #endif
00106 #endif
00107 
00108 #ifdef NO_MAKETEXPK
00109 #undef MAKETEXPK
00110 #endif
00111 
00112 /*
00113  * assure that LJ2P is defined when LJ4 is defined;
00114  * compile with support for LJ4's resident fonts
00115  */
00116 #ifdef LJ4
00117 #define LJ2P
00118 #define LJ_RESIDENT_FONTS
00119 #endif
00120 
00121 /*
00122  * assure that LJ2 is defined when LJ2P is defined
00123  */
00124 #ifdef LJ2P
00125 #ifndef LJ2
00126 #define LJ2
00127 #endif
00128 #endif
00129 
00130 /*
00131  * assure that LJ is defined when LJ2 of LJ4 is defined
00132  */
00133 #if defined(LJ2)
00134 #ifndef LJ
00135 #define LJ
00136 #endif
00137 #endif
00138 
00139 /*
00140  * assure that IBM3812 is not defined when LJ is defined
00141  */
00142 #ifdef LJ
00143 #ifdef IBM3812
00144 #undef IBM3812
00145 #endif
00146 #endif
00147 
00148 #ifdef LJ_RESIDENT_FONTS
00149 # ifndef DEFAULT_TFM_PATH
00150 #  ifdef __riscos
00151 #   define FONTAREA    "TeXFonts:"
00152 #  else
00153 #   define DEFAULT_TFM_PATH   "/usr/local/lib/tex/fonts"
00154 #  endif
00155 # endif
00156 #endif
00157 
00158 
00159 #define  _TRUE      (bool) 1
00160 #define  _FALSE     (bool) 0
00161 #define  UNKNOWN     -1
00162 
00163 #define  STRSIZE         255     /* stringsize for file specifications  */
00164 
00165 
00166 #ifdef __riscos
00167 # ifndef types_H                  /* for compatibility with OSLib */
00168 typedef  int     bool;
00169 # endif
00170 #else
00171 typedef  char    bool;
00172 #endif
00173 
00174 
00175 /* The smallest signed type: use `signed char' if ANSI C, `short' if
00176    char is unsigned, otherwise `char'.  */
00177 #ifndef SCHAR_TYPE
00178 #if __STDC__
00179 #define SCHAR_TYPE signed char
00180 #else /* not __STDC */
00181 #ifdef __CHAR_UNSIGNED__
00182 #define SCHAR_TYPE short
00183 #else
00184 #define SCHAR_TYPE char
00185 #endif
00186 #endif /* not __STDC__ */
00187 #endif /* not SCHAR_TYPE */
00188 typedef SCHAR_TYPE signed_char;
00189 
00190 #if !defined(u3b2) && !defined(LONG_64_BITS)
00191 #define  ARITHMETIC_RIGHT_SHIFT
00192 #endif
00193 
00194 #ifndef SIZEOF_LONG
00195 # ifdef __riscos
00196 #  define SIZEOF_LONG 8
00197 # endif
00198 #endif
00199 
00200 #if SIZEOF_LONG > 4
00201 # define long4 int
00202 #else
00203 # define long4 long
00204 #endif
00205 
00206 #ifdef __STDC__
00207 #define NeedFunctionPrototypes 1
00208 #include <stdarg.h>
00209 #else
00210 #define NeedFunctionPrototypes 0
00211 #include <varargs.h>
00212 #endif
00213 
00214 #if NeedFunctionPrototypes
00215 #define NeedVarargsPrototypes 1
00216 #endif
00217 
00218 #ifndef KPATHSEA
00219 extern bool findfile(
00220 #if NeedFunctionPrototypes
00221 char path[], char n[], long4 fontmag, char name[], 
00222              bool tfm, int level
00223 #endif
00224     );
00225 #endif
00226 
00227 
00228 /*
00229  * maximal number of characters in font file
00230  * #define  LASTFNTCHAR  127        7-bit classic version
00231  * #define  LASTFNTCHAR  255        8-bit fonts
00232  */
00233 #ifdef SEVENBIT
00234 # define LASTFNTCHAR 127
00235 #else
00236 # define LASTFNTCHAR  255
00237 #endif
00238 
00239 
00240 
00241 /* this information is needed in findfile.c and dvi2xx.c, NO CUSTOMIZATION */
00242 #ifdef LJ
00243 # ifndef MFMODE300
00244 #  define MFMODE300 "cx"     /* mode definition for metafont 300dpi */
00245 # endif
00246 # ifdef LJ4
00247 #  ifndef MFMODE600
00248 #   define MFMODE600 "ljfour"    /* mode definition for metafont 600dpi */
00249 #  endif
00250 # else
00251 #  define MFMODE MFMODE300       /* default mode */
00252 # endif
00253 #endif
00254 
00255 #ifdef IBM3812
00256 #define RESOLUTION    240
00257 #ifndef MFMODE
00258 #define MFMODE "IBMThreeEightOneTwo"    /* mode definition for metafont */
00259 #endif
00260 #endif
00261 
00262 #if defined (unix) && !defined (__DJGPP__)
00263 #define OS "Unix"
00264 #define READ_BINARY     "r"
00265 #define WRITE_BINARY    "w"
00266 #ifndef labs
00267 #define labs(x) abs(x)
00268 #endif
00269 #endif
00270 
00271 #ifdef MSDOS
00272 # define OS "MS-DOS"
00273 # define READ_BINARY     "rb"
00274 # define WRITE_BINARY    "wb"
00275 # ifdef __DJGPP__
00276 #  include <io.h>           /* for prototype of `setmode' */
00277 #  define AssureBinary(f) setmode((f), O_BINARY)
00278 # else
00279 #  define MSC5                     /* assume Microsoft C */
00280 # endif
00281 #endif
00282 #ifdef OS2
00283 #define OS "OS/2"
00284 #define READ_BINARY     "rb"
00285 #define WRITE_BINARY    "wb"
00286 #define MSC5
00287 #endif
00288 #ifdef WIN32
00289 #define OS "Win32"
00290 #define READ_BINARY     "rb"
00291 #define WRITE_BINARY    "wb"
00292 #  include <io.h>           /* for prototype of `_setmode' */
00293 #  define AssureBinary(f) _setmode((f), _O_BINARY)
00294 #define MSC10
00295 #endif
00296 
00297 #ifdef vms
00298 #define OS "VMS"
00299 #include <ssdef.h>
00300 #include <stsdef.h>
00301 #define ftell vms_ftell                /* use some external routines, because */
00302 #define fseek vms_fseek                /* of some bugs in the VMS run time    */
00303 #define getchar vms_getchar     /* library */
00304 #define getenv vms_getenv
00305 #define ungetc vms_ungetc
00306 #define getname vms_getname
00307 #define READ_BINARY     "rb"
00308 #define WRITE_BINARY    "wb","rfm=fix","bls=512","mrs=512" /* fixed records */
00309 #define labs(x) abs(x)
00310 #endif
00311 
00312 #ifdef _AMIGA
00313 #define OS "Amiga"
00314 #define READ_BINARY     "r"
00315 #define WRITE_BINARY    "w"
00316 #ifdef __SASC
00317 #define sys_errlist __sys_errlist
00318 #include <stdlib.h>
00319 #endif
00320 #endif
00321 
00322 #ifdef unix
00323 # include <stdio.h>
00324 #endif
00325 
00326 #ifdef HAVE_UNISTD_H
00327 # include <unistd.h>
00328 #endif
00329 
00330 #ifdef __riscos
00331 # define OS "RISC OS"
00332 # ifdef RISC_USE_OSL
00333 #  define READ_BINARY     0x43  /* if using fopen stuff reset to "rb", "wb" */
00334 #  define WRITE_BINARY    0x83
00335 # else
00336 #  define READ_BINARY     "rb"
00337 #  define WRITE_BINARY    "wb"
00338 # endif
00339 # define ERR_STREAM stdout   /* ???? */
00340 # else
00341 # define ERR_STREAM stderr
00342 #endif
00343 
00344 /*
00345 #ifndef TRUE
00346 #define TRUE 1
00347 #endif
00348 #ifndef FALSE
00349 #define FALSE 0
00350 #endif
00351 */
00352 
00353 
00354 /* Information returned by tfm_read_info. */
00355 typedef struct {
00356   /* These string lengths are imposed by the TFM format. Either of these
00357      values may be the empty string.  */
00358   unsigned char coding_scheme[40];
00359   unsigned char family[20];
00360 
00361   /* The second fontdimen. */
00362   unsigned interword;
00363 
00364   /* These values are what will work to select the font in PCL. If this
00365      TFM file doesn't have the `KN' extensions (distinguishable by the
00366      family == "HPAUTOTFM"). */
00367 #define SPACING_FIXED 0
00368 #define SPACING_PROPORTIONAL 1
00369   unsigned spacing;
00370   int weight;
00371   unsigned style;
00372   unsigned typeface_id;
00373 
00374   /* TFM files can always have 256 characters, even if we're using the
00375      old pixel format that only supports 128. The values are fix-words
00376      scaled by the design size; i.e., straight from the TFM file. */
00377   long4 widths[256];
00378 } tfm_info_type;
00379 
00380 #ifdef KPATHSEA
00381 #define BOPENCMD xfopen
00382 #else
00383 #define BOPENCMD fopen /* ???? */
00384 #endif
00385 
00386 /* Set up file stuff */
00387 #ifdef RISC_USE_OSL
00388 #include "fromosl.h"
00389 typedef  os_f FILEPTR;
00390 #define   read_byte(fp,char) os_bget(fp,&char)
00391 #define  write_byte(fp,char) os_bput(char,fp)
00392 #define  read_multi(buf,n,s,fp) osgbpb_read(fp,(byte*)buf,(s)*(n))
00393 #define write_multi(buf,n,s,fp) osgbpb_write(fp,(byte*)buf,(s)*(n))
00394 #define   BINOPEN(f) osfind_openin(READ_BINARY,f,NULL)
00395 #define  BOUTOPEN(f) osfind_openout(WRITE_BINARY,f,NULL)
00396 #define    BCLOSE(f) osfind_close(f)
00397 #define      FEOF(f) osargs_read_eof_status(f)
00398 #define FSEEK(f,pos,whence) os_seek(f,pos,whence)
00399 #define     FTELL(f) osargs_read_ptr(f)
00400 #define FPNULL 0
00401 #else
00402 typedef  FILE *FILEPTR;
00403 #define   read_byte(fp,char) char = fgetc(fp)
00404 #define  write_byte(fp,char) fputc(char,fp)
00405 #define  read_multi(buf,n,s,fp) fread(buf,n,s,fp)
00406 #define write_multi(buf,n,s,fp) fwrite(buf,n,s,fp)
00407 #define   BINOPEN(f) BOPENCMD(f,READ_BINARY)
00408 #define  BOUTOPEN(f) BOPENCMD(f,WRITE_BINARY)
00409 #define    BCLOSE(f) fclose(f)
00410 #define      FEOF(f) feof(f)
00411 #define FSEEK(f,pos,whence) fseek(f,pos,whence)
00412 #define     FTELL(f) ftell(f)
00413 #define FPNULL NULL
00414 #endif
00415 
00416 
00417 #define BUFFSIZE 8192  /* ???? */
00418 
00419 #ifndef SEEK_SET
00420 # define SEEK_SET 0
00421 #endif
00422 #ifndef SEEK_CUR
00423 # define SEEK_CUR 1
00424 #endif
00425 #ifndef SEEK_END
00426 # define SEEK_END 2
00427 #endif
00428 
00429 #ifndef O_BINARY
00430 # ifdef _O_BINARY
00431 #  define O_BINARY _O_BINARY
00432 # else
00433 #  define O_BINARY 0
00434 #endif
00435 #endif
00436 
00437 #if !defined (AssureBinary) && !defined (MSC5)
00438 # define AssureBinary(f)  0
00439 #endif
00440 
00441 #ifndef HAVE_VPRINTF
00442 #ifdef HAVE_DOPRNT
00443 #define       vfprintf(stream, message, args)    _doprnt(message, args, stream)
00444 /* If we have neither, should fall back to fprintf with fixed args.  */
00445 #endif
00446 #endif