HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
zconf.h
Go to the documentation of this file.
1 /* zconf.h -- configuration of the zlib compression library
2  * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
3  * For conditions of distribution and use, see copyright notice in zlib.h
4  */
5 
6 #ifndef ZCONF_H
7 #define ZCONF_H
8 
9 #include "zlib_name_mangling.h"
10 
11 #if !defined(_WIN32) && defined(__WIN32__)
12 # define _WIN32
13 #endif
14 
15 /* Clang macro for detecting declspec support
16  * https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute
17  */
18 #ifndef __has_declspec_attribute
19 # define __has_declspec_attribute(x) 0
20 #endif
21 
22 #if defined(ZLIB_CONST) && !defined(z_const)
23 # define z_const const
24 #else
25 # define z_const
26 #endif
27 
28 /* Maximum value for memLevel in deflateInit2 */
29 #ifndef MAX_MEM_LEVEL
30 # define MAX_MEM_LEVEL 9
31 #endif
32 
33 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
34  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
35  * created by gzip. (Files created by minigzip can still be extracted by
36  * gzip.)
37  */
38 #ifndef MIN_WBITS
39 # define MIN_WBITS 8 /* 256 LZ77 window */
40 #endif
41 #ifndef MAX_WBITS
42 # define MAX_WBITS 15 /* 32K LZ77 window */
43 #endif
44 
45 /* The memory requirements for deflate are (in bytes):
46  (1 << (windowBits+2)) + (1 << (memLevel+9))
47  that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
48  plus a few kilobytes for small objects. For example, if you want to reduce
49  the default memory requirements from 256K to 128K, compile with
50  make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
51  Of course this will generally degrade compression (there's no free lunch).
52 
53  The memory requirements for inflate are (in bytes) 1 << windowBits
54  that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
55  for small objects.
56 */
57 
58 /* Type declarations */
59 
60 
61 #ifndef OF /* function prototypes */
62 # define OF(args) args
63 #endif
64 
65 #ifdef ZLIB_INTERNAL
66 # define Z_INTERNAL ZLIB_INTERNAL
67 #endif
68 
69 /* If building or using zlib as a DLL, define ZLIB_DLL.
70  * This is not mandatory, but it offers a little performance increase.
71  */
72 #if defined(ZLIB_DLL) && (defined(_WIN32) || (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)))
73 # ifdef Z_INTERNAL
74 # define Z_EXTERN extern __declspec(dllexport)
75 # else
76 # define Z_EXTERN extern __declspec(dllimport)
77 # endif
78 #endif
79 
80 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
81  * define ZLIB_WINAPI.
82  * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
83  */
84 #if defined(ZLIB_WINAPI) && defined(_WIN32)
85 # ifndef WIN32_LEAN_AND_MEAN
86 # define WIN32_LEAN_AND_MEAN
87 # endif
88 # include <windows.h>
89  /* No need for _export, use ZLIB.DEF instead. */
90  /* For complete Windows compatibility, use WINAPI, not __stdcall. */
91 # define Z_EXPORT WINAPI
92 # define Z_EXPORTVA WINAPIV
93 #endif
94 
95 #ifndef Z_EXTERN
96 # define Z_EXTERN extern
97 #endif
98 #ifndef Z_EXPORT
99 # define Z_EXPORT
100 #endif
101 #ifndef Z_EXPORTVA
102 # define Z_EXPORTVA
103 #endif
104 
105 /* Conditional exports */
106 #define ZNG_CONDEXPORT Z_INTERNAL
107 
108 /* For backwards compatibility */
109 
110 #ifndef ZEXTERN
111 # define ZEXTERN Z_EXTERN
112 #endif
113 #ifndef ZEXPORT
114 # define ZEXPORT Z_EXPORT
115 #endif
116 #ifndef ZEXPORTVA
117 # define ZEXPORTVA Z_EXPORTVA
118 #endif
119 
120 /* Legacy zlib typedefs for backwards compatibility. Don't assume stdint.h is defined. */
121 typedef unsigned char Byte;
122 typedef Byte Bytef;
123 
124 typedef unsigned int uInt; /* 16 bits or more */
125 typedef unsigned long uLong; /* 32 bits or more */
126 
127 typedef char charf;
128 typedef int intf;
129 typedef uInt uIntf;
130 typedef uLong uLongf;
131 
132 typedef void const *voidpc;
133 typedef void *voidpf;
134 typedef void *voidp;
135 
136 typedef unsigned int z_crc_t;
137 
138 #if 1 /* was set to #if 1 by configure/cmake/etc */
139 # define Z_HAVE_UNISTD_H
140 #endif
141 
142 #ifdef NEED_PTRDIFF_T /* may be set to #if 1 by configure/cmake/etc */
143 typedef PTRDIFF_TYPE ptrdiff_t;
144 #endif
145 
146 #include <sys/types.h> /* for off_t */
147 
148 #include <stddef.h> /* for wchar_t and NULL */
149 
150 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
151  * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
152  * though the former does not conform to the LFS document), but considering
153  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
154  * equivalently requesting no 64-bit operations
155  */
156 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
157 # undef _LARGEFILE64_SOURCE
158 #endif
159 
160 #if (defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)) && !defined(_WIN32)
161 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
162 # ifndef z_off_t
163 # define z_off_t off_t
164 # endif
165 #endif
166 
167 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
168 # define Z_LFS64
169 #endif
170 
171 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
172 # define Z_LARGE64
173 #endif
174 
175 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
176 # define Z_WANT64
177 #endif
178 
179 #if !defined(SEEK_SET)
180 # define SEEK_SET 0 /* Seek from beginning of file. */
181 # define SEEK_CUR 1 /* Seek from current position. */
182 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
183 #endif
184 
185 #ifndef z_off_t
186 # define z_off_t long
187 #endif
188 
189 #if !defined(_WIN32) && defined(Z_LARGE64)
190 # define z_off64_t off64_t
191 #else
192 # if defined(__MSYS__)
193 # define z_off64_t _off64_t
194 # elif defined(_WIN32) && !defined(__GNUC__)
195 # define z_off64_t __int64
196 # else
197 # define z_off64_t z_off_t
198 # endif
199 #endif
200 
201 typedef size_t z_size_t;
202 
203 #endif /* ZCONF_H */
unsigned char Byte
Definition: zconf.h:121
char charf
Definition: zconf.h:127
uInt uIntf
Definition: zconf.h:129
int intf
Definition: zconf.h:128
unsigned long uLong
Definition: zconf.h:125
void * voidp
Definition: zconf.h:134
size_t z_size_t
Definition: zconf.h:201
void * voidpf
Definition: zconf.h:133
uLong uLongf
Definition: zconf.h:130
void const * voidpc
Definition: zconf.h:132
Byte Bytef
Definition: zconf.h:122
unsigned int z_crc_t
Definition: zconf.h:136
unsigned int uInt
Definition: zconf.h:124