OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / zlib / zconf.h
1 /* zconf.h -- configuration of the zlib compression library
2  * Copyright (C) 1995-2002 Jean-loup Gailly.
3  * For conditions of distribution and use, see copyright notice in zlib.h 
4  */
5
6 /* @(#) $Id: zconf.h,v 1.2 2002/03/16 18:22:46 henry Exp $ */
7
8 #ifndef _ZCONF_H
9 #define _ZCONF_H
10
11 /*
12  * If you *really* need a unique prefix for all types and library functions,
13  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14  */
15 #ifdef IPCOMP_PREFIX
16 #  define deflateInit_  ipcomp_deflateInit_
17 #  define deflate       ipcomp_deflate
18 #  define deflateEnd    ipcomp_deflateEnd
19 #  define inflateInit_  ipcomp_inflateInit_
20 #  define inflate       ipcomp_inflate
21 #  define inflateEnd    ipcomp_inflateEnd
22 #  define deflateInit2_ ipcomp_deflateInit2_
23 #  define deflateSetDictionary ipcomp_deflateSetDictionary
24 #  define deflateCopy   ipcomp_deflateCopy
25 #  define deflateReset  ipcomp_deflateReset
26 #  define deflateParams ipcomp_deflateParams
27 #  define inflateInit2_ ipcomp_inflateInit2_
28 #  define inflateSetDictionary ipcomp_inflateSetDictionary
29 #  define inflateSync   ipcomp_inflateSync
30 #  define inflateSyncPoint ipcomp_inflateSyncPoint
31 #  define inflateReset  ipcomp_inflateReset
32 #  define compress      ipcomp_compress
33 #  define compress2     ipcomp_compress2
34 #  define uncompress    ipcomp_uncompress
35 #  define adler32       ipcomp_adler32
36 #  define crc32         ipcomp_crc32
37 #  define get_crc_table ipcomp_get_crc_table
38 /* SSS: these also need to be prefixed to avoid clash with ppp_deflate and ext2compression */
39 #  define inflate_blocks ipcomp_deflate_blocks
40 #  define inflate_blocks_free ipcomp_deflate_blocks_free
41 #  define inflate_blocks_new ipcomp_inflate_blocks_new
42 #  define inflate_blocks_reset ipcomp_inflate_blocks_reset
43 #  define inflate_blocks_sync_point ipcomp_inflate_blocks_sync_point
44 #  define inflate_set_dictionary ipcomp_inflate_set_dictionary
45 #  define inflate_codes ipcomp_inflate_codes
46 #  define inflate_codes_free ipcomp_inflate_codes_free
47 #  define inflate_codes_new ipcomp_inflate_codes_new
48 #  define inflate_fast ipcomp_inflate_fast
49 #  define inflate_trees_bits ipcomp_inflate_trees_bits
50 #  define inflate_trees_dynamic ipcomp_inflate_trees_dynamic
51 #  define inflate_trees_fixed ipcomp_inflate_trees_fixed
52 #  define inflate_flush ipcomp_inflate_flush
53 #  define inflate_mask ipcomp_inflate_mask
54 #  define _dist_code _ipcomp_dist_code
55 #  define _length_code _ipcomp_length_code
56 #  define _tr_align _ipcomp_tr_align
57 #  define _tr_flush_block _ipcomp_tr_flush_block
58 #  define _tr_init _ipcomp_tr_init
59 #  define _tr_stored_block _ipcomp_tr_stored_block
60 #  define _tr_tally _ipcomp_tr_tally
61 #  define zError ipcomp_zError
62 #  define z_errmsg ipcomp_z_errmsg
63 #  define zlibVersion ipcomp_zlibVersion
64 #  define match_init ipcomp_match_init
65 #  define longest_match ipcomp_longest_match
66 #endif
67
68 #ifdef Z_PREFIX
69 #  define Byte          z_Byte
70 #  define uInt          z_uInt
71 #  define uLong         z_uLong
72 #  define Bytef         z_Bytef
73 #  define charf         z_charf
74 #  define intf          z_intf
75 #  define uIntf         z_uIntf
76 #  define uLongf        z_uLongf
77 #  define voidpf        z_voidpf
78 #  define voidp         z_voidp
79 #endif
80
81 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
82 #  define WIN32
83 #endif
84 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
85 #  ifndef __32BIT__
86 #    define __32BIT__
87 #  endif
88 #endif
89 #if defined(__MSDOS__) && !defined(MSDOS)
90 #  define MSDOS
91 #endif
92
93 /*
94  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
95  * than 64k bytes at a time (needed on systems with 16-bit int).
96  */
97 #if defined(MSDOS) && !defined(__32BIT__)
98 #  define MAXSEG_64K
99 #endif
100 #ifdef MSDOS
101 #  define UNALIGNED_OK
102 #endif
103
104 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
105 #  define STDC
106 #endif
107 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
108 #  ifndef STDC
109 #    define STDC
110 #  endif
111 #endif
112
113 #ifndef STDC
114 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
115 #    define const
116 #  endif
117 #endif
118
119 /* Some Mac compilers merge all .h files incorrectly: */
120 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
121 #  define NO_DUMMY_DECL
122 #endif
123
124 /* Old Borland C incorrectly complains about missing returns: */
125 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
126 #  define NEED_DUMMY_RETURN
127 #endif
128
129
130 /* Maximum value for memLevel in deflateInit2 */
131 #ifndef MAX_MEM_LEVEL
132 #  ifdef MAXSEG_64K
133 #    define MAX_MEM_LEVEL 8
134 #  else
135 #    define MAX_MEM_LEVEL 9
136 #  endif
137 #endif
138
139 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
140  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
141  * created by gzip. (Files created by minigzip can still be extracted by
142  * gzip.)
143  */
144 #ifndef MAX_WBITS
145 #  define MAX_WBITS   15 /* 32K LZ77 window */
146 #endif
147
148 /* The memory requirements for deflate are (in bytes):
149             (1 << (windowBits+2)) +  (1 << (memLevel+9))
150  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
151  plus a few kilobytes for small objects. For example, if you want to reduce
152  the default memory requirements from 256K to 128K, compile with
153      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
154  Of course this will generally degrade compression (there's no free lunch).
155
156    The memory requirements for inflate are (in bytes) 1 << windowBits
157  that is, 32K for windowBits=15 (default value) plus a few kilobytes
158  for small objects.
159 */
160
161                         /* Type declarations */
162
163 #ifndef OF /* function prototypes */
164 #  ifdef STDC
165 #    define OF(args)  args
166 #  else
167 #    define OF(args)  ()
168 #  endif
169 #endif
170
171 /* The following definitions for FAR are needed only for MSDOS mixed
172  * model programming (small or medium model with some far allocations).
173  * This was tested only with MSC; for other MSDOS compilers you may have
174  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
175  * just define FAR to be empty.
176  */
177 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
178    /* MSC small or medium model */
179 #  define SMALL_MEDIUM
180 #  ifdef _MSC_VER
181 #    define FAR _far
182 #  else
183 #    define FAR far
184 #  endif
185 #endif
186 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
187 #  ifndef __32BIT__
188 #    define SMALL_MEDIUM
189 #    define FAR _far
190 #  endif
191 #endif
192
193 /* Compile with -DZLIB_DLL for Windows DLL support */
194 #if defined(ZLIB_DLL)
195 #  if defined(_WINDOWS) || defined(WINDOWS)
196 #    ifdef FAR
197 #      undef FAR
198 #    endif
199 #    include <windows.h>
200 #    define ZEXPORT  WINAPI
201 #    ifdef WIN32
202 #      define ZEXPORTVA  WINAPIV
203 #    else
204 #      define ZEXPORTVA  FAR _cdecl _export
205 #    endif
206 #  endif
207 #  if defined (__BORLANDC__)
208 #    if (__BORLANDC__ >= 0x0500) && defined (WIN32)
209 #      include <windows.h>
210 #      define ZEXPORT __declspec(dllexport) WINAPI
211 #      define ZEXPORTRVA __declspec(dllexport) WINAPIV
212 #    else
213 #      if defined (_Windows) && defined (__DLL__)
214 #        define ZEXPORT _export
215 #        define ZEXPORTVA _export
216 #      endif
217 #    endif
218 #  endif
219 #endif
220
221 #if defined (__BEOS__)
222 #  if defined (ZLIB_DLL)
223 #    define ZEXTERN extern __declspec(dllexport)
224 #  else
225 #    define ZEXTERN extern __declspec(dllimport)
226 #  endif
227 #endif
228
229 #ifndef ZEXPORT
230 #  define ZEXPORT
231 #endif
232 #ifndef ZEXPORTVA
233 #  define ZEXPORTVA
234 #endif
235 #ifndef ZEXTERN
236 #  define ZEXTERN extern
237 #endif
238
239 #ifndef FAR
240 #   define FAR
241 #endif
242
243 #if !defined(MACOS) && !defined(TARGET_OS_MAC)
244 typedef unsigned char  Byte;  /* 8 bits */
245 #endif
246 typedef unsigned int   uInt;  /* 16 bits or more */
247 typedef unsigned long  uLong; /* 32 bits or more */
248
249 #ifdef SMALL_MEDIUM
250    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
251 #  define Bytef Byte FAR
252 #else
253    typedef Byte  FAR Bytef;
254 #endif
255 typedef char  FAR charf;
256 typedef int   FAR intf;
257 typedef uInt  FAR uIntf;
258 typedef uLong FAR uLongf;
259
260 #ifdef STDC
261    typedef void FAR *voidpf;
262    typedef void     *voidp;
263 #else
264    typedef Byte FAR *voidpf;
265    typedef Byte     *voidp;
266 #endif
267
268 #ifdef HAVE_UNISTD_H
269 #  include <sys/types.h> /* for off_t */
270 #  include <unistd.h>    /* for SEEK_* and off_t */
271 #  define z_off_t  off_t
272 #endif
273 #ifndef SEEK_SET
274 #  define SEEK_SET        0       /* Seek from beginning of file.  */
275 #  define SEEK_CUR        1       /* Seek from current position.  */
276 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
277 #endif
278 #ifndef z_off_t
279 #  define  z_off_t long
280 #endif
281
282 /* MVS linker does not support external names larger than 8 bytes */
283 #if defined(__MVS__)
284 #   pragma map(deflateInit_,"DEIN")
285 #   pragma map(deflateInit2_,"DEIN2")
286 #   pragma map(deflateEnd,"DEEND")
287 #   pragma map(inflateInit_,"ININ")
288 #   pragma map(inflateInit2_,"ININ2")
289 #   pragma map(inflateEnd,"INEND")
290 #   pragma map(inflateSync,"INSY")
291 #   pragma map(inflateSetDictionary,"INSEDI")
292 #   pragma map(inflate_blocks,"INBL")
293 #   pragma map(inflate_blocks_new,"INBLNE")
294 #   pragma map(inflate_blocks_free,"INBLFR")
295 #   pragma map(inflate_blocks_reset,"INBLRE")
296 #   pragma map(inflate_codes_free,"INCOFR")
297 #   pragma map(inflate_codes,"INCO")
298 #   pragma map(inflate_fast,"INFA")
299 #   pragma map(inflate_flush,"INFLU")
300 #   pragma map(inflate_mask,"INMA")
301 #   pragma map(inflate_set_dictionary,"INSEDI2")
302 #   pragma map(ipcomp_inflate_copyright,"INCOPY")
303 #   pragma map(inflate_trees_bits,"INTRBI")
304 #   pragma map(inflate_trees_dynamic,"INTRDY")
305 #   pragma map(inflate_trees_fixed,"INTRFI")
306 #   pragma map(inflate_trees_free,"INTRFR")
307 #endif
308
309 #endif /* _ZCONF_H */