summaryrefslogtreecommitdiff
path: root/dviware/dviljk/config.h
blob: a92d247157574fbc49676ef34e91731272d21cca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
/* $Id: config.h,v 2.1 1996/05/20 11:05:07 neumann Exp $ */

/* gcc -ansi doesn't predefine `unix', since ANSI forbids it.  And AIX
   generally doesn't predefine unix, who knows why.  HP-UX is, of course,
   also different.  Apple's MacOsX is also unix-like.  */
#ifndef unix
#if defined (__unix__) || defined (_AIX) || defined (_HPUX_SOURCE)
#define unix
#elif defined (__APPLE__) && defined (__MACH__)
#define unix
#elif defined (__NetBSD__)
#define unix
#endif
#endif

#define USEPXL

#ifdef __riscos
/* #define RISC_USE_OSL */        /* use file functions of OSlib */
/* #define RISC_BUFFER  */        /* buffer output */
#endif

/*
 *  default font path
 *  can be overridden by environment variable TEXPXL
 *  or -a command line option
 *  popular choice:
 * #define  FONTAREA       "/usr/local/lib/tex/fonts/pk"
 */
#ifndef FONTAREA
# ifdef __riscos
#  define FONTAREA    "TeXFonts:"
# else
#  ifdef vms
#   define FONTAREA    "tex$pkdir:"
#  else
#   ifdef _AMIGA
#    define FONTAREA    "TeXMF:pk"
#   else
#    define FONTAREA    "/usr/local/lib/tex/fonts/pk"
#   endif
#  endif
# endif
#endif

/* if DO_SUBDIRECTORIES is specified, search to this depth */
#ifndef MAX_SUBDIR_SEARCH_DEPTH
#define MAX_SUBDIR_SEARCH_DEPTH 10
#endif

/*
 * if your LaserJet II P or LaserJet III or LaserJet 2000
 * complains about not enough memory, you might try to reduce
 * the value below or uncomment to use the default settings
 */
#if defined (LJ2P) || defined (LJ4)
#define  MAX_FONTS_PER_PAGE 255         /* maximum number of fonts per page */
#endif


/* Timing is not very portable.... if you have troubles, use
 * -DNO_TIMING in the Makefile
 */

#ifdef u3b2
#define NO_TIMING
#endif
#ifdef _AMIGA
#define NO_TIMING
#endif
#ifdef KPATHSEA
#define NO_TIMING
#define MAKETEXPK
#endif
#ifdef __riscos
#define NO_TIMING
#endif

#ifndef NO_TIMING
#define TIMING
#endif

/*
 * per default use mktexpk in unix environments unless it is not wanted
 */
#ifdef unix
#ifndef MAKETEXPK
/* name of the program which is called to generate missing pk files
 */
#define MAKETEXPK "mktexpk"
#endif
#endif

#ifdef _AMIGA
#ifndef MAKETEXPK
/* name of the program which is called to generate missing pk files
 */
#define MAKETEXPK "mktexpk"
#endif
#endif

#ifdef __riscos
#ifndef MAKETEXPK
#define MAKETEXPK "mktexpk"
#endif
#endif

#ifdef NO_MAKETEXPK
#undef MAKETEXPK
#endif

/*
 * assure that LJ2P is defined when LJ4 is defined;
 * compile with support for LJ4's resident fonts
 */
#ifdef LJ4
#define LJ2P
#define LJ_RESIDENT_FONTS
#endif

/*
 * assure that LJ2 is defined when LJ2P is defined
 */
#ifdef LJ2P
#ifndef LJ2
#define LJ2
#endif
#endif

/*
 * assure that LJ is defined when LJ2 of LJ4 is defined
 */
#if defined(LJ2)
#ifndef LJ
#define LJ
#endif
#endif

/*
 * assure that IBM3812 is not defined when LJ is defined
 */
#ifdef LJ
#ifdef IBM3812
#undef IBM3812
#endif
#endif

#ifdef LJ_RESIDENT_FONTS
# ifndef DEFAULT_TFM_PATH
#  ifdef __riscos
#   define FONTAREA    "TeXFonts:"
#  else
#   define DEFAULT_TFM_PATH   "/usr/local/lib/tex/fonts"
#  endif
# endif
#endif


