zconf.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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. /* #undef Z_PREFIX */
  9. /*#define Z_HAVE_UNISTD_H*/
  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. /* all zlib typedefs in zlib.h and zconf.h */
  138. # define Byte z_Byte
  139. # define Bytef z_Bytef
  140. # define alloc_func z_alloc_func
  141. # define charf z_charf
  142. # define free_func z_free_func
  143. # ifndef Z_SOLO
  144. # define gzFile z_gzFile
  145. # endif
  146. # define gz_header z_gz_header
  147. # define gz_headerp z_gz_headerp
  148. # define in_func z_in_func
  149. # define intf z_intf
  150. # define out_func z_out_func
  151. # define uInt z_uInt
  152. # define uIntf z_uIntf
  153. # define uLong z_uLong
  154. # define uLongf z_uLongf
  155. # define voidp z_voidp
  156. # define voidpc z_voidpc
  157. # define voidpf z_voidpf
  158. /* all zlib structs in zlib.h and zconf.h */
  159. # define gz_header_s z_gz_header_s
  160. # define internal_state z_internal_state
  161. #endif
  162. #if defined(__MSDOS__) && !defined(MSDOS)
  163. # define MSDOS
  164. #endif
  165. #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
  166. # define OS2
  167. #endif
  168. #if defined(_WINDOWS) && !defined(WINDOWS)
  169. # define WINDOWS
  170. #endif
  171. #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
  172. # ifndef WIN32
  173. # define WIN32
  174. # endif
  175. #endif
  176. #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  177. # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
  178. # ifndef SYS16BIT
  179. # define SYS16BIT
  180. # endif
  181. # endif
  182. #endif
  183. /*
  184. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  185. * than 64k bytes at a time (needed on systems with 16-bit int).
  186. */
  187. #ifdef SYS16BIT
  188. # define MAXSEG_64K
  189. #endif
  190. #ifdef MSDOS
  191. # define UNALIGNED_OK
  192. #endif
  193. #ifdef __STDC_VERSION__
  194. # ifndef STDC
  195. # define STDC
  196. # endif
  197. # if __STDC_VERSION__ >= 199901L
  198. # ifndef STDC99
  199. # define STDC99
  200. # endif
  201. # endif
  202. #endif
  203. #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
  204. # define STDC
  205. #endif
  206. #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
  207. # define STDC
  208. #endif
  209. #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
  210. # define STDC
  211. #endif
  212. #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
  213. # define STDC
  214. #endif
  215. #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
  216. # define STDC
  217. #endif
  218. #ifndef STDC
  219. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  220. # define const /* note: need a more gentle solution here */
  221. # endif
  222. #endif
  223. #if defined(ZLIB_CONST) && !defined(z_const)
  224. # define z_const const
  225. #else
  226. # define z_const
  227. #endif
  228. #ifdef Z_SOLO
  229. typedef unsigned long z_size_t;
  230. #else
  231. # define z_longlong long long
  232. # if defined(NO_SIZE_T)
  233. typedef unsigned NO_SIZE_T z_size_t;
  234. # elif defined(STDC)
  235. # include <stddef.h>
  236. typedef size_t z_size_t;
  237. # else
  238. typedef unsigned long z_size_t;
  239. # endif
  240. # undef z_longlong
  241. #endif
  242. /* Maximum value for memLevel in deflateInit2 */
  243. #ifndef MAX_MEM_LEVEL
  244. # ifdef MAXSEG_64K
  245. # define MAX_MEM_LEVEL 8
  246. # else
  247. # define MAX_MEM_LEVEL 9
  248. # endif
  249. #endif
  250. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  251. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  252. * created by gzip. (Files created by minigzip can still be extracted by
  253. * gzip.)
  254. */
  255. #ifndef MAX_WBITS
  256. # define MAX_WBITS 15 /* 32K LZ77 window */
  257. #endif
  258. /* The memory requirements for deflate are (in bytes):
  259. (1 << (windowBits+2)) + (1 << (memLevel+9))
  260. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  261. plus a few kilobytes for small objects. For example, if you want to reduce
  262. the default memory requirements from 256K to 128K, compile with
  263. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  264. Of course this will generally degrade compression (there's no free lunch).
  265. The memory requirements for inflate are (in bytes) 1 << windowBits
  266. that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
  267. for small objects.
  268. */
  269. /* Type declarations */
  270. #ifndef OF /* function prototypes */
  271. # ifdef STDC
  272. # define OF(args) args
  273. # else
  274. # define OF(args) ()
  275. # endif
  276. #endif
  277. #ifndef Z_ARG /* function prototypes for stdarg */
  278. # if defined(STDC) || defined(Z_HAVE_STDARG_H)
  279. # define Z_ARG(args) args
  280. # else
  281. # define Z_ARG(args) ()
  282. # endif
  283. #endif
  284. /* The following definitions for FAR are needed only for MSDOS mixed
  285. * model programming (small or medium model with some far allocations).
  286. * This was tested only with MSC; for other MSDOS compilers you may have
  287. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  288. * just define FAR to be empty.
  289. */
  290. #ifdef SYS16BIT
  291. # if defined(M_I86SM) || defined(M_I86MM)
  292. /* MSC small or medium model */
  293. # define SMALL_MEDIUM
  294. # ifdef _MSC_VER
  295. # define FAR _far
  296. # else
  297. # define FAR far
  298. # endif
  299. # endif
  300. # if (defined(__SMALL__) || defined(__MEDIUM__))
  301. /* Turbo C small or medium model */
  302. # define SMALL_MEDIUM
  303. # ifdef __BORLANDC__
  304. # define FAR _far
  305. # else
  306. # define FAR far
  307. # endif
  308. # endif
  309. #endif
  310. #if defined(WINDOWS) || defined(WIN32)
  311. /* If building or using zlib as a DLL, define ZLIB_DLL.
  312. * This is not mandatory, but it offers a little performance increase.
  313. */
  314. # ifdef ZLIB_DLL
  315. # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  316. # ifdef ZLIB_INTERNAL
  317. # define ZEXTERN extern __declspec(dllexport)
  318. # else
  319. # define ZEXTERN extern __declspec(dllimport)
  320. # endif
  321. # endif
  322. # endif /* ZLIB_DLL */
  323. /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  324. * define ZLIB_WINAPI.
  325. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  326. */
  327. # ifdef ZLIB_WINAPI
  328. # ifdef FAR
  329. # undef FAR
  330. # endif
  331. # include <windows.h>
  332. /* No need for _export, use ZLIB.DEF instead. */
  333. /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  334. # define ZEXPORT WINAPI
  335. # ifdef WIN32
  336. # define ZEXPORTVA WINAPIV
  337. # else
  338. # define ZEXPORTVA FAR CDECL
  339. # endif
  340. # endif
  341. #endif
  342. #if defined (__BEOS__)
  343. # ifdef ZLIB_DLL
  344. # ifdef ZLIB_INTERNAL
  345. # define ZEXPORT __declspec(dllexport)
  346. # define ZEXPORTVA __declspec(dllexport)
  347. # else
  348. # define ZEXPORT __declspec(dllimport)
  349. # define ZEXPORTVA __declspec(dllimport)
  350. # endif
  351. # endif
  352. #endif
  353. #ifndef ZEXTERN
  354. # define ZEXTERN extern
  355. #endif
  356. #ifndef ZEXPORT
  357. # define ZEXPORT
  358. #endif
  359. #ifndef ZEXPORTVA
  360. # define ZEXPORTVA
  361. #endif
  362. #ifndef FAR
  363. # define FAR
  364. #endif
  365. #if !defined(__MACTYPES__)
  366. typedef unsigned char Byte; /* 8 bits */
  367. #endif
  368. typedef unsigned int uInt; /* 16 bits or more */
  369. typedef unsigned long uLong; /* 32 bits or more */
  370. #ifdef SMALL_MEDIUM
  371. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  372. # define Bytef Byte FAR
  373. #else
  374. typedef Byte FAR Bytef;
  375. #endif
  376. typedef char FAR charf;
  377. typedef int FAR intf;
  378. typedef uInt FAR uIntf;
  379. typedef uLong FAR uLongf;
  380. #ifdef STDC
  381. typedef void const *voidpc;
  382. typedef void FAR *voidpf;
  383. typedef void *voidp;
  384. #else
  385. typedef Byte const *voidpc;
  386. typedef Byte FAR *voidpf;
  387. typedef Byte *voidp;
  388. #endif
  389. #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
  390. # include <limits.h>
  391. # if (UINT_MAX == 0xffffffffUL)
  392. # define Z_U4 unsigned
  393. # elif (ULONG_MAX == 0xffffffffUL)
  394. # define Z_U4 unsigned long
  395. # elif (USHRT_MAX == 0xffffffffUL)
  396. # define Z_U4 unsigned short
  397. # endif
  398. #endif
  399. #ifdef Z_U4
  400. typedef Z_U4 z_crc_t;
  401. #else
  402. typedef unsigned long z_crc_t;
  403. #endif
  404. #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
  405. # define Z_HAVE_UNISTD_H
  406. #endif
  407. #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
  408. # define Z_HAVE_STDARG_H
  409. #endif
  410. #ifdef STDC
  411. # ifndef Z_SOLO
  412. # include <sys/types.h> /* for off_t */
  413. # endif
  414. #endif
  415. #if defined(STDC) || defined(Z_HAVE_STDARG_H)
  416. # ifndef Z_SOLO
  417. # include <stdarg.h> /* for va_list */
  418. # endif
  419. #endif
  420. #ifdef _WIN32
  421. # ifndef Z_SOLO
  422. # include <stddef.h> /* for wchar_t */
  423. # endif
  424. #endif
  425. /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
  426. * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
  427. * though the former does not conform to the LFS document), but considering
  428. * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  429. * equivalently requesting no 64-bit operations
  430. */
  431. #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
  432. # undef _LARGEFILE64_SOURCE
  433. #endif
  434. #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
  435. # define Z_HAVE_UNISTD_H
  436. #endif
  437. #ifndef Z_SOLO
  438. # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
  439. # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
  440. # ifdef VMS
  441. # include <unixio.h> /* for off_t */
  442. # endif
  443. # ifndef z_off_t
  444. # define z_off_t off_t
  445. # endif
  446. # endif
  447. #endif
  448. #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
  449. # define Z_LFS64
  450. #endif
  451. #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
  452. # define Z_LARGE64
  453. #endif
  454. #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
  455. # define Z_WANT64
  456. #endif
  457. #if !defined(SEEK_SET) && !defined(Z_SOLO)
  458. # define SEEK_SET 0 /* Seek from beginning of file. */
  459. # define SEEK_CUR 1 /* Seek from current position. */
  460. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  461. #endif
  462. #ifndef z_off_t
  463. # define z_off_t long
  464. #endif
  465. #if !defined(_WIN32) && defined(Z_LARGE64)
  466. # define z_off64_t off64_t
  467. #else
  468. # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
  469. # define z_off64_t __int64
  470. # else
  471. # define z_off64_t z_off_t
  472. # endif
  473. #endif
  474. /* MVS linker does not support external names larger than 8 bytes */
  475. #if defined(__MVS__)
  476. #pragma map(deflateInit_,"DEIN")
  477. #pragma map(deflateInit2_,"DEIN2")
  478. #pragma map(deflateEnd,"DEEND")
  479. #pragma map(deflateBound,"DEBND")
  480. #pragma map(inflateInit_,"ININ")
  481. #pragma map(inflateInit2_,"ININ2")
  482. #pragma map(inflateEnd,"INEND")
  483. #pragma map(inflateSync,"INSY")
  484. #pragma map(inflateSetDictionary,"INSEDI")
  485. #pragma map(compressBound,"CMBND")
  486. #pragma map(inflate_table,"INTABL")
  487. #pragma map(inflate_fast,"INFA")
  488. #pragma map(inflate_copyright,"INCOPY")
  489. #endif
  490. #endif /* ZCONF_H */