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 /* $Id: tailor.h,v 0.18 1993/06/14 19:32:20 jloup Exp $ */
13 #if defined(__MSDOS__) && !defined(MSDOS)
17 #if defined(__OS2__) && !defined(OS2)
21 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
27 /* DJGPP version 1.09+ on MS-DOS.
28 * The DJGPP 1.09 stat() function must be upgraded before gzip will
30 * No need for HAVE_DIRENT_H, since <unistd.h> defines POSIX_SOURCE which
31 * implies HAVE_DIRENT_H.
39 # define HAVE_DIRENT_H
44 # define HAVE_SYS_UTIME_H
47 # define PATH_SEP2 '\\'
48 # define PATH_SEP3 ':'
49 # define MAX_PATH_LEN 128
50 # define NO_MULTIPLE_DOTS
51 # define MAX_EXT_CHARS 3
55 # define NO_SIZE_CHECK
56 # define UNLINK_READONLY_BUG
57 # define casemap(c) tolow(c) /* Force file names to lower case */
60 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
61 # if !defined(NO_ASM) && !defined(ASMV)
69 # define PATH_SEP2 '\\'
70 # define PATH_SEP3 ':'
71 # define MAX_PATH_LEN 260
73 # define NO_MULTIPLE_DOTS
74 # define MAX_EXT_CHARS 3
76 # define casemap(c) tolow(c)
80 # define UNLINK_READONLY_BUG
83 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
85 # define HAVE_SYS_UTIME_H
91 # define HAVE_SYS_UTIME_H
92 # define HAVE_DIRENT_H
93 # define EXPAND(argc,argv) \
94 {_response(&argc, &argv); _wildcard(&argc, &argv);}
97 # define HAVE_DIRENT_H
103 # define EXPAND(argc,argv) \
104 {response_expand(&argc, &argv);}
108 #ifdef WIN32 /* Windows NT */
109 # define HAVE_SYS_UTIME_H
110 # define PATH_SEP2 '\\'
111 # define PATH_SEP3 ':'
112 # define MAX_PATH_LEN 260
114 # define STDC_HEADERS
115 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
116 # define UNLINK_READONLY_BUG
120 # define NO_MULTIPLE_DOTS
121 # define MAX_EXT_CHARS 3
122 # define Z_SUFFIX "z"
123 # define casemap(c) tolow(c) /* Force file names to lower case */
125 # define OS_CODE 0x0b
132 /* Turbo C 2.0 does not accept static allocations of large arrays */
133 void * fcalloc (unsigned items, unsigned size);
134 void fcfree (void *ptr);
137 # define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
138 # define fcfree(ptr) hfree(ptr)
142 # define fcalloc(items,size) calloc((items),(size))
144 # define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
146 # define fcfree(ptr) free(ptr)
149 #if defined(VAXC) || defined(VMS)
150 # define PATH_SEP ']'
151 # define PATH_SEP2 ':'
152 # define SUFFIX_SEP ';'
153 # define NO_MULTIPLE_DOTS
154 # define Z_SUFFIX "-gz"
156 # define casemap(c) tolow(c)
157 # define OS_CODE 0x02
158 # define OPTIONS_VAR "GZIP_OPT"
159 # define STDC_HEADERS
160 # define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
162 # define unlink delete
166 # define HAVE_FCNTL_H
171 # define PATH_SEP2 ':'
172 # define STDC_HEADERS
173 # define OS_CODE 0x01
176 # define HAVE_DIRENT_H
177 # define HAVE_FCNTL_H
178 # define HAVE_UNISTD_H
182 # define NO_STDIN_FSTAT
183 # define HAVE_SYS_DIR_H
184 # include <fcntl.h> /* for read() and write() */
185 # define direct dirent
186 extern void _expand_args(int *argc, char ***argv);
187 # define EXPAND(argc,argv) _expand_args(&argc,&argv);
188 # undef O_BINARY /* disable useless --ascii option */
192 #if defined(ATARI) || defined(atarist)
193 # ifndef STDC_HEADERS
194 # define STDC_HEADERS
195 # define HAVE_UNISTD_H
196 # define HAVE_DIRENT_H
199 # define OS_CODE 0x05
201 # define PATH_SEP2 '\\'
202 # define PATH_SEP3 ':'
203 # define MAX_PATH_LEN 128
204 # define NO_MULTIPLE_DOTS
205 # define MAX_EXT_CHARS 3
206 # define Z_SUFFIX "z"
207 # define casemap(c) tolow(c) /* Force file names to lower case */
212 # define PATH_SEP ':'
215 # define NO_STDIN_FSTAT
216 # define chmod(file, mode) (0)
217 # define OPEN(name, flags, mode) open(name, flags)
218 # define OS_CODE 0x07
220 # define isatty(fd) ((fd) <= 2)
224 #ifdef __50SERIES /* Prime/PRIMOS */
225 # define PATH_SEP '>'
226 # define STDC_HEADERS
227 # define NO_STDIN_FSTAT
228 # define NO_SIZE_CHECK
230 # define casemap(c) tolow(c) /* Force file names to lower case */
231 # define put_char(c) put_byte((c) & 0x7F)
232 # define get_char(c) ascii2pascii(get_byte())
233 # define OS_CODE 0x0F /* temporary, subject to change */
235 # undef SIGTERM /* We don't want a signal handler for SIGTERM */
239 #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
240 # define NOMEMCPY /* problem with overlapping copies */
244 # define OS_CODE 0x0a
248 # define NO_ST_INO /* don't rely on inode numbers */
252 /* Common defaults */
255 # define OS_CODE 0x03 /* assume Unix */
259 # define PATH_SEP '/'
263 # define casemap(c) (c)
267 # define OPTIONS_VAR "GZIP"
271 # define Z_SUFFIX ".gz"
275 # define MAX_SUFFIX MAX_EXT_CHARS
277 # define MAX_SUFFIX 30
280 #ifndef MAKE_LEGAL_NAME
281 # ifdef NO_MULTIPLE_DOTS
282 # define MAKE_LEGAL_NAME(name) make_simple_name(name)
284 # define MAKE_LEGAL_NAME(name)
290 /* keep at least MIN_PART chars between dots in a file name. */
294 # define EXPAND(argc,argv)
301 #ifndef SET_BINARY_MODE
302 # define SET_BINARY_MODE(fd)
306 # define OPEN(name, flags, mode) open(name, flags, mode)
310 # define get_char() get_byte()
314 # define put_char(c) put_byte(c)