MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / deflateEnd

Function deflateEnd

zlib/deflate.c:859–887  ·  view source on GitHub ↗

========================================================================= */

(strm)

Source from the content-addressed store, hash-verified

857
858/* ========================================================================= */
859int ZEXPORT deflateEnd (strm)
860 z_streamp strm;
861{
862 int status;
863
864 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
865
866 status = strm->state->status;
867 if (status != INIT_STATE &&
868 status != EXTRA_STATE &&
869 status != NAME_STATE &&
870 status != COMMENT_STATE &&
871 status != HCRC_STATE &&
872 status != BUSY_STATE &&
873 status != FINISH_STATE) {
874 return Z_STREAM_ERROR;
875 }
876
877 /* Deallocate in reverse order of allocations: */
878 TRY_FREE(strm, strm->state->pending_buf);
879 TRY_FREE(strm, strm->state->head);
880 TRY_FREE(strm, strm->state->prev);
881 TRY_FREE(strm, strm->state->window);
882
883 ZFREE(strm, strm->state);
884 strm->state = Z_NULL;
885
886 return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
887}
888
889/* =========================================================================
890 * Copy the source state to the destination state.

Callers 5

CompressFunction · 0.85
destroyFunction · 0.85
compress2Function · 0.85
deflateInit2_Function · 0.85
deflateCopyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected