Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / gnu / usr.bin / gzip / tailor.h
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.
5  */
6
7 /* The target dependent definitions should be defined here only.
8  * The target dependent functions should be defined in tailor.c.
9  */
10
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 $ */
13
14 #if defined(__MSDOS__) && !defined(MSDOS)
15 #  define MSDOS
16 #endif
17
18 #if defined(__OS2__) && !defined(OS2)
19 #  define OS2
20 #endif
21
22 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
23 #  undef MSDOS
24 #endif
25
26 #ifdef MSDOS
27 #  ifdef __GNUC__
28      /* DJGPP version 1.09+ on MS-DOS.
29       * The DJGPP 1.09 stat() function must be upgraded before gzip will
30       * fully work.
31       * No need for DIRENT, since <unistd.h> defines POSIX_SOURCE which
32       * implies DIRENT.
33       */
34 #    define near
35 #  else
36 #    define MAXSEG_64K
37 #    ifdef __TURBOC__
38 #      define NO_OFF_T
39 #      ifdef __BORLANDC__
40 #        define DIRENT
41 #      else
42 #        define NO_UTIME
43 #      endif
44 #    else /* MSC */
45 #      define HAVE_SYS_UTIME_H
46 #      define NO_UTIME_H
47 #    endif
48 #  endif
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
54 #  define Z_SUFFIX "z"
55 #  define NO_CHOWN
56 #  define PROTO
57 #  define STDC_HEADERS
58 #  define NO_SIZE_CHECK
59 #  define casemap(c) tolow(c) /* Force file names to lower case */
60 #  include <io.h>
61 #  define OS_CODE  0x00
62 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
63 #  if !defined(NO_ASM) && !defined(ASMV)
64 #    define ASMV
65 #  endif
66 #else
67 #  define near
68 #endif
69
70 #ifdef OS2
71 #  define PATH_SEP2 '\\'
72 #  define PATH_SEP3 ':'
73 #  define MAX_PATH_LEN  260
74 #  ifdef OS2FAT
75 #    define NO_MULTIPLE_DOTS
76 #    define MAX_EXT_CHARS 3
77 #    define Z_SUFFIX "z"
78 #    define casemap(c) tolow(c)
79 #  endif
80 #  define NO_CHOWN
81 #  define PROTO
82 #  define STDC_HEADERS
83 #  include <io.h>
84 #  define OS_CODE  0x06
85 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
86 #  ifdef _MSC_VER
87 #    define HAVE_SYS_UTIME_H
88 #    define NO_UTIME_H
89 #    define MAXSEG_64K
90 #    undef near
91 #    define near _near
92 #  endif
93 #  ifdef __EMX__
94 #    define HAVE_SYS_UTIME_H
95 #    define NO_UTIME_H
96 #    define DIRENT
97 #    define EXPAND(argc,argv) \
98        {_response(&argc, &argv); _wildcard(&argc, &argv);}
99 #  endif
100 #  ifdef __BORLANDC__
101 #    define DIRENT
102 #  endif
103 #  ifdef __ZTC__
104 #    define NO_DIR
105 #    define NO_UTIME_H
106 #    include <dos.h>
107 #    define EXPAND(argc,argv) \
108        {response_expand(&argc, &argv);}
109 #  endif
110 #endif
111
112 #ifdef WIN32 /* Windows NT */
113 #  define HAVE_SYS_UTIME_H
114 #  define NO_UTIME_H
115 #  define PATH_SEP2 '\\'
116 #  define PATH_SEP3 ':'
117 #  define MAX_PATH_LEN  260
118 #  define NO_CHOWN
119 #  define PROTO
120 #  define STDC_HEADERS
121 #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
122 #  include <io.h>
123 #  include <malloc.h>
124 #  ifdef NTFAT
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 */
129 #  endif
130 #  define OS_CODE  0x0b
131 #endif
132
133 #ifdef MSDOS
134 #  ifdef __TURBOC__
135 #    include <alloc.h>
136 #    define DYN_ALLOC
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);
140 #  else /* MSC */
141 #    include <malloc.h>
142 #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
143 #    define fcfree(ptr) hfree(ptr)
144 #  endif
145 #else
146 #  ifdef MAXSEG_64K
147 #    define fcalloc(items,size) calloc((items),(size))
148 #  else
149 #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
150 #  endif
151 #  define fcfree(ptr) free(ptr)
152 #endif
153
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"
160 #  define RECORD_IO 1
161 #  define casemap(c) tolow(c)
162 #  define OS_CODE  0x02
163 #  define OPTIONS_VAR "GZIP_OPT"
164 #  define STDC_HEADERS
165 #  define NO_UTIME
166 #  define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
167 #  include <file.h>
168 #  define unlink delete
169 #  ifdef VAXC
170 #    define NO_FCNTL_H
171 #    include <unixio.h>
172 #  endif
173 #endif
174
175 #ifdef AMIGA
176 #  define PATH_SEP2 ':'
177 #  define STDC_HEADERS
178 #  define OS_CODE  0x01
179 #  define ASMV
180 #  ifdef __GNUC__
181 #    define DIRENT
182 #    define HAVE_UNISTD_H
183 #  else /* SASC */
184 #    define NO_STDIN_FSTAT
185 #    define SYSDIR
186 #    define NO_SYMLINK
187 #    define NO_CHOWN
188 #    define NO_FCNTL_H
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 */
194 #  endif
195 #endif
196
197 #if defined(ATARI) || defined(atarist)
198 #  ifndef STDC_HEADERS
199 #    define STDC_HEADERS
200 #    define HAVE_UNISTD_H
201 #    define DIRENT
202 #  endif
203 #  define ASMV
204 #  define OS_CODE  0x05
205 #  ifdef TOSFS
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"
212 #    define NO_CHOWN
213 #    define casemap(c) tolow(c) /* Force file names to lower case */
214 #    define NO_SYMLINK
215 #  endif
216 #endif
217
218 #ifdef MACOS
219 #  define PATH_SEP ':'
220 #  define DYN_ALLOC
221 #  define PROTO
222 #  define NO_STDIN_FSTAT
223 #  define NO_CHOWN
224 #  define NO_UTIME
225 #  define chmod(file, mode) (0)
226 #  define OPEN(name, flags, mode) open(name, flags)
227 #  define OS_CODE  0x07
228 #  ifdef MPW
229 #    define isatty(fd) ((fd) <= 2)
230 #  endif
231 #endif
232
233 #ifdef __50SERIES /* Prime/PRIMOS */
234 #  define PATH_SEP '>'
235 #  define STDC_HEADERS
236 #  define NO_MEMORY_H
237 #  define NO_UTIME_H
238 #  define NO_UTIME
239 #  define NO_CHOWN
240 #  define NO_STDIN_FSTAT
241 #  define NO_SIZE_CHECK
242 #  define NO_SYMLINK
243 #  define RECORD_IO  1
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 */
248 #  ifdef SIGTERM
249 #    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
250 #  endif
251 #endif
252
253 #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
254 #  define NOMEMCPY /* problem with overlapping copies */
255 #endif
256
257 #ifdef TOPS20
258 #  define OS_CODE  0x0a
259 #endif
260
261 #ifndef unix
262 #  define NO_ST_INO /* don't rely on inode numbers */
263 #endif
264
265
266         /* Common defaults */
267
268 #ifndef OS_CODE
269 #  define OS_CODE  0x03  /* assume Unix */
270 #endif
271
272 #ifndef PATH_SEP
273 #  define PATH_SEP '/'
274 #endif
275
276 #ifndef casemap
277 #  define casemap(c) (c)
278 #endif
279
280 #ifndef OPTIONS_VAR
281 #  define OPTIONS_VAR "GZIP"
282 #endif
283
284 #ifndef Z_SUFFIX
285 #  define Z_SUFFIX ".gz"
286 #endif
287
288 #ifdef MAX_EXT_CHARS
289 #  define MAX_SUFFIX  MAX_EXT_CHARS
290 #else
291 #  define MAX_SUFFIX  30
292 #endif
293
294 #ifndef MAKE_LEGAL_NAME
295 #  ifdef NO_MULTIPLE_DOTS
296 #    define MAKE_LEGAL_NAME(name)   make_simple_name(name)
297 #  else
298 #    define MAKE_LEGAL_NAME(name)
299 #  endif
300 #endif
301
302 #ifndef MIN_PART
303 #  define MIN_PART 3
304    /* keep at least MIN_PART chars between dots in a file name. */
305 #endif
306
307 #ifndef EXPAND
308 #  define EXPAND(argc,argv)
309 #endif
310
311 #ifndef RECORD_IO
312 #  define RECORD_IO 0
313 #endif
314
315 #ifndef SET_BINARY_MODE
316 #  define SET_BINARY_MODE(fd)
317 #endif
318
319 #ifndef OPEN
320 #  define OPEN(name, flags, mode) open(name, flags, mode)
321 #endif
322
323 #ifndef get_char
324 #  define get_char() get_byte()
325 #endif
326
327 #ifndef put_char
328 #  define put_char(c) put_byte(c)
329 #endif