diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2014-11-06 15:35:10 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2014-11-06 15:35:13 +0100 |
commit | a167416289a8aef5d4c35861c9f4181f87b8bfd0 (patch) | |
tree | cfb0b940141a4273ac6ddb58070e36ea706b7358 /minzip/Zip.h | |
parent | 2.8.2.0 (diff) | |
parent | Use more aggressive sync writing to applypatch. (diff) | |
download | android_bootable_recovery-a167416289a8aef5d4c35861c9f4181f87b8bfd0.tar android_bootable_recovery-a167416289a8aef5d4c35861c9f4181f87b8bfd0.tar.gz android_bootable_recovery-a167416289a8aef5d4c35861c9f4181f87b8bfd0.tar.bz2 android_bootable_recovery-a167416289a8aef5d4c35861c9f4181f87b8bfd0.tar.lz android_bootable_recovery-a167416289a8aef5d4c35861c9f4181f87b8bfd0.tar.xz android_bootable_recovery-a167416289a8aef5d4c35861c9f4181f87b8bfd0.tar.zst android_bootable_recovery-a167416289a8aef5d4c35861c9f4181f87b8bfd0.zip |
Diffstat (limited to 'minzip/Zip.h')
-rw-r--r-- | minzip/Zip.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/minzip/Zip.h b/minzip/Zip.h index c94282827..2054b38a4 100644 --- a/minzip/Zip.h +++ b/minzip/Zip.h @@ -46,11 +46,11 @@ typedef struct ZipEntry { * One Zip archive. Treat as opaque. */ typedef struct ZipArchive { - int fd; - unsigned int numEntries; - ZipEntry* pEntries; - HashTable* pHash; // maps file name to ZipEntry - MemMapping map; + unsigned int numEntries; + ZipEntry* pEntries; + HashTable* pHash; // maps file name to ZipEntry + unsigned char* addr; + size_t length; } ZipArchive; /* @@ -68,7 +68,7 @@ typedef struct { * On success, returns 0 and populates "pArchive". Returns nonzero errno * value on failure. */ -int mzOpenZipArchive(const char* fileName, ZipArchive* pArchive); +int mzOpenZipArchive(unsigned char* addr, size_t length, ZipArchive* pArchive); /* * Close archive, releasing resources associated with it. @@ -183,6 +183,17 @@ bool mzExtractZipEntryToBuffer(const ZipArchive *pArchive, const ZipEntry *pEntry, unsigned char* buffer); /* + * Return a pointer and length for a given entry. The returned region + * should be valid until pArchive is closed, and should be treated as + * read-only. + * + * Only makes sense for entries which are stored (ie, not compressed). + * No guarantees are made regarding alignment of the returned pointer. + */ +bool mzGetStoredEntry(const ZipArchive *pArchive, + const ZipEntry* pEntry, unsigned char **addr, size_t *length); + +/* * Inflate all entries under zipDir to the directory specified by * targetDir, which must exist and be a writable directory. * |