Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

462 rindas
15 KiB

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