]> git.jsancho.org Git - lugaru.git/blob - zlib-1.2.3/zconf.h
Added GPL license and headers.
[lugaru.git] / zlib-1.2.3 / zconf.h
1 /* zconf.h -- configuration of the zlib compression library
2  * Copyright (C) 1995-2005 Jean-loup Gailly.
3  * For conditions of distribution and use, see copyright notice in zlib.h
4  */
5
6 /* @(#) $Id$ */
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 Z_PREFIX
16 #  define deflateInit_          z_deflateInit_
17 #  define deflate               z_deflate
18 #  define deflateEnd            z_deflateEnd
19 #  define inflateInit_          z_inflateInit_
20 #  define inflate               z_inflate
21 #  define inflateEnd            z_inflateEnd
22 #  define deflateInit2_         z_deflateInit2_
23 #  define deflateSetDictionary  z_deflateSetDictionary
24 #  define deflateCopy           z_deflateCopy
25 #  define deflateReset          z_deflateReset
26 #  define deflateParams         z_deflateParams
27 #  define deflateBound          z_deflateBound
28 #  define deflatePrime          z_deflatePrime
29 #  define inflateInit2_         z_inflateInit2_
30 #  define inflateSetDictionary  z_inflateSetDictionary
31 #  define inflateSync           z_inflateSync
32 #  define inflateSyncPoint      z_inflateSyncPoint
33 #  define inflateCopy           z_inflateCopy
34 #  define inflateReset          z_inflateReset
35 #  define inflateBack           z_inflateBack
36 #  define inflateBackEnd        z_inflateBackEnd
37 #  define compress              z_compress
38 #  define compress2             z_compress2
39 #  define compressBound         z_compressBound
40 #  define uncompress            z_uncompress
41 #  define adler32               z_adler32
42 #  define crc32                 z_crc32
43 #  define get_crc_table         z_get_crc_table
44 #  define zError                z_zError
45
46 // Added to prevent clash with MacOS system zlib (which is 1.1.3 and thus
47 //  has a security hole...we're using 1.1.4, which doesn't). --ryan.
48 #  define inflate_blocks z_inflate_blocks
49 #  define inflate_blocks_reset z_inflate_blocks_reset
50 #  define inflate_blocks_new z_inflate_blocks_new
51 #  define inflate_blocks_free z_inflate_blocks_free
52 #  define inflate_blocks_sync_point z_inflate_blocks_sync_point
53 #  define inflate_set_dictionary z_inflate_set_dictionary
54 #  define inflate_sync_dictionary z_inflate_sync_dictionary
55 #  define inflate_mask z_inflate_mask
56 #  define inflate_flush z_inflate_flush
57 #  define inflate_fast z_inflate_fast
58 #  define inflate_codes z_inflate_codes
59 #  define inflate_codes_new z_inflate_codes_new
60 #  define inflate_codes_free z_inflate_codes_free
61 #  define inflate_copyright z_inflate_copyright
62 #  define deflate_copyright z_deflate_copyright
63 #  define inflate_trees_fixed z_inflate_trees_fixed
64 #  define inflate_trees_dynamic z_inflate_trees_dynamic
65 #  define inflate_trees_bits z_inflate_trees_bits
66 #  define _dist_code z__dist_code
67 #  define _length_code z__length_code
68 #  define _tr_stored_block z__tr_stored_block
69 #  define _tr_align z__tr_align
70 #  define _tr_flush_block z__tr_flush_block
71 #  define _tr_init  z__tr_init
72 #  define _tr_tally z__tr_tally
73 #  define zcfree z_zcfree
74 #  define z_errmsg z_z_errmsg
75 #  define zlibVersion z_zlibVersion
76 #  define zcalloc z_zcalloc
77
78 #  define alloc_func            z_alloc_func
79 #  define free_func             z_free_func
80 #  define in_func               z_in_func
81 #  define out_func              z_out_func
82 #  define Byte                  z_Byte
83 #  define uInt                  z_uInt
84 #  define uLong                 z_uLong
85 #  define Bytef                 z_Bytef
86 #  define charf                 z_charf
87 #  define intf                  z_intf
88 #  define uIntf                 z_uIntf
89 #  define uLongf                z_uLongf
90 #  define voidpf                z_voidpf
91 #  define voidp                 z_voidp
92 #endif
93
94 #if defined(__MSDOS__) && !defined(MSDOS)
95 #  define MSDOS
96 #endif
97 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
98 #  define OS2
99 #endif
100 #if defined(_WINDOWS) && !defined(WINDOWS)
101 #  define WINDOWS
102 #endif
103 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
104 #  ifndef WIN32
105 #    define WIN32
106 #  endif
107 #endif
108 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
109 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
110 #    ifndef SYS16BIT
111 #      define SYS16BIT
112 #    endif
113 #  endif
114 #endif
115
116 /*
117  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
118  * than 64k bytes at a time (needed on systems with 16-bit int).
119  */
120 #ifdef SYS16BIT
121 #  define MAXSEG_64K
122 #endif
123 #ifdef MSDOS
124 #  define UNALIGNED_OK
125 #endif
126
127 #ifdef __STDC_VERSION__
128 #  ifndef STDC
129 #    define STDC
130 #  endif
131 #  if __STDC_VERSION__ >= 199901L
132 #    ifndef STDC99
133 #      define STDC99
134 #    endif
135 #  endif
136 #endif
137 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
138 #  define STDC
139 #endif
140 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
141 #  define STDC
142 #endif
143 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
144 #  define STDC
145 #endif
146 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
147 #  define STDC
148 #endif
149
150 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
151 #  define STDC
152 #endif
153
154 #ifndef STDC
155 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
156 #    define const       /* note: need a more gentle solution here */
157 #  endif
158 #endif
159
160 /* Some Mac compilers merge all .h files incorrectly: */
161 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
162 #  define NO_DUMMY_DECL
163 #endif
164
165 /* Maximum value for memLevel in deflateInit2 */
166 #ifndef MAX_MEM_LEVEL
167 #  ifdef MAXSEG_64K
168 #    define MAX_MEM_LEVEL 8
169 #  else
170 #    define MAX_MEM_LEVEL 9
171 #  endif
172 #endif
173
174 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
175  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
176  * created by gzip. (Files created by minigzip can still be extracted by
177  * gzip.)
178  */
179 #ifndef MAX_WBITS
180 #  define MAX_WBITS   15 /* 32K LZ77 window */
181 #endif
182
183 /* The memory requirements for deflate are (in bytes):
184             (1 << (windowBits+2)) +  (1 << (memLevel+9))
185  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
186  plus a few kilobytes for small objects. For example, if you want to reduce
187  the default memory requirements from 256K to 128K, compile with
188      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
189  Of course this will generally degrade compression (there's no free lunch).
190
191    The memory requirements for inflate are (in bytes) 1 << windowBits
192  that is, 32K for windowBits=15 (default value) plus a few kilobytes
193  for small objects.
194 */
195
196                         /* Type declarations */
197
198 #ifndef OF /* function prototypes */
199 #  ifdef STDC
200 #    define OF(args)  args
201 #  else
202 #    define OF(args)  ()
203 #  endif
204 #endif
205
206 /* The following definitions for FAR are needed only for MSDOS mixed
207  * model programming (small or medium model with some far allocations).
208  * This was tested only with MSC; for other MSDOS compilers you may have
209  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
210  * just define FAR to be empty.
211  */
212 #ifdef SYS16BIT
213 #  if defined(M_I86SM) || defined(M_I86MM)
214      /* MSC small or medium model */
215 #    define SMALL_MEDIUM
216 #    ifdef _MSC_VER
217 #      define FAR _far
218 #    else
219 #      define FAR far
220 #    endif
221 #  endif
222 #  if (defined(__SMALL__) || defined(__MEDIUM__))
223      /* Turbo C small or medium model */
224 #    define SMALL_MEDIUM
225 #    ifdef __BORLANDC__
226 #      define FAR _far
227 #    else
228 #      define FAR far
229 #    endif
230 #  endif
231 #endif
232
233 #if defined(WINDOWS) || defined(WIN32)
234    /* If building or using zlib as a DLL, define ZLIB_DLL.
235     * This is not mandatory, but it offers a little performance increase.
236     */
237 #  ifdef ZLIB_DLL
238 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
239 #      ifdef ZLIB_INTERNAL
240 #        define ZEXTERN extern __declspec(dllexport)
241 #      else
242 #        define ZEXTERN extern __declspec(dllimport)
243 #      endif
244 #    endif
245 #  endif  /* ZLIB_DLL */
246    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
247     * define ZLIB_WINAPI.
248     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
249     */
250 #  ifdef ZLIB_WINAPI
251 #    ifdef FAR
252 #      undef FAR
253 #    endif
254 #    include <windows.h>
255      /* No need for _export, use ZLIB.DEF instead. */
256      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
257 #    define ZEXPORT WINAPI
258 #    ifdef WIN32
259 #      define ZEXPORTVA WINAPIV
260 #    else
261 #      define ZEXPORTVA FAR CDECL
262 #    endif
263 #  endif
264 #endif
265
266 #if defined (__BEOS__)
267 #  ifdef ZLIB_DLL
268 #    ifdef ZLIB_INTERNAL
269 #      define ZEXPORT   __declspec(dllexport)
270 #      define ZEXPORTVA __declspec(dllexport)
271 #    else
272 #      define ZEXPORT   __declspec(dllimport)
273 #      define ZEXPORTVA __declspec(dllimport)
274 #    endif
275 #  endif
276 #endif
277
278 #ifndef ZEXTERN
279 #  define ZEXTERN extern
280 #endif
281 #ifndef ZEXPORT
282 #  define ZEXPORT
283 #endif
284 #ifndef ZEXPORTVA
285 #  define ZEXPORTVA
286 #endif
287
288 #ifndef FAR
289 #  define FAR
290 #endif
291
292 #if !defined(__MACTYPES__)
293 typedef unsigned char  Byte;  /* 8 bits */
294 #endif
295 typedef unsigned int   uInt;  /* 16 bits or more */
296 typedef unsigned long  uLong; /* 32 bits or more */
297
298 #ifdef SMALL_MEDIUM
299    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
300 #  define Bytef Byte FAR
301 #else
302    typedef Byte  FAR Bytef;
303 #endif
304 typedef char  FAR charf;
305 typedef int   FAR intf;
306 typedef uInt  FAR uIntf;
307 typedef uLong FAR uLongf;
308
309 #ifdef STDC
310    typedef void const *voidpc;
311    typedef void FAR   *voidpf;
312    typedef void       *voidp;
313 #else
314    typedef Byte const *voidpc;
315    typedef Byte FAR   *voidpf;
316    typedef Byte       *voidp;
317 #endif
318
319 #if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
320 #  include <sys/types.h> /* for off_t */
321 #  include <unistd.h>    /* for SEEK_* and off_t */
322 #  ifdef VMS
323 #    include <unixio.h>   /* for off_t */
324 #  endif
325 #  define z_off_t off_t
326 #endif
327 #ifndef SEEK_SET
328 #  define SEEK_SET        0       /* Seek from beginning of file.  */
329 #  define SEEK_CUR        1       /* Seek from current position.  */
330 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
331 #endif
332 #ifndef z_off_t
333 #  define z_off_t long
334 #endif
335
336 #if defined(__OS400__)
337 #  define NO_vsnprintf
338 #endif
339
340 #if defined(__MVS__)
341 #  define NO_vsnprintf
342 #  ifdef FAR
343 #    undef FAR
344 #  endif
345 #endif
346
347 /* MVS linker does not support external names larger than 8 bytes */
348 #if defined(__MVS__)
349 #   pragma map(deflateInit_,"DEIN")
350 #   pragma map(deflateInit2_,"DEIN2")
351 #   pragma map(deflateEnd,"DEEND")
352 #   pragma map(deflateBound,"DEBND")
353 #   pragma map(inflateInit_,"ININ")
354 #   pragma map(inflateInit2_,"ININ2")
355 #   pragma map(inflateEnd,"INEND")
356 #   pragma map(inflateSync,"INSY")
357 #   pragma map(inflateSetDictionary,"INSEDI")
358 #   pragma map(compressBound,"CMBND")
359 #   pragma map(inflate_table,"INTABL")
360 #   pragma map(inflate_fast,"INFA")
361 #   pragma map(inflate_copyright,"INCOPY")
362 #endif
363
364 #endif /* ZCONF_H */