os/ossrv/compressionlibs/ziplib/src/zlib/zlibapiwrapper.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/compressionlibs/ziplib/src/zlib/zlibapiwrapper.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,399 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This file contains the C interface for all the APIs provided by the 
    1.18 +// compression Library on Symbian. The actual functionlaity of all the 
    1.19 +// API's are divided over two different libraries, libzcore.dll and libz.dll
    1.20 +// All the API's are exported from this library and will be the only interface 
    1.21 +// for the user of compression library
    1.22 +// 
    1.23 +//
    1.24 +
    1.25 +#ifndef SYMBIAN_EZLIB_EXCLUDE_GZ_FUNCTIONS
    1.26 +	#include "libzgzio.h"
    1.27 +#endif
    1.28 +
    1.29 +#include "libzcore.h"
    1.30 +
    1.31 +
    1.32 +//================================================================= 
    1.33 +
    1.34 +EXPORT_C uLong  adler32(uLong adler,const Bytef *  buf,uInt len)
    1.35 +	{
    1.36 +	return(adler32_r(adler, buf, len));
    1.37 +	}
    1.38 +
    1.39 +//================================================================= 
    1.40 +
    1.41 +EXPORT_C  int compress (Bytef * dest, uLongf *  destLen,   
    1.42 +										 const Bytef * source, uLong sourceLen)
    1.43 +	{
    1.44 +	return (compress_r(dest, destLen, source, sourceLen));
    1.45 +	}
    1.46 +
    1.47 +//================================================================= 	
    1.48 +
    1.49 +EXPORT_C int  compress2 (Bytef * dest, uLongf * destLen,
    1.50 +							 const Bytef *  source,uLong  sourceLen, int level)
    1.51 +	{
    1.52 +	return (compress2_r(dest, destLen, source, sourceLen, level));
    1.53 +	}
    1.54 +	
    1.55 +//================================================================= 	
    1.56 +EXPORT_C  uLong  compressBound (uLong sourceLen)
    1.57 +	{
    1.58 +	return(compressBound_r(sourceLen));
    1.59 +	}
    1.60 +	
    1.61 +//================================================================= 	
    1.62 +EXPORT_C unsigned long  crc32( unsigned long crc,  
    1.63 +								 const unsigned char FAR *  buf, unsigned len)
    1.64 +	{
    1.65 +	return (crc32_r(crc, buf, len));
    1.66 +	}
    1.67 +	
    1.68 +//================================================================= 	
    1.69 +EXPORT_C int   deflate (z_streamp strm, int  flush)
    1.70 +	{
    1.71 +	return(deflate_r(strm, flush));
    1.72 +	}
    1.73 +	
    1.74 +//================================================================= 	
    1.75 +EXPORT_C  uLong deflateBound(z_streamp strm, uLong  sourceLen)
    1.76 +	{
    1.77 +	return (deflateBound_r(strm, sourceLen));
    1.78 +	}
    1.79 +	
    1.80 +//================================================================= 	
    1.81 +EXPORT_C int deflateCopy (z_streamp dest, z_streamp source)
    1.82 +	{
    1.83 +	return (deflateCopy_r(dest, source));
    1.84 +	}
    1.85 +	
    1.86 +//================================================================= 	
    1.87 +EXPORT_C int   deflateEnd (z_streamp strm)
    1.88 +	{
    1.89 +	return (deflateEnd_r(strm));
    1.90 +	}
    1.91 +	
    1.92 +//================================================================= 	
    1.93 +EXPORT_C int  deflateInit2_(z_streamp strm, int level, int method,
    1.94 +									int windowBits, int memLevel, int strategy,
    1.95 +										 const char * version, int stream_size)
    1.96 +	{
    1.97 +	return (deflateInit2__r(strm, level, method, windowBits, memLevel, strategy, version, stream_size));
    1.98 +	}
    1.99 +	
   1.100 +//================================================================= 	
   1.101 +EXPORT_C int  deflateInit_( z_streamp strm, int  level,
   1.102 +										const char * version, int  stream_size)
   1.103 +	{
   1.104 +	return(deflateInit__r(strm, level, version,stream_size));
   1.105 +	}
   1.106 +	
   1.107 +//================================================================= 	
   1.108 +EXPORT_C int deflateParams(z_streamp strm, int  level, int  strategy)
   1.109 +	{
   1.110 +	return (deflateParams_r(strm, level, strategy));
   1.111 +	}
   1.112 +	
   1.113 +//================================================================= 	
   1.114 +EXPORT_C int  deflateReset (z_streamp strm)
   1.115 +	{
   1.116 +	return (deflateReset_r(strm));
   1.117 +	}
   1.118 +	
   1.119 +//================================================================= 	
   1.120 +EXPORT_C int  deflateSetDictionary (z_streamp strm, const Bytef *  dictionary,uInt   dictLength)
   1.121 +	{
   1.122 +	return (deflateSetDictionary_r(strm, dictionary, dictLength ));
   1.123 +	}
   1.124 +	
   1.125 +	
   1.126 +//================================================================= 	
   1.127 +EXPORT_C  const unsigned long FAR * get_crc_table()
   1.128 +	{
   1.129 +	return (get_crc_table_r());
   1.130 +	}
   1.131 +#ifndef SYMBIAN_EZLIB_EXCLUDE_GZ_FUNCTIONS	
   1.132 +//=================================================================	
   1.133 +EXPORT_C int gzclose (gzFile file)
   1.134 +	{
   1.135 +	return (gzclose_r(file));
   1.136 +	}
   1.137 +	
   1.138 +//=================================================================
   1.139 +EXPORT_C void gzclearerr (gzFile file)
   1.140 +	{
   1.141 +	gzclearerr_r(file);
   1.142 +	return;
   1.143 +	}
   1.144 +	
   1.145 +//================================================================= 
   1.146 +EXPORT_C gzFile gzdopen (int fd, const char *  mode)
   1.147 +	{
   1.148 +	return (gzdopen_r(fd, mode));
   1.149 +	}
   1.150 +	
   1.151 +//=================================================================
   1.152 +EXPORT_C int gzdirect (gzFile file)
   1.153 +	{
   1.154 +	return ( gzdirect_r(file) );
   1.155 +	}
   1.156 +	
   1.157 +//================================================================= 	
   1.158 +EXPORT_C  int gzeof (gzFile file)
   1.159 +	{
   1.160 +	return (gzeof_r(file));
   1.161 +	}
   1.162 +	
   1.163 +//================================================================= 	
   1.164 +EXPORT_C const char *  gzerror (gzFile file, int *  errnum)
   1.165 +	{
   1.166 +	return (gzerror_r(file, errnum));
   1.167 +	}
   1.168 +	
   1.169 +//================================================================= 	
   1.170 +EXPORT_C  int gzflush (gzFile file,int flush)
   1.171 +	{
   1.172 +	return ( gzflush_r(file, flush) );
   1.173 +	}
   1.174 +	
   1.175 +//================================================================= 
   1.176 +EXPORT_C int gzgetc(gzFile file)
   1.177 +	{
   1.178 +	return ( gzgetc_r(file) ); 
   1.179 +	}
   1.180 +	
   1.181 +//================================================================= 	
   1.182 +EXPORT_C char * gzgets(gzFile file, char * buf, int len)
   1.183 +	{
   1.184 +	return ( gzgets_r(file, buf, len) );
   1.185 +	}
   1.186 +
   1.187 +//================================================================= 	
   1.188 +EXPORT_C gzFile gzopen (const char * path, const char * mode)	
   1.189 +	{
   1.190 +	return ( gzopen_r (path, mode) );
   1.191 +	}
   1.192 +	
   1.193 +
   1.194 +//================================================================= 
   1.195 +EXPORT_C int gzprintf (gzFile file, const char *format, /*args*/ ...)
   1.196 +	{
   1.197 +	va_list va;
   1.198 +	va_start(va, format);
   1.199 +	return (gzprintf_r(file, format , va));
   1.200 +	}
   1.201 +
   1.202 +
   1.203 +//================================================================= 
   1.204 +EXPORT_C int  gzputc(gzFile file, int c)
   1.205 +	{
   1.206 +	return ( gzputc_r (file, c) );
   1.207 +	}
   1.208 +	
   1.209 +//================================================================= 
   1.210 +EXPORT_C int  gzputs(gzFile file, const char * s)
   1.211 +	{
   1.212 +	return (gzputs_r(file, s) );
   1.213 +	}
   1.214 +
   1.215 +//================================================================= 
   1.216 +EXPORT_C int gzread (gzFile file, voidp buf,unsigned len)
   1.217 +	{
   1.218 +	return ( gzread_r(file, buf, len) );
   1.219 +	}
   1.220 +
   1.221 +//================================================================= 
   1.222 +EXPORT_C int  gzrewind (gzFile file)
   1.223 +	{
   1.224 +	return ( gzrewind_r(file) );
   1.225 +	}
   1.226 +
   1.227 +//================================================================= 
   1.228 +EXPORT_C  z_off_t gzseek (gzFile file, z_off_t  offset, int whence)
   1.229 +	{
   1.230 +	return (gzseek_r (file, offset, whence) );
   1.231 +	}
   1.232 +
   1.233 +//================================================================= 
   1.234 +EXPORT_C   int gzsetparams (gzFile file, int  level, int  strategy)
   1.235 +	{
   1.236 +	return ( gzsetparams_r (file, level, strategy ) );
   1.237 +	}
   1.238 +
   1.239 +//================================================================= 
   1.240 +EXPORT_C z_off_t gztell (gzFile file)
   1.241 +	{
   1.242 +	return ( gztell_r(file) );
   1.243 +	}
   1.244 +
   1.245 +//================================================================= 
   1.246 +EXPORT_C int gzungetc (int c, gzFile file)
   1.247 +	{
   1.248 +	return (gzungetc_r (c, file) );
   1.249 +	}
   1.250 +
   1.251 +//================================================================= 
   1.252 +EXPORT_C  int gzwrite (gzFile file,voidpc  buf, unsigned len)
   1.253 +	{
   1.254 +	return ( gzwrite_r (file , buf, len) );
   1.255 +	}
   1.256 +#endif //end SYMBIAN_EZLIB_EXCLUDE_GZ_FUNCTIONS
   1.257 +
   1.258 +//================================================================= 
   1.259 +EXPORT_C  int inflate(z_streamp strm,int  flush)
   1.260 +	{
   1.261 +	return ( inflate_r(strm, flush) );
   1.262 +	}
   1.263 +
   1.264 +//================================================================= 
   1.265 +EXPORT_C  int inflateEnd(z_streamp strm)
   1.266 +	{
   1.267 +	return ( inflateEnd_r(strm) );
   1.268 +	}
   1.269 +
   1.270 +//================================================================= 
   1.271 +EXPORT_C int inflateInit2_(z_streamp strm, int windowBits,
   1.272 +										const char * version, int  stream_size)
   1.273 +	{
   1.274 +	return (inflateInit2__r(strm, windowBits, version, stream_size ));
   1.275 +	}
   1.276 +	
   1.277 +//================================================================= 
   1.278 +EXPORT_C  int inflateInit_(z_streamp strm, const char * version, 
   1.279 +															int stream_size)
   1.280 +	{
   1.281 +	return ( inflateInit__r(strm, version, stream_size) );
   1.282 +	}
   1.283 +	
   1.284 +//================================================================= 
   1.285 +EXPORT_C  int inflateReset(z_streamp strm)
   1.286 +	{
   1.287 +	return ( inflateReset_r(strm) );
   1.288 +	}
   1.289 +
   1.290 +//=================================================================
   1.291 +EXPORT_C int  inflateSetDictionary(z_streamp strm,
   1.292 +									const Bytef *  dictionary, uInt dictLength)
   1.293 +	{
   1.294 +	return(inflateSetDictionary_r(strm, dictionary, dictLength));
   1.295 +	}
   1.296 +	
   1.297 +//================================================================= 
   1.298 +EXPORT_C int  inflateSync(z_streamp strm)
   1.299 +	{
   1.300 +	return ( inflateSync_r(strm) );
   1.301 +	}
   1.302 +
   1.303 +//================================================================= 
   1.304 +EXPORT_C  int inflateSyncPoint(z_streamp strm)
   1.305 +	{
   1.306 +	return ( inflateSyncPoint_r(strm) );
   1.307 +	}
   1.308 +
   1.309 +//=================================================================
   1.310 +EXPORT_C int  uncompress (Bytef * dest,uLongf *  destLen,  
   1.311 +								const Bytef * source, uLong  sourceLen)
   1.312 +	{
   1.313 +	return ( uncompress_r(dest, destLen, source, sourceLen) );
   1.314 +	}
   1.315 +
   1.316 +//=================================================================
   1.317 +EXPORT_C const char *  zlibVersion()
   1.318 +	{
   1.319 +	return ( zlibVersion_r() );
   1.320 +	}
   1.321 +
   1.322 +//================================================================= 
   1.323 +EXPORT_C const char *  zError(int err)
   1.324 +	{
   1.325 +	return ( zError_r(err) );
   1.326 +	}
   1.327 +	
   1.328 +//================================================================= 
   1.329 +EXPORT_C uLong adler32_combine(uLong adler1, uLong adler2, z_off_t len2)
   1.330 +	{
   1.331 +	return ( adler32_combine_r (adler1, adler2, len2) );
   1.332 +	}
   1.333 +
   1.334 +//=================================================================
   1.335 +EXPORT_C uLong crc32_combine (uLong crc1, uLong crc2, z_off_t len2)
   1.336 +	{
   1.337 +	return ( crc32_combine_r (crc1, crc2, len2) );
   1.338 +	}
   1.339 +
   1.340 +//=================================================================
   1.341 +EXPORT_C uLong zlibCompileFlags ()
   1.342 +	{
   1.343 +	return ( zlibCompileFlags_r () );
   1.344 +	}
   1.345 +
   1.346 +//=================================================================
   1.347 +EXPORT_C int deflateSetHeader (z_streamp strm, gz_headerp head)
   1.348 +	{
   1.349 +	return ( deflateSetHeader_r (strm, head) );
   1.350 +	}
   1.351 +
   1.352 +//=================================================================
   1.353 +EXPORT_C int deflatePrime (z_streamp strm, int bits, int value)
   1.354 +	{
   1.355 +	return ( deflatePrime_r (strm, bits, value) );
   1.356 +	}
   1.357 +
   1.358 +//=================================================================
   1.359 +EXPORT_C int deflateTune (z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)
   1.360 +	{
   1.361 +	return ( deflateTune_r (strm, good_length, max_lazy, nice_length, max_chain) );
   1.362 +	}
   1.363 +
   1.364 +//=================================================================
   1.365 +EXPORT_C int inflateCopy (z_streamp dest, z_streamp source)
   1.366 +	{
   1.367 +	return ( inflateCopy_r (dest, source) );
   1.368 +	}
   1.369 +
   1.370 +//=================================================================
   1.371 +EXPORT_C int inflatePrime (z_streamp strm, int bits, int value)
   1.372 +	{
   1.373 +	return ( inflatePrime_r (strm, bits, value) );
   1.374 +	}
   1.375 +
   1.376 +//=================================================================
   1.377 +EXPORT_C int inflateGetHeader (z_streamp strm, gz_headerp head)
   1.378 +	{
   1.379 +	return ( inflateGetHeader_r (strm, head) );
   1.380 +	}
   1.381 +
   1.382 +//=================================================================
   1.383 +EXPORT_C int inflateBackInit_ (z_streamp strm, int windowBits, unsigned char FAR *window, 
   1.384 +											const char *version,
   1.385 +											int stream_size)
   1.386 +	{
   1.387 +	return ( inflateBackInit__r (strm, windowBits, window,  version, stream_size) );
   1.388 +	}
   1.389 +
   1.390 +//=================================================================
   1.391 +EXPORT_C int inflateBack (z_streamp strm, in_func in, void FAR *in_desc,
   1.392 +        									out_func out, void FAR *out_desc)
   1.393 +	{
   1.394 +	return ( inflateBack_r (strm, in, in_desc,out, out_desc) );
   1.395 +	}
   1.396 +
   1.397 +
   1.398 +//=================================================================
   1.399 +EXPORT_C int inflateBackEnd (z_streamp strm)
   1.400 +	{
   1.401 +	return	( inflateBackEnd_r (strm) );
   1.402 +	}