1 /* tailor.h -- target dependent definitions
2 * Copyright (C) 1992-1993 Jean-loup Gailly.
3 * This is free software; you can redistribute it and/or modify it under the
4 * terms of the GNU General Public License, see the file COPYING.
7 /* The target dependent definitions should be defined here only.
8 * The target dependent functions should be defined in tailor.c.
11 /* $FreeBSD: src/gnu/usr.bin/gzip/tailor.h,v 1.7 1999/08/27 23:35:53 peter Exp $ */
12 /* $DragonFly: src/gnu/usr.bin/gzip/Attic/tailor.h,v 1.2 2003/06/17 04:25:46 dillon Exp $ */
14 #if defined(__MSDOS__) && !defined(MSDOS)
18 #if defined(__OS2__) && !defined(OS2)
22 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
28 /* DJGPP version 1.09+ on MS-DOS.
29 * The DJGPP 1.09 stat() function must be upgraded before gzip will
31 * No need for DIRENT, since <unistd.h> defines POSIX_SOURCE which
45 # define HAVE_SYS_UTIME_H
49 # define PATH_SEP2 '\\'
50 # define PATH_SEP3 ':'
51 # define MAX_PATH_LEN 128
52 # define NO_MULTIPLE_DOTS
53 # define MAX_EXT_CHARS 3
58 # define NO_SIZE_CHECK
59 # define casemap(c) tolow(c) /* Force file names to lower case */
62 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
63 # if !defined(NO_ASM) && !defined(ASMV)
71 # define PATH_SEP2 '\\'
72 # define PATH_SEP3 ':'
73 # define MAX_PATH_LEN 260
75 # define NO_MULTIPLE_DOTS
76 # define MAX_EXT_CHARS 3
78 # define casemap(c) tolow(c)
85 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
87 # define HAVE_SYS_UTIME_H
94 # define HAVE_SYS_UTIME_H
97 # define EXPAND(argc,argv) \
98 {_response(&argc, &argv); _wildcard(&argc, &argv);}
107 # define EXPAND(argc,argv) \
108 {response_expand(&argc, &argv);}
112 #ifdef WIN32 /* Windows NT */
113 # define HAVE_SYS_UTIME_H
115 # define PATH_SEP2 '\\'
116 # define PATH_SEP3 ':'
117 # define MAX_PATH_LEN 260
120 # define STDC_HEADERS
121 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
125 # define NO_MULTIPLE_DOTS
126 # define MAX_EXT_CHARS 3
127 # define Z_SUFFIX "z"
128 # define casemap(c) tolow(c) /* Force file names to lower case */
130 # define OS_CODE 0x0b
137 /* Turbo C 2.0 does not accept static allocations of large arrays */
138 void * fcalloc (unsigned items, unsigned size);
139 void fcfree (void *ptr);
142 # define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
143 # define fcfree(ptr) hfree(ptr)
147 # define fcalloc(items,size) calloc((items),(size))
149 # define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
151 # define fcfree(ptr) free(ptr)
154 #if defined(VAXC) || defined(VMS)
155 # define PATH_SEP ']'
156 # define PATH_SEP2 ':'
157 # define SUFFIX_SEP ';'
158 # define NO_MULTIPLE_DOTS
159 # define Z_SUFFIX "-gz"
161 # define casemap(c) tolow(c)
162 # define OS_CODE 0x02
163 # define OPTIONS_VAR "GZIP_OPT"
164 # define STDC_HEADERS
166 # define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
168 # define unlink delete
176 # define PATH_SEP2 ':'
177 # define STDC_HEADERS
178 # define OS_CODE 0x01
182 # define HAVE_UNISTD_H
184 # define NO_STDIN_FSTAT
189 # include <fcntl.h> /* for read() and write() */
190 # define direct dirent
191 extern void _expand_args(int *argc, char ***argv);
192 # define EXPAND(argc,argv) _expand_args(&argc,&argv);
193 # undef O_BINARY /* disable useless --ascii option */
197 #if defined(ATARI) || defined(atarist)
198 # ifndef STDC_HEADERS
199 # define STDC_HEADERS
200 # define HAVE_UNISTD_H
204 # define OS_CODE 0x05
206 # define PATH_SEP2 '\\'
207 # define PATH_SEP3 ':'
208 # define MAX_PATH_LEN 128
209 # define NO_MULTIPLE_DOTS
210 # define MAX_EXT_CHARS 3
211 # define Z_SUFFIX "z"
213 # define casemap(c) tolow(c) /* Force file names to lower case */
219 # define PATH_SEP ':'
222 # define NO_STDIN_FSTAT
225 # define chmod(file, mode) (0)
226 # define OPEN(name, flags, mode) open(name, flags)
227 # define OS_CODE 0x07
229 # define isatty(fd) ((fd) <= 2)
233 #ifdef __50SERIES /* Prime/PRIMOS */
234 # define PATH_SEP '>'
235 # define STDC_HEADERS
240 # define NO_STDIN_FSTAT
241 # define NO_SIZE_CHECK
244 # define casemap(c) tolow(c) /* Force file names to lower case */
245 # define put_char(c) put_byte((c) & 0x7F)
246 # define get_char(c) ascii2pascii(get_byte())
247 # define OS_CODE 0x0F /* temporary, subject to change */
249 # undef SIGTERM /* We don't want a signal handler for SIGTERM */
253 #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
254 # define NOMEMCPY /* problem with overlapping copies */
258 # define OS_CODE 0x0a
262 # define NO_ST_INO /* don't rely on inode numbers */
266 /* Common defaults */
269 # define OS_CODE 0x03 /* assume Unix */
273 # define PATH_SEP '/'
277 # define casemap(c) (c)
281 # define OPTIONS_VAR "GZIP"
285 # define Z_SUFFIX ".gz"
289 # define MAX_SUFFIX MAX_EXT_CHARS
291 # define MAX_SUFFIX 30
294 #ifndef MAKE_LEGAL_NAME
295 # ifdef NO_MULTIPLE_DOTS
296 # define MAKE_LEGAL_NAME(name) make_simple_name(name)
298 # define MAKE_LEGAL_NAME(name)
304 /* keep at least MIN_PART chars between dots in a file name. */
308 # define EXPAND(argc,argv)
315 #ifndef SET_BINARY_MODE
316 # define SET_BINARY_MODE(fd)
320 # define OPEN(name, flags, mode) open(name, flags, mode)
324 # define get_char() get_byte()
328 # define put_char(c) put_byte(c)