summaryrefslogtreecommitdiff
path: root/dviware/beebe/src/machdefs.h
blob: 8dfc345a316a6014ac52cb7f08b4901d83e99fee (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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
/* -*-C-*- machdefs.h */
/*-->machdefs*/
/**********************************************************************/
/****************************** machdefs ******************************/
/**********************************************************************/

/***********************************************************************

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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_TOPS20	-- DEC-20 TOPS-20
	OS_UNIX		-- Unix (almost any variant)
	OS_VAXVMS	-- VAX VMS

Device names (defined in each DVIxxx.C file):
	APPLEIMAGEWRITER -- Apple ImageWriter printer
	BBNBITGRAPH	-- BBN BitGraph terminal
	CANON_A2	-- Canon LBP-8 A2 laser printer
	DECLA75		-- DEC LA75 printer
	DECLN03PLUS	-- DEC LN03-PLUS laser printer
	EPSON		-- Epson 9-pin family dot-matrix printer
	GOLDENDAWNGL100	-- Golden Dawn GL100 laser printer
	HPJETPLUS	-- Hewlett-Packard Laser Jet Plus (downloaded fonts)
	HPLASERJET	-- Hewlett-Packard Laser Jet (bitmap display)
	IMPRESS		-- imPRESS (IMAGEN laser printer)
	MPISPRINTER	-- MPI Sprinter printer
	OKIDATA2410	-- OKIData 2410 printer
	POSTSCRIPT	-- Adobe PostScript (Apple LaserWriter laser printer)
	PRINTRONIX	-- Printronix (DEC LXY-11, C-Itoh) printer
	TOSHIBAP1351	-- Toshiba P-1351 dot matrix printer

***********************************************************************/

/**********************************************************************
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.
***********************************************************************/

#define ALLOW_INTERRUPT	0
#define ANSI_PROTOTYPES	0

#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 */

#define FOPEN		fopen
#define FSEEK		fseek
#define FTELL		ftell
#define GETENV		getenv
#define HIRES		0
#define MALLOC(n)	malloc(n)
#define MAXDRIFT	2	/* we insist that
				abs|(hh-pixel_round(h))<=MAXDRIFT| */

/* 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 */

#define PS_XONXOFFBUG	0
#define PXLID		0
#define RB_OPEN		"r"

/* 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 UNGETC		ungetc
#define USEGLOBALMAG	0
#define WB_OPEN		"w"
#define ZAPTHISOUT	0


/**********************************************************************/
/* Clear all implementation/operating-system flags--reset later */

#define ATT		0	/* define zero or one of these */
#define BSD41		0
#define BSD42		0
#define HPUX		0
#define IBM_PC_LATTICE	0
#define IBM_PC_MICROSOFT	0
#define IBM_PC_WIZARD	0
#define KCC_20		0
#define PCC_20		0

#define OS_ATARI	0	/* define one of these */
#define OS_PCDOS	0
#define OS_TOPS20	0
#define OS_UNIX		0
#define OS_VAXVMS	0

#define APPLEIMAGEWRITER	0	/* one will be defined by DVIxxx */
#define BBNBITGRAPH	0
#define CANON_A2	0
#define DECLA75		0
#define DECLN03PLUS	0
#define EPSON		0
#define GOLDENDAWNGL100	0
#define HPJETPLUS	0
#define HPLASERJET	0
#define IMPRESS		0
#define MPISPRINTER	0
#define OKIDATA2410	0
#define POSTSCRIPT	0
#define PRINTRONIX	0
#define TOSHIBAP1351	0
#define VIRTUAL_FONTS	0


/***********************************************************************
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.
***********************************************************************/

/*====================
#undef PCC_20
#undef OS_TOPS20
#define PCC_20		1
#define OS_TOPS20	1
====================*/

/*====================
#undef KCC_20
#undef OS_TOPS20
#define KCC_20		1
#define OS_TOPS20	1
====================*/

/*====================
#undef  OS_ATARI
#define OS_ATARI	1
====================*/

/*====================
#undef  IBM_PC_LATTICE
#undef  OS_PCDOS
#define IBM_PC_LATTICE	1
#define OS_PCDOS	1
====================*/


#undef  IBM_PC_MICROSOFT
#undef  OS_PCDOS
#define IBM_PC_MICROSOFT	1
#define OS_PCDOS	1


/*====================
#undef  IBM_PC_WIZARD
#undef  OS_PCDOS
#define IBM_PC_WIZARD	1
#define OS_PCDOS	1
====================*/

/*====================
#undef  OS_VAXVMS
#define OS_VAXVMS	1
====================*/

#if    (OS_ATARI | OS_PCDOS | OS_TOPS20 | OS_UNIX | OS_VAXVMS)
#else
#undef  OS_UNIX
#define OS_UNIX		1		/* provide default operating system */
#endif


/**********************************************************************/

#if    OS_ATARI

#undef  BSD42
#define BSD42		1

#undef  DISKFULL
#define DISKFULL(fp)	ferror(fp)

#define DVIHELP 	"type e:\\tex\\dvi.hlp"

#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 */

#ifndef PS_MAXWIDTH
#define PS_MAXWIDTH	72
#endif

#ifndef PS_SHORTLINES
#define PS_SHORTLINES	1
#endif

#ifdef SUBPATH			/* can be set at compile time */
#else
#define SUBPATH 	"e:\\tex\\inputs\\"
#endif

#ifdef TEXINPUTS		/* can be set at compile time */
#else
#define TEXINPUTS	"TEXINPUTS"
#endif

#define TEXFONTS	"TEXFONTS"

#endif /* OS_ATARI */


/**********************************************************************/

#if    OS_PCDOS

#if    IBM_PC_MICROSOFT
#undef ANSI_PROTOTYPES
#define ANSI_PROTOTYPES	1

/*
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

#undef MALLOC
#define MALLOC(n)	calloc(n,1)
#endif /* IBM_PC_MICROSOFT */

#define DVIHELP		"type d:\\tex\\dvi.hlp"

#undef DVIPREFIX
#define DVIPREFIX	""

#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 */

#ifndef PS_MAXWIDTH
#define PS_MAXWIDTH	72
#endif

#ifndef PS_SHORTLINES
#define PS_SHORTLINES	1
#endif

#undef  RB_OPEN
#define RB_OPEN		"rb"

#ifdef SUBPATH			/* can be set at compile time */
#else
#define SUBPATH		"d:\\tex\\inputs\\"
#endif

#if    TEXINPUTS		/* can be set at compile time */
#else
#define TEXINPUTS	"TEXINPUTS"
#endif

#define TEXFONTS	"TEXFONTS"

#if    IBM_PC_MICROSOFT
#undef VIRTUAL_FONTS
#define VIRTUAL_FONTS	1
#endif

#undef  WB_OPEN
#define WB_OPEN		"wb"

#endif /* OS_PCDOS */


/***********************************************************************/
#if    OS_TOPS20

/************************************************************************
**
**  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

#ifndef FONTPATH
#define FONTPATH "TEXFONTS:"
#endif

#ifndef SUBPATH
#define SUBPATH "TEXINPUTS:"
#endif

#ifndef TEXFONTS
#define TEXFONTS "TEXFONTS:"
#endif

#ifndef TEXINPUTS
#define TEXINPUTS "TEXINPUTS:"
#endif

#undef VIRTUAL_FONTS
#define VIRTUAL_FONTS 0		/* cannot support this yet */

#endif

#if    KCC_20
#include <jsys.h>
/* KCC-20 and PCC-20  have similar enough JSYS  interfaces that we  just
define values for KCC-20 using PCC-20 names. */
#define JSchfdb	CHFDB
#define JSmtopr	MTOPR
#define JSrfcoc	RFCOC
#define JSrfmod	RFMOD
#define JSsfcoc	SFCOC
#define JSsfmod	SFMOD
#define JSsti	STI
#define JSstpar	STPAR
#define JStlink	TLINK
#define Getmask(name) 	 ( 1?name )
#define Getshift(name)	 ( 0?name )
#define Absmask(name) ( (1?name) << (0?name) )    /* maybe use this one */
#define Value(name)   ( (1?name) << (0?name) )    /* maybe use this one */
#define makefield(name, value)	( ((value) & Getmask(name)) << Getshift(name) )
#define getfield(var, name)	( (var) >> Getshift(name) & Getmask(name) )
#define setfield(var, name, value) ( (var) = ((var) & ~Absmask(name)) |\
	makefield(name, value) )
