1 /* zconf.h -- configuration of the zlib compression library 2 * Copyright (C) 1995-1996 Jean-loup Gailly. 3 * For conditions of distribution and use, see copyright notice in zlib.h 4 */ 5 6 /* $Id: zconf.h,v 1.20 1996/07/02 15:09:28 me Exp $ */ 7 8 #ifndef _ZCONF_H 9 #define _ZCONF_H 10 11 /* 12 * If you *really* need a unique prefix for all types and library functions, 13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 14 */ 15 #ifdef Z_PREFIX 16 # define deflateInit_ z_deflateInit_ 17 # define deflate z_deflate 18 # define deflateEnd z_deflateEnd 19 # define inflateInit_ z_inflateInit_ 20 # define inflate z_inflate 21 # define inflateEnd z_inflateEnd 22 # define deflateInit2_ z_deflateInit2_ 23 # define deflateSetDictionary z_deflateSetDictionary 24 # define deflateCopy z_deflateCopy 25 # define deflateReset z_deflateReset 26 # define deflateParams z_deflateParams 27 # define inflateInit2_ z_inflateInit2_ 28 # define inflateSetDictionary z_inflateSetDictionary 29 # define inflateSync z_inflateSync 30 # define inflateReset z_inflateReset 31 # define compress z_compress 32 # define uncompress z_uncompress 33 # define adler32 z_adler32 34 # define crc32 z_crc32 35 # define get_crc_table z_get_crc_table 36 37 # define Byte z_Byte 38 # define uInt z_uInt 39 # define uLong z_uLong 40 # define Bytef z_Bytef 41 # define charf z_charf 42 # define intf z_intf 43 # define uIntf z_uIntf 44 # define uLongf z_uLongf 45 # define voidpf z_voidpf 46 # define voidp z_voidp 47 #endif 48 49 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) 50 # define WIN32 51 #endif 52 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) 53 # ifndef __32BIT__ 54 # define __32BIT__ 55 # endif 56 #endif 57 #if defined(__MSDOS__) && !defined(MSDOS) 58 # define MSDOS 59 #endif 60 61 /* 62 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more 63 * than 64k bytes at a time (needed on systems with 16-bit int). 64 */ 65 #if defined(MSDOS) && !defined(__32BIT__) 66 # define MAXSEG_64K 67 #endif 68 #ifdef MSDOS 69 # define UNALIGNED_OK 70 #endif 71 72 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) 73 # define STDC 74 #endif 75 #if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC) 76 # define STDC 77 #endif 78 79 #ifndef STDC 80 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ 81 # define const 82 # endif 83 #endif 84 85 /* Some Mac compilers merge all .h files incorrectly: */ 86 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) 87 # define NO_DUMMY_DECL 88 #endif 89 90 /* Maximum value for memLevel in deflateInit2 */ 91 #ifndef MAX_MEM_LEVEL 92 # ifdef MAXSEG_64K 93 # define MAX_MEM_LEVEL 8 94 # else 95 # define MAX_MEM_LEVEL 9 96 # endif 97 #endif 98 99 /* Maximum value for windowBits in deflateInit2 and inflateInit2 */ 100 #ifndef MAX_WBITS 101 # define MAX_WBITS 15 /* 32K LZ77 window */ 102 #endif 103 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 112 The memory requirements for inflate are (in bytes) 1 << windowBits 113 that is, 32K for windowBits=15 (default value) plus a few kilobytes 114 for small objects. 115 */ 116 117 /* Type declarations */ 118 119 #ifndef OF /* function prototypes */ 120 # ifdef STDC 121 # define OF(args) args 122 # else 123 # define OF(args) () 124 # endif 125 #endif 126 127 /* The following definitions for FAR are needed only for MSDOS mixed 128 * model programming (small or medium model with some far allocations). 129 * This was tested only with MSC; for other MSDOS compilers you may have 130 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, 131 * just define FAR to be empty. 132 */ 133 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) 134 /* MSC small or medium model */ 135 # define SMALL_MEDIUM 136 # ifdef _MSC_VER 137 # define FAR __far 138 # else 139 # define FAR far 140 # endif 141 #endif 142 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) 143 # ifndef __32BIT__ 144 # define SMALL_MEDIUM 145 # define FAR __far 146 # endif 147 #endif 148 #ifndef FAR 149 # define FAR 150 #endif 151 152 typedef unsigned char Byte; /* 8 bits */ 153 typedef unsigned int uInt; /* 16 bits or more */ 154 typedef unsigned long uLong; /* 32 bits or more */ 155 156 #if defined(__BORLANDC__) && defined(SMALL_MEDIUM) 157 /* Borland C/C++ ignores FAR inside typedef */ 158 # define Bytef Byte FAR 159 #else 160 typedef Byte FAR Bytef; 161 #endif 162 typedef char FAR charf; 163 typedef int FAR intf; 164 typedef uInt FAR uIntf; 165 typedef uLong FAR uLongf; 166 167 #ifdef STDC 168 typedef void FAR *voidpf; 169 typedef void *voidp; 170 #else 171 typedef Byte FAR *voidpf; 172 typedef Byte *voidp; 173 #endif 174 175 176 /* Compile with -DZLIB_DLL for Windows DLL support */ 177 #if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL) 178 # include <windows.h> 179 # define EXPORT WINAPI 180 #else 181 # define EXPORT 182 #endif 183 184 #endif /* _ZCONF_H */ 185