zconf.h 16 KB

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