• Home
  • Raw
  • Download

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()
350 pEntry->versionMadeBy >> 8, i); in parseZipArchive()
353 pEntry->externalFileAttributes = get4LE(ptr + CENATX); in parseZipArchive()
371 pEntry->offset = localHdrOffset + LOCHDR in parseZipArchive()
373 if (!safe_add(NULL, pEntry->offset, pEntry->compLen)) { in parseZipArchive()
377 if ((size_t)pEntry->offset + pEntry->compLen > pMap->length) { in parseZipArchive()
387 addEntryToHashTable(pArchive->pHash, pEntry); in parseZipArchive()
517 bool mzIsZipEntrySymlink(const ZipEntry* pEntry) in mzIsZipEntrySymlink() argument
519 if ((pEntry->versionMadeBy & 0xff00) == CENVEM_UNIX) { in mzIsZipEntrySymlink()
520 return S_ISLNK(pEntry->externalFileAttributes >> 16); in mzIsZipEntrySymlink()
528 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction, in processStoredEntry() argument
531 size_t bytesLeft = pEntry->compLen; in processStoredEntry()
557 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction, in processDeflatedEntry() argument
567 compRemaining = pEntry->compLen; in processDeflatedEntry()
653 if (result != pEntry->uncompLen) { in processDeflatedEntry()
656 result, pEntry->uncompLen); in processDeflatedEntry()
673 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction, in mzProcessZipEntryContents() argument
683 lseek(pArchive->fd, pEntry->offset, SEEK_SET); in mzProcessZipEntryContents()
685 switch (pEntry->compression) { in mzProcessZipEntryContents()
687 ret = processStoredEntry(pArchive, pEntry, processFunction, cookie); in mzProcessZipEntryContents()
690 ret = processDeflatedEntry(pArchive, pEntry, processFunction, cookie); in mzProcessZipEntryContents()
694 pEntry->compression, pEntry->fileName); in mzProcessZipEntryContents()
714 bool mzIsZipEntryIntact(const ZipArchive *pArchive, const ZipEntry *pEntry) in mzIsZipEntryIntact() argument
720 ret = mzProcessZipEntryContents(pArchive, pEntry, crcProcessFunction, in mzIsZipEntryIntact()
726 if (crc != (unsigned long)pEntry->crc32) { in mzIsZipEntryIntact()
728 pEntry->fileNameLen, pEntry->fileName, crc, pEntry->crc32); in mzIsZipEntryIntact()
755 bool mzReadZipEntry(const ZipArchive* pArchive, const ZipEntry* pEntry, in mzReadZipEntry() argument
763 ret = mzProcessZipEntryContents(pArchive, pEntry, copyProcessFunction, in mzReadZipEntry()
802 const ZipEntry *pEntry, int fd) in mzExtractZipEntryToFile() argument
804 bool ret = mzProcessZipEntryContents(pArchive, pEntry, writeProcessFunction, in mzExtractZipEntryToFile()
834 const ZipEntry *pEntry, unsigned char *buffer) in mzExtractZipEntryToBuffer() argument
838 bec.len = mzGetZipEntryUncompLen(pEntry); in mzExtractZipEntryToBuffer()
840 bool ret = mzProcessZipEntryContents(pArchive, pEntry, in mzExtractZipEntryToBuffer()
865 static const char *targetEntryPath(MzPathHelper *helper, ZipEntry *pEntry) in targetEntryPath() argument
873 pEntry->fileNameLen - helper->zipDirLen + 1; in targetEntryPath()
902 memcpy(epath, pEntry->fileName + helper->zipDirLen, in targetEntryPath()
903 pEntry->fileNameLen - helper->zipDirLen); in targetEntryPath()
904 epath += pEntry->fileNameLen - helper->zipDirLen; in targetEntryPath()
988 ZipEntry *pEntry = pArchive->pEntries + i; in mzExtractRecursive() local
989 if (pEntry->fileNameLen < zipDirLen) { in mzExtractRecursive()
1009 if (strncmp(pEntry->fileName, zpath, zipDirLen) != 0) { in mzExtractRecursive()
1026 const char *targetFile = targetEntryPath(&helper, pEntry); in mzExtractRecursive()
1029 pEntry->fileNameLen, pEntry->fileName); in mzExtractRecursive()
1045 if (pEntry->fileName[pEntry->fileNameLen-1] == '/') { in mzExtractRecursive()
1073 if (!(flags & MZ_EXTRACT_FILES_ONLY) && mzIsZipEntrySymlink(pEntry)) { in mzExtractRecursive()
1078 if (pEntry->uncompLen == 0) { in mzExtractRecursive()
1084 char *linkTarget = malloc(pEntry->uncompLen + 1); in mzExtractRecursive()
1089 ok = mzReadZipEntry(pArchive, pEntry, linkTarget, in mzExtractRecursive()
1090 pEntry->uncompLen); in mzExtractRecursive()
1097 linkTarget[pEntry->uncompLen] = '\0'; in mzExtractRecursive()
1124 bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd); in mzExtractRecursive()