zconf.h
上传用户:detong
上传日期:2022-06-22
资源大小:20675k
文件大小:9k
源码类别:

系统编程

开发平台:

Unix_Linux

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