| 636 | } |
| 637 | |
| 638 | bool zlib_stream::unzip_begin(bool have_zlib_header /* = true */, |
| 639 | int wsize /* = 15 */) |
| 640 | { |
| 641 | #ifdef HAS_ZLIB |
| 642 | # if defined(ACL_CPP_DLL) || defined(HAS_ZLIB_DLL) |
| 643 | if (__inflateInit2 == NULL) { |
| 644 | logger_warn("__inflateInit2 null, zlib maybe not loaded yet"); |
| 645 | return false; |
| 646 | } |
| 647 | # endif |
| 648 | #endif |
| 649 | zlib_flags_ = zlib_flags_unzip_begin; |
| 650 | finished_ = false; |
| 651 | is_compress_ = false; |
| 652 | |
| 653 | #ifdef COSMOCC |
| 654 | int ret = __inflateInit2(zstream_, have_zlib_header ? wsize : -wsize); |
| 655 | #else |
| 656 | int ret = __inflateInit2(zstream_, have_zlib_header ? |
| 657 | wsize : -wsize, ZLIB_VERSION, sizeof(z_stream)); |
| 658 | #endif |
| 659 | if (ret != Z_OK) { |
| 660 | logger_error("inflateInit error"); |
| 661 | return (false); |
| 662 | } |
| 663 | return true; |
| 664 | } |
| 665 | |
| 666 | bool zlib_stream::unzip_update(const char* in, int len, string* out, |
| 667 | zlib_flush_t flag /* = zlib_flush_off */) |
no outgoing calls