1 //<MStar Software> 2 //****************************************************************************** 3 // MStar Software 4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. 5 // All software, firmware and related documentation herein ("MStar Software") are 6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by 7 // law, including, but not limited to, copyright law and international treaties. 8 // Any use, modification, reproduction, retransmission, or republication of all 9 // or part of MStar Software is expressly prohibited, unless prior written 10 // permission has been granted by MStar. 11 // 12 // By accessing, browsing and/or using MStar Software, you acknowledge that you 13 // have read, understood, and agree, to be bound by below terms ("Terms") and to 14 // comply with all applicable laws and regulations: 15 // 16 // 1. MStar shall retain any and all right, ownership and interest to MStar 17 // Software and any modification/derivatives thereof. 18 // No right, ownership, or interest to MStar Software and any 19 // modification/derivatives thereof is transferred to you under Terms. 20 // 21 // 2. You understand that MStar Software might include, incorporate or be 22 // supplied together with third party`s software and the use of MStar 23 // Software may require additional licenses from third parties. 24 // Therefore, you hereby agree it is your sole responsibility to separately 25 // obtain any and all third party right and license necessary for your use of 26 // such third party`s software. 27 // 28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as 29 // MStar`s confidential information and you agree to keep MStar`s 30 // confidential information in strictest confidence and not disclose to any 31 // third party. 32 // 33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any 34 // kind. Any warranties are hereby expressly disclaimed by MStar, including 35 // without limitation, any warranties of merchantability, non-infringement of 36 // intellectual property rights, fitness for a particular purpose, error free 37 // and in conformity with any international standard. You agree to waive any 38 // claim against MStar for any loss, damage, cost or expense that you may 39 // incur related to your use of MStar Software. 40 // In no event shall MStar be liable for any direct, indirect, incidental or 41 // consequential damages, including without limitation, lost of profit or 42 // revenues, lost or damage of data, and unauthorized system use. 43 // You agree that this Section 4 shall still apply without being affected 44 // even if MStar Software has been modified by MStar in accordance with your 45 // request or instruction for your use, except otherwise agreed by both 46 // parties in writing. 47 // 48 // 5. If requested, MStar may from time to time provide technical supports or 49 // services in relation with MStar Software to you for your use of 50 // MStar Software in conjunction with your or your customer`s product 51 // ("Services"). 52 // You understand and agree that, except otherwise agreed by both parties in 53 // writing, Services are provided on an "AS IS" basis and the warranty 54 // disclaimer set forth in Section 4 above shall apply. 55 // 56 // 6. Nothing contained herein shall be construed as by implication, estoppels 57 // or otherwise: 58 // (a) conferring any license or right to use MStar name, trademark, service 59 // mark, symbol or any other identification; 60 // (b) obligating MStar or any of its affiliates to furnish any person, 61 // including without limitation, you and your customers, any assistance 62 // of any kind whatsoever, or any information; or 63 // (c) conferring any license or right under any intellectual property right. 64 // 65 // 7. These terms shall be governed by and construed in accordance with the laws 66 // of Taiwan, R.O.C., excluding its conflict of law rules. 67 // Any and all dispute arising out hereof or related hereto shall be finally 68 // settled by arbitration referred to the Chinese Arbitration Association, 69 // Taipei in accordance with the ROC Arbitration Law and the Arbitration 70 // Rules of the Association by three (3) arbitrators appointed in accordance 71 // with the said Rules. 72 // The place of arbitration shall be in Taipei, Taiwan and the language shall 73 // be English. 74 // The arbitration award shall be final and binding to both parties. 75 // 76 //****************************************************************************** 77 //<MStar Software> 78 /* zconf.h -- configuration of the zlib compression library 79 * Copyright (C) 1995-2005 Jean-loup Gailly. 80 * For conditions of distribution and use, see copyright notice in zlib.h 81 */ 82 83 /* @(#) $Id$ */ 84 85 #ifndef ZCONF_H 86 #define ZCONF_H 87 88 /* 89 * If you *really* need a unique prefix for all types and library functions, 90 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 91 */ 92 #ifdef Z_PREFIX 93 # define deflateInit_ z_deflateInit_ 94 # define deflate z_deflate 95 # define deflateEnd z_deflateEnd 96 # define inflateInit_ z_inflateInit_ 97 # define inflate z_inflate 98 # define inflateEnd z_inflateEnd 99 # define deflateInit2_ z_deflateInit2_ 100 # define deflateSetDictionary z_deflateSetDictionary 101 # define deflateCopy z_deflateCopy 102 # define deflateReset z_deflateReset 103 # define deflateParams z_deflateParams 104 # define deflateBound z_deflateBound 105 # define deflatePrime z_deflatePrime 106 # define inflateInit2_ z_inflateInit2_ 107 # define inflateSetDictionary z_inflateSetDictionary 108 # define inflateSync z_inflateSync 109 # define inflateSyncPoint z_inflateSyncPoint 110 # define inflateCopy z_inflateCopy 111 # define inflateReset z_inflateReset 112 # define inflateBack z_inflateBack 113 # define inflateBackEnd z_inflateBackEnd 114 # define compress z_compress 115 # define compress2 z_compress2 116 # define compressBound z_compressBound 117 # define uncompress z_uncompress 118 # define adler32 z_adler32 119 # define crc32 z_crc32 120 # define get_crc_table z_get_crc_table 121 # define zError z_zError 122 123 # define alloc_func z_alloc_func 124 # define free_func z_free_func 125 # define in_func z_in_func 126 # define out_func z_out_func 127 # define Byte z_Byte 128 # define uInt z_uInt 129 # define uLong z_uLong 130 # define Bytef z_Bytef 131 # define charf z_charf 132 # define intf z_intf 133 # define uIntf z_uIntf 134 # define uLongf z_uLongf 135 # define voidpf z_voidpf 136 # define voidp z_voidp 137 #endif 138 139 #if defined(__MSDOS__) && !defined(MSDOS) 140 # define MSDOS 141 #endif 142 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) 143 # define OS2 144 #endif 145 #if defined(_WINDOWS) && !defined(WINDOWS) 146 # define WINDOWS 147 #endif 148 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) 149 # ifndef WIN32 150 # define WIN32 151 # endif 152 #endif 153 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) 154 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) 155 # ifndef SYS16BIT 156 # define SYS16BIT 157 # endif 158 # endif 159 #endif 160 161 /* 162 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more 163 * than 64k bytes at a time (needed on systems with 16-bit int). 164 */ 165 #ifdef SYS16BIT 166 # define MAXSEG_64K 167 #endif 168 #ifdef MSDOS 169 # define UNALIGNED_OK 170 #endif 171 172 #ifdef __STDC_VERSION__ 173 # ifndef STDC 174 # define STDC 175 # endif 176 # if __STDC_VERSION__ >= 199901L 177 # ifndef STDC99 178 # define STDC99 179 # endif 180 # endif 181 #endif 182 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) 183 # define STDC 184 #endif 185 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) 186 # define STDC 187 #endif 188 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) 189 # define STDC 190 #endif 191 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) 192 # define STDC 193 #endif 194 195 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ 196 # define STDC 197 #endif 198 199 #ifndef STDC 200 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ 201 # define const /* note: need a more gentle solution here */ 202 # endif 203 #endif 204 205 /* Some Mac compilers merge all .h files incorrectly: */ 206 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) 207 # define NO_DUMMY_DECL 208 #endif 209 210 /* Maximum value for memLevel in deflateInit2 */ 211 #ifndef MAX_MEM_LEVEL 212 # ifdef MAXSEG_64K 213 # define MAX_MEM_LEVEL 8 214 # else 215 # define MAX_MEM_LEVEL 9 216 # endif 217 #endif 218 219 /* Maximum value for windowBits in deflateInit2 and inflateInit2. 220 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files 221 * created by gzip. (Files created by minigzip can still be extracted by 222 * gzip.) 223 */ 224 #ifndef MAX_WBITS 225 # define MAX_WBITS 15 /* 32K LZ77 window */ 226 #endif 227 228 /* The memory requirements for deflate are (in bytes): 229 (1 << (windowBits+2)) + (1 << (memLevel+9)) 230 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) 231 plus a few kilobytes for small objects. For example, if you want to reduce 232 the default memory requirements from 256K to 128K, compile with 233 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" 234 Of course this will generally degrade compression (there's no free lunch). 235 236 The memory requirements for inflate are (in bytes) 1 << windowBits 237 that is, 32K for windowBits=15 (default value) plus a few kilobytes 238 for small objects. 239 */ 240 241 /* Type declarations */ 242 243 #ifndef OF /* function prototypes */ 244 # ifdef STDC 245 # define OF(args) args 246 # else 247 # define OF(args) () 248 # endif 249 #endif 250 251 /* The following definitions for FAR are needed only for MSDOS mixed 252 * model programming (small or medium model with some far allocations). 253 * This was tested only with MSC; for other MSDOS compilers you may have 254 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, 255 * just define FAR to be empty. 256 */ 257 #ifdef SYS16BIT 258 # if defined(M_I86SM) || defined(M_I86MM) 259 /* MSC small or medium model */ 260 # define SMALL_MEDIUM 261 # ifdef _MSC_VER 262 # define FAR _far 263 # else 264 # define FAR far 265 # endif 266 # endif 267 # if (defined(__SMALL__) || defined(__MEDIUM__)) 268 /* Turbo C small or medium model */ 269 # define SMALL_MEDIUM 270 # ifdef __BORLANDC__ 271 # define FAR _far 272 # else 273 # define FAR far 274 # endif 275 # endif 276 #endif 277 278 #if defined(WINDOWS) || defined(WIN32) 279 /* If building or using zlib as a DLL, define ZLIB_DLL. 280 * This is not mandatory, but it offers a little performance increase. 281 */ 282 # ifdef ZLIB_DLL 283 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) 284 # ifdef ZLIB_INTERNAL 285 # define ZEXTERN extern __declspec(dllexport) 286 # else 287 # define ZEXTERN extern __declspec(dllimport) 288 # endif 289 # endif 290 # endif /* ZLIB_DLL */ 291 /* If building or using zlib with the WINAPI/WINAPIV calling convention, 292 * define ZLIB_WINAPI. 293 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. 294 */ 295 # ifdef ZLIB_WINAPI 296 # ifdef FAR 297 # undef FAR 298 # endif 299 # include <windows.h> 300 /* No need for _export, use ZLIB.DEF instead. */ 301 /* For complete Windows compatibility, use WINAPI, not __stdcall. */ 302 # define ZEXPORT WINAPI 303 # ifdef WIN32 304 # define ZEXPORTVA WINAPIV 305 # else 306 # define ZEXPORTVA FAR CDECL 307 # endif 308 # endif 309 #endif 310 311 #if defined (__BEOS__) 312 # ifdef ZLIB_DLL 313 # ifdef ZLIB_INTERNAL 314 # define ZEXPORT __declspec(dllexport) 315 # define ZEXPORTVA __declspec(dllexport) 316 # else 317 # define ZEXPORT __declspec(dllimport) 318 # define ZEXPORTVA __declspec(dllimport) 319 # endif 320 # endif 321 #endif 322 323 #ifndef ZEXTERN 324 # define ZEXTERN extern 325 #endif 326 #ifndef ZEXPORT 327 # define ZEXPORT 328 #endif 329 #ifndef ZEXPORTVA 330 # define ZEXPORTVA 331 #endif 332 333 #ifndef FAR 334 # define FAR 335 #endif 336 337 #if !defined(__MACTYPES__) 338 typedef MS_U8 Byte; /* 8 bits */ 339 #endif 340 typedef MS_U32 uInt; /* 16 bits or more */ 341 typedef MS_U32 uLong; /* 32 bits or more */ 342 343 #ifdef SMALL_MEDIUM 344 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ 345 # define Bytef Byte FAR 346 #else 347 typedef Byte FAR Bytef; 348 #endif 349 typedef char FAR charf; 350 typedef MS_U32 FAR intf; 351 typedef uInt FAR uIntf; 352 typedef uLong FAR uLongf; 353 354 #ifdef STDC 355 typedef void const *voidpc; 356 typedef void FAR *voidpf; 357 typedef void *voidp; 358 #else 359 typedef Byte const *voidpc; 360 typedef Byte FAR *voidpf; 361 typedef Byte *voidp; 362 #endif 363 364 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ 365 # include <sys/types.h> /* for off_t */ 366 # include <unistd.h> /* for SEEK_* and off_t */ 367 # ifdef VMS 368 # include <unixio.h> /* for off_t */ 369 # endif 370 # define z_off_t off_t 371 #endif 372 #ifndef SEEK_SET 373 # define SEEK_SET 0 /* Seek from beginning of file. */ 374 # define SEEK_CUR 1 /* Seek from current position. */ 375 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ 376 #endif 377 #ifndef z_off_t 378 # define z_off_t long 379 #endif 380 381 #if defined(__OS400__) 382 # define NO_vsnprintf 383 #endif 384 385 #if defined(__MVS__) 386 # define NO_vsnprintf 387 # ifdef FAR 388 # undef FAR 389 # endif 390 #endif 391 392 /* MVS linker does not support external names larger than 8 bytes */ 393 #if defined(__MVS__) 394 # pragma map(deflateInit_,"DEIN") 395 # pragma map(deflateInit2_,"DEIN2") 396 # pragma map(deflateEnd,"DEEND") 397 # pragma map(deflateBound,"DEBND") 398 # pragma map(inflateInit_,"ININ") 399 # pragma map(inflateInit2_,"ININ2") 400 # pragma map(inflateEnd,"INEND") 401 # pragma map(inflateSync,"INSY") 402 # pragma map(inflateSetDictionary,"INSEDI") 403 # pragma map(compressBound,"CMBND") 404 # pragma map(inflate_table,"INTABL") 405 # pragma map(inflate_fast,"INFA") 406 //# pragma map(inflate_copyright,"INCOPY") 407 #endif 408 409 #endif /* ZCONF_H */ 410