summaryrefslogtreecommitdiff
path: root/support/vvcode/machine.h
blob: 9505de1ac851af5477a3c6b9e8075274e29aa60b (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
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
/*-
******************************************************************************
******************************************************************************
**
**  ARCHIVE HEADER INFORMATION
**
**  @C-file{
**      FILENAME    = "machine.h",
**      VERSION     = "1.00",
**      DATE        = "",
**      TIME        = "",
**
**      AUTHOR      = "Niel Kempson",
**      ADDRESS     = "25 Whitethorn Drive, Cheltenham, GL52 5LL, England",
**      TELEPHONE   = "+44-242 579105",
**      EMAIL       = "kempson@tex.ac.uk (Internet)",
**
**      SUPPORTED   = "yes",
**      ARCHIVED    = "tex.ac.uk, ftp.tex.ac.uk",
**      KEYWORDS    = "VVcode",
**
**      CODETABLE   = "ISO/ASCII",
**      CHECKSUM    = "51492 1481 5732 57976",
**
**      DOCSTRING   = { This file is part of VVcode.
**                  }
**  }
**
**  MODULE CONTENTS
**
**      [tbs]
**
**  COPYRIGHT
**
**      Copyright (c) 1991-1993 by Niel Kempson <kempson@tex.ac.uk>
**
**      This program is free software; you can redistribute it and/or
**      modify it under the terms of the GNU General Public License as
**      published by the Free Software Foundation; either version 1, or
**      (at your option) any later version.
**
**      This program is distributed in the hope that it will be useful,
**      but WITHOUT ANY WARRANTY; without even the implied warranty of
**      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**      General Public License for more details.
**
**      You should have received a copy of the GNU General Public License
**      along with this program; if not, write to the Free Software
**      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
**      In other words, you are welcome to use, share and improve this
**      program.  You are forbidden to forbid anyone else to use, share
**      and improve what you give them.   Help stamp out software-hoarding!  
**
**  CHANGE LOG
**
******************************************************************************
******************************************************************************
*/

/*-
******************************************************************************
******************************************************************************
**
** MACROS TO BE DEFINED
**
** For each of the operating environments, the macros listed below must be
** defined.  For full details of the meaning of these macros, see the file
** porting.doc that comes with vvcode.
**
** VVcode Environment
**
**  VV_OPERATING_SYSTEM
**  VV_IMPLEMENTATION
**  ANSI_SYNTAX
**
** Command Line Interface
**
**  QUAL_INTRO
**  QUAL_SEP
**  OPTIONAL_QUALIFIER_VALUES
**  STICKY_DEFAULTS
**  STDOUT_OUTPUT
**  SUPPORT_PIPING
**  STDIO_SYMBOL
**
** File Specifications
**
**  MAX_PATH
**  MAX_PREAMBLE
**  MAX_NAME
**  MAX_EXT
**  MAX_POSTAMBLE
**  PREAMBLE_END
**  EXTENSION_BEGIN
**  POSTAMBLE_BEGIN
**  UPPERCASE_FILESYSTEM
**  LEGAL_FILESPEC_CHARS
**  REPLACEMENT_FILESPEC_CHAR
**
** File Formats
**
**  SUPPORT_FIXED_FMT
**  SUPPORT_STREAM_FMT
**  SUPPORT_VARIABLE_FMT
**  TEXT_LINE_OVERHEAD
**
**  DEF_MODE
**  DEF_TEXT_FMT
**  DEF_BINARY_FMT
**
**  MIN_VARIABLE_RECORD_LEN
**  MAX_VARIABLE_RECORD_LEN
**  DEF_VARIABLE_RECORD_LEN
**
**  MIN_FIXED_RECORD_LEN
**  MAX_FIXED_RECORD_LEN
**  DEF_FIXED_RECORD_LEN
**
**  DEF_TEXT_PADCHAR
**  DEF_BINARY_PADCHAR
**
******************************************************************************
******************************************************************************
*/


/*-
******************************************************************************
******************************************************************************
**
** COMPILERS AND ENVIRONMENTS SUPPORTED
**
**      The compilers and environments supported are summarized here.  More
**      details are provided under the header comment for each environment.
**
**  MS-DOS 
**      MS-DOS, PC-DOS v3.2, v3.3, v4.01, v5.00
**
**          Borland Turbo C v1.5, v2.0
**          Borland Turbo C++ v1.0, v2.0, v3.0
**          Microsoft C v5.1, v6.0
**
**  OS/2
**      IBM OS/2 v2.0
**
**          GNUC C v2.1 with EMX v0.8c or later
**          Microsoft C v6.0
**          IBM C Set/2 v1.0
**
**  UNIX
**      BSD 4.1, BSD 4.2, BSD 4.3, System V
**
**          GNU C v1.38
**          native cc
**
**  VAX/VMS 
**      v5.1 - v5.4-1
**
**          GNU C v1.38
**          VMS cc v3
**
**  VM/CMS
**      version ?
**
**          Waterloo C version ?
**
******************************************************************************
******************************************************************************
*/


#ifdef  FALSE
# undef  FALSE
#endif
#define FALSE                   0

#ifdef  TRUE
# undef  TRUE
#endif
#define TRUE                    1


/*
**============================================================================
** OS_MSDOS
**
**  Definitions for the Microsoft MS/PC-DOS operating system used on the IBM
**  PC and compatibles.  The compilers supported are:
**
**      Borland Turbo C v1.5, v2.0          MSDOS_TURBOC
**      Borland Turbo C++ v1.0, v2.0, v3.0  MSDOS_TURBOC
**      Microsoft C v5.1                    MSDOS_MSC
**      Microsoft C v6                      MSDOS_MSC
**
**============================================================================
*/
#if (OS_MSDOS)

/*
**----------------------------------------------------------------------------
** VVCODE ENVIRONMENT
**
**  Both MS-DOS C compilers support the ANSI standard.
**  The MS-DOS implementation of VVCODE does not act as a filter.
**----------------------------------------------------------------------------
*/
# define VV_OPERATING_SYSTEM        "MS-DOS"

# if (MSDOS_TURBOC)
#  define ANSI_SYNTAX               TRUE
#  define VV_IMPLEMENTATION         "MS-DOS Turbo C"
# endif                         /* (MSDOS_TURBOC) */

# if (MSDOS_MSC)
#  define ANSI_SYNTAX               TRUE
#  define VV_IMPLEMENTATION         "MS-DOS Microsoft C"
# endif                         /* (MSDOS_MSC) */

/*-
**----------------------------------------------------------------------------
** INCLUDE FILES
**----------------------------------------------------------------------------
*/
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
# include <ctype.h>
# include <dos.h>
# include <errno.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <time.h>

# if (MSDOS_TURBOC)
#  include <alloc.h>
# endif                         /* (MSDOS_TURBOC) */

# if (MSDOS_MSC)
#  include <malloc.h>
# endif                         /* (MSDOS_MSC) */

/*
**----------------------------------------------------------------------------
** COMMAND LINE PARSING
**
**  MS-DOS qualifiers are usually introduced with a '/' and values separated
**  with an '='.  A typical command line would be:
**
**      program  /qualifier  file1  /qual=VALUE  file2
**----------------------------------------------------------------------------
*/
# define QUAL_INTRO                 "/-"
# define QUAL_SEP                   "=:-"
# define OPTIONAL_QUALIFIER_VALUES  TRUE
# define STICKY_DEFAULTS            TRUE
# define STDOUT_OUTPUT              FALSE
# define SUPPORT_PIPING             TRUE
# define STDIO_SYMBOL               "-"

/*
**----------------------------------------------------------------------------
** FILE SPECIFICATIONS
**
**  The general MS-DOS file specification has the form:
**
**          \\node\dir1\dir2\name.ext
**          device:\dir1\dir2\name.ext
**
**  The preamble is terminated by one of ':' or '\'.
**  There is no postamble.
**----------------------------------------------------------------------------
*/
# define MAX_PATH                   80
# define MAX_PREAMBLE               64
# define MAX_NAME                   8
# define MAX_EXT                    4
# define MAX_POSTAMBLE              0

# define PREAMBLE_END               ":\\"
# define EXTENSION_BEGIN            '.'
# define POSTAMBLE_BEGIN            ""
# define UPPERCASE_FILESYSTEM       TRUE

# define LEGAL_FILESPEC_CHARS \
 "@#$%^&-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
# define REPLACEMENT_FILESPEC_CHAR  '_'

/*
**----------------------------------------------------------------------------
** FILE FORMATS
**
**  MS-DOS has a stream file system and does not support the different file
**  formats - they are all written as stream files.  Text and binary files are
**  written differently.
**----------------------------------------------------------------------------
*/
# define SUPPORT_FIXED_FMT          TRUE
# define SUPPORT_STREAM_FMT         TRUE
# define SUPPORT_VARIABLE_FMT       TRUE

# define TEXT_LINE_OVERHEAD         1

# define DEF_MODE                   MODE_BINARY
# define DEF_TEXT_FMT               FMT_STREAM
# define DEF_BINARY_FMT             FMT_STREAM

# define MIN_VARIABLE_RECORD_LEN    1
# define MAX_VARIABLE_RECORD_LEN    32765
# define DEF_VARIABLE_RECORD_LEN    80

# define MIN_FIXED_RECORD_LEN       1
# define MAX_FIXED_RECORD_LEN       32767
# define DEF_FIXED_RECORD_LEN       512

# define DEF_TEXT_PADCHAR            ' '
# define DEF_BINARY_PADCHAR          0


#endif                          /* (OS_MSDOS) */



/*
**============================================================================
** OS_OS2
**
**  Definitions for the IBM OS/2 operating system used on the IBM PC and 
**  compatibles.  The compilers supported are:
**
**      GNUC C v2.1 with EMX                OS2_GNUC
**      IBM C Set/2                         OS2_CSET
**      Microsoft C v6                      OS2_MSC
**
**============================================================================
*/
#if (OS_OS2)

/*
**----------------------------------------------------------------------------
** VVCODE ENVIRONMENT
**
**  All three OS/2 C compilers support the ANSI standard.
**  The OS/2 implementation of VVCODE does not act as a filter.
**----------------------------------------------------------------------------
*/
# define VV_OPERATING_SYSTEM        "OS/2"

# if (OS2_CSET)
#  define ANSI_SYNTAX               TRUE
#  define VV_IMPLEMENTATION         "OS/2 2.x IBM C Set/2"
# endif                         /* (OS2_CSET) */

# if (OS2_GNUC)
#  define ANSI_SYNTAX               TRUE
#  define VV_IMPLEMENTATION         "OS/2 2.x EMX/GNU C"
# endif                         /* (OS2_GNUC) */

# if (OS2_MSC)
#  define ANSI_SYNTAX               TRUE
#  define VV_IMPLEMENTATION         "OS/2 Microsoft C"
# endif                         /* (OS2_MSCT) */

/*-
**----------------------------------------------------------------------------
** INCLUDE FILES
**----------------------------------------------------------------------------
*/
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
# include <ctype.h>
# include <errno.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <time.h>

/*
**----------------------------------------------------------------------------
** COMMAND LINE PARSING
**
**  OS/2 qualifiers are usually introduced with a '/' and values separated
**  with an '='.  A typical command line would be:
**
**      program  /qualifier  file1  /qual=VALUE  file2
**----------------------------------------------------------------------------
*/
# define QUAL_INTRO                 "/-"
# define QUAL_SEP                   "=:-"
# define OPTIONAL_QUALIFIER_VALUES  TRUE
# define STICKY_DEFAULTS            TRUE
# define STDOUT_OUTPUT              FALSE
# define SUPPORT_PIPING             TRUE
# define STDIO_SYMBOL               "-"

/*
**----------------------------------------------------------------------------
** FILE SPECIFICATIONS
**
**  The general OS/2 file specification has the form:
**
**          \\node\dir1\dir2\name.ext
**          device:\dir1\dir2\name.ext
**
**  The preamble is terminated by one of ':' or '\'.
**  There is no postamble.
**----------------------------------------------------------------------------
*/
# define MAX_PATH                   80
# define MAX_PREAMBLE               64
# define MAX_NAME                   8
# define MAX_EXT                    4
# define MAX_POSTAMBLE              0

# define PREAMBLE_END               ":\\"
# define EXTENSION_BEGIN            '.'
# define POSTAMBLE_BEGIN            ""
# define UPPERCASE_FILESYSTEM       TRUE

# define LEGAL_FILESPEC_CHARS \
 "@#$%^-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
# define REPLACEMENT_FILESPEC_CHAR  '_'

/*
**----------------------------------------------------------------------------
** FILE FORMATS
**
**  OS/2 has a stream file system and does not support the different file
**  formats - they are all written as stream files.  Text and binary files are
**  written differently.
**----------------------------------------------------------------------------
*/
# define SUPPORT_FIXED_FMT          FALSE
# define SUPPORT_STREAM_FMT         TRUE
# define SUPPORT_VARIABLE_FMT       FALSE

# define TEXT_LINE_OVERHEAD         1

# define DEF_MODE                   MODE_BINARY
# define DEF_TEXT_FMT               FMT_STREAM
# define DEF_BINARY_FMT             FMT_STREAM

# define MIN_VARIABLE_RECORD_LEN    INV_RECORD_LEN
# define MAX_VARIABLE_RECORD_LEN    INV_RECORD_LEN
# define DEF_VARIABLE_RECORD_LEN    INV_RECORD_LEN

# define MIN_FIXED_RECORD_LEN       INV_RECORD_LEN
# define MAX_FIXED_RECORD_LEN       INV_RECORD_LEN
# define DEF_FIXED_RECORD_LEN       INV_RECORD_LEN

# define DEF_TEXT_PADCHAR           ' '
# define DEF_BINARY_PADCHAR         0

#endif                          /* (OS_OS2) */



/*
**============================================================================
** OS_UNIX
**
**  Definitions for the Unix operating system.  The variants of Unix &
**  compilers supported are:
**
**      BSD 4.1 Unix                            UNIX_BSD41, UNIX_BSD
**      BSD 4.2 Unix                            UNIX_BSD42, UNIX_BSD
**      BSD 4.3 Unix                            UNIX_BSD43, UNIX_BSD
**      Unix system V                           UNIX_SYSV
**      SCO Unix system V                       UNIX_SYSV
**
**      The GNU C compiler                      UNIX_GNUC
**      The Microsoft C compiler (on SCO Unix)  UNIX_MSC
**============================================================================
*/
#if (OS_UNIX)

/*
**----------------------------------------------------------------------------
** VVCODE ENVIRONMENT
**
**  The standard Berkeley C compiler does not support the ANSI standard.
**  The Unix implementation of VVCODE acts as a filter.
**----------------------------------------------------------------------------
*/
# define VV_OPERATING_SYSTEM        "UNIX"

# if (UNIX_BSD)
#  define VV_IMPLEMENTATION         "BSD Unix"
# endif                         /* (UNIX_BSD) */

# if (UNIX_SYSV)
#  define VV_IMPLEMENTATION         "Unix System V"
# endif                         /* (UNIX_SYSV) */

#ifndef VV_IMPLEMENTATION
#  define VV_IMPLEMENTATION         "Generic Unix C"
# endif                         /* (VV_IMPLEMENTATION) */

# if (UNIX_GNUC || UNIX_MSC)
#  define ANSI_SYNTAX               TRUE
# else                          /* NOT (UNIX_GNUC || UNIX_MSC) */
#  define ANSI_SYNTAX               FALSE
# endif                         /* (UNIX_GNUC || UNIX_MSC) */

/*-
**----------------------------------------------------------------------------
** INCLUDE FILES
**----------------------------------------------------------------------------
*/
# if (ANSI_SYNTAX)
#  include <stdlib.h>
# endif                         /* (ANSI_SYNTAX) */

# if (UNIX_STRINGS_H)
#  include <strings.h>
# else                          /* NOT (UNIX_STRINGS_H) */
#  include <string.h>
# endif                         /* (UNIX_STRINGS_H) */

# include <errno.h>
# include <ctype.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <time.h>

/*
**----------------------------------------------------------------------------
** COMMAND LINE INTERFACE
**
**  Unix qualifiers are usually introduced with a '-' and values separated
**  from the qualifier by whitespace.  A typical command line would be:
**
**      program  -overwrite file1 -mode binary file2
**----------------------------------------------------------------------------
*/
# define QUAL_INTRO                 "-"
# define QUAL_SEP                   " =:"
# define OPTIONAL_QUALIFIER_VALUES  FALSE
# define STICKY_DEFAULTS            FALSE
# define STDOUT_OUTPUT              TRUE
# define SUPPORT_PIPING             TRUE
# define STDIO_SYMBOL               "-"

/*
**----------------------------------------------------------------------------
** FILE SPECIFICATIONS
**
**  The general Unix file specification has the form:
**
**          node:/device/dir1/dir2/name.ext
**
**  The preamble is terminated by one of ':' or '/'.
**  There is no postamble.
**----------------------------------------------------------------------------
*/
# if (UNIX_BSD41)
#  define MAX_PATH                  255
#  define MAX_PREAMBLE              255
#  define MAX_NAME                  14
#  define MAX_EXT                   14
#  define MAX_POSTAMBLE             0
# endif                         /* (UNIX_BSD41) */

# if (UNIX_BSD42)
#  define MAX_PATH                  255
#  define MAX_PREAMBLE              255
#  define MAX_NAME                  255
#  define MAX_EXT                   255
#  define MAX_POSTAMBLE             0
# endif                         /* (UNIX_BSD42) */

# if (UNIX_BSD43)
#  define MAX_PATH                  1024
#  define MAX_PREAMBLE              1024
#  define MAX_NAME                  1024
#  define MAX_EXT                   1024
#  define MAX_POSTAMBLE             0
# endif                         /* (UNIX_BSD43) */

# if (UNIX_SYSV)
#  define MAX_PATH                  255
#  define MAX_PREAMBLE              255
#  define MAX_NAME                  14
#  define MAX_EXT                   14
#  define MAX_POSTAMBLE             0
# endif                         /* (UNIX_SYSV) */

# define PREAMBLE_END               ":/"
# define EXTENSION_BEGIN            '.'
# define POSTAMBLE_BEGIN            ""
# define UPPERCASE_FILESYSTEM       FALSE

# define LEGAL_FILESPEC_CHARS \
 ".@#$%^&-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
# define REPLACEMENT_FILESPEC_CHAR  '_'

/*
**----------------------------------------------------------------------------
** FILE FORMATS
**
**  UNIX has a stream file system and does not support the different file
**  formats - they are all written as stream files.  Text and binary files
**  are not differentiated either.
**----------------------------------------------------------------------------
*/
# define SUPPORT_FIXED_FMT          FALSE
# define SUPPORT_STREAM_FMT         TRUE
# define SUPPORT_VARIABLE_FMT       FALSE

# define TEXT_LINE_OVERHEAD         0

# define DEF_MODE                   MODE_BINARY
# define DEF_TEXT_FMT               FMT_STREAM
# define DEF_BINARY_FMT             FMT_STREAM

# define MIN_VARIABLE_RECORD_LEN    INV_RECORD_LEN
# define MAX_VARIABLE_RECORD_LEN    INV_RECORD_LEN
# define DEF_VARIABLE_RECORD_LEN    INV_RECORD_LEN

# define MIN_FIXED_RECORD_LEN       INV_RECORD_LEN
# define MAX_FIXED_RECORD_LEN       INV_RECORD_LEN
# define DEF_FIXED_RECORD_LEN       INV_RECORD_LEN

# define DEF_TEXT_PADCHAR           0
# define DEF_BINARY_PADCHAR         0

#endif                          /* (OS_UNIX) */



/*
**============================================================================
** OS_VAXVMS
**
**  Digital Equipment Corporation's proprietary VMS operating system for their
**  VAX series of computers.  The versions and VMS and compilers supported
**  are:
**
**      VAX/VMS v5.1 - v5.4-1
**
**      VMS cc v3                   VMS_VAXC
**      GNU C v1.38                 VMS_GNUC
**
**============================================================================
*/
#if (OS_VAXVMS)

/*
**----------------------------------------------------------------------------
** GENERAL DEFINITIONS
**
**  The VAX/VMS C compiler supports most of the ANSI standard.
**----------------------------------------------------------------------------
*/
# define VV_OPERATING_SYSTEM        "VAX-VMS"

# if (VMS_VAXC)
#  define ANSI_SYNTAX               TRUE
#  define VV_IMPLEMENTATION         "VAX/VMS C"
# endif                          /* (VMS_VAXC) */

# if (VMS_GNUC)
#  define ANSI_SYNTAX               TRUE
#  define VV_IMPLEMENTATION         "VAX/VMS GNU C"
# endif                          /* (VMS_GNUC) */

/*-
**----------------------------------------------------------------------------
** INCLUDE FILES
**----------------------------------------------------------------------------
*/
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
# include <errno.h>
# include <ctype.h>
# include <stat.h>
# include <time.h>
# include <types.h>
# include <unixio.h>

/*
**----------------------------------------------------------------------------
** COMMAND LINE INTERFACE
**
**  VAX/VMS qualifiers are usually introduced with a '/' and values separated
**  with an '='.  A typical command line would be:
**
**      program  /qualifier  file1  /qual=VALUE  file2
**
** The VMS system utilities for command line parsing are used by VVCODE.
** These definitions are used mainly for printing help and error messages.
**----------------------------------------------------------------------------
*/
# define QUAL_INTRO                 "/"
# define QUAL_SEP                   "=:"
# define OPTIONAL_QUALIFIER_VALUES  TRUE
# define STICKY_DEFAULTS            TRUE
# define STDOUT_OUTPUT              FALSE
# define SUPPORT_PIPING             FALSE
# define STDIO_SYMBOL               "-"

/*
**----------------------------------------------------------------------------
** FILE SPECIFICATION PARSING
**
**  The general VAX/VMS file specification has six components in the form:
**
**          node::device:[dir1.dir2]name.ext;version
**          node::device:<dir1.dir2>name.ext;version
**
**  The preamble is terminated by one of ':', ']' or '>'
**  The extension is terminated by ';'
**----------------------------------------------------------------------------
*/
# define MAX_PATH                   255
# define MAX_PREAMBLE               255
# define MAX_NAME                   39
# define MAX_EXT                    39
# define MAX_POSTAMBLE              5

# define PREAMBLE_END               ":>]"
# define EXTENSION_BEGIN            '.'
# define POSTAMBLE_BEGIN            ";"
# define UPPERCASE_FILESYSTEM       TRUE

# define LEGAL_FILESPEC_CHARS \
 "$-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
# define REPLACEMENT_FILESPEC_CHAR  '_'

/*
**----------------------------------------------------------------------------
** FILE FORMATS
**
**  VAX/VMS has a record/block oriented stream file system and supports all of
**  the different file formats.  The default format for text files is variable
**  length records and for binary files, fixed length records.
**----------------------------------------------------------------------------
*/
# define SUPPORT_FIXED_FMT          TRUE
# define SUPPORT_STREAM_FMT         TRUE
# define SUPPORT_VARIABLE_FMT       TRUE

# define TEXT_LINE_OVERHEAD         1

# define DEF_MODE                   MODE_BINARY
# define DEF_TEXT_FMT               FMT_VARIABLE
# define DEF_BINARY_FMT             FMT_FIXED

# define MIN_VARIABLE_RECORD_LEN    0L
# define MAX_VARIABLE_RECORD_LEN    32765L
# define DEF_VARIABLE_RECORD_LEN    0L

# define MIN_FIXED_RECORD_LEN       2
# define MAX_FIXED_RECORD_LEN       32767L
# define DEF_FIXED_RECORD_LEN       512L

# define DEF_TEXT_PADCHAR           ' '
# define DEF_BINARY_PADCHAR         '\0'

#endif                          /* (OS_VAXVMS) */



/*
**============================================================================
** OS_VMCMS
**
**  IBM's VM/CMS operating system for their S/370 and S/390 series of 
**  computers.  The versions of VM/CMS and compilers supported
**  are:
**
**      VM/CMS version ?
**
**      Waterloo C version ?
**      
**
**============================================================================
*/
#if (OS_VMCMS)

/*
**----------------------------------------------------------------------------
** GENERAL DEFINITIONS
**
**  The VM/CMS C compiler supports most of the ANSI standard.
**----------------------------------------------------------------------------
*/
# define VV_OPERATING_SYSTEM        "VM/CMS"
# define VV_IMPLEMENTATION          "VM/CMS C"
# define ANSI_SYNTAX                TRUE

/*-
**----------------------------------------------------------------------------
** INCLUDE FILES
**----------------------------------------------------------------------------
*/
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
# include <errno.h>
# include <ctype.h>
# include <time.h>
# include <types.h>

/*
**----------------------------------------------------------------------------
** COMMAND LINE INTERFACE
**
**  VM/CMS qualifiers are usually introduced with a '(' and values separated
**  with a ':'.  A typical command line would be:
**
**      program  (qualifier)  file1  (qual:VALUE)  file2
**
** The VM/CMS system utilities for command line parsing are used by VVCODE.
** These definitions are used mainly for printing help and error messages.
**----------------------------------------------------------------------------
*/
# define QUAL_INTRO                 "("
# define QUAL_SEP                   "=:"
# define OPTIONAL_QUALIFIER_VALUES  TRUE
# define STICKY_DEFAULTS            TRUE
# define STDOUT_OUTPUT              FALSE
# define SUPPORT_PIPING             FALSE
# define STDIO_SYMBOL                "-"

/*
**----------------------------------------------------------------------------
** FILE SPECIFICATION PARSING
**
**  The general VM/CMS file specification has three components in the form:
**
**      filename filetype filemode
**
**  which is often supported by C compilers as
**
**      filename.filetype.filemode
**
**  The name and extension components are terminated by ' '.
**----------------------------------------------------------------------------
*/
# define MAX_PATH                   19
# define MAX_PREAMBLE               0
# define MAX_NAME                   8
# define MAX_EXT                    9
# define MAX_POSTAMBLE              3

# define PREAMBLE_END               ""
# define EXTENSION_BEGIN            ' '
# define POSTAMBLE_BEGIN            " "
# define UPPERCASE_FILESYSTEM       FALSE

# define LEGAL_FILESPEC_CHARS \
 "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
# define REPLACEMENT_FILESPEC_CHAR   'X'

/*
**----------------------------------------------------------------------------
** FILE OPENING
**
**  VM/CMS has a record/block oriented stream file system and supports
**  variable length and fixed format files.  The default format for text files
**  is variable length records and for binary files, fixed length records.
**----------------------------------------------------------------------------
*/
# define SUPPORT_FIXED_FMT          FALSE
# define SUPPORT_STREAM_FMT         TRUE
# define SUPPORT_VARIABLE_FMT       TRUE

# define TEXT_LINE_OVERHEAD         1

# define DEF_MODE                   MODE_BINARY
# define DEF_TEXT_FMT               FMT_VARIABLE
# define DEF_BINARY_FMT             FMT_FIXED

# define MIN_VARIABLE_RECORD_LEN    0L
# define MAX_VARIABLE_RECORD_LEN    65535L
# define DEF_VARIABLE_RECORD_LEN    0L

# define MIN_FIXED_RECORD_LEN       2L
# define MAX_FIXED_RECORD_LEN       32760L
# define DEF_FIXED_RECORD_LEN       512L

# define DEF_TEXT_PADCHAR           ' '
# define DEF_BINARY_PADCHAR         '\0'

#endif                          /* (OS_VMCMS) */