gzip: drop mentions of Amiga, VMS
[debian/gzip] / tailor.h
1 /* tailor.h -- target dependent definitions
2
3    Copyright (C) 1997-1999, 2002, 2006, 2009-2016 Free Software Foundation,
4    Inc.
5    Copyright (C) 1992-1993 Jean-loup Gailly
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 /* The target dependent definitions should be defined here only.
22  * The target dependent functions should be defined in tailor.c.
23  */
24
25 #if defined(__MSDOS__) && !defined(MSDOS)
26 #  define MSDOS
27 #endif
28
29 #if defined(__OS2__) && !defined(OS2)
30 #  define OS2
31 #endif
32
33 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
34 #  undef MSDOS
35 #endif
36
37 #ifdef MSDOS
38 #  ifdef __GNUC__
39      /* DJGPP version 1.09+ on MS-DOS.
40       * The DJGPP 1.09 stat() function must be upgraded before gzip will
41       * fully work.
42       */
43 #    define near
44 #  else
45 #    define MAXSEG_64K
46 #    ifdef __TURBOC__
47 #      define off_t long
48 #      define HAVE_UTIME_H
49 #    else /* MSC */
50 #      define HAVE_SYS_UTIME_H
51 #    endif
52 #  endif
53 #  define MAX_PATH_LEN  128
54 #  define NO_MULTIPLE_DOTS
55 #  define MAX_EXT_CHARS 3
56 #  define Z_SUFFIX "z"
57 #  define NO_SIZE_CHECK
58 #  define UNLINK_READONLY_BUG
59 #  define casemap(c) tolow(c) /* Force file names to lower case */
60 #  include <io.h>
61 #  define OS_CODE  0x00
62 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
63 #  if !defined(NO_ASM) && !defined(ASMV)
64 #    define ASMV
65 #  endif
66 #else
67 #  define near
68 #endif
69
70 #ifdef OS2
71 #  define MAX_PATH_LEN  260
72 #  ifdef OS2FAT
73 #    define NO_MULTIPLE_DOTS
74 #    define MAX_EXT_CHARS 3
75 #    define Z_SUFFIX "z"
76 #    define casemap(c) tolow(c)
77 #  endif
78 #  define UNLINK_READONLY_BUG
79 #  include <io.h>
80 #  define OS_CODE  0x06
81 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
82 #  ifdef _MSC_VER
83 #    define HAVE_SYS_UTIME_H
84 #    define MAXSEG_64K
85 #    undef near
86 #    define near _near
87 #  endif
88 #  ifdef __EMX__
89 #    define HAVE_SYS_UTIME_H
90 #    define EXPAND(argc,argv) \
91        {_response(&argc, &argv); _wildcard(&argc, &argv);}
92 #  endif
93 #  ifdef __BORLANDC__
94 #    define HAVE_UTIME_H
95 #  endif
96 #  ifdef __ZTC__
97 #    define NO_DIR 1
98 #    include <dos.h>
99 #    define EXPAND(argc,argv) \
100        {response_expand(&argc, &argv);}
101 #  endif
102 #endif
103
104 #if defined WIN32 || defined _WIN32
105 #  define HAVE_SYS_UTIME_H
106 #  define MAX_PATH_LEN  260
107 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
108 #  define UNLINK_READONLY_BUG
109 #  include <io.h>
110 #  include <malloc.h>
111 #  ifdef NTFAT
112 #    define NO_MULTIPLE_DOTS
113 #    define MAX_EXT_CHARS 3
114 #    define Z_SUFFIX "z"
115 #    define casemap(c) tolow(c) /* Force file names to lower case */
116 #  endif
117 #  define OS_CODE  0x0b
118 #endif
119
120 #ifdef MSDOS
121 #  ifdef __TURBOC__
122 #    include <alloc.h>
123 #    define DYN_ALLOC
124      /* Turbo C 2.0 does not accept static allocations of large arrays */
125      void * fcalloc (unsigned items, unsigned size);
126      void fcfree (void *ptr);
127 #  else /* MSC */
128 #    include <malloc.h>
129 #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
130 #    define fcfree(ptr) hfree(ptr)
131 #  endif
132 #else
133 #  ifdef MAXSEG_64K
134 #    define fcalloc(items,size) calloc((items),(size))
135 #  else
136 #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
137 #  endif
138 #  define fcfree(ptr) free(ptr)
139 #endif
140
141 #if defined(ATARI) || defined(atarist)
142 #  define ASMV
143 #  define OS_CODE  0x05
144 #  ifdef TOSFS
145 #    define MAX_PATH_LEN  128
146 #    define NO_MULTIPLE_DOTS
147 #    define MAX_EXT_CHARS 3
148 #    define Z_SUFFIX "z"
149 #    define casemap(c) tolow(c) /* Force file names to lower case */
150 #  endif
151 #endif
152
153 #ifdef TOPS20
154 #  define OS_CODE  0x0a
155 #endif
156
157 #ifndef SIGPIPE
158 # define SIGPIPE 0
159 #endif
160
161
162         /* Common defaults */
163
164 #ifndef OS_CODE
165 #  define OS_CODE  0x03  /* assume Unix */
166 #endif
167
168 #ifndef casemap
169 #  define casemap(c) (c)
170 #endif
171
172 #ifndef OPTIONS_VAR
173 #  define OPTIONS_VAR "GZIP"
174 #endif
175
176 #ifndef Z_SUFFIX
177 #  define Z_SUFFIX ".gz"
178 #endif
179
180 #ifdef MAX_EXT_CHARS
181 #  define MAX_SUFFIX  MAX_EXT_CHARS
182 #else
183 #  define MAX_SUFFIX  30
184 #endif
185
186 #ifndef MAKE_LEGAL_NAME
187 #  ifdef NO_MULTIPLE_DOTS
188 #    define MAKE_LEGAL_NAME(name)   make_simple_name(name)
189 #  else
190 #    define MAKE_LEGAL_NAME(name)
191 #  endif
192 #endif
193
194 #ifndef MIN_PART
195 #  define MIN_PART 3
196    /* keep at least MIN_PART chars between dots in a file name. */
197 #endif
198
199 #ifndef EXPAND
200 #  define EXPAND(argc,argv)
201 #endif
202
203 #ifndef SET_BINARY_MODE
204 #  define SET_BINARY_MODE(fd)
205 #endif