Home | History | Annotate | Download | only in minzip

Lines Matching full:pentry

91 static void dumpEntry(const ZipEntry* pEntry)
93 LOGI(" %p '%.*s'\n", pEntry->fileName,pEntry->fileNameLen,pEntry->fileName);
94 LOGI(" off=%ld comp=%ld uncomp=%ld how=%d\n", pEntry->offset,
95 pEntry->compLen, pEntry->uncompLen, pEntry->compression);
146 static void addEntryToHashTable(HashTable* pHash, ZipEntry* pEntry)
148 unsigned int itemHash = computeHash(pEntry->fileName, pEntry->fileNameLen);
152 itemHash, pEntry, hashcmpZipEntry, true);
153 if (found != pEntry) {
250 ZipEntry* pEntry;
323 pEntry = &pArchive->pEntries[target];
325 pEntry = &pArchive->pEntries[0];
328 pEntry = &pArchive->pEntries[i];
334 pEntry->fileNameLen = fileNameLen;
335 pEntry->fileName = fileName;
337 pEntry->compLen = get4LE(ptr + CENSIZ);
338 pEntry->uncompLen = get4LE(ptr + CENLEN);
339 pEntry->compression = get2LE(ptr + CENHOW);
340 pEntry->modTime = get4LE(ptr + CENTIM);
341 pEntry->crc32 = get4LE(ptr + CENCRC);
345 pEntry->versionMadeBy = get2LE(ptr + CENVEM);
346 if ((pEntry->versionMadeBy & 0xff00) != 0 &&
347 (pEntry->versionMadeBy & 0xff00) != CENVEM_UNIX)
350 pEntry->versionMadeBy >> 8, i);
353 pEntry->externalFileAttributes = get4LE(ptr + CENATX);
371 pEntry->offset = localHdrOffset + LOCHDR
373 if (!safe_add(NULL, pEntry->offset, pEntry->compLen)) {
377 if ((size_t)pEntry->offset + pEntry->compLen > pMap->length) {
387 addEntryToHashTable(pArchive->pHash, pEntry);
390 //dumpEntry(pEntry);
517 bool mzIsZipEntrySymlink(const ZipEntry* pEntry)
519 if ((pEntry->versionMadeBy & 0xff00) == CENVEM_UNIX) {
520 return S_ISLNK(pEntry->externalFileAttributes >> 16);
528 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction,
531 size_t bytesLeft = pEntry->compLen;
557 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction,
567 compRemaining = pEntry->compLen;
653 if (result != pEntry->uncompLen) {
656 result, pEntry->uncompLen);
673 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction,
683 lseek(pArchive->fd, pEntry->offset, SEEK_SET);
685 switch (pEntry->compression) {
687 ret = processStoredEntry(pArchive, pEntry, processFunction, cookie);
690 ret = processDeflatedEntry(pArchive, pEntry, processFunction, cookie);
694 pEntry->compression, pEntry->fileName);
714 bool mzIsZipEntryIntact(const ZipArchive *pArchive, const ZipEntry *pEntry)
720 ret = mzProcessZipEntryContents(pArchive, pEntry, crcProcessFunction,
726 if (crc != (unsigned long)pEntry->crc32) {
728 pEntry->fileNameLen, pEntry->fileName, crc, pEntry->crc32);
755 bool mzReadZipEntry(const ZipArchive* pArchive, const ZipEntry* pEntry,
763 ret = mzProcessZipEntryContents(pArchive, pEntry, copyProcessFunction,
799 * Uncompress "pEntry" in "pArchive" to "fd" at the current offset.
802 const ZipEntry *pEntry, int fd)
804 bool ret = mzProcessZipEntryContents(pArchive, pEntry, writeProcessFunction,
830 * Uncompress "pEntry" in "pArchive" to buffer, which must be large
831 * enough to hold mzGetZipEntryUncomplen(pEntry) bytes.
834 const ZipEntry *pEntry, unsigned char *buffer)
838 bec.len = mzGetZipEntryUncompLen(pEntry);
840 bool ret = mzProcessZipEntryContents(pArchive, pEntry,
865 static const char *targetEntryPath(MzPathHelper *helper, ZipEntry *pEntry)
873 pEntry->fileNameLen - helper->zipDirLen + 1;
902 memcpy(epath, pEntry->fileName + helper->zipDirLen,
903 pEntry->fileNameLen - helper->zipDirLen);
904 epath += pEntry->fileNameLen - helper->zipDirLen;
988 ZipEntry *pEntry = pArchive->pEntries + i;
989 if (pEntry->fileNameLen < zipDirLen) {
1009 if (strncmp(pEntry->fileName, zpath, zipDirLen) != 0) {
1026 const char *targetFile = targetEntryPath(&helper, pEntry);
1029 pEntry->fileNameLen, pEntry->fileName);
1045 if (pEntry->fileName[pEntry->fileNameLen-1] == '/') {
1073 if (!(flags & MZ_EXTRACT_FILES_ONLY) && mzIsZipEntrySymlink(pEntry)) {
1078 if (pEntry->uncompLen == 0) {
1084 char *linkTarget = malloc(pEntry->uncompLen + 1);
1089 ok = mzReadZipEntry(pArchive, pEntry, linkTarget,
1090 pEntry->uncompLen);
1097 linkTarget[pEntry->uncompLen] = '\0';
1124 bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd);