zconf.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. /* zconf.h -- configuration of the zlib compression library
  2. * Copyright (C) 1995-2010 Jean-loup Gailly.
  3. * For conditions of distribution and use, see copyright notice in zlib.h
  4. */
  5. /* @(#) $Id$ */
  6. #ifndef ZCONF_H
  7. #define ZCONF_H
  8. /* Since Qt Core must export these symbols, define Z_PREFIX to avoid clashes system zlib */
  9. #define Z_PREFIX
  10. /*
  11. * If you *really* need a unique prefix for all types and library functions,
  12. * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
  13. * Even better than compiling with -DZ_PREFIX would be to use configure to set
  14. * this permanently in zconf.h using "./configure --zprefix".
  15. */
  16. #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
  17. /* all linked symbols */
  18. # define _dist_code z__dist_code
  19. # define _length_code z__length_code
  20. # define _tr_align z__tr_align
  21. # define _tr_flush_block z__tr_flush_block
  22. # define _tr_init z__tr_init
  23. # define _tr_stored_block z__tr_stored_block
  24. # define _tr_tally z__tr_tally
  25. # define adler32 z_adler32
  26. # define adler32_combine z_adler32_combine
  27. # define adler32_combine64 z_adler32_combine64
  28. # define compress z_compress
  29. # define compress2 z_compress2
  30. # define compressBound z_compressBound
  31. # define crc32 z_crc32
  32. # define crc32_combine z_crc32_combine
  33. # define crc32_combine64 z_crc32_combine64
  34. # define deflate z_deflate
  35. # define deflateBound z_deflateBound
  36. # define deflateCopy z_deflateCopy
  37. # define deflateEnd z_deflateEnd
  38. # define deflateInit2_ z_deflateInit2_
  39. # define deflateInit_ z_deflateInit_
  40. # define deflateParams z_deflateParams
  41. # define deflatePrime z_deflatePrime
  42. # define deflateReset z_deflateReset
  43. # define deflateSetDictionary z_deflateSetDictionary
  44. # define deflateSetHeader z_deflateSetHeader
  45. # define deflateTune z_deflateTune
  46. # define deflate_copyright z_deflate_copyright
  47. # define get_crc_table z_get_crc_table
  48. # define gz_error z_gz_error
  49. # define gz_intmax z_gz_intmax
  50. # define gz_strwinerror z_gz_strwinerror
  51. # define gzbuffer z_gzbuffer
  52. # define gzclearerr z_gzclearerr
  53. # define gzclose z_gzclose
  54. # define gzclose_r z_gzclose_r
  55. # define gzclose_w z_gzclose_w
  56. # define gzdirect z_gzdirect
  57. # define gzdopen z_gzdopen
  58. # define gzeof z_gzeof
  59. # define gzerror z_gzerror
  60. # define gzflush z_gzflush
  61. # define gzgetc z_gzgetc
  62. # define gzgets z_gzgets
  63. # define gzoffset z_gzoffset
  64. # define gzoffset64 z_gzoffset64
  65. # define gzopen z_gzopen
  66. # define gzopen64 z_gzopen64
  67. # define gzprintf z_gzprintf
  68. # define gzputc z_gzputc
  69. # define gzputs z_gzputs
  70. # define gzread z_gzread
  71. # define gzrewind z_gzrewind
  72. # define gzseek z_gzseek
  73. # define gzseek64 z_gzseek64
  74. # define gzsetparams z_gzsetparams
  75. # define gztell z_gztell
  76. # define gztell64 z_gztell64
  77. # define gzungetc z_gzungetc
  78. # define gzwrite z_gzwrite
  79. # define inflate z_inflate
  80. # define inflateBack z_inflateBack
  81. # define inflateBackEnd z_inflateBackEnd
  82. # define inflateBackInit_ z_inflateBackInit_
  83. # define inflateCopy z_inflateCopy
  84. # define inflateEnd z_inflateEnd
  85. # define inflateGetHeader z_inflateGetHeader
  86. # define inflateInit2_ z_inflateInit2_
  87. # define inflateInit_ z_inflateInit_
  88. # define inflateMark z_inflateMark
  89. # define inflatePrime z_inflatePrime
  90. # define inflateReset z_inflateReset
  91. # define inflateReset2 z_inflateReset2
  92. # define inflateSetDictionary z_inflateSetDictionary
  93. # define inflateSync z_inflateSync
  94. # define inflateSyncPoint z_inflateSyncPoint
  95. # define inflateUndermine z_inflateUndermine
  96. # define inflate_copyright z_inflate_copyright
  97. # define inflate_fast z_inflate_fast
  98. # define inflate_table z_inflate_table
  99. # define uncompress z_uncompress
  100. # define zError z_zError
  101. # define zcalloc z_zcalloc
  102. # define zcfree z_zcfree
  103. # define zlibCompileFlags z_zlibCompileFlags
  104. # define zlibVersion z_zlibVersion
  105. # define z_errmsg z_z_errmsg
  106. /* all zlib typedefs in zlib.h and zconf.h */
  107. # define Byte z_Byte
  108. # define Bytef z_Bytef
  109. # define alloc_func z_alloc_func
  110. # define charf z_charf
  111. # define free_func z_free_func
  112. # define gzFile z_gzFile
  113. # define gz_header z_gz_header
  114. # define gz_headerp z_gz_headerp
  115. # define in_func z_in_func
  116. # define intf z_intf
  117. # define out_func z_out_func
  118. # define uInt z_uInt
  119. # define uIntf z_uIntf
  120. # define uLong z_uLong
  121. # define uLongf z_uLongf
  122. # define voidp z_voidp
  123. # define voidpc z_voidpc
  124. # define voidpf z_voidpf
  125. /* all zlib structs in zlib.h and zconf.h */
  126. # define gz_header_s z_gz_header_s
  127. # define internal_state z_internal_state
  128. #endif
  129. #if defined(__MSDOS__) && !defined(MSDOS)
  130. # define MSDOS
  131. #endif
  132. #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
  133. # define OS2
  134. #endif
  135. #if defined(_WINDOWS) && !defined(WINDOWS)
  136. # define WINDOWS
  137. #endif
  138. #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
  139. # ifndef WIN32
  140. # define WIN32
  141. # endif
  142. #endif
  143. #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  144. # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
  145. # ifndef SYS16BIT
  146. # define SYS16BIT
  147. # endif
  148. # endif
  149. #endif
  150. /*
  151. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  152. * than 64k bytes at a time (needed on systems with 16-bit int).
  153. */
  154. #ifdef SYS16BIT
  155. # define MAXSEG_64K
  156. #endif
  157. #ifdef MSDOS
  158. # define UNALIGNED_OK
  159. #endif
  160. #ifdef __STDC_VERSION__
  161. # ifndef STDC
  162. # define STDC
  163. # endif
  164. # if __STDC_VERSION__ >= 199901L
  165. # ifndef STDC99
  166. # define STDC99
  167. # endif
  168. # endif
  169. #endif
  170. #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
  171. # define STDC
  172. #endif
  173. #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
  174. # define STDC
  175. #endif
  176. #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
  177. # define STDC
  178. #endif
  179. #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
  180. # define STDC
  181. #endif
  182. #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
  183. # define STDC
  184. #endif
  185. #ifndef STDC
  186. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  187. # define const /* note: need a more gentle solution here */
  188. # endif
  189. #endif
  190. /* Some Mac compilers merge all .h files incorrectly: */
  191. #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
  192. # define NO_DUMMY_DECL
  193. #endif
  194. /* Maximum value for memLevel in deflateInit2 */
  195. #ifndef MAX_MEM_LEVEL
  196. # ifdef MAXSEG_64K
  197. # define MAX_MEM_LEVEL 8
  198. # else
  199. # define MAX_MEM_LEVEL 9
  200. # endif
  201. #endif
  202. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  203. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  204. * created by gzip. (Files created by minigzip can still be extracted by
  205. * gzip.)
  206. */
  207. #ifndef MAX_WBITS
  208. # define MAX_WBITS 15 /* 32K LZ77 window */
  209. #endif
  210. /* The memory requirements for deflate are (in bytes):
  211. (1 << (windowBits+2)) + (1 << (memLevel+9))
  212. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  213. plus a few kilobytes for small objects. For example, if you want to reduce
  214. the default memory requirements from 256K to 128K, compile with
  215. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  216. Of course this will generally degrade compression (there's no free lunch).
  217. The memory requirements for inflate are (in bytes) 1 << windowBits
  218. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  219. for small objects.
  220. */
  221. /* Type declarations */
  222. #ifndef OF /* function prototypes */
  223. # ifdef STDC
  224. # define OF(args) args
  225. # else
  226. # define OF(args) ()
  227. # endif
  228. #endif
  229. /* The following definitions for FAR are needed only for MSDOS mixed
  230. * model programming (small or medium model with some far allocations).
  231. * This was tested only with MSC; for other MSDOS compilers you may have
  232. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  233. * just define FAR to be empty.
  234. */
  235. #ifdef SYS16BIT
  236. # if defined(M_I86SM) || defined(M_I86MM)
  237. /* MSC small or medium model */
  238. # define SMALL_MEDIUM
  239. # ifdef _MSC_VER
  240. # define FAR _far
  241. # else
  242. # define FAR far
  243. # endif
  244. # endif
  245. # if (defined(__SMALL__) || defined(__MEDIUM__))
  246. /* Turbo C small or medium model */
  247. # define SMALL_MEDIUM
  248. # ifdef __BORLANDC__
  249. # define FAR _far
  250. # else
  251. # define FAR far
  252. # endif
  253. # endif
  254. #endif
  255. #if defined(WINDOWS) || defined(WIN32)
  256. /* If building or using zlib as a DLL, define ZLIB_DLL.
  257. * This is not mandatory, but it offers a little performance increase.
  258. */
  259. # ifdef ZLIB_DLL
  260. # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  261. # ifdef ZLIB_INTERNAL
  262. # define ZEXTERN extern __declspec(dllexport)
  263. # else
  264. # define ZEXTERN extern __declspec(dllimport)
  265. # endif
  266. # endif
  267. # endif /* ZLIB_DLL */
  268. /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  269. * define ZLIB_WINAPI.
  270. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  271. */
  272. # ifdef ZLIB_WINAPI
  273. # ifdef FAR
  274. # undef FAR
  275. # endif
  276. # include <windows.h>
  277. /* No need for _export, use ZLIB.DEF instead. */
  278. /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  279. # define ZEXPORT WINAPI
  280. # ifdef WIN32
  281. # define ZEXPORTVA WINAPIV
  282. # else
  283. # define ZEXPORTVA FAR CDECL
  284. # endif
  285. # endif
  286. #endif
  287. #if defined (__BEOS__)
  288. # ifdef ZLIB_DLL
  289. # ifdef ZLIB_INTERNAL
  290. # define ZEXPORT __declspec(dllexport)
  291. # define ZEXPORTVA __declspec(dllexport)
  292. # else
  293. # define ZEXPORT __declspec(dllimport)
  294. # define ZEXPORTVA __declspec(dllimport)
  295. # endif
  296. # endif
  297. #endif
  298. #ifndef ZEXTERN
  299. # define ZEXTERN extern
  300. #endif
  301. #ifndef ZEXPORT
  302. # define ZEXPORT
  303. #endif
  304. #ifndef ZEXPORTVA
  305. # define ZEXPORTVA
  306. #endif
  307. #ifndef FAR
  308. # define FAR
  309. #endif
  310. #if !defined(__MACTYPES__)
  311. typedef unsigned char Byte; /* 8 bits */
  312. #endif
  313. typedef unsigned int uInt; /* 16 bits or more */
  314. typedef unsigned long uLong; /* 32 bits or more */
  315. #ifdef SMALL_MEDIUM
  316. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  317. # define Bytef Byte FAR
  318. #else
  319. typedef Byte FAR Bytef;
  320. #endif
  321. typedef char FAR charf;
  322. typedef int FAR intf;
  323. typedef uInt FAR uIntf;
  324. typedef uLong FAR uLongf;
  325. #ifdef STDC
  326. typedef void const *voidpc;
  327. typedef void FAR *voidpf;
  328. typedef void *voidp;
  329. #else
  330. typedef Byte const *voidpc;
  331. typedef Byte FAR *voidpf;
  332. typedef Byte *voidp;
  333. #endif
  334. #if defined(HAVE_UNISTD_H) || !defined(WIN32)
  335. # define Z_HAVE_UNISTD_H
  336. #endif
  337. #if defined(STDC) && !defined(_WIN32_WCE)
  338. # include <sys/types.h> /* for off_t */
  339. #endif
  340. /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
  341. * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
  342. * though the former does not conform to the LFS document), but considering
  343. * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  344. * equivalently requesting no 64-bit operations
  345. */
  346. #if -_LARGEFILE64_SOURCE - -1 == 1
  347. # undef _LARGEFILE64_SOURCE
  348. #endif
  349. #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
  350. # include <unistd.h> /* for SEEK_* and off_t */
  351. # ifdef VMS
  352. # include <unixio.h> /* for off_t */
  353. # endif
  354. # ifndef z_off_t
  355. # define z_off_t off_t
  356. # endif
  357. #endif
  358. #ifndef SEEK_SET
  359. # define SEEK_SET 0 /* Seek from beginning of file. */
  360. # define SEEK_CUR 1 /* Seek from current position. */
  361. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  362. #endif
  363. #ifndef z_off_t
  364. # define z_off_t long
  365. #endif
  366. #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
  367. # define z_off64_t off64_t
  368. #else
  369. # define z_off64_t z_off_t
  370. #endif
  371. #if defined(__OS400__)
  372. # define NO_vsnprintf
  373. #endif
  374. #if defined(__MVS__)
  375. # define NO_vsnprintf
  376. #endif
  377. /* MVS linker does not support external names larger than 8 bytes */
  378. #if defined(__MVS__)
  379. #pragma map(deflateInit_,"DEIN")
  380. #pragma map(deflateInit2_,"DEIN2")
  381. #pragma map(deflateEnd,"DEEND")
  382. #pragma map(deflateBound,"DEBND")
  383. #pragma map(inflateInit_,"ININ")
  384. #pragma map(inflateInit2_,"ININ2")
  385. #pragma map(inflateEnd,"INEND")
  386. #pragma map(inflateSync,"INSY")
  387. #pragma map(inflateSetDictionary,"INSEDI")
  388. #pragma map(compressBound,"CMBND")
  389. #pragma map(inflate_table,"INTABL")
  390. #pragma map(inflate_fast,"INFA")
  391. #pragma map(inflate_copyright,"INCOPY")
  392. #endif
  393. #endif /* ZCONF_H */