1 /* tailor.h -- target dependent definitions
3 Copyright (C) 1997, 1998, 1999, 2002, 2006 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 3, 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.
24 #if defined(__MSDOS__) && !defined(MSDOS)
28 #if defined(__OS2__) && !defined(OS2)
32 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
38 /* DJGPP version 1.09+ on MS-DOS.
39 * The DJGPP 1.09 stat() function must be upgraded before gzip will
41 * No need for HAVE_DIRENT_H, since <unistd.h> defines POSIX_SOURCE which
42 * implies HAVE_DIRENT_H.
50 # define HAVE_DIRENT_H
54 # define HAVE_SYS_UTIME_H
57 # define PATH_SEP2 '\\'
58 # define PATH_SEP3 ':'
59 # define MAX_PATH_LEN 128
60 # define NO_MULTIPLE_DOTS
61 # define MAX_EXT_CHARS 3
65 # define NO_SIZE_CHECK
66 # define UNLINK_READONLY_BUG
67 # define casemap(c) tolow(c) /* Force file names to lower case */
70 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
71 # if !defined(NO_ASM) && !defined(ASMV)
79 # define PATH_SEP2 '\\'
80 # define PATH_SEP3 ':'
81 # define MAX_PATH_LEN 260
83 # define NO_MULTIPLE_DOTS
84 # define MAX_EXT_CHARS 3
86 # define casemap(c) tolow(c)
90 # define UNLINK_READONLY_BUG
93 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
95 # define HAVE_SYS_UTIME_H
101 # define HAVE_SYS_UTIME_H
102 # define HAVE_DIRENT_H
103 # define EXPAND(argc,argv) \
104 {_response(&argc, &argv); _wildcard(&argc, &argv);}
107 # define HAVE_DIRENT_H
108 # define HAVE_UTIME_H
113 # define EXPAND(argc,argv) \
114 {response_expand(&argc, &argv);}
118 #ifdef WIN32 /* Windows NT */
119 # define HAVE_SYS_UTIME_H
120 # define PATH_SEP2 '\\'
121 # define PATH_SEP3 ':'
122 # define MAX_PATH_LEN 260
124 # define STDC_HEADERS
125 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
126 # define UNLINK_READONLY_BUG
130 # define NO_MULTIPLE_DOTS
131 # define MAX_EXT_CHARS 3
132 # define Z_SUFFIX "z"
133 # define casemap(c) tolow(c) /* Force file names to lower case */
135 # define OS_CODE 0x0b
142 /* Turbo C 2.0 does not accept static allocations of large arrays */
143 void * fcalloc (unsigned items, unsigned size);
144 void fcfree (void *ptr);
147 # define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
148 # define fcfree(ptr) hfree(ptr)
152 # define fcalloc(items,size) calloc((items),(size))
154 # define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
156 # define fcfree(ptr) free(ptr)
159 #if defined(VAXC) || defined(VMS)
160 # define PATH_SEP ']'
161 # define PATH_SEP2 ':'
162 # define SUFFIX_SEP ';'
163 # define NO_MULTIPLE_DOTS
164 # define Z_SUFFIX "-gz"
166 # define casemap(c) tolow(c)
167 # define OS_CODE 0x02
168 # define OPTIONS_VAR "GZIP_OPT"
169 # define STDC_HEADERS
170 # define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
172 # define unlink delete
176 # define HAVE_FCNTL_H
181 # define PATH_SEP2 ':'
182 # define STDC_HEADERS
183 # define OS_CODE 0x01
186 # define HAVE_DIRENT_H
187 # define HAVE_FCNTL_H
188 # define HAVE_UNISTD_H
192 # define NO_STDIN_FSTAT
193 # define HAVE_SYS_DIR_H
194 # include <fcntl.h> /* for read() and write() */
195 # define direct dirent
196 extern void _expand_args(int *argc, char ***argv);
197 # define EXPAND(argc,argv) _expand_args(&argc,&argv);
198 # undef O_BINARY /* disable useless --ascii option */
202 #if defined(ATARI) || defined(atarist)
203 # ifndef STDC_HEADERS
204 # define STDC_HEADERS
205 # define HAVE_UNISTD_H
206 # define HAVE_DIRENT_H
209 # define OS_CODE 0x05
211 # define PATH_SEP2 '\\'
212 # define PATH_SEP3 ':'
213 # define MAX_PATH_LEN 128
214 # define NO_MULTIPLE_DOTS
215 # define MAX_EXT_CHARS 3
216 # define Z_SUFFIX "z"
217 # define casemap(c) tolow(c) /* Force file names to lower case */
222 # define PATH_SEP ':'
225 # define NO_STDIN_FSTAT
226 # define chmod(file, mode) (0)
227 # define OPEN(name, flags, mode) open(name, flags)
228 # define OS_CODE 0x07
230 # define isatty(fd) ((fd) <= 2)
234 #ifdef __50SERIES /* Prime/PRIMOS */
235 # define PATH_SEP '>'
236 # define STDC_HEADERS
237 # define NO_STDIN_FSTAT
238 # define NO_SIZE_CHECK
240 # define casemap(c) tolow(c) /* Force file names to lower case */
241 # define put_char(c) put_byte((c) & 0x7F)
242 # define get_char(c) ascii2pascii(get_byte())
243 # define OS_CODE 0x0F /* temporary, subject to change */
245 # undef SIGTERM /* We don't want a signal handler for SIGTERM */
249 #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
250 # define NOMEMCPY /* problem with overlapping copies */
254 # define OS_CODE 0x0a
258 /* Common defaults */
261 # define OS_CODE 0x03 /* assume Unix */
265 # define PATH_SEP '/'
269 # define casemap(c) (c)
273 # define OPTIONS_VAR "GZIP"
277 # define Z_SUFFIX ".gz"
281 # define MAX_SUFFIX MAX_EXT_CHARS
283 # define MAX_SUFFIX 30
286 #ifndef MAKE_LEGAL_NAME
287 # ifdef NO_MULTIPLE_DOTS
288 # define MAKE_LEGAL_NAME(name) make_simple_name(name)
290 # define MAKE_LEGAL_NAME(name)
296 /* keep at least MIN_PART chars between dots in a file name. */
300 # define EXPAND(argc,argv)
307 #ifndef SET_BINARY_MODE
308 # define SET_BINARY_MODE(fd)
312 # define OPEN(name, flags, mode) open_safer (name, flags, mode)
316 # define get_char() get_byte()
320 # define put_char(c) put_byte(c)