| 3847 | } |
| 3848 | |
| 3849 | tdefl_status tdefl_init(tdefl_compressor *d, |
| 3850 | tdefl_put_buf_func_ptr pPut_buf_func, |
| 3851 | void *pPut_buf_user, int flags) { |
| 3852 | d->m_pPut_buf_func = pPut_buf_func; |
| 3853 | d->m_pPut_buf_user = pPut_buf_user; |
| 3854 | d->m_flags = (mz_uint)(flags); |
| 3855 | d->m_max_probes[0] = 1 + ((flags & 0xFFF) + 2) / 3; |
| 3856 | d->m_greedy_parsing = (flags & TDEFL_GREEDY_PARSING_FLAG) != 0; |
| 3857 | d->m_max_probes[1] = 1 + (((flags & 0xFFF) >> 2) + 2) / 3; |
| 3858 | if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG)) |
| 3859 | MZ_CLEAR_OBJ(d->m_hash); |
| 3860 | d->m_lookahead_pos = d->m_lookahead_size = d->m_dict_size = |
| 3861 | d->m_total_lz_bytes = d->m_lz_code_buf_dict_pos = d->m_bits_in = 0; |
| 3862 | d->m_output_flush_ofs = d->m_output_flush_remaining = d->m_finished = |
| 3863 | d->m_block_index = d->m_bit_buffer = d->m_wants_to_finish = 0; |
| 3864 | d->m_pLZ_code_buf = d->m_lz_code_buf + 1; |
| 3865 | d->m_pLZ_flags = d->m_lz_code_buf; |
| 3866 | d->m_num_flags_left = 8; |
| 3867 | d->m_pOutput_buf = d->m_output_buf; |
| 3868 | d->m_pOutput_buf_end = d->m_output_buf; |
| 3869 | d->m_prev_return_status = TDEFL_STATUS_OKAY; |
| 3870 | d->m_saved_match_dist = d->m_saved_match_len = d->m_saved_lit = 0; |
| 3871 | d->m_adler32 = 1; |
| 3872 | d->m_pIn_buf = NULL; |
| 3873 | d->m_pOut_buf = NULL; |
| 3874 | d->m_pIn_buf_size = NULL; |
| 3875 | d->m_pOut_buf_size = NULL; |
| 3876 | d->m_flush = TDEFL_NO_FLUSH; |
| 3877 | d->m_pSrc = NULL; |
| 3878 | d->m_src_buf_left = 0; |
| 3879 | d->m_out_buf_ofs = 0; |
| 3880 | memset(&d->m_huff_count[0][0], 0, |
| 3881 | sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0); |
| 3882 | memset(&d->m_huff_count[1][0], 0, |
| 3883 | sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1); |
| 3884 | return TDEFL_STATUS_OKAY; |
| 3885 | } |
| 3886 | |
| 3887 | tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d) { |
| 3888 | return d->m_prev_return_status; |
no outgoing calls
no test coverage detected