squelch warnings about not using ${misc:Depends} in control file. review of
[debian/gzip] / tailor.h
1 /* tailor.h -- target dependent definitions
2
3    Copyright (C) 1997-1999, 2002, 2006, 2009-2010 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       * No need for HAVE_DIRENT_H, since <unistd.h> defines POSIX_SOURCE which
43       * implies HAVE_DIRENT_H.
44       */
45 #    define near
46 #  else
47 #    define MAXSEG_64K
48 #    ifdef __TURBOC__
49 #      define off_t long
50 #      ifdef __BORLANDC__
51 #        define HAVE_DIRENT_H
52 #      endif
53 #      define HAVE_UTIME_H
54 #    else /* MSC */
55 #      define HAVE_SYS_UTIME_H
56 #    endif
57 #  endif
58 #  define PATH_SEP2 '\\'
59 #  define PATH_SEP3 ':'
60 #  define MAX_PATH_LEN  128
61 #  define NO_MULTIPLE_DOTS
62 #  define MAX_EXT_CHARS 3
63 #  define Z_SUFFIX "z"
64 #  define PROTO
65 #  define STDC_HEADERS
66 #  define NO_SIZE_CHECK
67 #  define UNLINK_READONLY_BUG
68 #  define casemap(c) tolow(c) /* Force file names to lower case */
69 #  include <io.h>
70 #  define OS_CODE  0x00
71 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
72 #  if !defined(NO_ASM) && !defined(ASMV)
73 #    define ASMV
74 #  endif
75 #else
76 #  define near
77 #endif
78
79 #ifdef OS2
80 #  define PATH_SEP2 '\\'
81 #  define PATH_SEP3 ':'
82 #  define MAX_PATH_LEN  260
83 #  ifdef OS2FAT
84 #    define NO_MULTIPLE_DOTS
85 #    define MAX_EXT_CHARS 3
86 #    define Z_SUFFIX "z"
87 #    define casemap(c) tolow(c)
88 #  endif
89 #  define PROTO
90 #  define STDC_HEADERS
91 #  define UNLINK_READONLY_BUG
92 #  include <io.h>
93 #  define OS_CODE  0x06
94 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
95 #  ifdef _MSC_VER
96 #    define HAVE_SYS_UTIME_H
97 #    define MAXSEG_64K
98 #    undef near
99 #    define near _near
100 #  endif
101 #  ifdef __EMX__
102 #    define HAVE_SYS_UTIME_H
103 #    define HAVE_DIRENT_H
104 #    define EXPAND(argc,argv) \
105        {_response(&argc, &argv); _wildcard(&argc, &argv);}
106 #  endif
107 #  ifdef __BORLANDC__
108 #    define HAVE_DIRENT_H
109 #    define HAVE_UTIME_H
110 #  endif
111 #  ifdef __ZTC__
112 #    define NO_DIR 1
113 #    include <dos.h>
114 #    define EXPAND(argc,argv) \
115        {response_expand(&argc, &argv);}
116 #  endif
117 #endif
118
119 #ifdef WIN32 /* Windows NT */
120 #  define HAVE_SYS_UTIME_H
121 #  define PATH_SEP2 '\\'
122 #  define PATH_SEP3 ':'
123 #  define MAX_PATH_LEN  260
124 #  define PROTO
125 #  define STDC_HEADERS
126 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
127 #  define UNLINK_READONLY_BUG
128 #  include <io.h>
129 #  include <malloc.h>
130 #  ifdef NTFAT
131 #    define NO_MULTIPLE_DOTS
132 #    define MAX_EXT_CHARS 3
133 #    define Z_SUFFIX "z"
134 #    define casemap(c) tolow(c) /* Force file names to lower case */
135 #  endif
136 #  define OS_CODE  0x0b
137 #endif
138
139 #ifdef MSDOS
140 #  ifdef __TURBOC__
141 #    include <alloc.h>
142 #    define DYN_ALLOC
143      /* Turbo C 2.0 does not accept static allocations of large arrays */
144      void * fcalloc (unsigned items, unsigned size);
145      void fcfree (void *ptr);
146 #  else /* MSC */
147 #    include <malloc.h>
148 #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
149 #    define fcfree(ptr) hfree(ptr)
150 #  endif
151 #else
152 #  ifdef MAXSEG_64K
153 #    define fcalloc(items,size) calloc((items),(size))
154 #  else
155 #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
156 #  endif
157 #  define fcfree(ptr) free(ptr)
158 #endif
159
160 #if defined(VAXC) || defined(VMS)
161 #  define PATH_SEP ']'
162 #  define PATH_SEP2 ':'
163 #  define SUFFIX_SEP ';'
164 #  define NO_MULTIPLE_DOTS
165 #  define Z_SUFFIX "-gz"
166 #  define RECORD_IO 1
167 #  define casemap(c) tolow(c)
168 #  define OS_CODE  0x02
169 #  define OPTIONS_VAR "GZIP_OPT"
170 #  define STDC_HEADERS
171 #  define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
172 #  include <file.h>
173 #  define unlink delete
174 #  ifdef VAXC
175 #    include <unixio.h>
176 #  else
177 #    define HAVE_FCNTL_H
178 #  endif
179 #endif
180
181 #ifdef AMIGA
182 #  define PATH_SEP2 ':'
183 #  define STDC_HEADERS
184 #  define OS_CODE  0x01
185 #  define ASMV
186 #  ifdef __GNUC__
187 #    define HAVE_DIRENT_H
188 #    define HAVE_FCNTL_H
189 #    define HAVE_UNISTD_H
190 #    define HAVE_CHOWN
191 #    define HAVE_LSTAT
192 #  else /* SASC */
193 #    define NO_STDIN_FSTAT
194 #    define HAVE_SYS_DIR_H
195 #    include <fcntl.h> /* for read() and write() */
196 #    define direct dirent
197      extern void _expand_args(int *argc, char ***argv);
198 #    define EXPAND(argc,argv) _expand_args(&argc,&argv);
199 #    undef  O_BINARY /* disable useless --ascii option */
200 #  endif
201 #endif
202
203 #if defined(ATARI) || defined(atarist)
204 #  define ASMV
205 #  define OS_CODE  0x05
206 #  ifdef TOSFS
207 #    define PATH_SEP2 '\\'
208 #    define PATH_SEP3 ':'
209 #    define MAX_PATH_LEN  128
210 #    define NO_MULTIPLE_DOTS
211 #    define MAX_EXT_CHARS 3
212 #    define Z_SUFFIX "z"
213 #    define casemap(c) tolow(c) /* Force file names to lower case */
214 #  endif
215 #endif
216
217 #ifdef MACOS
218 #  define PATH_SEP ':'
219 #  define DYN_ALLOC
220 #  define PROTO
221 #  define NO_STDIN_FSTAT
222 #  define chmod(file, mode) (0)
223 #  define OPEN(name, flags, mode) open(name, flags)
224 #  define OS_CODE  0x07
225 #  ifdef MPW
226 #    define isatty(fd) ((fd) <= 2)
227 #  endif
228 #endif
229
230 #ifdef __50SERIES /* Prime/PRIMOS */
231 #  define PATH_SEP '>'
232 #  define STDC_HEADERS
233 #  define NO_STDIN_FSTAT
234 #  define NO_SIZE_CHECK
235 #  define RECORD_IO  1
236 #  define casemap(c)  tolow(c) /* Force file names to lower case */
237 #  define put_char(c) put_byte((c) & 0x7F)
238 #  define get_char(c) ascii2pascii(get_byte())
239 #  define OS_CODE  0x0F    /* temporary, subject to change */
240 #  ifdef SIGTERM
241 #    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
242 #  endif
243 #endif
244
245 #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
246 #  define NOMEMCPY /* problem with overlapping copies */
247 #endif
248
249 #ifdef TOPS20
250 #  define OS_CODE  0x0a
251 #endif
252
253
254         /* Common defaults */
255
256 #ifndef OS_CODE
257 #  define OS_CODE  0x03  /* assume Unix */
258 #endif
259
260 #ifndef PATH_SEP
261 #  define PATH_SEP '/'
262 #endif
263
264 #ifndef casemap
265 #  define casemap(c) (c)
266 #endif
267
268 #ifndef OPTIONS_VAR
269 #  define OPTIONS_VAR "GZIP"
270 #endif
271
272 #ifndef Z_SUFFIX
273 #  define Z_SUFFIX ".gz"
274 #endif
275
276 #ifdef MAX_EXT_CHARS
277 #  define MAX_SUFFIX  MAX_EXT_CHARS
278 #else
279 #  define MAX_SUFFIX  30
280 #endif
281
282 #ifndef MAKE_LEGAL_NAME
283 #  ifdef NO_MULTIPLE_DOTS
284 #    define MAKE_LEGAL_NAME(name)   make_simple_name(name)
285 #  else
286 #    define MAKE_LEGAL_NAME(name)
287 #  endif
288 #endif
289
290 #ifndef MIN_PART
291 #  define MIN_PART 3
292    /* keep at least MIN_PART chars between dots in a file name. */
293 #endif
294
295 #ifndef EXPAND
296 #  define EXPAND(argc,argv)
297 #endif
298
299 #ifndef RECORD_IO
300 #  define RECORD_IO 0
301 #endif
302
303 #ifndef SET_BINARY_MODE
304 #  define SET_BINARY_MODE(fd)
305 #endif
306
307 #ifndef OPEN
308 #  define OPEN(name, flags, mode) open_safer (name, flags, mode)
309 #endif
310
311 #ifndef get_char
312 #  define get_char() get_byte()
313 #endif
314
315 #ifndef put_char
316 #  define put_char(c) put_byte(c)
317 #endif