zconf.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. /* zconf.h -- configuration of the zlib compression library
  2. * Copyright (C) 1995-2005 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. // #ifdef __ECOS__
  9. #undef __ECOS__
  10. #define __ECOS__
  11. #include <rtthread.h>
  12. #ifndef RT_USING_LIBC
  13. #define malloc rt_malloc
  14. #define free rt_free
  15. #define printf rt_kprintf
  16. #endif
  17. //#define Z_PREFIX //by prife
  18. //#include <pkgconf/compress_zlib.h> //prife no such file.
  19. #if CYGINT_COMPRESS_ZLIB_LOCAL_ALLOC != 0
  20. #define MY_ZCALLOC
  21. #endif
  22. #ifdef CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP
  23. #undef MAX_WBITS
  24. #define MAX_WBITS 15+16 /* 32K LZ77 window */
  25. #else
  26. #define NO_GZIP
  27. #define NO_GZCOMPRESS
  28. #endif
  29. // #endif
  30. /*
  31. * If you *really* need a unique prefix for all types and library functions,
  32. * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
  33. */
  34. #ifdef Z_PREFIX
  35. # define deflateInit_ z_deflateInit_
  36. # define deflate z_deflate
  37. # define deflateEnd z_deflateEnd
  38. # define inflateInit_ z_inflateInit_
  39. # define inflate z_inflate
  40. # define inflateEnd z_inflateEnd
  41. # define deflateInit2_ z_deflateInit2_
  42. # define deflateSetDictionary z_deflateSetDictionary
  43. # define deflateCopy z_deflateCopy
  44. # define deflateReset z_deflateReset
  45. # define deflateParams z_deflateParams
  46. # define deflateBound z_deflateBound
  47. # define deflatePrime z_deflatePrime
  48. # define inflateInit2_ z_inflateInit2_
  49. # define inflateSetDictionary z_inflateSetDictionary
  50. # define inflateSync z_inflateSync
  51. # define inflateSyncPoint z_inflateSyncPoint
  52. # define inflateCopy z_inflateCopy
  53. # define inflateReset z_inflateReset
  54. # define inflateBack z_inflateBack
  55. # define inflateBackEnd z_inflateBackEnd
  56. # define compress z_compress
  57. # define compress2 z_compress2
  58. # define compressBound z_compressBound
  59. # define uncompress z_uncompress
  60. # define adler32 z_adler32
  61. # define crc32 z_crc32
  62. # define get_crc_table z_get_crc_table
  63. # define zError z_zError
  64. # define alloc_func z_alloc_func
  65. # define free_func z_free_func
  66. # define in_func z_in_func
  67. # define out_func z_out_func
  68. # define Byte z_Byte
  69. # define uInt z_uInt
  70. # define uLong z_uLong
  71. # define Bytef z_Bytef
  72. # define charf z_charf
  73. # define intf z_intf
  74. # define uIntf z_uIntf
  75. # define uLongf z_uLongf
  76. # define voidpf z_voidpf
  77. # define voidp z_voidp
  78. #endif
  79. #if defined(__MSDOS__) && !defined(MSDOS)
  80. # define MSDOS
  81. #endif
  82. #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
  83. # define OS2
  84. #endif
  85. #if defined(_WINDOWS) && !defined(WINDOWS)
  86. # define WINDOWS
  87. #endif
  88. #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
  89. # ifndef WIN32
  90. # define WIN32
  91. # endif
  92. #endif
  93. #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  94. # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
  95. # ifndef SYS16BIT
  96. # define SYS16BIT
  97. # endif
  98. # endif
  99. #endif
  100. /*
  101. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  102. * than 64k bytes at a time (needed on systems with 16-bit int).
  103. */
  104. #ifdef SYS16BIT
  105. # define MAXSEG_64K
  106. #endif
  107. #ifdef MSDOS
  108. # define UNALIGNED_OK
  109. #endif
  110. #ifdef __STDC_VERSION__
  111. # ifndef STDC
  112. # define STDC
  113. # endif
  114. # if __STDC_VERSION__ >= 199901L
  115. # ifndef STDC99
  116. # define STDC99
  117. # endif
  118. # endif
  119. #endif
  120. #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
  121. # define STDC
  122. #endif
  123. #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
  124. # define STDC
  125. #endif
  126. #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
  127. # define STDC
  128. #endif
  129. #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
  130. # define STDC
  131. #endif
  132. #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
  133. # define STDC
  134. #endif
  135. #ifndef STDC
  136. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  137. # define const /* note: need a more gentle solution here */
  138. # endif
  139. #endif
  140. /* Some Mac compilers merge all .h files incorrectly: */
  141. #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
  142. # define NO_DUMMY_DECL
  143. #endif
  144. /* Maximum value for memLevel in deflateInit2 */
  145. #ifndef MAX_MEM_LEVEL
  146. # ifdef MAXSEG_64K
  147. # define MAX_MEM_LEVEL 8
  148. # else
  149. # define MAX_MEM_LEVEL 9
  150. # endif
  151. #endif
  152. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  153. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  154. * created by gzip. (Files created by minigzip can still be extracted by
  155. * gzip.)
  156. */
  157. #ifndef MAX_WBITS
  158. # define MAX_WBITS 15 /* 32K LZ77 window */
  159. #endif
  160. /* The memory requirements for deflate are (in bytes):
  161. (1 << (windowBits+2)) + (1 << (memLevel+9))
  162. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  163. plus a few kilobytes for small objects. For example, if you want to reduce
  164. the default memory requirements from 256K to 128K, compile with
  165. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  166. Of course this will generally degrade compression (there's no free lunch).
  167. The memory requirements for inflate are (in bytes) 1 << windowBits
  168. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  169. for small objects.
  170. */
  171. /* Type declarations */
  172. #ifndef OF /* function prototypes */
  173. # ifdef STDC
  174. # define OF(args) args
  175. # else
  176. # define OF(args) ()
  177. # endif
  178. #endif
  179. /* The following definitions for FAR are needed only for MSDOS mixed
  180. * model programming (small or medium model with some far allocations).
  181. * This was tested only with MSC; for other MSDOS compilers you may have
  182. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  183. * just define FAR to be empty.
  184. */
  185. #ifdef SYS16BIT
  186. # if defined(M_I86SM) || defined(M_I86MM)
  187. /* MSC small or medium model */
  188. # define SMALL_MEDIUM
  189. # ifdef _MSC_VER
  190. # define FAR _far
  191. # else
  192. # define FAR far
  193. # endif
  194. # endif
  195. # if (defined(__SMALL__) || defined(__MEDIUM__))
  196. /* Turbo C small or medium model */
  197. # define SMALL_MEDIUM
  198. # ifdef __BORLANDC__
  199. # define FAR _far
  200. # else
  201. # define FAR far
  202. # endif
  203. # endif
  204. #endif
  205. #if defined(WINDOWS) || defined(WIN32)
  206. /* If building or using zlib as a DLL, define ZLIB_DLL.
  207. * This is not mandatory, but it offers a little performance increase.
  208. */
  209. # ifdef ZLIB_DLL
  210. # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  211. # ifdef ZLIB_INTERNAL
  212. # define ZEXTERN extern __declspec(dllexport)
  213. # else
  214. # define ZEXTERN extern __declspec(dllimport)
  215. # endif
  216. # endif
  217. # endif /* ZLIB_DLL */
  218. /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  219. * define ZLIB_WINAPI.
  220. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  221. */
  222. # ifdef ZLIB_WINAPI
  223. # ifdef FAR
  224. # undef FAR
  225. # endif
  226. # include <windows.h>
  227. /* No need for _export, use ZLIB.DEF instead. */
  228. /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  229. # define ZEXPORT WINAPI
  230. # ifdef WIN32
  231. # define ZEXPORTVA WINAPIV
  232. # else
  233. # define ZEXPORTVA FAR CDECL
  234. # endif
  235. # endif
  236. #endif
  237. #if defined (__BEOS__)
  238. # ifdef ZLIB_DLL
  239. # ifdef ZLIB_INTERNAL
  240. # define ZEXPORT __declspec(dllexport)
  241. # define ZEXPORTVA __declspec(dllexport)
  242. # else
  243. # define ZEXPORT __declspec(dllimport)
  244. # define ZEXPORTVA __declspec(dllimport)
  245. # endif
  246. # endif
  247. #endif
  248. #ifndef ZEXTERN
  249. # define ZEXTERN extern
  250. #endif
  251. #ifndef ZEXPORT
  252. # define ZEXPORT
  253. #endif
  254. #ifndef ZEXPORTVA
  255. # define ZEXPORTVA
  256. #endif
  257. #ifndef FAR
  258. # define FAR
  259. #endif
  260. #if !defined(__MACTYPES__)
  261. typedef unsigned char Byte; /* 8 bits */
  262. #endif
  263. typedef unsigned int uInt; /* 16 bits or more */
  264. typedef unsigned long uLong; /* 32 bits or more */
  265. #ifdef SMALL_MEDIUM
  266. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  267. # define Bytef Byte FAR
  268. #else
  269. typedef Byte FAR Bytef;
  270. #endif
  271. typedef char FAR charf;
  272. typedef int FAR intf;
  273. typedef uInt FAR uIntf;
  274. typedef uLong FAR uLongf;
  275. #ifdef STDC
  276. typedef void const *voidpc;
  277. typedef void FAR *voidpf;
  278. typedef void *voidp;
  279. #else
  280. typedef Byte const *voidpc;
  281. typedef Byte FAR *voidpf;
  282. typedef Byte *voidp;
  283. #endif
  284. #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
  285. # include <sys/types.h> /* for off_t */
  286. # include <unistd.h> /* for SEEK_* and off_t */
  287. # ifdef VMS
  288. # include <unixio.h> /* for off_t */
  289. # endif
  290. # define z_off_t off_t
  291. #endif
  292. #ifndef SEEK_SET
  293. # define SEEK_SET 0 /* Seek from beginning of file. */
  294. # define SEEK_CUR 1 /* Seek from current position. */
  295. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  296. #endif
  297. #ifndef z_off_t
  298. # define z_off_t long
  299. #endif
  300. #if defined(__OS400__)
  301. # define NO_vsnprintf
  302. #endif
  303. #if defined(__MVS__)
  304. # define NO_vsnprintf
  305. # ifdef FAR
  306. # undef FAR
  307. # endif
  308. #endif
  309. /* MVS linker does not support external names larger than 8 bytes */
  310. #if defined(__MVS__)
  311. # pragma map(deflateInit_,"DEIN")
  312. # pragma map(deflateInit2_,"DEIN2")
  313. # pragma map(deflateEnd,"DEEND")
  314. # pragma map(deflateBound,"DEBND")
  315. # pragma map(inflateInit_,"ININ")
  316. # pragma map(inflateInit2_,"ININ2")
  317. # pragma map(inflateEnd,"INEND")
  318. # pragma map(inflateSync,"INSY")
  319. # pragma map(inflateSetDictionary,"INSEDI")
  320. # pragma map(compressBound,"CMBND")
  321. # pragma map(inflate_table,"INTABL")
  322. # pragma map(inflate_fast,"INFA")
  323. # pragma map(inflate_copyright,"INCOPY")
  324. #endif
  325. #endif /* ZCONF_H */