2
0

zconf.h 16 KB

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