#define  _TRUE      (bool) 1
#define  _FALSE     (bool) 0
#define  UNKNOWN     -1

#define  STRSIZE         255     /* stringsize for file specifications  */


#ifdef __riscos
# ifndef types_H                  /* for compatibility with OSLib */
typedef  int     bool;
# endif
#else
typedef  char    bool;
#endif


/* The smallest signed type: use `signed char' if ANSI C, `short' if
   char is unsigned, otherwise `char'.  */
#ifndef SCHAR_TYPE
#if __STDC__
#define SCHAR_TYPE signed char
#else /* not __STDC */
#ifdef __CHAR_UNSIGNED__
#define SCHAR_TYPE short
#else
#define SCHAR_TYPE char
#endif
#endif /* not __STDC__ */
#endif /* not SCHAR_TYPE */
typedef SCHAR_TYPE signed_char;

#if !defined(u3b2) && !defined(LONG_64_BITS)
#define  ARITHMETIC_RIGHT_SHIFT
#endif

#ifndef SIZEOF_LONG
# ifdef __riscos
#  define SIZEOF_LONG 8
# endif
#endif

#if SIZEOF_LONG > 4
# define long4 int
# define FMT_long4 "%d"
#else
# define long4 long
# define FMT_long4 "%ld"
#endif

#include <stdarg.h>

#ifndef KPATHSEA
#error "Would need changed findfile, dviljk has changed allocation semantic of name member in tfontptr"
#endif


/*
 * maximal number of characters in font file
 * #define  LASTFNTCHAR  127        7-bit classic version
 * #define  LASTFNTCHAR  255        8-bit fonts
 */
#ifdef SEVENBIT
# define LASTFNTCHAR 127
#else
# define LASTFNTCHAR  255
#endif



/* this information is needed in findfile.c and dvi2xx.c, NO CUSTOMIZATION */
#ifdef LJ
# ifndef MFMODE300
#  define MFMODE300 "cx"     /* mode definition for metafont 300dpi */
# endif
# ifdef LJ4
#  ifndef MFMODE600
#   define MFMODE600 "ljfour"    /* mode definition for metafont 600dpi */
#  endif
# else
#  define MFMODE MFMODE300       /* default mode */
# endif
#endif

#ifdef IBM3812
#define RESOLUTION    240
#ifndef MFMODE
#define MFMODE "IBMThreeEightOneTwo"    /* mode definition for metafont */
#endif
#endif

#if defined (unix) && !defined (__DJGPP__)
#define OS "Unix"
#define READ_BINARY     "r"
#define WRITE_BINARY    "w"
#ifndef labs
#define labs(x) abs(x)
#endif
#endif

#ifdef MSDOS
# define OS "MS-DOS"
# define READ_BINARY     "rb"
# define WRITE_BINARY    "wb"
# ifdef __DJGPP__
#  include <io.h>		/* for prototype of `setmode' */
#  define AssureBinary(f) setmode((f), O_BINARY)
# else
#  define MSC5			/* assume Microsoft C */
# endif
#endif
#ifdef OS2
#define OS "OS/2"
#define READ_BINARY     "rb"
#define WRITE_BINARY    "wb"
#define MSC5
#endif
#ifdef WIN32
#define OS "Win32"
#define READ_BINARY     "rb"
#define WRITE_BINARY    "wb"
#  include <io.h>		/* for prototype of `_setmode' */
#  define AssureBinary(f) _setmode((f), _O_BINARY)
#define MSC10
#endif

#ifdef vms
#define OS "VMS"
#include <ssdef.h>
#include <stsdef.h>
#define ftell vms_ftell		    /* use some external routines, because */
#define fseek vms_fseek		    /* of some bugs in the VMS run time    */
#define getchar vms_getchar	    /* library */
#define getenv vms_getenv
#define ungetc vms_ungetc
#define getname vms_getname
#define READ_BINARY     "rb"
#define WRITE_BINARY    "wb","rfm=fix","bls=512","mrs=512" /* fixed records */
#define labs(x) abs(x)
#endif

