zconf.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /* zconf.h -- configuration of the zlib compression library
  2. * Copyright (C) 1995-2002 Jean-loup Gailly.
  3. * For conditions of distribution and use, see copyright notice in zlib.h
  4. */
  5. /* @(#) $Id: zconf.h,v 1.2 2002/11/06 22:32:54 davidT Exp $ */
  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. */
  12. #ifdef Z_PREFIX
  13. # define deflateInit_ z_deflateInit_
  14. # define deflate z_deflate
  15. # define deflateEnd z_deflateEnd
  16. # define inflateInit_ z_inflateInit_
  17. # define inflate z_inflate
  18. # define inflateEnd z_inflateEnd
  19. # define deflateInit2_ z_deflateInit2_
  20. # define deflateSetDictionary z_deflateSetDictionary
  21. # define deflateCopy z_deflateCopy
  22. # define deflateReset z_deflateReset
  23. # define deflateParams z_deflateParams
  24. # define inflateInit2_ z_inflateInit2_
  25. # define inflateSetDictionary z_inflateSetDictionary
  26. # define inflateSync z_inflateSync
  27. # define inflateSyncPoint z_inflateSyncPoint
  28. # define inflateReset z_inflateReset
  29. # define compress z_compress
  30. # define compress2 z_compress2
  31. # define uncompress z_uncompress
  32. # define adler32 z_adler32
  33. # define crc32 z_crc32
  34. # define get_crc_table z_get_crc_table
  35. # define Byte z_Byte
  36. # define uInt z_uInt
  37. # define uLong z_uLong
  38. # define Bytef z_Bytef
  39. # define charf z_charf
  40. # define intf z_intf
  41. # define uIntf z_uIntf
  42. # define uLongf z_uLongf
  43. # define voidpf z_voidpf
  44. # define voidp z_voidp
  45. #endif
  46. #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
  47. # define WIN32
  48. #endif
  49. #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
  50. # ifndef __32BIT__
  51. # define __32BIT__
  52. # endif
  53. #endif
  54. #if defined(__MSDOS__) && !defined(MSDOS)
  55. # define MSDOS
  56. #endif
  57. /*
  58. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  59. * than 64k bytes at a time (needed on systems with 16-bit int).
  60. */
  61. #if defined(MSDOS) && !defined(__32BIT__)
  62. # define MAXSEG_64K
  63. #endif
  64. #ifdef MSDOS
  65. # define UNALIGNED_OK
  66. #endif
  67. #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
  68. # define STDC
  69. #endif
  70. #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
  71. # ifndef STDC
  72. # define STDC
  73. # endif
  74. #endif
  75. #ifndef STDC
  76. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  77. # define const
  78. # endif
  79. #endif
  80. /* Some Mac compilers merge all .h files incorrectly: */
  81. #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
  82. # define NO_DUMMY_DECL
  83. #endif
  84. /* Old Borland C incorrectly complains about missing returns: */
  85. #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
  86. # define NEED_DUMMY_RETURN
  87. #endif
  88. /* Maximum value for memLevel in deflateInit2 */
  89. #ifndef MAX_MEM_LEVEL
  90. # ifdef MAXSEG_64K
  91. # define MAX_MEM_LEVEL 8
  92. # else
  93. # define MAX_MEM_LEVEL 9
  94. # endif
  95. #endif
  96. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  97. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  98. * created by gzip. (Files created by minigzip can still be extracted by
  99. * gzip.)
  100. */
  101. #ifndef MAX_WBITS
  102. # define MAX_WBITS 15 /* 32K LZ77 window */
  103. #endif
  104. /* The memory requirements for deflate are (in bytes):
  105. (1 << (windowBits+2)) + (1 << (memLevel+9))
  106. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  107. plus a few kilobytes for small objects. For example, if you want to reduce
  108. the default memory requirements from 256K to 128K, compile with
  109. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  110. Of course this will generally degrade compression (there's no free lunch).
  111. The memory requirements for inflate are (in bytes) 1 << windowBits
  112. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  113. for small objects.
  114. */
  115. /* Type declarations */
  116. #ifndef OF /* function prototypes */
  117. # ifdef STDC
  118. # define OF(args) args
  119. # else
  120. # define OF(args) ()
  121. # endif
  122. #endif
  123. /* The following definitions for FAR are needed only for MSDOS mixed
  124. * model programming (small or medium model with some far allocations).
  125. * This was tested only with MSC; for other MSDOS compilers you may have
  126. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  127. * just define FAR to be empty.
  128. */
  129. #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
  130. /* MSC small or medium model */
  131. # define SMALL_MEDIUM
  132. # ifdef _MSC_VER
  133. # define FAR _far
  134. # else
  135. # define FAR far
  136. # endif
  137. #endif
  138. #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
  139. # ifndef __32BIT__
  140. # define SMALL_MEDIUM
  141. # define FAR _far
  142. # endif
  143. #endif
  144. /* Compile with -DZLIB_DLL for Windows DLL support */
  145. #if defined(ZLIB_DLL)
  146. # if defined(_WINDOWS) || defined(WINDOWS)
  147. # ifdef FAR
  148. # undef FAR
  149. # endif
  150. # include <windows.h>
  151. # define ZEXPORT WINAPI
  152. # ifdef WIN32
  153. # define ZEXPORTVA WINAPIV
  154. # else
  155. # define ZEXPORTVA FAR _cdecl _export
  156. # endif
  157. # endif
  158. # if defined (__BORLANDC__)
  159. # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
  160. # include <windows.h>
  161. # define ZEXPORT __declspec(dllexport) WINAPI
  162. # define ZEXPORTRVA __declspec(dllexport) WINAPIV
  163. # else
  164. # if defined (_Windows) && defined (__DLL__)
  165. # define ZEXPORT _export
  166. # define ZEXPORTVA _export
  167. # endif
  168. # endif
  169. # endif
  170. #endif
  171. #ifndef ZEXPORT
  172. # define ZEXPORT
  173. #endif
  174. #ifndef ZEXPORTVA
  175. # define ZEXPORTVA
  176. #endif
  177. #ifndef ZEXTERN
  178. # define ZEXTERN static
  179. #endif
  180. #ifndef ZEXTERNDEF
  181. # define ZEXTERNDEF static
  182. #endif
  183. #ifndef FAR
  184. # define FAR
  185. #endif
  186. #if !defined(MACOS) && !defined(TARGET_OS_MAC)
  187. typedef unsigned char Byte; /* 8 bits */
  188. #endif
  189. typedef unsigned int uInt; /* 16 bits or more */
  190. typedef unsigned long uLong; /* 32 bits or more */
  191. #ifdef SMALL_MEDIUM
  192. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  193. # define Bytef Byte FAR
  194. #else
  195. typedef Byte FAR Bytef;
  196. #endif
  197. typedef char FAR charf;
  198. typedef int FAR intf;
  199. typedef uInt FAR uIntf;
  200. typedef uLong FAR uLongf;
  201. #ifdef STDC
  202. typedef void FAR *voidpf;
  203. typedef void *voidp;
  204. #else
  205. typedef Byte FAR *voidpf;
  206. typedef Byte *voidp;
  207. #endif
  208. #ifdef HAVE_UNISTD_H
  209. # include <sys/types.h> /* for off_t */
  210. # include <unistd.h> /* for SEEK_* and off_t */
  211. # define z_off_t off_t
  212. #endif
  213. #ifndef SEEK_SET
  214. # define SEEK_SET 0 /* Seek from beginning of file. */
  215. # define SEEK_CUR 1 /* Seek from current position. */
  216. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  217. #endif
  218. #ifndef z_off_t
  219. # define z_off_t long
  220. #endif
  221. /* MVS linker does not support external names larger than 8 bytes */
  222. #if defined(__MVS__)
  223. # pragma map(deflateInit_,"DEIN")
  224. # pragma map(deflateInit2_,"DEIN2")
  225. # pragma map(deflateEnd,"DEEND")
  226. # pragma map(inflateInit_,"ININ")
  227. # pragma map(inflateInit2_,"ININ2")
  228. # pragma map(inflateEnd,"INEND")
  229. # pragma map(inflateSync,"INSY")
  230. # pragma map(inflateSetDictionary,"INSEDI")
  231. # pragma map(inflate_blocks,"INBL")
  232. # pragma map(inflate_blocks_new,"INBLNE")
  233. # pragma map(inflate_blocks_free,"INBLFR")
  234. # pragma map(inflate_blocks_reset,"INBLRE")
  235. # pragma map(inflate_codes_free,"INCOFR")
  236. # pragma map(inflate_codes,"INCO")
  237. # pragma map(inflate_fast,"INFA")
  238. # pragma map(inflate_flush,"INFLU")
  239. # pragma map(inflate_mask,"INMA")
  240. # pragma map(inflate_set_dictionary,"INSEDI2")
  241. # pragma map(inflate_copyright,"INCOPY")
  242. # pragma map(inflate_trees_bits,"INTRBI")
  243. # pragma map(inflate_trees_dynamic,"INTRDY")
  244. # pragma map(inflate_trees_fixed,"INTRFI")
  245. # pragma map(inflate_trees_free,"INTRFR")
  246. #endif
  247. #endif /* _ZCONF_H */