Home | History | Annotate | Download | only in minzip

Lines Matching defs: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 > pArchive->length) {
387 addEntryToHashTable(pArchive->pHash, pEntry);
390 //dumpEntry(pEntry);
491 bool mzIsZipEntrySymlink(const ZipEntry* pEntry)
493 if ((pEntry->versionMadeBy & 0xff00) == CENVEM_UNIX) {
494 return S_ISLNK(pEntry->externalFileAttributes >> 16);
502 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction,
505 return processFunction(pArchive->addr + pEntry->offset, pEntry->uncompLen, cookie);
509 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction,
519 compRemaining = pEntry->compLen;
528 zstream.next_in = pArchive->addr + pEntry->offset;
529 zstream.avail_in = pEntry->compLen;
586 if (result != pEntry->uncompLen) {
589 result, pEntry->uncompLen);
606 const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction,
612 switch (pEntry->compression) {
614 ret = processStoredEntry(pArchive, pEntry, processFunction, cookie);
617 ret = processDeflatedEntry(pArchive, pEntry, processFunction, cookie);
621 pEntry->compression, pEntry->fileName);
639 bool mzIsZipEntryIntact(const ZipArchive *pArchive, const ZipEntry *pEntry)
645 ret = mzProcessZipEntryContents(pArchive, pEntry, crcProcessFunction,
651 if (crc != (unsigned long)pEntry->crc32) {
653 pEntry->fileNameLen, pEntry->fileName, crc, pEntry->crc32);
680 bool mzReadZipEntry(const ZipArchive* pArchive, const ZipEntry* pEntry,
688 ret = mzProcessZipEntryContents(pArchive, pEntry, copyProcessFunction,
726 * Uncompress "pEntry" in "pArchive" to "fd" at the current offset.
729 const ZipEntry *pEntry, int fd)
731 bool ret = mzProcessZipEntryContents(pArchive, pEntry, writeProcessFunction,
744 const ZipEntry *pEntry, unsigned char **addr, size_t *length)
746 if (pEntry->compression != STORED) {
748 pEntry->fileName);
752 *addr = pArchive->addr + pEntry->offset;
753 *length = pEntry->uncompLen;
774 * Uncompress "pEntry" in "pArchive" to buffer, which must be large
775 * enough to hold mzGetZipEntryUncomplen(pEntry) bytes.
778 const ZipEntry *pEntry, unsigned char *buffer)
782 bec.len = mzGetZipEntryUncompLen(pEntry);
784 bool ret = mzProcessZipEntryContents(pArchive, pEntry,
809 static const char *targetEntryPath(MzPathHelper *helper, ZipEntry *pEntry)
817 pEntry->fileNameLen - helper->zipDirLen + 1;
846 memcpy(epath, pEntry->fileName + helper->zipDirLen,
847 pEntry->fileNameLen - helper->zipDirLen);
848 epath += pEntry->fileNameLen - helper->zipDirLen;
934 ZipEntry *pEntry = pArchive->pEntries + i;
935 if (pEntry->fileNameLen < zipDirLen) {
955 if (strncmp(pEntry->fileName, zpath, zipDirLen) != 0) {
972 const char *targetFile = targetEntryPath(&helper, pEntry);
975 pEntry->fileNameLen, pEntry->fileName);
991 if (pEntry->fileName[pEntry->fileNameLen-1] == '/') {
1019 if (!(flags & MZ_EXTRACT_FILES_ONLY) && mzIsZipEntrySymlink(pEntry)) {
1024 if (pEntry->uncompLen == 0) {
1030 char *linkTarget = malloc(pEntry->uncompLen + 1);
1035 ok = mzReadZipEntry(pArchive, pEntry, linkTarget,
1036 pEntry->uncompLen);
1043 linkTarget[pEntry->uncompLen] = '\0';
1085 bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd);