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 Z_SUFFIX "-gz"
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);
173 # define unlink delete
177 # define HAVE_FCNTL_H
182 # define PATH_SEP2 ':'
183 # define STDC_HEADERS
184 # define OS_CODE 0x01
187 # define HAVE_DIRENT_H
188 # define HAVE_FCNTL_H
189 # define HAVE_UNISTD_H
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 */
203 #if defined(ATARI) || defined(atarist)
205 # define OS_CODE 0x05
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 */
218 # define PATH_SEP ':'
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
226 # define isatty(fd) ((fd) <= 2)
230 #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
231 # define NOMEMCPY /* problem with overlapping copies */
235 # define OS_CODE 0x0a
239 /* Common defaults */
242 # define OS_CODE 0x03 /* assume Unix */
246 # define PATH_SEP '/'
250 # define casemap(c) (c)
254 # define OPTIONS_VAR "GZIP"
258 # define Z_SUFFIX ".gz"
262 # define MAX_SUFFIX MAX_EXT_CHARS
264 # define MAX_SUFFIX 30
267 #ifndef MAKE_LEGAL_NAME
268 # ifdef NO_MULTIPLE_DOTS
269 # define MAKE_LEGAL_NAME(name) make_simple_name(name)
271 # define MAKE_LEGAL_NAME(name)
277 /* keep at least MIN_PART chars between dots in a file name. */
281 # define EXPAND(argc,argv)
288 #ifndef SET_BINARY_MODE
289 # define SET_BINARY_MODE(fd)
293 # define OPEN(name, flags, mode) open_safer (name, flags, mode)