| 1 |
/* $Id: config.h,v 2.1 1996/05/20 11:05:07 neumann Exp $ */ |
| 2 |
|
| 3 |
/* gcc -ansi doesn't predefine `unix', since ANSI forbids it. And AIX |
| 4 |
generally doesn't predefine unix, who knows why. HP-UX is, of course, |
| 5 |
also different. Apple's MacOsX is also unix-like. */ |
| 6 |
#ifndef unix |
| 7 |
#if defined (__unix__) || defined (_AIX) || defined (_HPUX_SOURCE) |
| 8 |
#define unix |
| 9 |
#elif defined (__APPLE__) && defined (__MACH__) |
| 10 |
#define unix |
| 11 |
#elif defined (__NetBSD__) |
| 12 |
#define unix |
| 13 |
#endif |
| 14 |
#endif |
| 15 |
|
| 16 |
#define USEPXL |
| 17 |
|
| 18 |
#include <stdbool.h> |
| 19 |
|
| 20 |
#ifdef __riscos |
| 21 |
/* #define RISC_USE_OSL */ /* use file functions of OSlib */ |
| 22 |
/* #define RISC_BUFFER */ /* buffer output */ |
| 23 |
#endif |
| 24 |
|
| 25 |
/* |
| 26 |
* default font path |
| 27 |
* can be overridden by environment variable TEXPXL |
| 28 |
* or -a command line option |
| 29 |
* popular choice: |
| 30 |
* #define FONTAREA "/usr/local/lib/tex/fonts/pk" |
| 31 |
*/ |
| 32 |
#ifndef FONTAREA |
| 33 |
# ifdef __riscos |
| 34 |
# define FONTAREA "TeXFonts:" |
| 35 |
# else |
| 36 |
# ifdef vms |
| 37 |
# define FONTAREA "tex$pkdir:" |
| 38 |
# else |
| 39 |
# ifdef _AMIGA |
| 40 |
# define FONTAREA "TeXMF:pk" |
| 41 |
# else |
| 42 |
# define FONTAREA "/usr/local/lib/tex/fonts/pk" |
| 43 |
# endif |
| 44 |
# endif |
| 45 |
# endif |
| 46 |
#endif |
| 47 |
|
| 48 |
/* if DO_SUBDIRECTORIES is specified, search to this depth */ |
| 49 |
#ifndef MAX_SUBDIR_SEARCH_DEPTH |
| 50 |
#define MAX_SUBDIR_SEARCH_DEPTH 10 |
| 51 |
#endif |
| 52 |
|
| 53 |
/* |
| 54 |
* if your LaserJet II P or LaserJet III or LaserJet 2000 |
| 55 |
* complains about not enough memory, you might try to reduce |
| 56 |
* the value below or uncomment to use the default settings |
| 57 |
*/ |
| 58 |
#if defined (LJ2P) || defined (LJ4) |
| 59 |
#define MAX_FONTS_PER_PAGE 255 /* maximum number of fonts per page */ |
| 60 |
#endif |
| 61 |
|
| 62 |
|
| 63 |
/* Timing is not very portable.... if you have troubles, use |
| 64 |
* -DNO_TIMING in the Makefile |
| 65 |
*/ |
| 66 |
|
| 67 |
#ifdef u3b2 |
| 68 |
#define NO_TIMING |
| 69 |
#endif |
| 70 |
#ifdef _AMIGA |
| 71 |
#define NO_TIMING |
| 72 |
#endif |
| 73 |
#ifdef KPATHSEA |
| 74 |
#define NO_TIMING |
| 75 |
#define MAKETEXPK |
| 76 |
#endif |
| 77 |
#ifdef __riscos |
| 78 |
#define NO_TIMING |
| 79 |
#endif |
| 80 |
|
| 81 |
#ifndef NO_TIMING |
| 82 |
#define TIMING |
| 83 |
#endif |
| 84 |
|
| 85 |
/* |
| 86 |
* per default use mktexpk in unix environments unless it is not wanted |
| 87 |
*/ |
| 88 |
#ifdef unix |
| 89 |
#ifndef MAKETEXPK |
| 90 |
/* name of the program which is called to generate missing pk files |
| 91 |
*/ |
| 92 |
#define MAKETEXPK "mktexpk" |
| 93 |
#endif |
| 94 |
#endif |
| 95 |
|
| 96 |
#ifdef _AMIGA |
| 97 |
#ifndef MAKETEXPK |
| 98 |
/* name of the program which is called to generate missing pk files |
| 99 |
*/ |
| 100 |
#define MAKETEXPK "mktexpk" |
| 101 |
#endif |
| 102 |
#endif |
| 103 |
|
| 104 |
#ifdef __riscos |
| 105 |
#ifndef MAKETEXPK |
| 106 |
#define MAKETEXPK "mktexpk" |
| 107 |
#endif |
| 108 |
#endif |
| 109 |
|
| 110 |
#ifdef NO_MAKETEXPK |
| 111 |
#undef MAKETEXPK |
| 112 |
#endif |
| 113 |
|
| 114 |
/* |
| 115 |
* assure that LJ2P is defined when LJ4 is defined; |
| 116 |
* compile with support for LJ4's resident fonts |
| 117 |
*/ |
| 118 |
#ifdef LJ4 |
| 119 |
#define LJ2P |
| 120 |
#define LJ_RESIDENT_FONTS |
| 121 |
#endif |
| 122 |
|
| 123 |
/* |
| 124 |
* assure that LJ2 is defined when LJ2P is defined |
| 125 |
*/ |
| 126 |
#ifdef LJ2P |
| 127 |
#ifndef LJ2 |
| 128 |
#define LJ2 |
| 129 |
#endif |
| 130 |
#endif |
| 131 |
|
| 132 |
/* |
| 133 |
* assure that LJ is defined when LJ2 of LJ4 is defined |
| 134 |
*/ |
| 135 |
#if defined(LJ2) |
| 136 |
#ifndef LJ |
| 137 |
#define LJ |
| 138 |
#endif |
| 139 |
#endif |
| 140 |
|
| 141 |
/* |
| 142 |
* assure that IBM3812 is not defined when LJ is defined |
| 143 |
*/ |
| 144 |
#ifdef LJ |
| 145 |
#ifdef IBM3812 |
| 146 |
#undef IBM3812 |
| 147 |
#endif |
| 148 |
#endif |
| 149 |
|
| 150 |
#ifdef LJ_RESIDENT_FONTS |
| 151 |
# ifndef DEFAULT_TFM_PATH |
| 152 |
# ifdef __riscos |
| 153 |
# define FONTAREA "TeXFonts:" |
| 154 |
# else |
| 155 |
# define DEFAULT_TFM_PATH "/usr/local/lib/tex/fonts" |
| 156 |
# endif |
| 157 |
# endif |
| 158 |
#endif |
| 159 |
|
| 160 |
|
| 161 |
#define _TRUE (bool) 1 |
| 162 |
#define _FALSE (bool) 0 |
| 163 |
#define UNKNOWN -1 |
| 164 |
|
| 165 |
#define STRSIZE 255 /* stringsize for file specifications */ |
| 166 |
|
| 167 |
|
| 168 |
/* The smallest signed type: use `signed char' if ANSI C, `short' if |
| 169 |
char is unsigned, otherwise `char'. */ |
| 170 |
#ifndef SCHAR_TYPE |
| 171 |
#if __STDC__ |
| 172 |
#define SCHAR_TYPE signed char |
| 173 |
#else /* not __STDC */ |
| 174 |
#ifdef __CHAR_UNSIGNED__ |
| 175 |
#define SCHAR_TYPE short |
| 176 |
#else |
| 177 |
#define SCHAR_TYPE char |
| 178 |
#endif |
| 179 |
#endif /* not __STDC__ */ |
| 180 |
#endif /* not SCHAR_TYPE */ |
| 181 |
typedef SCHAR_TYPE signed_char; |
| 182 |
|
| 183 |
#if !defined(u3b2) && !defined(LONG_64_BITS) |
| 184 |
#define ARITHMETIC_RIGHT_SHIFT |
| 185 |
#endif |
| 186 |
|
| 187 |
#ifndef SIZEOF_LONG |
| 188 |
# ifdef __riscos |
| 189 |
# define SIZEOF_LONG 8 |
| 190 |
# endif |
| 191 |
#endif |
| 192 |
|
| 193 |
#if SIZEOF_LONG > 4 |
| 194 |
# define long4 int |
| 195 |
# define FMT_long4 "%d" |
| 196 |
#else |
| 197 |
# define long4 long |
| 198 |
# define FMT_long4 "%ld" |
| 199 |
#endif |
| 200 |
|
| 201 |
#include <stdarg.h> |
| 202 |
|
| 203 |
#ifndef KPATHSEA |
| 204 |
#error "Would need changed findfile, dviljk has changed allocation semantic of name member in tfontptr" |
| 205 |
#endif |
| 206 |
|
| 207 |
|
| 208 |
/* |
| 209 |
* maximal number of characters in font file |
| 210 |
* #define LASTFNTCHAR 127 7-bit classic version |
| 211 |
* #define LASTFNTCHAR 255 8-bit fonts |
| 212 |
*/ |
| 213 |
#ifdef SEVENBIT |
| 214 |
# define LASTFNTCHAR 127 |
| 215 |
#else |
| 216 |
# define LASTFNTCHAR 255 |
| 217 |
#endif |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
/* this information is needed in findfile.c and dvi2xx.c, NO CUSTOMIZATION */ |
| 222 |
#ifdef LJ |
| 223 |
# ifndef MFMODE300 |
| 224 |
# define MFMODE300 "cx" /* mode definition for metafont 300dpi */ |
| 225 |
# endif |
| 226 |
# ifdef LJ4 |
| 227 |
# ifndef MFMODE600 |
| 228 |
# define MFMODE600 "ljfour" /* mode definition for metafont 600dpi */ |
| 229 |
# endif |
| 230 |
# else |
| 231 |
# define MFMODE MFMODE300 /* default mode */ |
| 232 |
# endif |
| 233 |
#endif |
| 234 |
|
| 235 |
#ifdef IBM3812 |
| 236 |
#define RESOLUTION 240 |
| 237 |
#ifndef MFMODE |
| 238 |
#define MFMODE "IBMThreeEightOneTwo" /* mode definition for metafont */ |
| 239 |
#endif |
| 240 |
#endif |
| 241 |
|
| 242 |
#if defined (unix) && !defined (__DJGPP__) |
| 243 |
#define OS "Unix" |
| 244 |
#define READ_BINARY "r" |
| 245 |
#define WRITE_BINARY "w" |
| 246 |
#ifndef labs |
| 247 |
#define labs(x) abs(x) |
| 248 |
#endif |
| 249 |
#endif |
| 250 |
|
| 251 |
#ifdef MSDOS |
| 252 |
# define OS "MS-DOS" |
| 253 |
# define READ_BINARY "rb" |
| 254 |
# define WRITE_BINARY "wb" |
| 255 |
# ifdef __DJGPP__ |
| 256 |
# include <io.h> /* for prototype of `setmode' */ |
| 257 |
# define AssureBinary(f) setmode((f), O_BINARY) |
| 258 |
# else |
| 259 |
# define MSC5 /* assume Microsoft C */ |
| 260 |
# endif |
| 261 |
#endif |
| 262 |
#ifdef OS2 |
| 263 |
#define OS "OS/2" |
| 264 |
#define READ_BINARY "rb" |
| 265 |
#define WRITE_BINARY "wb" |
| 266 |
#define MSC5 |
| 267 |
#endif |
| 268 |
#ifdef WIN32 |
| 269 |
#define OS "Win32" |
| 270 |
#define READ_BINARY "rb" |
| 271 |
#define WRITE_BINARY "wb" |
| 272 |
# include <io.h> /* for prototype of `_setmode' */ |
| 273 |
# define AssureBinary(f) _setmode((f), _O_BINARY) |
| 274 |
#define MSC10 |
| 275 |
#endif |
| 276 |
|
| 277 |
#ifdef vms |
| 278 |
#define OS "VMS" |
| 279 |
#include <ssdef.h> |
| 280 |
#include <stsdef.h> |
| 281 |
#define ftell vms_ftell /* use some external routines, because */ |
| 282 |
#define fseek vms_fseek /* of some bugs in the VMS run time */ |
| 283 |
#define getchar vms_getchar /* library */ |
| 284 |
#define getenv vms_getenv |
| 285 |
#define ungetc vms_ungetc |
| 286 |
#define getname vms_getname |
| 287 |
#define READ_BINARY "rb" |
| 288 |
#define WRITE_BINARY "wb","rfm=fix","bls=512","mrs=512" /* fixed records */ |
| 289 |
#define labs(x) abs(x) |
| 290 |
#endif |
| 291 |
|
| 292 |
#ifdef _AMIGA |
| 293 |
#define OS "Amiga" |
| 294 |
#define READ_BINARY "r" |
| 295 |
#define WRITE_BINARY "w" |
| 296 |
#ifdef __SASC |
| 297 |
#define sys_errlist __sys_errlist |
| 298 |
#include <stdlib.h> |
| 299 |
#endif |
| 300 |
#endif |
| 301 |
|
| 302 |
#ifdef unix |
| 303 |
# include <stdio.h> |
| 304 |
#endif |
| 305 |
|
| 306 |
#ifdef HAVE_UNISTD_H |
| 307 |
# include <unistd.h> |
| 308 |
#endif |
| 309 |
|
| 310 |
#ifdef __riscos |
| 311 |
# define OS "RISC OS" |
| 312 |
# ifdef RISC_USE_OSL |
| 313 |
# define READ_BINARY 0x43 /* if using fopen stuff reset to "rb", "wb" */ |
| 314 |
# define WRITE_BINARY 0x83 |
| 315 |
# else |
| 316 |
# define READ_BINARY "rb" |
| 317 |
# define WRITE_BINARY "wb" |
| 318 |
# endif |
| 319 |
# define ERR_STREAM stdout /* ???? */ |
| 320 |
# else |
| 321 |
# define ERR_STREAM stderr |
| 322 |
#endif |
| 323 |
|
| 324 |
/* |
| 325 |
#ifndef TRUE |
| 326 |
#define TRUE 1 |
| 327 |
#endif |
| 328 |
#ifndef FALSE |
| 329 |
#define FALSE 0 |
| 330 |
#endif |
| 331 |
*/ |
| 332 |
|
| 333 |
#ifdef KPATHSEA |
| 334 |
#define BOPENCMD xfopen |
| 335 |
#else |
| 336 |
#define BOPENCMD fopen /* ???? */ |
| 337 |
#endif |
| 338 |
|
| 339 |
/* Set up file stuff */ |
| 340 |
#ifdef RISC_USE_OSL |
| 341 |
#include "fromosl.h" |
| 342 |
typedef os_f FILEPTR; |
| 343 |
#define read_byte(fp,char) os_bget(fp,&char) |
| 344 |
#define write_byte(fp,char) os_bput(char,fp) |
| 345 |
#define read_multi(buf,n,s,fp) osgbpb_read(fp,(byte*)buf,(s)*(n)) |
| 346 |
#define write_multi(buf,n,s,fp) osgbpb_write(fp,(byte*)buf,(s)*(n)) |
| 347 |
#define BINOPEN(f) osfind_openin(READ_BINARY,f,NULL) |
| 348 |
#define BOUTOPEN(f) osfind_openout(WRITE_BINARY,f,NULL) |
| 349 |
#define BCLOSE(f) osfind_close(f) |
| 350 |
#define FEOF(f) osargs_read_eof_status(f) |
| 351 |
#define FSEEK(f,pos,whence) os_seek(f,pos,whence) |
| 352 |
#define FTELL(f) osargs_read_ptr(f) |
| 353 |
#define FPNULL 0 |
| 354 |
#else |
| 355 |
typedef FILE *FILEPTR; |
| 356 |
#define read_byte(fp,char) char = fgetc(fp) |
| 357 |
#define write_byte(fp,char) fputc(char,fp) |
| 358 |
#define read_multi(buf,n,s,fp) fread(buf,n,s,fp) |
| 359 |
#define write_multi(buf,n,s,fp) fwrite(buf,n,s,fp) |
| 360 |
#define BINOPEN(f) BOPENCMD(f,READ_BINARY) |
| 361 |
#define BOUTOPEN(f) BOPENCMD(f,WRITE_BINARY) |
| 362 |
#define BCLOSE(f) fclose(f) |
| 363 |
#define FEOF(f) feof(f) |
| 364 |
#define FSEEK(f,pos,whence) fseek(f,pos,whence) |
| 365 |
#define FTELL(f) ftell(f) |
| 366 |
#define FPNULL NULL |
| 367 |
#endif |
| 368 |
|
| 369 |
|
| 370 |
#define BUFFSIZE 8192 /* ???? */ |
| 371 |
|
| 372 |
#ifndef SEEK_SET |
| 373 |
# define SEEK_SET 0 |
| 374 |
#endif |
| 375 |
#ifndef SEEK_CUR |
| 376 |
# define SEEK_CUR 1 |
| 377 |
#endif |
| 378 |
#ifndef SEEK_END |
| 379 |
# define SEEK_END 2 |
| 380 |
#endif |
| 381 |
|
| 382 |
#ifndef O_BINARY |
| 383 |
# ifdef _O_BINARY |
| 384 |
# define O_BINARY _O_BINARY |
| 385 |
# else |
| 386 |
# define O_BINARY 0 |
| 387 |
#endif |
| 388 |
#endif |
| 389 |
|
| 390 |
#if !defined (AssureBinary) && !defined (MSC5) |
| 391 |
# define AssureBinary(f) 0 |
| 392 |
#endif |
| 393 |
|
| 394 |
#ifndef HAVE_VPRINTF |
| 395 |
#ifdef HAVE_DOPRNT |
| 396 |
#define vfprintf(stream, message, args) _doprnt(message, args, stream) |
| 397 |
/* If we have neither, should fall back to fprintf with fixed args. */ |
| 398 |
#endif |
| 399 |
#endif |
| 400 |
|
| 401 |
/* If unlink and rmdir are not there, we don't delete the temporary files. */ |
| 402 |
#ifndef HAVE_RMDIR |
| 403 |
#define rmdir(dir) |
| 404 |
#endif |
| 405 |
#ifndef HAVE_UNLINK |
| 406 |
#define unlink(file) |
| 407 |
#endif |
| 408 |
|
| 409 |
/* If mkdtemp() does not exist, we have to use mktemp() or tmpnam() |
| 410 |
and mkdir(). For the latter, we need the declaration. */ |
| 411 |
#ifndef HAVE_MKDTEMP |
| 412 |
#include <sys/types.h> |
| 413 |
#include <sys/stat.h> |
| 414 |
#endif |
| 415 |
|
| 416 |
#ifndef KPATHSEA |
| 417 |
/* FIXME: Should provide a strdup function. But currently this tree is |
| 418 |
only used in connection with kpathsea anyhow. */ |
| 419 |
#error "Need xstrdup and xmalloc function, e.g. from kpathsea" |
| 420 |
#endif |