| 5551 | } |
| 5552 | |
| 5553 | mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, |
| 5554 | size_t size_to_reserve_at_beginning, |
| 5555 | size_t initial_allocation_size) { |
| 5556 | pZip->m_pWrite = mz_zip_heap_write_func; |
| 5557 | pZip->m_pIO_opaque = pZip; |
| 5558 | if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning)) |
| 5559 | return MZ_FALSE; |
| 5560 | if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, |
| 5561 | size_to_reserve_at_beginning))) { |
| 5562 | if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc( |
| 5563 | pZip->m_pAlloc_opaque, 1, initial_allocation_size))) { |
| 5564 | mz_zip_writer_end(pZip); |
| 5565 | return MZ_FALSE; |
| 5566 | } |
| 5567 | pZip->m_pState->m_mem_capacity = initial_allocation_size; |
| 5568 | } |
| 5569 | return MZ_TRUE; |
| 5570 | } |
| 5571 | |
| 5572 | #ifndef MINIZ_NO_STDIO |
| 5573 | static size_t mz_zip_file_write_func(void *pOpaque, mz_uint64 file_ofs, |
nothing calls this directly
no test coverage detected