Lines Matching refs: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) in addEntryToHashTable() argument
148 unsigned int itemHash = computeHash(pEntry->fileName, pEntry->fileNameLen); in addEntryToHashTable()
152 itemHash, pEntry, hashcmpZipEntry, true); in addEntryToHashTable()
153 if (found != pEntry) { in addEntryToHashTable()
250 ZipEntry* pEntry; in parseZipArchive() local
323 pEntry = &pArchive->pEntries[target]; in parseZipArchive()
325 pEntry = &pArchive->pEntries[0]; in parseZipArchive()
328 pEntry = &pArchive->pEntries[i]; in parseZipArchive()
334 pEntry->fileNameLen = fileNameLen; in parseZipArchive()
335 pEntry->fileName = fileName; in parseZipArchive()
337 pEntry->compLen = get4LE(ptr + CENSIZ); in parseZipArchive()
338 pEntry->uncompLen = get4LE(ptr + CENLEN); in parseZipArchive()
339 pEntry->compression = get2LE(ptr + CENHOW); in parseZipArchive()
340 pEntry->modTime = get4LE(ptr + CENTIM); in parseZipArchive()
341 pEntry->crc32 = get4LE(ptr + CENCRC); in parseZipArchive()
345 pEntry->versionMadeBy = get2LE(ptr + CENVEM); in parseZipArchive()
346 if ((pEntry->versionMadeBy & 0xff00) != 0 && in parseZipArchive()
347 (pEntry->versionMadeBy & 0xff00) != CENVEM_UNIX) { in parseZipArchive()
349 pEntry->versionMadeBy >> 8, i); in parseZipArchive()
352 pEntry->externalFileAttributes = get4LE(ptr + CENATX); in parseZipArchive()
370 pEntry->offset = localHdrOffset + LOCHDR in parseZipArchive()
372 if (!safe_add(NULL, pEntry->offset, pEntry->compLen)) { in parseZipArchive()
376 if ((size_t)pEntry->offset + pEntry->compLen > pMap->length) { in parseZipArchive()
386 addEntryToHashTable(pArchive->pHash, pEntry); in parseZipArchive()
516 bool mzIsZipEntrySymlink(const ZipEntry* pEntry) in mzIsZipEntrySymlink() argument
518 if ((pEntry->versionMadeBy & 0xff00) == CENVEM_UNIX) { in mzIsZipEntrySymlink()
519 return S_ISLNK(pEntry->externalFileAttributes >> 16); in mzIsZipEntrySymlink()
527 … const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction, in processStoredEntry() argument
530 size_t bytesLeft = pEntry->compLen; in processStoredEntry()
556 … const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction, in processDeflatedEntry() argument
566 compRemaining = pEntry->compLen; in processDeflatedEntry()
651 if (result != pEntry->uncompLen) { in processDeflatedEntry()
654 result, pEntry->uncompLen); in processDeflatedEntry()
671 … const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction, in mzProcessZipEntryContents() argument
681 lseek(pArchive->fd, pEntry->offset, SEEK_SET); in mzProcessZipEntryContents()
683 switch (pEntry->compression) { in mzProcessZipEntryContents()
685 ret = processStoredEntry(pArchive, pEntry, processFunction, cookie); in mzProcessZipEntryContents()
688 ret = processDeflatedEntry(pArchive, pEntry, processFunction, cookie); in mzProcessZipEntryContents()
692 pEntry->compression, pEntry->fileName); in mzProcessZipEntryContents()
712 bool mzIsZipEntryIntact(const ZipArchive *pArchive, const ZipEntry *pEntry) in mzIsZipEntryIntact() argument
718 ret = mzProcessZipEntryContents(pArchive, pEntry, crcProcessFunction, in mzIsZipEntryIntact()
724 if (crc != (unsigned long)pEntry->crc32) { in mzIsZipEntryIntact()
726 pEntry->fileNameLen, pEntry->fileName, crc, pEntry->crc32); in mzIsZipEntryIntact()
753 bool mzReadZipEntry(const ZipArchive* pArchive, const ZipEntry* pEntry, in mzReadZipEntry() argument
761 ret = mzProcessZipEntryContents(pArchive, pEntry, copyProcessFunction, in mzReadZipEntry()
800 const ZipEntry *pEntry, int fd) in mzExtractZipEntryToFile() argument
802 bool ret = mzProcessZipEntryContents(pArchive, pEntry, writeProcessFunction, in mzExtractZipEntryToFile()
833 const ZipEntry *pEntry, unsigned char *buffer) in mzExtractZipEntryToBuffer() argument
837 bec.len = mzGetZipEntryUncompLen(pEntry); in mzExtractZipEntryToBuffer()
839 bool ret = mzProcessZipEntryContents(pArchive, pEntry, in mzExtractZipEntryToBuffer()
864 static const char *targetEntryPath(MzPathHelper *helper, ZipEntry *pEntry) in targetEntryPath() argument
872 pEntry->fileNameLen - helper->zipDirLen + 1; in targetEntryPath()
901 memcpy(epath, pEntry->fileName + helper->zipDirLen, in targetEntryPath()
902 pEntry->fileNameLen - helper->zipDirLen); in targetEntryPath()
903 epath += pEntry->fileNameLen - helper->zipDirLen; in targetEntryPath()
987 ZipEntry *pEntry = pArchive->pEntries + i; in mzExtractRecursive() local
988 if (pEntry->fileNameLen < zipDirLen) { in mzExtractRecursive()
1008 if (strncmp(pEntry->fileName, zpath, zipDirLen) != 0) { in mzExtractRecursive()
1025 const char *targetFile = targetEntryPath(&helper, pEntry); in mzExtractRecursive()
1028 pEntry->fileNameLen, pEntry->fileName); in mzExtractRecursive()
1044 if (pEntry->fileName[pEntry->fileNameLen - 1] == '/') { in mzExtractRecursive()
1072 if (!(flags & MZ_EXTRACT_FILES_ONLY) && mzIsZipEntrySymlink(pEntry)) { in mzExtractRecursive()
1077 if (pEntry->uncompLen == 0) { in mzExtractRecursive()
1083 char *linkTarget = malloc(pEntry->uncompLen + 1); in mzExtractRecursive()
1088 ok = mzReadZipEntry(pArchive, pEntry, linkTarget, in mzExtractRecursive()
1089 pEntry->uncompLen); in mzExtractRecursive()
1096 linkTarget[pEntry->uncompLen] = '\0'; in mzExtractRecursive()
1123 bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd); in mzExtractRecursive()