1 /* tailor.h -- target dependent definitions
3 Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
4 Copyright (C) 1992-1993 Jean-loup Gailly
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
20 /* The target dependent definitions should be defined here only.
21 * The target dependent functions should be defined in tailor.c.
26 #if defined(__MSDOS__) && !defined(MSDOS)
30 #if defined(__OS2__) && !defined(OS2)
34 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
40 /* DJGPP version 1.09+ on MS-DOS.
41 * The DJGPP 1.09 stat() function must be upgraded before gzip will
43 * No need for HAVE_DIRENT_H, since <unistd.h> defines POSIX_SOURCE which
44 * implies HAVE_DIRENT_H.
52 # define HAVE_DIRENT_H
56 # define HAVE_SYS_UTIME_H
59 # define PATH_SEP2 '\\'
60 # define PATH_SEP3 ':'
61 # define MAX_PATH_LEN 128
62 # define NO_MULTIPLE_DOTS
63 # define MAX_EXT_CHARS 3
67 # define NO_SIZE_CHECK
68 # define UNLINK_READONLY_BUG
69 # define casemap(c) tolow(c) /* Force file names to lower case */
72 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
73 # if !defined(NO_ASM) && !defined(ASMV)
81 # define PATH_SEP2 '\\'
82 # define PATH_SEP3 ':'
83 # define MAX_PATH_LEN 260
85 # define NO_MULTIPLE_DOTS
86 # define MAX_EXT_CHARS 3
88 # define casemap(c) tolow(c)
92 # define UNLINK_READONLY_BUG
95 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
97 # define HAVE_SYS_UTIME_H
103 # define HAVE_SYS_UTIME_H
104 # define HAVE_DIRENT_H
105 # define EXPAND(argc,argv) \
106 {_response(&argc, &argv); _wildcard(&argc, &argv);}
109 # define HAVE_DIRENT_H
110 # define HAVE_UTIME_H
115 # define EXPAND(argc,argv) \
116 {response_expand(&argc, &argv);}
120 #ifdef WIN32 /* Windows NT */
121 # define HAVE_SYS_UTIME_H
122 # define PATH_SEP2 '\\'
123 # define PATH_SEP3 ':'
124 # define MAX_PATH_LEN 260
126 # define STDC_HEADERS
127 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
128 # define UNLINK_READONLY_BUG
132 # define NO_MULTIPLE_DOTS
133 # define MAX_EXT_CHARS 3
134 # define Z_SUFFIX "z"
135 # define casemap(c) tolow(c) /* Force file names to lower case */
137 # define OS_CODE 0x0b
144 /* Turbo C 2.0 does not accept static allocations of large arrays */
145 void * fcalloc (unsigned items, unsigned size);
146 void fcfree (void *ptr);
149 # define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
150 # define fcfree(ptr) hfree(ptr)
154 # define fcalloc(items,size) calloc((items),(size))
156 # define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
158 # define fcfree(ptr) free(ptr)
161 #if defined(VAXC) || defined(VMS)
162 # define PATH_SEP ']'
163 # define PATH_SEP2 ':'
164 # define SUFFIX_SEP ';'
165 # define NO_MULTIPLE_DOTS
166 # define Z_SUFFIX "-gz"
168 # define casemap(c) tolow(c)
169 # define OS_CODE 0x02
170 # define OPTIONS_VAR "GZIP_OPT"
171 # define STDC_HEADERS
172 # define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
174 # define unlink delete
178 # define HAVE_FCNTL_H
183 # define PATH_SEP2 ':'
184 # define STDC_HEADERS
185 # define OS_CODE 0x01
188 # define HAVE_DIRENT_H
189 # define HAVE_FCNTL_H
190 # define HAVE_UNISTD_H
194 # define NO_STDIN_FSTAT
195 # define HAVE_SYS_DIR_H
196 # include <fcntl.h> /* for read() and write() */
197 # define direct dirent
198 extern void _expand_args(int *argc, char ***argv);
199 # define EXPAND(argc,argv) _expand_args(&argc,&argv);
200 # undef O_BINARY /* disable useless --ascii option */
204 #if defined(ATARI) || defined(atarist)
205 # ifndef STDC_HEADERS
206 # define STDC_HEADERS
207 # define HAVE_UNISTD_H
208 # define HAVE_DIRENT_H
211 # define OS_CODE 0x05
213 # define PATH_SEP2 '\\'
214 # define PATH_SEP3 ':'
215 # define MAX_PATH_LEN 128
216 # define NO_MULTIPLE_DOTS
217 # define MAX_EXT_CHARS 3
218 # define Z_SUFFIX "z"
219 # define casemap(c) tolow(c) /* Force file names to lower case */
224 # define PATH_SEP ':'
227 # define NO_STDIN_FSTAT
228 # define chmod(file, mode) (0)
229 # define OPEN(name, flags, mode) open(name, flags)
230 # define OS_CODE 0x07
232 # define isatty(fd) ((fd) <= 2)
236 #ifdef __50SERIES /* Prime/PRIMOS */
237 # define PATH_SEP '>'
238 # define STDC_HEADERS
239 # define NO_STDIN_FSTAT
240 # define NO_SIZE_CHECK
242 # define casemap(c) tolow(c) /* Force file names to lower case */
243 # define put_char(c) put_byte((c) & 0x7F)
244 # define get_char(c) ascii2pascii(get_byte())
245 # define OS_CODE 0x0F /* temporary, subject to change */
247 # undef SIGTERM /* We don't want a signal handler for SIGTERM */
251 #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
252 # define NOMEMCPY /* problem with overlapping copies */
256 # define OS_CODE 0x0a
260 # define NO_ST_INO /* don't rely on inode numbers */
264 /* Common defaults */
267 # define OS_CODE 0x03 /* assume Unix */
271 # define PATH_SEP '/'
275 # define casemap(c) (c)
279 # define OPTIONS_VAR "GZIP"
283 # define Z_SUFFIX ".gz"
287 # define MAX_SUFFIX MAX_EXT_CHARS
289 # define MAX_SUFFIX 30
292 #ifndef MAKE_LEGAL_NAME
293 # ifdef NO_MULTIPLE_DOTS
294 # define MAKE_LEGAL_NAME(name) make_simple_name(name)
296 # define MAKE_LEGAL_NAME(name)
302 /* keep at least MIN_PART chars between dots in a file name. */
306 # define EXPAND(argc,argv)
313 #ifndef SET_BINARY_MODE
314 # define SET_BINARY_MODE(fd)
318 # define OPEN(name, flags, mode) open_safer (name, flags, mode)
322 # define get_char() get_byte()
326 # define put_char(c) put_byte(c)