#ifdef _AMIGA
#define OS "Amiga"
#define READ_BINARY     "r"
#define WRITE_BINARY    "w"
#ifdef __SASC
#define sys_errlist __sys_errlist
#include <stdlib.h>
#endif
#endif

#ifdef unix
# include <stdio.h>
#endif

#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif

#ifdef __riscos
# define OS "RISC OS"
# ifdef RISC_USE_OSL
#  define READ_BINARY     0x43  /* if using fopen stuff reset to "rb", "wb" */
#  define WRITE_BINARY    0x83
# else
#  define READ_BINARY     "rb"
#  define WRITE_BINARY    "wb"
# endif
# define ERR_STREAM stdout   /* ???? */
# else
# define ERR_STREAM stderr
#endif

/*
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
*/

#ifdef KPATHSEA
#define BOPENCMD xfopen
#else
#define BOPENCMD fopen /* ???? */
#endif

/* Set up file stuff */
#ifdef RISC_USE_OSL
#include "fromosl.h"
typedef  os_f FILEPTR;
#define   read_byte(fp,char) os_bget(fp,&char)
#define  write_byte(fp,char) os_bput(char,fp)
#define  read_multi(buf,n,s,fp) osgbpb_read(fp,(byte*)buf,(s)*(n))
#define write_multi(buf,n,s,fp) osgbpb_write(fp,(byte*)buf,(s)*(n))
#define   BINOPEN(f) osfind_openin(READ_BINARY,f,NULL)
#define  BOUTOPEN(f) osfind_openout(WRITE_BINARY,f,NULL)
#define    BCLOSE(f) osfind_close(f)
#define      FEOF(f) osargs_read_eof_status(f)
#define FSEEK(f,pos,whence) os_seek(f,pos,whence)
#define     FTELL(f) osargs_read_ptr(f)
#define FPNULL 0
#else
typedef  FILE *FILEPTR;
#define   read_byte(fp,char) char = fgetc(fp)
#define  write_byte(fp,char) fputc(char,fp)
#define  read_multi(buf,n,s,fp) fread(buf,n,s,fp)
#define write_multi(buf,n,s,fp) fwrite(buf,n,s,fp)
#define   BINOPEN(f) BOPENCMD(f,READ_BINARY)
#define  BOUTOPEN(f) BOPENCMD(f,WRITE_BINARY)
#define    BCLOSE(f) fclose(f)
#define      FEOF(f) feof(f)
#define FSEEK(f,pos,whence) fseek(f,pos,whence)
#define     FTELL(f) ftell(f)
#define FPNULL NULL
#endif


#define BUFFSIZE 8192  /* ???? */

#ifndef SEEK_SET
# define SEEK_SET 0
#endif
#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif
#ifndef SEEK_END
# define SEEK_END 2
#endif

#ifndef O_BINARY
# ifdef _O_BINARY
#  define O_BINARY _O_BINARY
# else
#  define O_BINARY 0
#endif
#endif

#if !defined (AssureBinary) && !defined (MSC5)
# define AssureBinary(f)  0
#endif

#ifndef HAVE_VPRINTF
#ifdef HAVE_DOPRNT
#define	vfprintf(stream, message, args)	_doprnt(message, args, stream)
/* If we have neither, should fall back to fprintf with fixed args.  */
#endif
#endif

/* If unlink and rmdir are not there, we don't delete the temporary files. */
#ifndef HAVE_RMDIR
#define rmdir(dir)
#endif
#ifndef HAVE_UNLINK
#define unlink(file)
#endif

/* If mkdtemp() does not exist, we have to use mktemp() or tmpnam()
   and mkdir(). For the latter, we need the declaration. */
#ifndef HAVE_MKDTEMP
#include <sys/types.h>
#include <sys/stat.h>
#endif

#ifndef KPATHSEA
/* FIXME: Should provide a strdup function. But currently this tree is
   only used in connection with kpathsea anyhow. */
#error "Need xstrdup and xmalloc function, e.g. from kpathsea"
#endif