| 1773 | } |
| 1774 | |
| 1775 | ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, size_t bufsize) { |
| 1776 | mz_zip_archive *pzip = NULL; |
| 1777 | |
| 1778 | if (!zip) { |
| 1779 | // zip_t handler is not initialized |
| 1780 | return (ssize_t)ZIP_ENOINIT; |
| 1781 | } |
| 1782 | |
| 1783 | pzip = &(zip->archive); |
| 1784 | if (pzip->m_zip_mode != MZ_ZIP_MODE_READING || |
| 1785 | zip->entry.index < (ssize_t)0) { |
| 1786 | // the entry is not found or we do not have read access |
| 1787 | return (ssize_t)ZIP_ENOENT; |
| 1788 | } |
| 1789 | |
| 1790 | if (!mz_zip_reader_extract_to_mem_no_alloc(pzip, (mz_uint)zip->entry.index, |
| 1791 | buf, bufsize, 0, NULL, 0)) { |
| 1792 | return (ssize_t)ZIP_EMEMNOALLOC; |
| 1793 | } |
| 1794 | |
| 1795 | return (ssize_t)zip->entry.uncomp_size; |
| 1796 | } |
| 1797 | |
| 1798 | ssize_t zip_entry_noallocreadwithoffset(struct zip_t *zip, size_t offset, |
| 1799 | size_t size, void *buf) { |
no test coverage detected