1 /* tailor.h -- target dependent definitions
3 Copyright (C) 1997-1999, 2002, 2006, 2009-2010 Free Software Foundation,
5 Copyright (C) 1992-1993 Jean-loup Gailly
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)
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.
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. */
21 /* The target dependent definitions should be defined here only.
22 * The target dependent functions should be defined in tailor.c.
25 #if defined(__MSDOS__) && !defined(MSDOS)
29 #if defined(__OS2__) && !defined(OS2)
33 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
39 /* DJGPP version 1.09+ on MS-DOS.
40 * The DJGPP 1.09 stat() function must be upgraded before gzip will
42 * No need for HAVE_DIRENT_H, since <unistd.h> defines POSIX_SOURCE which
43 * implies HAVE_DIRENT_H.
51 # define HAVE_DIRENT_H
55 # define HAVE_SYS_UTIME_H
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
66 # define NO_SIZE_CHECK
67 # define UNLINK_READONLY_BUG
68 # define casemap(c) tolow(c) /* Force file names to lower case */
71 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
72 # if !defined(NO_ASM) && !defined(ASMV)
80 # define PATH_SEP2 '\\'
81 # define PATH_SEP3 ':'
82 # define MAX_PATH_LEN 260
84 # define NO_MULTIPLE_DOTS
85 # define MAX_EXT_CHARS 3
87 # define casemap(c) tolow(c)
91 # define UNLINK_READONLY_BUG
94 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
96 # define HAVE_SYS_UTIME_H
102 # define HAVE_SYS_UTIME_H
103 # define HAVE_DIRENT_H
104 # define EXPAND(argc,argv) \
105 {_response(&argc, &argv); _wildcard(&argc, &argv);}
108 # define HAVE_DIRENT_H
109 # define HAVE_UTIME_H
114 # define EXPAND(argc,argv) \
115 {response_expand(&argc, &argv);}
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
125 # define STDC_HEADERS
126 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
127 # define UNLINK_READONLY_BUG
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 */
136 # define OS_CODE 0x0b
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);
148 # define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
149 # define fcfree(ptr) hfree(ptr)
153 # define fcalloc(items,size) calloc((items),(size))
155 # define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
157 # define fcfree(ptr) free(ptr)
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 NO_SIZE_CHECK
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)
206 # define OS_CODE 0x05
208 # define PATH_SEP2 '\\'
209 # define PATH_SEP3 ':'
210 # define MAX_PATH_LEN 128
211 # define NO_MULTIPLE_DOTS
212 # define MAX_EXT_CHARS 3
213 # define Z_SUFFIX "z"
214 # define casemap(c) tolow(c) /* Force file names to lower case */
219 # define PATH_SEP ':'
222 # define NO_STDIN_FSTAT
223 # define chmod(file, mode) (0)
224 # define OPEN(name, flags, mode) open(name, flags)
225 # define OS_CODE 0x07
227 # define isatty(fd) ((fd) <= 2)
232 # define OS_CODE 0x0a
236 /* Common defaults */
239 # define OS_CODE 0x03 /* assume Unix */
243 # define PATH_SEP '/'
247 # define casemap(c) (c)
251 # define OPTIONS_VAR "GZIP"
255 # define Z_SUFFIX ".gz"
259 # define MAX_SUFFIX MAX_EXT_CHARS
261 # define MAX_SUFFIX 30
264 #ifndef MAKE_LEGAL_NAME
265 # ifdef NO_MULTIPLE_DOTS
266 # define MAKE_LEGAL_NAME(name) make_simple_name(name)
268 # define MAKE_LEGAL_NAME(name)
274 /* keep at least MIN_PART chars between dots in a file name. */
278 # define EXPAND(argc,argv)
285 #ifndef SET_BINARY_MODE
286 # define SET_BINARY_MODE(fd)
290 # define OPEN(name, flags, mode) open_safer (name, flags, mode)