00001 /***************************************************************************** 00002 * 00003 * $RCSfile: zconf_8h-source.html,v $ 00004 * 00005 * Configuration of the zlib Compression Library 00006 * 00007 * Copyright (C) 1995-1998 Jean-loup Gailly. 00008 * For conditions of distribution and use, see copyright notice in SysZLib.h 00009 * 00010 * $Author: mp $ 00011 * 00012 * $Date: 2007-10-08 20:40:35 $ 00013 * 00014 * $Revision: 1.7.2.1 $ 00015 * 00016 * $Log: zconf_8h-source.html,v $ 00016 * Revision 1.7.2.1 2007-10-08 20:40:35 mp 00016 * updated for gps4palm V0.9.5 beta 00016 * 00017 * Revision 1.1.1.1 2003-07-14 18:59:29 mp 00018 * Imported GPS4Palm to CVS revision control. 00019 * 00020 * 00021 ****************************************************************************/ 00022 #ifndef _ZCONF_H 00023 #define _ZCONF_H 00024 00025 /* 00026 * If you *really* need a unique prefix for all types and library functions, 00027 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 00028 */ 00029 #ifdef Z_PREFIX 00030 # define deflateInit_ z_deflateInit_ 00031 # define deflate z_deflate 00032 # define deflateEnd z_deflateEnd 00033 # define inflateInit_ z_inflateInit_ 00034 # define inflate z_inflate 00035 # define inflateEnd z_inflateEnd 00036 # define deflateInit2_ z_deflateInit2_ 00037 # define deflateSetDictionary z_deflateSetDictionary 00038 # define deflateCopy z_deflateCopy 00039 # define deflateReset z_deflateReset 00040 # define deflateParams z_deflateParams 00041 # define inflateInit2_ z_inflateInit2_ 00042 # define inflateSetDictionary z_inflateSetDictionary 00043 # define inflateSync z_inflateSync 00044 # define inflateSyncPoint z_inflateSyncPoint 00045 # define inflateReset z_inflateReset 00046 # define compress z_compress 00047 # define compress2 z_compress2 00048 # define uncompress z_uncompress 00049 # define adler32 z_adler32 00050 # define crc32 z_crc32 00051 # define get_crc_table z_get_crc_table 00052 00053 # define Byte z_Byte 00054 # define uInt z_uInt 00055 # define uLong z_uLong 00056 # define Bytef z_Bytef 00057 # define charf z_charf 00058 # define intf z_intf 00059 # define uIntf z_uIntf 00060 # define uLongf z_uLongf 00061 # define voidpf z_voidpf 00062 # define voidp z_voidp 00063 #endif 00064 00065 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) 00066 # define WIN32 00067 #endif 00068 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) 00069 # ifndef __32BIT__ 00070 # define __32BIT__ 00071 # endif 00072 #endif 00073 #if defined(__MSDOS__) && !defined(MSDOS) 00074 # define MSDOS 00075 #endif 00076 00077 /* 00078 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more 00079 * than 64k bytes at a time (needed on systems with 16-bit int). 00080 */ 00081 #if defined(MSDOS) && !defined(__32BIT__) 00082 # define MAXSEG_64K 00083 #endif 00084 #ifdef MSDOS 00085 # define UNALIGNED_OK 00086 #endif 00087 00088 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) 00089 # define STDC 00090 #endif 00091 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) 00092 # ifndef STDC 00093 # define STDC 00094 # endif 00095 #endif 00096 00097 #ifndef STDC 00098 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ 00099 # define const 00100 # endif 00101 #endif 00102 00103 /* Some Mac compilers merge all .h files incorrectly: */ 00104 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) 00105 # define NO_DUMMY_DECL 00106 #endif 00107 00108 /* Old Borland C incorrectly complains about missing returns: */ 00109 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) 00110 # define NEED_DUMMY_RETURN 00111 #endif 00112 00113 00114 /* Maximum value for memLevel in deflateInit2 */ 00115 #ifndef MAX_MEM_LEVEL 00116 # ifdef MAXSEG_64K 00117 # define MAX_MEM_LEVEL 8 00118 # else 00119 # define MAX_MEM_LEVEL 9 00120 # endif 00121 #endif 00122 00123 /* Maximum value for windowBits in deflateInit2 and inflateInit2. 00124 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 00125 * created by gzip. (Files created by minigzip can still be extracted by 00126 * gzip.) 00127 */ 00128 #ifndef MAX_WBITS 00129 # define MAX_WBITS 15 /* 32K LZ77 window */ 00130 #endif 00131 00132 /* The memory requirements for deflate are (in bytes): 00133 (1 << (windowBits+2)) + (1 << (memLevel+9)) 00134 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 00135 plus a few kilobytes for small objects. For example, if you want to reduce 00136 the default memory requirements from 256K to 128K, compile with 00137 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 00138 Of course this will generally degrade compression (there's no free lunch). 00139 00140 The memory requirements for inflate are (in bytes) 1 << windowBits 00141 that is, 32K for windowBits=15 (default value) plus a few kilobytes 00142 for small objects. 00143 */ 00144 00145 /* Type declarations */ 00146 00147 #ifndef OF /* function prototypes */ 00148 # ifdef STDC 00149 # define OF(args) args 00150 # else 00151 # define OF(args) () 00152 # endif 00153 #endif 00154 00155 /* The following definitions for FAR are needed only for MSDOS mixed 00156 * model programming (small or medium model with some far allocations). 00157 * This was tested only with MSC; for other MSDOS compilers you may have 00158 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, 00159 * just define FAR to be empty. 00160 */ 00161 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) 00162 /* MSC small or medium model */ 00163 # define SMALL_MEDIUM 00164 # ifdef _MSC_VER 00165 # define FAR _far 00166 # else 00167 # define FAR far 00168 # endif 00169 #endif 00170 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) 00171 # ifndef __32BIT__ 00172 # define SMALL_MEDIUM 00173 # define FAR _far 00174 # endif 00175 #endif 00176 00177 /* Compile with -DZLIB_DLL for Windows DLL support */ 00178 #if defined(ZLIB_DLL) 00179 # if defined(_WINDOWS) || defined(WINDOWS) 00180 # ifdef FAR 00181 # undef FAR 00182 # endif 00183 # include <windows.h> 00184 # define ZEXPORT WINAPI 00185 # ifdef WIN32 00186 # define ZEXPORTVA WINAPIV 00187 # else 00188 # define ZEXPORTVA FAR _cdecl _export 00189 # endif 00190 # endif 00191 # if defined (__BORLANDC__) 00192 # if (__BORLANDC__ >= 0x0500) && defined (WIN32) 00193 # include <windows.h> 00194 # define ZEXPORT __declspec(dllexport) WINAPI 00195 # define ZEXPORTRVA __declspec(dllexport) WINAPIV 00196 # else 00197 # if defined (_Windows) && defined (__DLL__) 00198 # define ZEXPORT _export 00199 # define ZEXPORTVA _export 00200 # endif 00201 # endif 00202 # endif 00203 #endif 00204 00205 #if defined (__BEOS__) 00206 # if defined (ZLIB_DLL) 00207 # define ZEXTERN extern __declspec(dllexport) 00208 # else 00209 # define ZEXTERN extern __declspec(dllimport) 00210 # endif 00211 #endif 00212 00213 #ifndef ZEXPORT 00214 # define ZEXPORT 00215 #endif 00216 #ifndef ZEXPORTVA 00217 # define ZEXPORTVA 00218 #endif 00219 #ifndef ZEXTERN 00220 # define ZEXTERN extern 00221 #endif 00222 00223 #ifndef FAR 00224 # define FAR 00225 #endif 00226 00227 #if !defined(MACOS) && !defined(TARGET_OS_MAC) && !defined(PALMOS) 00228 typedef unsigned char Byte; /* 8 bits */ 00229 #endif 00230 typedef unsigned int uInt; /* 16 bits or more */ 00231 typedef unsigned long uLong; /* 32 bits or more */ 00232 00233 #ifdef PALMOS 00234 typedef unsigned char FAR Bytef; 00235 #else 00236 #ifdef SMALL_MEDIUM 00237 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ 00238 # define Bytef Byte FAR 00239 #else 00240 typedef Byte FAR Bytef; 00241 #endif 00242 #endif 00243 typedef char FAR charf; 00244 typedef int FAR intf; 00245 typedef uInt FAR uIntf; 00246 typedef uLong FAR uLongf; 00247 00248 #ifdef STDC 00249 typedef void FAR *voidpf; 00250 typedef void *voidp; 00251 #else 00252 typedef Byte FAR *voidpf; 00253 typedef Byte *voidp; 00254 #endif 00255 00256 #ifdef HAVE_UNISTD_H 00257 # include <sys/types.h> /* for off_t */ 00258 # include <unistd.h> /* for SEEK_* and off_t */ 00259 # define z_off_t off_t 00260 #endif 00261 #ifndef SEEK_SET 00262 # define SEEK_SET 0 /* Seek from beginning of file. */ 00263 # define SEEK_CUR 1 /* Seek from current position. */ 00264 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ 00265 #endif 00266 #ifndef z_off_t 00267 # define z_off_t long 00268 #endif 00269 00270 /* MVS linker does not support external names larger than 8 bytes */ 00271 #if defined(__MVS__) 00272 # pragma map(deflateInit_,"DEIN") 00273 # pragma map(deflateInit2_,"DEIN2") 00274 # pragma map(deflateEnd,"DEEND") 00275 # pragma map(inflateInit_,"ININ") 00276 # pragma map(inflateInit2_,"ININ2") 00277 # pragma map(inflateEnd,"INEND") 00278 # pragma map(inflateSync,"INSY") 00279 # pragma map(inflateSetDictionary,"INSEDI") 00280 # pragma map(inflate_blocks,"INBL") 00281 # pragma map(inflate_blocks_new,"INBLNE") 00282 # pragma map(inflate_blocks_free,"INBLFR") 00283 # pragma map(inflate_blocks_reset,"INBLRE") 00284 # pragma map(inflate_codes_free,"INCOFR") 00285 # pragma map(inflate_codes,"INCO") 00286 # pragma map(inflate_fast,"INFA") 00287 # pragma map(inflate_flush,"INFLU") 00288 # pragma map(inflate_mask,"INMA") 00289 # pragma map(inflate_set_dictionary,"INSEDI2") 00290 # pragma map(inflate_copyright,"INCOPY") 00291 # pragma map(inflate_trees_bits,"INTRBI") 00292 # pragma map(inflate_trees_dynamic,"INTRDY") 00293 # pragma map(inflate_trees_fixed,"INTRFI") 00294 # pragma map(inflate_trees_free,"INTRFR") 00295 #endif 00296 00297 #ifdef PALMOS 00298 #undef Byte 00299 00300 #ifdef OLDGCC 00301 00302 #pragma pack(2) 00303 #include <Common.h> 00304 #include <System/SysAll.h> 00305 #include <UI/UIAll.h> 00306 00307 #else 00308 00309 #include <PalmOS.h> 00310 #include <PalmCompatibility.h> 00311 00312 #endif 00313 00314 #include <System/Unix/unix_stdlib.h> 00315 #include <System/Unix/unix_string.h> 00316 00317 #define NO_MEMCPY 00318 #define MAXSEG_64K 00319 00320 extern inline void zmemzero OF((Bytef* dst, uInt num)) 00321 { 00322 while (num--) 00323 *((char *) dst)++ = 0; 00324 } 00325 00326 extern inline void zmemcpy OF((Bytef* dst, const Bytef* src, uInt num)) 00327 { 00328 while (num--) 00329 *((char *) dst)++ = *((char *) src)++; 00330 } 00331 00332 extern inline int zmemcmp OF((const Bytef* dst, const Bytef* src, uInt num)) 00333 { 00334 00335 while (num-- && (*((char *) dst)++ == *((char *) src)++)); 00336 if (num >= 0) 00337 return *--((char *) dst) - *--((char *) src); 00338 else 00339 return 0; 00340 } 00341 00342 #define inflate_mask(x) (0xffffU >> ( 16 - x )) 00343 00344 #endif 00345 00346 #endif /* _ZCONF_H */