Lines Matching refs:pState

2239   inflate_state *pState;
2249 pState = (inflate_state *)pStream->state;
2250 if (pState->m_window_bits > 0) decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER;
2253 first_call = pState->m_first_call;
2254 pState->m_first_call = 0;
2255 if (pState->m_last_status < 0) return MZ_DATA_ERROR;
2257 if (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
2258 pState->m_has_flushed |= (flush == MZ_FINISH);
2266 status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes,
2269 pState->m_last_status = status;
2273 pStream->adler = tinfl_get_adler32(&pState->m_decomp);
2281 pState->m_last_status = TINFL_STATUS_FAILED;
2289 if (pState->m_dict_avail) {
2290 n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
2291 memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
2295 pState->m_dict_avail -= n;
2296 pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
2297 return ((pState->m_last_status == TINFL_STATUS_DONE) &&
2298 (!pState->m_dict_avail))
2305 out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs;
2308 &pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict,
2309 pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags);
2310 pState->m_last_status = status;
2315 pStream->adler = tinfl_get_adler32(&pState->m_decomp);
2317 pState->m_dict_avail = (mz_uint)out_bytes;
2319 n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
2320 memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
2324 pState->m_dict_avail -= n;
2325 pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
2339 return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
2346 (!pStream->avail_out) || (pState->m_dict_avail))
2350 return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail))
4994 mz_zip_internal_state *pState = pZip->m_pState;
4995 const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets;
4996 const mz_zip_array *pCentral_dir = &pState->m_central_dir;
4998 &pState->m_sorted_central_dir_offsets, mz_uint32, 0);
5391 mz_zip_internal_state *pState = pZip->m_pState;
5392 const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets;
5393 const mz_zip_array *pCentral_dir = &pState->m_central_dir;
5395 &pState->m_sorted_central_dir_offsets, mz_uint32, 0);
5894 mz_zip_internal_state *pState = pZip->m_pState;
5896 mz_zip_array_clear(pZip, &pState->m_central_dir);
5897 mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
5898 mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);
5901 if (pState->m_pFile) {
5902 MZ_FCLOSE(pState->m_pFile);
5903 pState->m_pFile = NULL;
5907 pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
5979 mz_zip_internal_state *pState = pZip->m_pState;
5980 mz_uint64 new_size = MZ_MAX(file_ofs + n, pState->m_mem_size);
5989 if (new_size > pState->m_mem_capacity) {
5991 size_t new_capacity = MZ_MAX(64, pState->m_mem_capacity);
5994 pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity)))
5996 pState->m_pMem = pNew_block;
5997 pState->m_mem_capacity = new_capacity;
5999 memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n);
6000 pState->m_mem_size = (size_t)new_size;
6065 mz_zip_internal_state *pState;
6075 pState = pZip->m_pState;
6077 if (pState->m_pFile) {
6087 (pState->m_pFile = MZ_FREOPEN(pFilename, "r+b", pState->m_pFile))) {
6088 // The mz_zip_archive is now in a bogus state because pState->m_pFile is
6094 } else if (pState->m_pMem) {
6098 pState->m_mem_capacity = pState->m_mem_size;
6130 mz_zip_writer_add_state *pState = (mz_zip_writer_add_state *)pUser;
6131 if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque,
6132 pState->m_cur_archive_file_ofs, pBuf,
6135 pState->m_cur_archive_file_ofs += len;
6136 pState->m_comp_size += len;
6193 mz_zip_internal_state *pState = pZip->m_pState;
6194 mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size;
6195 size_t orig_central_dir_size = pState->m_central_dir.m_size;
6200 (((mz_uint64)pState->m_central_dir.m_size +
6211 if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header,
6213 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename,
6215 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra,
6217 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment,
6219 (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets,
6222 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size,
6279 mz_zip_internal_state *pState;
6292 pState = pZip->m_pState;
6332 pZip, &pState->m_central_dir,
6334 (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1)))
6643 mz_zip_internal_state *pState;
6652 pState = pZip->m_pState;
6745 orig_central_dir_size = pState->m_central_dir.m_size;
6750 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_header,
6758 pZip, &pState->m_central_dir,
6760 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size,
6765 if (pState->m_central_dir.m_size > 0xFFFFFFFF) return MZ_FALSE;
6767 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1)) {
6768 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size,
6780 mz_zip_internal_state *pState;
6787 pState = pZip->m_pState;
6791 ((pZip->m_archive_size + pState->m_central_dir.m_size +
6800 central_dir_size = pState->m_central_dir.m_size;
6803 pState->m_central_dir.m_p,
6823 if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF)) return MZ_FALSE;
6846 mz_zip_internal_state *pState;
6853 pState = pZip->m_pState;
6855 mz_zip_array_clear(pZip, &pState->m_central_dir);
6856 mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
6857 mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);
6860 if (pState->m_pFile) {
6861 MZ_FCLOSE(pState->m_pFile);
6862 pState->m_pFile = NULL;
6866 if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem)) {
6867 pZip->m_pFree(pZip->m_pAlloc_opaque, pState->m_pMem);
6868 pState->m_pMem = NULL;
6871 pZip->m_pFree(pZip->m_pAlloc_opaque, pState);