| 4698 | } |
| 4699 | |
| 4700 | mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, |
| 4701 | size_t size, mz_uint32 flags) { |
| 4702 | if (!mz_zip_reader_init_internal(pZip, flags)) |
| 4703 | return MZ_FALSE; |
| 4704 | pZip->m_archive_size = size; |
| 4705 | pZip->m_pRead = mz_zip_mem_read_func; |
| 4706 | pZip->m_pIO_opaque = pZip; |
| 4707 | #ifdef __cplusplus |
| 4708 | pZip->m_pState->m_pMem = const_cast<void *>(pMem); |
| 4709 | #else |
| 4710 | pZip->m_pState->m_pMem = (void *)pMem; |
| 4711 | #endif |
| 4712 | pZip->m_pState->m_mem_size = size; |
| 4713 | if (!mz_zip_reader_read_central_dir(pZip, flags)) { |
| 4714 | mz_zip_reader_end(pZip); |
| 4715 | return MZ_FALSE; |
| 4716 | } |
| 4717 | return MZ_TRUE; |
| 4718 | } |
| 4719 | |
| 4720 | #ifndef MINIZ_NO_STDIO |
| 4721 | static size_t mz_zip_file_read_func(void *pOpaque, mz_uint64 file_ofs, |
nothing calls this directly
no test coverage detected