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