summaryrefslogtreecommitdiff
path: root/cmsmvs/cmsmvs.h
blob: e2adb31c5bfebba2d4e122cd8f8e3a146c7aec27 (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
/*
  Copyright (c) 1990-1999 Info-ZIP.  All rights reserved.

  See the accompanying file LICENSE, version 1999-Oct-05 or later
  (the contents of which are also included in zip.h) for terms of use.
  If, for some reason, both of these files are missing, the Info-ZIP license
  also may be found at:  ftp://ftp.cdrom.com/pub/infozip/license.html
*/
/* Include file for VM/CMS and MVS */

/* This is normally named osdep.h on most systems.  Since CMS       */
/* generally doesn't support directories, it's been given a unique  */
/* name to avoid confusion.                                         */


#ifndef __cmsmvs_h   /* prevent multiple inclusions */
#define __cmsmvs_h

#ifdef MVS
#  define _POSIX_SOURCE    /* tell MVS we want full definitions */
#  include <features.h>
#endif /* MVS */

#include <time.h>               /* the usual non-BSD time functions */
/* cstat.h is not required for MVS and actually gets in the way.  Is it
 * needed for CMS?
 */
#ifdef MVS
#  include <sys/stat.h>
#  include <sys/modes.h>
#else /* !MVS */
#  include "cstat.h"
#endif


/* Newer compiler version defines something for us */
#if defined(__VM__) && !defined(VM_CMS)
#  define VM_CMS
#endif

#define CMS_MVS
#define EBCDIC

#ifndef MVS  /* MVS has perfectly good definitions for the following */
#  define NO_UNISTD_H
#  define NO_FCNTL_H
#endif /*MVS */

/* If we're generating a stand-alone CMS module, patch in        */
/* a new main() function before the real main() for arg parsing. */
#ifdef CMS_STAND_ALONE
#  define USE_ZIPMAIN
#endif

#ifndef NULL
#  define NULL 0
#endif

#define PASSWD_FROM_STDIN
                  /* Kludge until we know how to open a non-echo tty channel */

/* definition for ZIP */
#define getch() getc(stdin)
#define MAXPATHLEN 128
#define NO_RMDIR
#define NO_MKTEMP
#define USE_CASE_MAP
#define isatty(t) 1

#ifndef MVS  /* MVS has perfectly good definitions for the following */
#  define fileno(x) (char *)(x)
#  define fdopen fopen
#  define unlink remove
#  define link rename
#  define utime(f,t)
#endif /*MVS */
#ifdef ZCRYPT_INTERNAL
#  define ZCR_SEED2     (unsigned)3141592654L   /* use PI as seed pattern */
#endif

#ifdef MVS
#  if defined(__CRC32_C)
#    pragma csect(STATIC,"crc32_s")
#  elif defined(__DEFLATE_C)
#    pragma csect(STATIC,"deflat_s")
#  elif defined(__ZIPFILE_C)
#    pragma csect(STATIC,"zipfil_s")
#  elif defined(__ZIPUP_C)
#    pragma csect(STATIC,"zipup_s")
#  endif
#endif /* MVS */

/* end defines for ZIP */



#if 0  /*$RGH$*/
/* RECFM=F, LRECL=1 works for sure */
#define FOPR "rb,recfm=fb"
#define FOPM "r+"
#define FOPW "wb,recfm=fb,lrecl=1"
#define FOPWT "w"
#endif

/* Try allowing ZIP files to be RECFM=V with "byteseek" for CMS, recfm=U for MVS */
#define FOPR "rb,byteseek"
#define FOPM "r+,byteseek"
#ifdef MVS
  #define FOPW "wb,recfm=u,byteseek"
#else /* !MVS */
  #define FOPW "wb,recfm=v,lrecl=32760,byteseek"
#endif /* MVS */

#if 0
#define FOPW_TMP "w,byteseek"
#else
#define FOPW_TMP "w,type=memory(hiperspace)"
#endif

#define CBSZ 0x40000
#define ZBSZ 0x40000

#endif /* !__cmsmvs_h */