|  |  | -+ | 1 | /* Portions Copyright (c)  Symbian Software Ltd 2007.  All rights reserved. */ | 
|  | 
| 1 | /* deflate.c -- compress data using the deflation algorithm | <> | 3 | /* deflate.cpp -- compress data using the deflation algorithm | 
|  | 
|  |  | -+ | 207 | #ifdef __SYMBIAN32__ | 
|  |  |  | 208 | EXPORT_C int  deflateInit__r( z_streamp strm,int  level,const char * version,int  stream_size) | 
|  |  |  | 209 | #else | 
|  | 
|  |  | -+ | 215 | #endif //__SYMBIAN32__ | 
|  | 
| 210 | return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, | <> | 217 | return deflateInit2__r(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, | 
|  | 
|  |  | -+ | 223 | #ifdef __SYMBIAN32__ | 
|  |  |  | 224 | EXPORT_C int  deflateInit2__r(z_streamp strm, int level,int method,int windowBits,int memLevel,int strategy, | 
|  |  |  | 225 | const char * version,int stream_size) | 
|  |  |  | 226 | #else | 
|  | 
|  |  | -+ | 237 | #endif //__SYMBIAN32__ | 
|  | 
| 301 | deflateEnd (strm); | <> | 314 | deflateEnd_r (strm); | 
|  | 
| 311 | return deflateReset(strm); | <> | 324 | return deflateReset_r (strm); | 
|  | 
|  |  | -+ | 328 | #ifdef __SYMBIAN32__ | 
|  |  |  | 329 | EXPORT_C int  deflateSetDictionary_r (z_streamp strm, const Bytef *  dictionary,uInt   dictLength) | 
|  |  |  | 330 | #else | 
|  | 
|  |  | -+ | 335 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 342 | // Line to stop compiler warning about unused mandatory global variable 'deflate_copyright' | 
|  |  |  | 343 | char dontCare = deflate_copyright[0]; dontCare = dontCare; | 
|  | 
| 332 | strm->adler = adler32(strm->adler, dictionary, dictLength); | <> | 352 | strm->adler = adler32_r(strm->adler, dictionary, dictLength); | 
|  | 
|  |  | -+ | 377 | #ifdef __SYMBIAN32__ | 
|  |  |  | 378 | EXPORT_C int  deflateReset_r (z_streamp strm) | 
|  |  |  | 379 | #else | 
|  | 
|  |  | -+ | 382 | #endif //__SYMBIAN32__ | 
|  | 
| 381 | s->wrap == 2 ? crc32(0L, Z_NULL, 0) : | <> | 405 | s->wrap == 2 ? crc32_r(0L, Z_NULL, 0) : | 
|  | 
| 383 | adler32(0L, Z_NULL, 0); | <> | 407 | adler32_r(0L, Z_NULL, 0); | 
|  | 
|  |  | -+ | 418 | #ifdef __SYMBIAN32__ | 
|  |  |  | 419 | EXPORT_C int deflateSetHeader_r (z_streamp strm, gz_headerp  head) | 
|  |  |  | 420 | #else | 
|  | 
|  |  | -+ | 424 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 433 | #ifdef __SYMBIAN32__ | 
|  |  |  | 434 | EXPORT_C int  deflatePrime_r (z_streamp strm,int  bits,int  value) | 
|  |  |  | 435 | #else | 
|  | 
|  |  | -+ | 440 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 450 | #ifdef __SYMBIAN32__ | 
|  |  |  | 451 | EXPORT_C int deflateParams_r (z_streamp strm,int  level,int  strategy) | 
|  |  |  | 452 | #else | 
|  | 
|  |  | -+ | 457 | #endif //__SYMBIAN32__ | 
|  | 
| 440 | err = deflate(strm, Z_PARTIAL_FLUSH); | <> | 478 | err = deflate_r(strm, Z_PARTIAL_FLUSH); | 
|  | 
|  |  | -+ | 493 | #ifdef __SYMBIAN32__ | 
|  |  |  | 494 | EXPORT_C int  deflateTune_r(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain) | 
|  |  |  | 495 | #else | 
|  | 
|  |  | -+ | 502 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 533 | #ifdef __SYMBIAN32__ | 
|  |  |  | 534 | EXPORT_C  uLong deflateBound_r(z_streamp strm,uLong  sourceLen) | 
|  |  |  | 535 | #else | 
|  | 
|  |  | -+ | 539 | #endif //__SYMBIAN32__ | 
|  | 
| 510 | return compressBound(sourceLen); | <> | 558 | return compressBound_r(sourceLen); | 
|  | 
|  |  | -+ | 567 | #ifdef __SYMBIAN32__ | 
|  |  |  | 568 | local void putShortMSB (deflate_state * s, uInt  b) | 
|  |  |  | 569 | #else | 
|  | 
|  |  | -+ | 573 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 585 | #ifdef __SYMBIAN32__ | 
|  |  |  | 586 | local void flush_pending(z_streamp strm) | 
|  |  |  | 587 | #else | 
|  | 
|  |  | -+ | 590 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 610 | #ifdef __SYMBIAN32__ | 
|  |  |  | 611 | EXPORT_C int  deflate_r (z_streamp strm,int  flush) | 
|  |  |  | 612 | #else | 
|  | 
|  |  | -+ | 616 | #endif //__SYMBIAN32__ | 
|  | 
| 580 | strm->adler = crc32(0L, Z_NULL, 0); | <> | 642 | strm->adler = crc32_r(0L, Z_NULL, 0); | 
|  | 
| 616 | strm->adler = crc32(strm->adler, s->pending_buf, | <> | 678 | strm->adler = crc32_r(strm->adler, s->pending_buf, | 
|  | 
| 648 | strm->adler = adler32(0L, Z_NULL, 0); | <> | 710 | strm->adler = adler32_r(0L, Z_NULL, 0); | 
|  | 
| 659 | strm->adler = crc32(strm->adler, s->pending_buf + beg, | <> | 721 | strm->adler = crc32_r(strm->adler, s->pending_buf + beg, | 
|  | 
| 670 | strm->adler = crc32(strm->adler, s->pending_buf + beg, | <> | 732 | strm->adler = crc32_r(strm->adler, s->pending_buf + beg, | 
|  | 
| 688 | strm->adler = crc32(strm->adler, s->pending_buf + beg, | <> | 750 | strm->adler = crc32_r(strm->adler, s->pending_buf + beg, | 
|  | 
| 701 | strm->adler = crc32(strm->adler, s->pending_buf + beg, | <> | 763 | strm->adler = crc32_r(strm->adler, s->pending_buf + beg, | 
|  | 
| 719 | strm->adler = crc32(strm->adler, s->pending_buf + beg, | <> | 781 | strm->adler = crc32_r(strm->adler, s->pending_buf + beg, | 
|  | 
| 732 | strm->adler = crc32(strm->adler, s->pending_buf + beg, | <> | 794 | strm->adler = crc32_r(strm->adler, s->pending_buf + beg, | 
|  | 
| 747 | strm->adler = crc32(0L, Z_NULL, 0); | <> | 809 | strm->adler = crc32_r(0L, Z_NULL, 0); | 
|  | 
|  |  | -+ | 921 | #ifdef __SYMBIAN32__ | 
|  |  |  | 922 | EXPORT_C int   deflateEnd_r (z_streamp strm) | 
|  |  |  | 923 | #else | 
|  | 
|  |  | -+ | 926 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 961 | #ifdef __SYMBIAN32__ | 
|  |  |  | 962 | EXPORT_C int deflateCopy_r (z_streamp dest, z_streamp source) | 
|  |  |  | 963 | #else | 
|  | 
|  |  | -+ | 967 | #endif //__SYMBIAN32__ | 
|  | 
| 928 | deflateEnd (dest); | <> | 999 | deflateEnd_r (dest); | 
|  | 
|  |  | -+ | 1027 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1028 | local int read_buf(z_streamp strm,Bytef *  buf,unsigned  size) | 
|  |  |  | 1029 | #else | 
|  | 
|  |  | -+ | 1034 | #endif //__SYMBIAN32__ | 
|  | 
| 969 | strm->adler = adler32(strm->adler, strm->next_in, len); | <> | 1044 | strm->adler = adler32_r(strm->adler, strm->next_in, len); | 
|  | 
| 973 | strm->adler = crc32(strm->adler, strm->next_in, len); | <> | 1048 | strm->adler = crc32_r(strm->adler, strm->next_in, len); | 
|  | 
|  |  | -+ | 1062 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1063 | local void lm_init (deflate_state * s) | 
|  |  |  | 1064 | #else | 
|  | 
|  |  | -+ | 1067 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1107 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1108 | local uInt longest_match(deflate_state * s,IPos  cur_match) | 
|  |  |  | 1109 | #else | 
|  | 
|  |  | -+ | 1113 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1259 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1260 | local uInt longest_match_fast(deflate_state * s,IPos cur_match) | 
|  |  |  | 1261 | #else | 
|  | 
|  |  | -+ | 1265 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1320 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1321 | local void check_match( deflate_state * s,IPos  start, match,int length) | 
|  |  |  | 1322 | #else | 
|  | 
|  |  | -+ | 1327 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1358 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1359 | local void fill_window(   deflate_state * s) | 
|  |  |  | 1360 | #else | 
|  | 
|  |  | -+ | 1363 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1486 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1487 | local block_state deflate_stored(deflate_state * s,int flush) | 
|  |  |  | 1488 | #else | 
|  | 
|  |  | -+ | 1492 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1548 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1549 | local block_state deflate_fast(   deflate_state * s,int  flush) | 
|  |  |  | 1550 | #else | 
|  | 
|  |  | -+ | 1554 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1658 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1659 | local block_state deflate_slow(  deflate_state * s,int  flush) | 
|  |  |  | 1660 | #else | 
|  | 
|  |  | -+ | 1664 | #endif //__SYMBIAN32__ | 
   
|  |  | -+ | 1 | /* Portions Copyright (c)  Symbian Software Ltd 2007.  All rights reserved. */ | 
|  | 
| 11 |  | <> | 13 | #include "libzgzio.h"   /* libzgzio.h must be included BEFORE zutil.h, as its header guard is used in zutil.h */ | 
|  | 
|  |  | -+ | 77 | #ifdef SYMBIAN_EZLIB_DEVICE | 
|  |  |  | 78 | /* This array is a copy of the one originally defined in zutil.cpp.  It is | 
|  |  |  | 79 | required here as zutil.cpp is now compiled seperately in libzcore.dll */ | 
|  |  |  | 80 | const char * const z_errmsg[10] = { | 
|  |  |  | 81 | "need dictionary",     /* Z_NEED_DICT       2  */ | 
|  |  |  | 82 | "stream end",          /* Z_STREAM_END      1  */ | 
|  |  |  | 83 | "",                    /* Z_OK              0  */ | 
|  |  |  | 84 | "file error",          /* Z_ERRNO         (-1) */ | 
|  |  |  | 85 | "stream error",        /* Z_STREAM_ERROR  (-2) */ | 
|  |  |  | 86 | "data error",          /* Z_DATA_ERROR    (-3) */ | 
|  |  |  | 87 | "insufficient memory", /* Z_MEM_ERROR     (-4) */ | 
|  |  |  | 88 | "buffer error",        /* Z_BUF_ERROR     (-5) */ | 
|  |  |  | 89 | "incompatible version",/* Z_VERSION_ERROR (-6) */ | 
|  |  |  | 90 | ""}; | 
|  |  |  | 91 | #endif /* SYMBIAN_EZLIB_DEVICE */ | 
|  | 
|  |  | -+ | 110 | #ifdef __SYMBIAN32__ | 
|  |  |  | 111 | local gzFile gz_open (const char * path,const char *  mode, int fd) | 
|  |  |  | 112 | #else | 
|  | 
|  |  | -+ | 117 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 123 | s->crc = crc32(0L, Z_NULL, 0); | <> | 145 | s->crc = crc32_r(0L, Z_NULL, 0); | 
|  | 
| 155 | err = deflateInit2(&(s->stream), level, | <> | 177 | err = deflateInit2_r(&(s->stream), level, | 
|  | 
| 167 | err = inflateInit2(&(s->stream), -MAX_WBITS); | <> | 189 | err = inflateInit2_r(&(s->stream), -MAX_WBITS); | 
|  | 
|  |  | -+ | 230 | #ifdef __SYMBIAN32__ | 
|  |  |  | 231 | gzFile gzopen_r (const char * path, const char * mode) | 
|  |  |  | 232 | #else | 
|  | 
|  |  | -+ | 236 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 246 | #ifdef __SYMBIAN32__ | 
|  |  |  | 247 | gzFile gzdopen_r (int fd, const char *  mode) | 
|  |  |  | 248 | #else | 
|  | 
|  |  | -+ | 252 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 265 | #ifdef __SYMBIAN32__ | 
|  |  |  | 266 | int gzsetparams_r (gzFile file,int  level,int  strategy) | 
|  |  |  | 267 | #else | 
|  | 
|  |  | -+ | 272 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 253 | return deflateParams (&(s->stream), level, strategy); | <> | 289 | return deflateParams_r (&(s->stream), level, strategy); | 
|  | 
|  |  | -+ | 297 | #ifdef __SYMBIAN32__ | 
|  |  |  | 298 | local int get_byte (gz_stream *s) | 
|  |  |  | 299 | #else | 
|  | 
|  |  | -+ | 302 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 328 | #ifdef __SYMBIAN32__ | 
|  |  |  | 329 | local void check_header (gz_stream * s) | 
|  |  |  | 330 | #else | 
|  | 
|  |  | -+ | 333 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 352 | * Cleanup then free the given gz_stream. Return a zlib error code. | <> | 396 |     Cleanup then free the given gz_stream. Return a zlib error code. | 
|  | 
|  |  | -+ | 399 | #ifdef __SYMBIAN32__ | 
|  |  |  | 400 | local int destroy (gz_stream * s) | 
|  |  |  | 401 | #else | 
|  | 
|  |  | -+ | 404 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 369 | err = deflateEnd(&(s->stream)); | <> | 417 | err = deflateEnd_r(&(s->stream)); | 
|  | 
| 372 | err = inflateEnd(&(s->stream)); | <> | 420 | err = inflateEnd_r(&(s->stream)); | 
|  | 
|  |  | -+ | 442 | #ifdef __SYMBIAN32__ | 
|  |  |  | 443 | int gzread_r (gzFile file,voidp  buf,unsigned  len) | 
|  |  |  | 444 | #else | 
|  | 
|  |  | -+ | 449 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 464 | s->z_err = inflate(&(s->stream), Z_NO_FLUSH); | <> | 516 | s->z_err = inflate_r(&(s->stream), Z_NO_FLUSH); | 
|  | 
| 470 | s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); | <> | 522 | s->crc = crc32_r(s->crc, start, (uInt)(s->stream.next_out - start)); | 
|  | 
| 483 | inflateReset(&(s->stream)); | <> | 535 | inflateReset_r(&(s->stream)); | 
| 484 | s->crc = crc32(0L, Z_NULL, 0); |  | 536 | s->crc = crc32_r(0L, Z_NULL, 0); | 
|  | 
| 490 | s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); | <> | 542 | s->crc = crc32_r(s->crc, start, (uInt)(s->stream.next_out - start)); | 
|  | 
|  |  | -+ | 555 | #ifdef __SYMBIAN32__ | 
|  |  |  | 556 | int gzgetc_r (gzFile file) | 
|  |  |  | 557 | #else | 
|  | 
|  |  | -+ | 560 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 508 | return gzread(file, &c, 1) == 1 ? c : -1; | <> | 565 | return gzread_r(file, &c, 1) == 1 ? c : -1; | 
|  | 
|  |  | -+ | 572 | #ifdef __SYMBIAN32__ | 
|  |  |  | 573 | int gzungetc_r (int c,gzFile file) | 
|  |  |  | 574 | #else | 
|  | 
|  |  | -+ | 578 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 601 | #ifdef __SYMBIAN32__ | 
|  |  |  | 602 | char * gzgets_r (gzFile file, char * buf, int len) | 
|  |  |  | 603 | #else | 
|  | 
|  |  | -+ | 608 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 548 | while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ; | <> | 613 | while (--len > 0 && gzread_r(file, buf, 1) == 1 && *buf++ != '\n') ; | 
|  | 
|  |  | -+ | 624 | #ifdef __SYMBIAN32__ | 
|  |  |  | 625 | int gzwrite_r (gzFile file,voidpc  buf,unsigned len) | 
|  |  |  | 626 | #else | 
|  | 
|  |  | -+ | 631 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 584 | s->z_err = deflate(&(s->stream), Z_NO_FLUSH); | <> | 653 | s->z_err = deflate_r(&(s->stream), Z_NO_FLUSH); | 
|  | 
| 589 | s->crc = crc32(s->crc, (const Bytef *)buf, len); | <> | 658 | s->crc = crc32_r(s->crc, (const Bytef *)buf, len); | 
|  | 
|  |  | -+ | 672 | #ifdef __SYMBIAN32__ | 
|  |  |  | 673 | int gzprintf_r (gzFile file, const char *format, va_list va) | 
|  |  |  | 674 | #else | 
|  | 
|  |  | -+ | 676 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 605 | char buf[Z_PRINTF_BUFSIZE]; | +- |  |  | 
| 606 | va_list va; |  |  |  | 
|  | 
|  |  | -+ | 679 | int ret; | 
|  | 
|  |  | -+ | 681 | #ifndef SYMBIAN_EZLIB_DEVICE | 
|  |  |  | 682 | char buf[Z_PRINTF_BUFSIZE]; | 
|  | 
|  |  | <> | 684 | #else | 
|  |  |  | 685 | char *buf = (char*)0; | 
|  |  |  | 686 | buf = (char*) ALLOC(Z_PRINTF_BUFSIZE * sizeof(char)); | 
|  |  |  | 687 | if(!buf) | 
| 610 | va_start(va, format); |  | 688 | return 0; | 
|  |  |  | 689 | buf[Z_PRINTF_BUFSIZE - 1] = 0; | 
|  |  |  | 690 | #endif /* SYMBIAN_EZLIB_DEVICE */ | 
|  | 
|  |  | -+ | 696 | #    ifndef SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 698 | #    else | 
|  |  |  | 699 | for (len = 0; len < Z_PRINTF_BUFSIZE; len++) | 
|  |  |  | 700 | #    endif /* SYMBIAN_EZLIB_DEVICE */ | 
|  | 
|  |  | -+ | 708 | #    ifndef SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 710 | #    else | 
|  |  |  | 711 | (void)vsnprintf(buf, Z_PRINTF_BUFSIZE, format, va); | 
|  |  |  | 712 | #    endif /* SYMBIAN_EZLIB_DEVICE */ | 
|  | 
|  |  | -+ | 716 | #    ifndef SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 718 | #    else | 
|  |  |  | 719 | len = vsnprintf(buf, Z_PRINTF_BUFSIZE, format, va); | 
|  |  |  | 720 | #    endif /* SYMBIAN_EZLIB_DEVICE */ | 
|  | 
|  |  | -+ | 725 | #ifndef SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 727 | { | 
|  |  |  | 728 | #else | 
|  |  |  | 729 | if (len <= 0 || len >= Z_PRINTF_BUFSIZE || buf[Z_PRINTF_BUFSIZE - 1] != 0) | 
|  |  |  | 730 | { | 
|  |  |  | 731 | free(buf); | 
|  |  |  | 732 | #endif /* SYMBIAN_EZLIB_DEVICE */ | 
|  | 
|  |  | <> | 734 | } | 
| 633 | return gzwrite(file, buf, (unsigned)len); |  | 735 | ret = gzwrite_r(file, buf, (unsigned)len); | 
|  | 
|  |  | -+ | 737 | #ifdef SYMBIAN_EZLIB_DEVICE | 
|  |  |  | 738 | free(buf); | 
|  |  |  | 739 | #endif /* SYMBIAN_EZLIB_DEVICE */ | 
|  |  |  | 740 | return ret; | 
|  | 
|  |  | -+ | 786 | #ifdef __SYMBIAN32__ | 
|  |  |  | 787 | int  gzputc_r (gzFile file,int  c) | 
|  |  |  | 788 | #else | 
|  | 
|  |  | -+ | 792 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 684 | return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1; | <> | 796 | return gzwrite_r(file, &cc, 1) == 1 ? (int)cc : -1; | 
|  | 
|  |  | -+ | 805 | #ifdef __SYMBIAN32__ | 
|  |  |  | 806 | int  gzputs_r (gzFile file,  const char * s) | 
|  |  |  | 807 | #else | 
|  | 
|  |  | -+ | 811 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 697 | return gzwrite(file, (char*)s, (unsigned)strlen(s)); | <> | 813 | return gzwrite_r(file, (char*)s, (unsigned)strlen(s)); | 
|  | 
|  |  | -+ | 821 | #ifdef __SYMBIAN32__ | 
|  |  |  | 822 | local int do_flush (gzFile file,int  flush) | 
|  |  |  | 823 | #else | 
|  | 
|  |  | -+ | 827 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 730 | s->z_err = deflate(&(s->stream), flush); | <> | 850 | s->z_err = deflate_r(&(s->stream), flush); | 
|  | 
|  |  | <> | 865 | #ifdef __SYMBIAN32__ | 
|  |  |  | 866 | int gzflush_r (gzFile file,int  flush) | 
| 745 |  |  | 867 | #else | 
|  | 
|  |  | -+ | 871 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 890 | #ifdef __SYMBIAN32__ | 
|  |  |  | 891 | z_off_t gzseek_r (gzFile file,z_off_t  offset,int whence) | 
|  |  |  | 892 | #else | 
|  | 
|  |  | -+ | 897 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 798 | size = gzwrite(file, s->inbuf, size); | <> | 926 | size = gzwrite_r(file, s->inbuf, size); | 
|  | 
| 828 | } else if (gzrewind(file) < 0) { | <> | 956 | } else if (gzrewind_r(file) < 0) { | 
|  | 
| 847 | size = gzread(file, s->outbuf, (uInt)size); | <> | 975 | size = gzread_r(file, s->outbuf, (uInt)size); | 
|  | 
|  |  | -+ | 985 | #ifdef __SYMBIAN32__ | 
|  |  |  | 986 | int  gzrewind_r (gzFile file) | 
|  |  |  | 987 | #else | 
|  | 
|  |  | -+ | 990 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 869 | s->crc = crc32(0L, Z_NULL, 0); | <> | 1001 | s->crc = crc32_r(0L, Z_NULL, 0); | 
| 870 | if (!s->transparent) (void)inflateReset(&s->stream); |  | 1002 | if (!s->transparent) (void)inflateReset_r(&s->stream); | 
|  | 
|  |  | -+ | 1013 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1014 | z_off_t gztell_r (gzFile file) | 
|  |  |  | 1015 | #else | 
|  | 
|  |  | -+ | 1018 | #endif /* __SYMBIAN32__ */ | 
|  | 
| 884 | return gzseek(file, 0L, SEEK_CUR); | <> | 1020 | return gzseek_r(file, 0L, SEEK_CUR); | 
|  | 
|  |  | -+ | 1027 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1028 | int gzeof_r (gzFile file) | 
|  |  |  | 1029 | #else | 
|  | 
|  |  | -+ | 1032 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 1048 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1049 | int gzdirect_r (gzFile file) | 
|  |  |  | 1050 | #else | 
|  | 
|  |  | -+ | 1053 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 1064 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1065 | local void putLong (FILE * file,uLong  x) | 
|  |  |  | 1066 | #else | 
|  | 
|  |  | -+ | 1070 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 1083 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1084 | local uLong getLong (gz_stream * s) | 
|  |  |  | 1085 | #else | 
|  | 
|  |  | -+ | 1088 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 1105 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1106 | int gzclose_r(gzFile file) | 
|  |  |  | 1107 | #else | 
|  | 
|  |  | -+ | 1110 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 1143 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1144 | const char *  gzerror_r (gzFile file, int *  errnum) | 
|  |  |  | 1145 | #else | 
|  | 
|  |  | -+ | 1149 | #endif /* __SYMBIAN32__ */ | 
|  | 
|  |  | -+ | 1177 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1178 | void gzclearerr_r (gzFile file) | 
|  |  |  | 1179 | #else | 
|  | 
|  |  | -+ | 1182 | #endif /* __SYMBIAN32__ */ | 
   
|  |  | -+ | 1 | /* Portions Copyright (c)  Symbian Software Ltd 2007.  All rights reserved. */ | 
|  | 
| 1 | /* inflate.c -- zlib decompression | <> | 3 | /* inflate.cpp -- zlib decompression | 
|  | 
|  |  | <> | 105 | #ifdef __SYMBIAN32__ | 
|  |  |  | 106 | EXPORT_C  int inflateReset_r (z_streamp strm) | 
| 102 |  |  | 107 | #else | 
|  | 
|  |  | -+ | 110 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 135 | #ifdef __SYMBIAN32__ | 
|  |  |  | 136 | EXPORT_C int  inflatePrime_r(z_streamp strm, int bits, int value) | 
|  |  |  | 137 | #else | 
|  | 
|  |  | -+ | 142 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 155 | #ifdef __SYMBIAN32__ | 
|  |  |  | 156 | EXPORT_C int inflateInit2__r(z_streamp strm, int windowBits,const char * version,int  stream_size) | 
|  |  |  | 157 | #else | 
|  | 
|  |  | -+ | 163 | #endif //__SYMBIAN32__ | 
|  | 
| 184 | return inflateReset(strm); | <> | 199 | return inflateReset_r (strm); | 
|  | 
|  |  | -+ | 202 | #ifdef __SYMBIAN32__ | 
|  |  |  | 203 | EXPORT_C  int inflateInit__r (z_streamp strm,const char *  version,int stream_size) | 
|  |  |  | 204 | #else | 
|  | 
|  |  | -+ | 209 | #endif //__SYMBIAN32__ | 
|  | 
| 192 | return inflateInit2_(strm, DEF_WBITS, version, stream_size); | <> | 211 | return inflateInit2__r(strm, DEF_WBITS, version, stream_size); | 
|  | 
|  |  | -+ | 226 | #ifdef __SYMBIAN32__ | 
|  |  |  | 227 | local void fixedtables(struct inflate_state FAR * state) | 
|  |  |  | 228 | #else | 
|  | 
|  |  | -+ | 231 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 273 | #ifndef SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 336 | #endif //SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 353 | #ifdef __SYMBIAN32__ | 
|  |  |  | 354 | local int updatewindow(z_streamp strm,unsigned  out) | 
|  |  |  | 355 | #else | 
|  | 
|  |  | -+ | 359 | #endif //__SYMBIAN32__ | 
|  | 
| 378 | (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) | <> | 414 | (state->flags ? crc32_r(check, buf, len) : adler32_r(check, buf, len)) | 
|  | 
| 380 | #  define UPDATE(check, buf, len) adler32(check, buf, len) | <> | 416 | #  define UPDATE(check, buf, len) adler32_r(check, buf, len) | 
|  | 
| 389 | check = crc32(check, hbuf, 2); \ | <> | 425 | check = crc32_r(check, hbuf, 2); \ | 
|  | 
| 398 | check = crc32(check, hbuf, 4); \ | <> | 434 | check = crc32_r(check, hbuf, 4); \ | 
|  | 
|  |  | <> | 590 | #ifdef __SYMBIAN32__ | 
|  |  |  | 591 | EXPORT_C  int inflate_r (z_streamp strm,int  flush) | 
| 553 |  |  | 592 | #else | 
|  | 
|  |  | -+ | 596 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 608 | /*  Need to replace "this" variable with "current" as "this" is a reserved | 
|  |  |  | 609 | *  keyword in C++ which is prefectly fine for a c code. As this file | 
|  |  |  | 610 | *  has been changed to C++ "this" needs to be changed. | 
|  |  |  | 611 | */ | 
|  |  |  | 612 | #   define this current | 
|  | 
| 597 | state->check = crc32(0L, Z_NULL, 0); | <> | 643 | state->check = crc32_r(0L, Z_NULL, 0); | 
|  | 
| 629 | strm->adler = state->check = adler32(0L, Z_NULL, 0); | <> | 675 | strm->adler = state->check = adler32_r(0L, Z_NULL, 0); | 
|  | 
| 693 | state->check = crc32(state->check, next, copy); | <> | 739 | state->check = crc32_r(state->check, next, copy); | 
|  | 
| 714 | state->check = crc32(state->check, next, copy); | <> | 760 | state->check = crc32_r(state->check, next, copy); | 
|  | 
| 735 | state->check = crc32(state->check, next, copy); | <> | 781 | state->check = crc32_r(state->check, next, copy); | 
|  | 
| 757 | strm->adler = state->check = crc32(0L, Z_NULL, 0); | <> | 803 | strm->adler = state->check = crc32_r(0L, Z_NULL, 0); | 
|  | 
| 771 | strm->adler = state->check = adler32(0L, Z_NULL, 0); | <> | 817 | strm->adler = state->check = adler32_r(0L, Z_NULL, 0); | 
|  | 
|  |  | <> | 1200 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1201 | EXPORT_C  int inflateEnd_r (z_streamp strm) | 
| 1154 |  |  | 1202 | #else | 
|  | 
|  |  | -+ | 1205 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | <> | 1217 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1218 | EXPORT_C int  inflateSetDictionary_r (z_streamp strm,const Bytef *  dictionary,uInt dictLength) | 
| 1168 |  |  | 1219 | #else | 
|  | 
|  |  | -+ | 1224 | #endif //__SYMBIAN32__ | 
|  | 
| 1185 | id = adler32(0L, Z_NULL, 0); | <> | 1237 | id = adler32_r(0L, Z_NULL, 0); | 
| 1186 | id = adler32(id, dictionary, dictLength); |  | 1238 | id = adler32_r(id, dictionary, dictLength); | 
|  | 
|  |  | -+ | 1264 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1265 | EXPORT_C int  inflateGetHeader_r(z_streamp strm, gz_headerp head) | 
|  |  |  | 1266 | #else | 
|  | 
|  |  | -+ | 1270 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1297 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1298 | local unsigned syncsearch(unsigned FAR * have,unsigned char FAR *  buf,unsigned len) | 
|  |  |  | 1299 | #else | 
|  | 
|  |  | -+ | 1304 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1325 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1326 | EXPORT_C int  inflateSync_r (z_streamp strm) | 
|  |  |  | 1327 | #else | 
|  | 
|  |  | -+ | 1330 | #endif //__SYMBIAN32__ | 
|  | 
| 1299 | inflateReset(strm); | <> | 1366 | inflateReset_r(strm); | 
|  | 
|  |  | -+ | 1380 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1381 | EXPORT_C  int inflateSyncPoint_r (z_streamp strm) | 
|  |  |  | 1382 | #else | 
|  | 
|  |  | -+ | 1385 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1395 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1396 | EXPORT_C int inflateCopy_r(z_streamp dest, z_streamp source) | 
|  |  |  | 1397 | #else | 
|  | 
|  |  | -+ | 1401 | #endif //__SYMBIAN32__ | 
   
|  |  | -+ | 1 | /* Portions Copyright (c)  Symbian Software Ltd 2007.  All rights reserved. */ | 
|  | 
| 1 | /* trees.c -- output deflated data using Huffman coding | <> | 3 | /* trees.cpp -- output deflated data using Huffman coding | 
|  | 
| 128 |  | <> | 130 | #ifndef SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 140 | #else | 
|  | 
|  |  | -+ | 142 | local const static_tree_desc  static_l_desc = | 
|  |  |  | 143 | {static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; | 
|  | 
|  |  | -+ | 145 | local const static_tree_desc  static_d_desc = | 
|  |  |  | 146 | {static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS}; | 
|  | 
|  |  | -+ | 148 | local const static_tree_desc  static_bl_desc = | 
|  |  |  | 149 | {(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS}; | 
|  | 
|  |  | -+ | 151 | #endif //SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 208 | #ifdef __SYMBIAN32__ | 
|  |  |  | 209 | local void send_bits(deflate_state * s, int value,int  length) | 
|  |  |  | 210 | #else | 
|  | 
|  |  | -+ | 215 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 401 | #ifdef __SYMBIAN32__ | 
|  |  |  | 402 | void _tr_init(   deflate_state * s) | 
|  |  |  | 403 | #else | 
|  | 
|  |  | -+ | 406 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 434 | #ifdef __SYMBIAN32__ | 
|  |  |  | 435 | local void init_block(    deflate_state * s) | 
|  |  |  | 436 | #else | 
|  | 
|  |  | -+ | 439 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 482 | #ifdef __SYMBIAN32__ | 
|  |  |  | 483 | local void pqdownheap(  deflate_state * s,ct_data *  tree,int k) | 
|  |  |  | 484 | #else | 
|  | 
|  |  | -+ | 489 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 521 | #ifdef __SYMBIAN32__ | 
|  |  |  | 522 | local void gen_bitlen(    deflate_state * s,     tree_desc * desc) | 
|  |  |  | 523 | #else | 
|  | 
|  |  | -+ | 527 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 612 | #ifdef __SYMBIAN32__ | 
|  |  |  | 613 | local void gen_codes (    ct_data * tree, int max_code,    ushf *  bl_count) | 
|  |  |  | 614 | #else | 
|  | 
|  |  | -+ | 619 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 658 | #ifdef __SYMBIAN32__ | 
|  |  |  | 659 | local void build_tree(    deflate_state * s,    tree_desc *  desc) | 
|  |  |  | 660 | #else | 
|  | 
|  |  | -+ | 664 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 750 | #ifdef __SYMBIAN32__ | 
|  |  |  | 751 | local void scan_tree (   deflate_state * s,   ct_data *  tree,int  max_code) | 
|  |  |  | 752 | #else | 
|  | 
|  |  | -+ | 757 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 799 | #ifdef __SYMBIAN32__ | 
|  |  |  | 800 | local void send_tree (    deflate_state * s,    ct_data *  tree, int max_code) | 
|  |  |  | 801 | #else | 
|  | 
|  |  | -+ | 806 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 854 | #ifdef __SYMBIAN32__ | 
|  |  |  | 855 | local int build_bl_tree(  deflate_state * s) | 
|  |  |  | 856 | #else | 
|  | 
|  |  | -+ | 859 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 893 | #ifdef __SYMBIAN32__ | 
|  |  |  | 894 | local void send_all_trees(   deflate_state * s, int lcodes, int dcodes, int blcodes) | 
|  |  |  | 895 | #else | 
|  | 
|  |  | -+ | 899 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 926 | #ifdef __SYMBIAN32__ | 
|  |  |  | 927 | void _tr_stored_block(   deflate_state * s,    charf *  buf,ulg  stored_len, int eof) | 
|  |  |  | 928 | #else | 
|  | 
|  |  | -+ | 934 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 955 | #ifdef __SYMBIAN32__ | 
|  |  |  | 956 | void _tr_align(    deflate_state * s) | 
|  |  |  | 957 | #else | 
|  | 
|  |  | -+ | 960 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 988 | #ifdef __SYMBIAN32__ | 
|  |  |  | 989 | void _tr_flush_block(  deflate_state * s,    charf *  buf,ulg  stored_len,int  eof) | 
|  |  |  | 990 | #else | 
|  | 
|  |  | -+ | 996 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1093 | #ifndef SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 1095 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1096 | int _tr_tally (   deflate_state * s,unsigned  dist,unsigned  lc) | 
|  |  |  | 1097 | #else | 
|  | 
|  |  | -+ | 1102 | #endif //__SYMBIAN32__ | 
|  | 
| 1068 |  | <> | 1145 | #endif //SYMBIAN_EZLIB_DEVICE | 
|  | 
|  |  | -+ | 1149 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1150 | local void compress_block(  deflate_state * s,    ct_data *  ltree,     ct_data * dtree) | 
|  |  |  | 1151 | #else | 
|  | 
|  |  | -+ | 1156 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1207 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1208 | local void set_data_type(    deflate_state * s) | 
|  |  |  | 1209 | #else | 
|  | 
|  |  | -+ | 1212 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1231 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1232 | local unsigned bi_reverse(unsigned code,int  len) | 
|  |  |  | 1233 | #else | 
|  | 
|  |  | -+ | 1237 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1250 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1251 | local void bi_flush(  deflate_state * s) | 
|  |  |  | 1252 | #else | 
|  | 
|  |  | -+ | 1255 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1271 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1272 | local void bi_windup(    deflate_state * s) | 
|  |  |  | 1273 | #else | 
|  | 
|  |  | -+ | 1276 | #endif //__SYMBIAN32__ | 
|  | 
|  |  | -+ | 1294 | #ifdef __SYMBIAN32__ | 
|  |  |  | 1295 | local void copy_block(    deflate_state * s,    charf    * buf,unsigned  len,int  header) | 
|  |  |  | 1296 | #else | 
|  | 
|  |  | -+ | 1302 | #endif //__SYMBIAN32__ |