zconf.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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. /*
  9. * If you *really* need a unique prefix for all types and library functions,
  10. * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
  11. * Even better than compiling with -DZ_PREFIX would be to use configure to set
  12. * this permanently in zconf.h using "./configure --zprefix".
  13. */
  14. #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
  15. # define Z_PREFIX_SET
  16. /* all linked symbols and init macros */
  17. # define _dist_code z__dist_code
  18. # define _length_code z__length_code
  19. # define _tr_align z__tr_align
  20. # define _tr_flush_bits z__tr_flush_bits
  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 adler32_z z_adler32_z
  29. # ifndef Z_SOLO
  30. # define compress z_compress
  31. # define compress2 z_compress2
  32. # define compressBound z_compressBound
  33. # endif
  34. # define crc32 z_crc32
  35. # define crc32_combine z_crc32_combine
  36. # define crc32_combine64 z_crc32_combine64
  37. # define crc32_combine_gen z_crc32_combine_gen
  38. # define crc32_combine_gen64 z_crc32_combine_gen64
  39. # define crc32_combine_op z_crc32_combine_op
  40. # define crc32_z z_crc32_z
  41. # define deflate z_deflate
  42. # define deflateBound z_deflateBound
  43. # define deflateCopy z_deflateCopy
  44. # define deflateEnd z_deflateEnd
  45. # define deflateGetDictionary z_deflateGetDictionary
  46. # define deflateInit z_deflateInit
  47. # define deflateInit2 z_deflateInit2
  48. # define deflateInit2_ z_deflateInit2_
  49. # define deflateInit_ z_deflateInit_
  50. # define deflateParams z_deflateParams
  51. # define deflatePending z_deflatePending
  52. # define deflatePrime z_deflatePrime
  53. # define deflateReset z_deflateReset
  54. # define deflateResetKeep z_deflateResetKeep
  55. # define deflateSetDictionary z_deflateSetDictionary
  56. # define deflateSetHeader z_deflateSetHeader
  57. # define deflateTune z_deflateTune
  58. # define deflate_copyright z_deflate_copyright
  59. # define get_crc_table z_get_crc_table
  60. # ifndef Z_SOLO
  61. # define gz_error z_gz_error
  62. # define gz_intmax z_gz_intmax
  63. # define gz_strwinerror z_gz_strwinerror
  64. # define gzbuffer z_gzbuffer
  65. # define gzclearerr z_gzclearerr
  66. # define gzclose z_gzclose
  67. # define gzclose_r z_gzclose_r
  68. # define gzclose_w z_gzclose_w
  69. # define gzdirect z_gzdirect
  70. # define gzdopen z_gzdopen
  71. # define gzeof z_gzeof
  72. # define gzerror z_gzerror
  73. # define gzflush z_gzflush
  74. # define gzfread z_gzfread
  75. # define gzfwrite z_gzfwrite
  76. # define gzgetc z_gzgetc
  77. # define gzgetc_ z_gzgetc_
  78. # define gzgets z_gzgets
  79. # define gzoffset z_gzoffset
  80. # define gzoffset64 z_gzoffset64
  81. # define gzopen z_gzopen
  82. # define gzopen64 z_gzopen64
  83. # ifdef _WIN32
  84. # define gzopen_w z_gzopen_w
  85. # endif
  86. # define gzprintf z_gzprintf
  87. # define gzputc z_gzputc
  88. # define gzputs z_gzputs
  89. # define gzread z_gzread
  90. # define gzrewind z_gzrewind
  91. # define gzseek z_gzseek
  92. # define gzseek64 z_gzseek64
  93. # define gzsetparams z_gzsetparams
  94. # define gztell z_gztell
  95. # define gztell64 z_gztell64
  96. # define gzungetc z_gzungetc
  97. # define gzvprintf z_gzvprintf
  98. # define gzwrite z_gzwrite
  99. # endif
  100. # define inflate z_inflate
  101. # define inflateBack z_inflateBack
  102. # define inflateBackEnd z_inflateBackEnd
  103. # define inflateBackInit z_inflateBackInit
  104. # define inflateBackInit_ z_inflateBackInit_
  105. # define inflateCodesUsed z_inflateCodesUsed
  106. # define inflateCopy z_inflateCopy
  107. # define inflateEnd z_inflateEnd
  108. # define inflateGetDictionary z_inflateGetDictionary
  109. # define inflateGetHeader z_inflateGetHeader
  110. # define inflateInit z_inflateInit
  111. # define inflateInit2 z_inflateInit2
  112. # define inflateInit2_ z_inflateInit2_
  113. # define inflateInit_ z_inflateInit_
  114. # define inflateMark z_inflateMark
  115. # define inflatePrime z_inflatePrime
  116. # define inflateReset z_inflateReset
  117. # define inflateReset2 z_inflateReset2
  118. # define inflateResetKeep z_inflateResetKeep
  119. # define inflateSetDictionary z_inflateSetDictionary
  120. # define inflateSync z_inflateSync
  121. # define inflateSyncPoint z_inflateSyncPoint
  122. # define inflateUndermine z_inflateUndermine
  123. # define inflateValidate z_inflateValidate
  124. # define inflate_copyright z_inflate_copyright
  125. # define inflate_fast z_inflate_fast
  126. # define inflate_table z_inflate_table
  127. # ifndef Z_SOLO
  128. # define uncompress z_uncompress
  129. # define uncompress2 z_uncompress2
  130. # endif
  131. # define zError z_zError
  132. # ifndef Z_SOLO
  133. # define zcalloc z_zcalloc
  134. # define zcfree z_zcfree
  135. # endif
  136. # define zlibCompileFlags z_zlibCompileFlags
  137. # define zlibVersion z_zlibVersion
  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. # ifdef _WIN64
  231. typedef unsigned long long z_size_t;
  232. # else
  233. typedef unsigned long z_size_t;
  234. # endif
  235. #else
  236. # define z_longlong long long
  237. # if defined(NO_SIZE_T)
  238. typedef unsigned NO_SIZE_T z_size_t;
  239. # elif defined(STDC)
  240. # include <stddef.h>
  241. typedef size_t z_size_t;
  242. # else
  243. typedef unsigned long z_size_t;
  244. # endif
  245. # undef z_longlong
  246. #endif
  247. /* Maximum value for memLevel in deflateInit2 */
  248. #ifndef MAX_MEM_LEVEL
  249. # ifdef MAXSEG_64K
  250. # define MAX_MEM_LEVEL 8
  251. # else
  252. # define MAX_MEM_LEVEL 9
  253. # endif
  254. #endif
  255. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  256. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  257. * created by gzip. (Files created by minigzip can still be extracted by
  258. * gzip.)
  259. */
  260. #ifndef MAX_WBITS
  261. # define MAX_WBITS 15 /* 32K LZ77 window */
  262. #endif
  263. /* The memory requirements for deflate are (in bytes):
  264. (1 << (windowBits+2)) + (1 << (memLevel+9))
  265. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  266. plus a few kilobytes for small objects. For example, if you want to reduce
  267. the default memory requirements from 256K to 128K, compile with
  268. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  269. Of course this will generally degrade compression (there's no free lunch).
  270. The memory requirements for inflate are (in bytes) 1 << windowBits
  271. that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
  272. for small objects.
  273. */
  274. /* Type declarations */
  275. #ifndef OF /* function prototypes */
  276. # ifdef STDC
  277. # define OF(args) args
  278. # else
  279. # define OF(args) ()
  280. # endif
  281. #endif
  282. #ifndef Z_ARG /* function prototypes for stdarg */
  283. # if defined(STDC) || defined(Z_HAVE_STDARG_H)
  284. # define Z_ARG(args) args
  285. # else
  286. # define Z_ARG(args) ()
  287. # endif
  288. #endif
  289. /* The following definitions for FAR are needed only for MSDOS mixed
  290. * model programming (small or medium model with some far allocations).
  291. * This was tested only with MSC; for other MSDOS compilers you may have
  292. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  293. * just define FAR to be empty.
  294. */
  295. #ifdef SYS16BIT
  296. # if defined(M_I86SM) || defined(M_I86MM)
  297. /* MSC small or medium model */
  298. # define SMALL_MEDIUM
  299. # ifdef _MSC_VER
  300. # define FAR _far
  301. # else
  302. # define FAR far
  303. # endif
  304. # endif
  305. # if (defined(__SMALL__) || defined(__MEDIUM__))
  306. /* Turbo C small or medium model */
  307. # define SMALL_MEDIUM
  308. # ifdef __BORLANDC__
  309. # define FAR _far
  310. # else
  311. # define FAR far
  312. # endif
  313. # endif
  314. #endif
  315. #if defined(WINDOWS) || defined(WIN32)
  316. /* If building or using zlib as a DLL, define ZLIB_DLL.
  317. * This is not mandatory, but it offers a little performance increase.
  318. */
  319. # ifdef ZLIB_DLL
  320. # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  321. # ifdef ZLIB_INTERNAL
  322. # define ZEXTERN extern __declspec(dllexport)
  323. # else
  324. # define ZEXTERN extern __declspec(dllimport)
  325. # endif
  326. # endif
  327. # endif /* ZLIB_DLL */
  328. /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  329. * define ZLIB_WINAPI.
  330. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  331. */
  332. # ifdef ZLIB_WINAPI
  333. # ifdef FAR
  334. # undef FAR
  335. # endif
  336. # ifndef WIN32_LEAN_AND_MEAN
  337. # define WIN32_LEAN_AND_MEAN
  338. # endif
  339. # include <windows.h>
  340. /* No need for _export, use ZLIB.DEF instead. */
  341. /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  342. # define ZEXPORT WINAPI
  343. # ifdef WIN32
  344. # define ZEXPORTVA WINAPIV
  345. # else
  346. # define ZEXPORTVA FAR CDECL
  347. # endif
  348. # endif
  349. #endif
  350. #if defined (__BEOS__)
  351. # ifdef ZLIB_DLL
  352. # ifdef ZLIB_INTERNAL
  353. # define ZEXPORT __declspec(dllexport)
  354. # define ZEXPORTVA __declspec(dllexport)
  355. # else
  356. # define ZEXPORT __declspec(dllimport)
  357. # define ZEXPORTVA __declspec(dllimport)
  358. # endif
  359. # endif
  360. #endif
  361. #ifndef ZEXTERN
  362. # define ZEXTERN extern
  363. #endif
  364. #ifndef ZEXPORT
  365. # define ZEXPORT
  366. #endif
  367. #ifndef ZEXPORTVA
  368. # define ZEXPORTVA
  369. #endif
  370. #ifndef FAR
  371. # define FAR
  372. #endif
  373. #if !defined(__MACTYPES__)
  374. typedef unsigned char Byte; /* 8 bits */
  375. #endif
  376. typedef unsigned int uInt; /* 16 bits or more */
  377. typedef unsigned long uLong; /* 32 bits or more */
  378. #ifdef SMALL_MEDIUM
  379. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  380. # define Bytef Byte FAR
  381. #else
  382. typedef Byte FAR Bytef;
  383. #endif
  384. typedef char FAR charf;
  385. typedef int FAR intf;
  386. typedef uInt FAR uIntf;
  387. typedef uLong FAR uLongf;
  388. #ifdef STDC
  389. typedef void const *voidpc;
  390. typedef void FAR *voidpf;
  391. typedef void *voidp;
  392. #else
  393. typedef Byte const *voidpc;
  394. typedef Byte FAR *voidpf;
  395. typedef Byte *voidp;
  396. #endif
  397. #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
  398. # include <limits.h>
  399. # if (UINT_MAX == 0xffffffffUL)
  400. # define Z_U4 unsigned
  401. # elif (ULONG_MAX == 0xffffffffUL)
  402. # define Z_U4 unsigned long
  403. # elif (USHRT_MAX == 0xffffffffUL)
  404. # define Z_U4 unsigned short
  405. # endif
  406. #endif
  407. #ifdef Z_U4
  408. typedef Z_U4 z_crc_t;
  409. #else
  410. typedef unsigned long z_crc_t;
  411. #endif
  412. #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
  413. # define Z_HAVE_UNISTD_H
  414. #endif
  415. #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
  416. # define Z_HAVE_STDARG_H
  417. #endif
  418. #ifdef STDC
  419. # ifndef Z_SOLO
  420. # include <sys/types.h> /* for off_t */
  421. # endif
  422. #endif
  423. #if defined(STDC) || defined(Z_HAVE_STDARG_H)
  424. # ifndef Z_SOLO
  425. # include <stdarg.h> /* for va_list */
  426. # endif
  427. #endif
  428. #ifdef _WIN32
  429. # ifndef Z_SOLO
  430. # include <stddef.h> /* for wchar_t */
  431. # endif
  432. #endif
  433. /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
  434. * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
  435. * though the former does not conform to the LFS document), but considering
  436. * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  437. * equivalently requesting no 64-bit operations
  438. */
  439. #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
  440. # undef _LARGEFILE64_SOURCE
  441. #endif
  442. #ifndef Z_HAVE_UNISTD_H
  443. # ifdef __WATCOMC__
  444. # define Z_HAVE_UNISTD_H
  445. # endif
  446. #endif
  447. #ifndef Z_HAVE_UNISTD_H
  448. # if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
  449. # define Z_HAVE_UNISTD_H
  450. # endif
  451. #endif
  452. #ifndef Z_SOLO
  453. # if defined(Z_HAVE_UNISTD_H)
  454. # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
  455. # ifdef VMS
  456. # include <unixio.h> /* for off_t */
  457. # endif
  458. # ifndef z_off_t
  459. # define z_off_t off_t
  460. # endif
  461. # endif
  462. #endif
  463. #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
  464. # define Z_LFS64
  465. #endif
  466. #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
  467. # define Z_LARGE64
  468. #endif
  469. #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
  470. # define Z_WANT64
  471. #endif
  472. #if !defined(SEEK_SET) && !defined(Z_SOLO)
  473. # define SEEK_SET 0 /* Seek from beginning of file. */
  474. # define SEEK_CUR 1 /* Seek from current position. */
  475. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  476. #endif
  477. #ifndef z_off_t
  478. # define z_off_t long
  479. #endif
  480. #if !defined(_WIN32) && defined(Z_LARGE64)
  481. # define z_off64_t off64_t
  482. #else
  483. # if defined(_WIN32) && !defined(__GNUC__)
  484. # define z_off64_t __int64
  485. # else
  486. # define z_off64_t z_off_t
  487. # endif
  488. #endif
  489. /* MVS linker does not support external names larger than 8 bytes */
  490. #if defined(__MVS__)
  491. #pragma map(deflateInit_,"DEIN")
  492. #pragma map(deflateInit2_,"DEIN2")
  493. #pragma map(deflateEnd,"DEEND")
  494. #pragma map(deflateBound,"DEBND")
  495. #pragma map(inflateInit_,"ININ")
  496. #pragma map(inflateInit2_,"ININ2")
  497. #pragma map(inflateEnd,"INEND")
  498. #pragma map(inflateSync,"INSY")
  499. #pragma map(inflateSetDictionary,"INSEDI")
  500. #pragma map(compressBound,"CMBND")
  501. #pragma map(inflate_table,"INTABL")
  502. #pragma map(inflate_fast,"INFA")
  503. #pragma map(inflate_copyright,"INCOPY")
  504. #endif
  505. #endif /* ZCONF_H */