#endif

#if    PCC_20
#undef  ARITHRSHIFT
#define ARITHRSHIFT	0	/* PCC-20 uses logical right shift */
#undef  DISKFULL
#define DISKFULL(fp)	ferror(fp)	/* PCC-20 does not always set errno */
#endif

#define DVIHELP	"help dvi\nor\ntype hlp:dvi.hlp\nor\nxinfo local clsc dvi"

#if    PCC_20
#undef FASTZERO
#define FASTZERO	1	/* for fast assembly language memory zeroing */
#endif

#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	"/texfonts/"
#endif

#undef FOPEN
#define FOPEN		f20open	/* private version for 8-bit binary */

#define HOST_WORD_SIZE	36

#undef MAXFNAME
#define MAXFNAME	256	/* longest host complete filename */

#ifdef KCC_20
#undef MAXOPEN
#define MAXOPEN		26
#endif

#ifdef PCC_20
#undef MAXOPEN
#define MAXOPEN		14
#endif

#ifndef PS_MAXWIDTH
#define PS_MAXWIDTH	72
#endif

#ifndef PS_SHORTLINES
#define PS_SHORTLINES	1
#endif

#undef  RB_OPEN
#define RB_OPEN		"rb"

#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

#if    PCC_20
#undef VIRTUAL_FONTS
#define VIRTUAL_FONTS	1
#endif

#undef  WB_OPEN
#define WB_OPEN		"wb"

/**********************************************************************/
/* 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. */

/* selected fields for CHFDB% */
#define CF_nud		01:35-0		/* no update directory */
#define CF_dsp		0777:35-17	/* fdb displacement */
#define CF_jfn		0777777:35-35	/* jfn */

#define FBbyv		011		/* retention+bytesize+mode,,# of pages*/
#define FB_ret		077:35-5	/* retention count */


/* tty mode definitions */

#define MOrlw		030		/* read width */
#define MOslw		031		/* set width */
#define MOrll		032		/* read length */
#define MOsll		033		/* set length */

#define MOsnt		034		/* set tty non-terminal status */
#define MOsmn		01		/* no system messages(i.e. suppress) */
#define MOsmy		00		/* yes system messages(default) */
#define MOrnt		035		/* read tty non-terminal status */

/* fields of jfn mode word */

#define TT_osp		01:35-0		/* output suppress */
#define TT_mff		01:35-1		/* mechanical formfeed present */
#define TT_tab		01:35-2		/* mechanical tab present */
#define TT_lca		01:35-3		/* lower case capabilities present */
#define TT_len		0177:35-10	/* page length */
#define TT_wid		0177:35-17	/* page width */
#define TT_wak		017:35-23	/* wakeup field */
#define TT_wk0		01:35-18	/* wakeup class 0 (unused) */
#define TT_ign		01:35-19	/* ignore tt_wak on sfmod */
#define TT_wkf		01:35-20	/* wakeup on formating control chars */
#define TT_wkn		01:35-21	/* wakeup on non-formatting controls */
#define TT_wkp		01:35-22	/* wakeup on punctuation */
#define TT_wka		01:35-23	/* wakeup on alphanumerics */
#define TT_eco		01:35-24	/* echos on */
#define TT_ecm		01:35-25	/* echo mode */
#define TT_alk		01:35-26	/* allow links */
#define TT_aad		01:35-27	/* allow advice (not implemented) */
#define TT_dam		03:35-29	/* data mode */
#define TTbin		00		/* binary */
#define TTasc		01		/* ascii */
#define TTato		02		/* ascii and translate output only */
#define TTate		03		/* ascii and translate echos only */
#define TT_uoc		01:35-30	/* upper case output control */
#define TT_lic		01:35-31	/* lower case input control */
#define TT_dum		03:35-33	/* duplex mode */
#define TTfdx		00		/* full duplex */
#define TT0dx		01		/* not used, reserved */
#define TThdx		02		/* half duplex (character) */
#define TTldx		03		/* line half duplex */
#define TT_pgm		01:35-34	/* page mode */
#define TT_car		01:35-35	/* carrier state */

/* tlink */

#define TL_cro		01:35-0		/* clear remote to object link */
#define TL_cor		01:35-1		/* clear object to remote link */
#define TL_eor		01:35-2		/* establist object to remote link */
#define TL_ero		01:35-3		/* establish remote to object link */
#define TL_sab		01:35-4		/* set accept bit for object */
#define TL_abs		01:35-5		/* accept bit state */
#define TL_sta		01:35-6		/* set or clear advice */
#define TL_aad		01:35-7		/* accept advice */
#define TL_obj		0777777:35-35	/* object designator */

#endif /* OS_TOPS20 */

/**********************************************************************/

#if    OS_UNIX

#undef BSD42
#define BSD42		1		/* want DVISPOOL code in dviterm.h */

#define DVIHELP		"man dvi\nor\napropos dvi"

#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	"/usr/lib/tex/fonts/"
#endif

#undef MAXOPEN

#if    HPUX
#define MAXFNAME	1024	/* longest host complete filename */
#define MAXOPEN		50
#else  /* NOT HPUX */
#define MAXFNAME	256	/* longest host complete filename */
#define MAXOPEN		14
#endif /* HPUX */

#ifndef PS_MAXWIDTH
#define PS_MAXWIDTH	72
#endif

#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 */


/**********************************************************************/

#if    OS_VAXVMS

/***********************************************************************
** 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() */

#define DVIHELP		"help dvi\nor\ntype tex_inputs:dvi.hlp"
#define EXIT		vms_exit

#define FILE_CNT(fp)	(*fp)->_cnt
#define FILE_BASE(fp)	(*fp)->_base
#define FILE_PTR(fp)	(*fp)->_ptr

#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. */

#define MAXFNAME	256	/* longest host complete filename */

#undef MAXOPEN
#define MAXOPEN		14

#undef  RB_OPEN
#define RB_OPEN		"rb"

#ifndef PS_MAXWIDTH
#define PS_MAXWIDTH	72
#endif

#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. */

#undef  WB_OPEN
#define WB_OPEN		"wb"

#endif /* OS_VAXVMS */

/**********************************************************************/