You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by ja...@apache.org on 2015/07/31 22:50:39 UTC
incubator-corinthia git commit: openDirectory is ready,
make test cases
Repository: incubator-corinthia
Updated Branches:
refs/heads/newZipExperiment ba684e00e -> 0a2dd7329
openDirectory is ready, make test cases
Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/0a2dd732
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/0a2dd732
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/0a2dd732
Branch: refs/heads/newZipExperiment
Commit: 0a2dd73295fc766eae04068a9bfb8d536e45e979
Parents: ba684e0
Author: jani <ja...@apache.org>
Authored: Fri Jul 31 22:50:22 2015 +0200
Committer: jani <ja...@apache.org>
Committed: Fri Jul 31 22:50:22 2015 +0200
----------------------------------------------------------------------
DocFormats/headers/DFPlatform.h | 10 +++++----
DocFormats/platform/src/Wrapper_zip.c | 36 +++++-------------------------
2 files changed, 12 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0a2dd732/DocFormats/headers/DFPlatform.h
----------------------------------------------------------------------
diff --git a/DocFormats/headers/DFPlatform.h b/DocFormats/headers/DFPlatform.h
index 5868073..50881d6 100644
--- a/DocFormats/headers/DFPlatform.h
+++ b/DocFormats/headers/DFPlatform.h
@@ -70,10 +70,12 @@ void DFInitOnce(DFOnce *once, DFOnceFunction fun);
// Zip functions
typedef struct {
- int compressedSize; // File size on disk
- int uncompressedSize; // Real file size
- int fileNameLength; // Length of filename
- char *fileName; // filename
+ int compressedSize; // File size on disk
+ int uncompressedSize; // Real file size
+ int compressionMethod; // Type of compression
+ long offset; // offset in file
+ int fileNameLength; // Length of filename
+ char *fileName; // filename
} DFextZipDirEntry;
typedef struct {
FILE *zipFile; // file handle to zip file
http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/0a2dd732/DocFormats/platform/src/Wrapper_zip.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/src/Wrapper_zip.c b/DocFormats/platform/src/Wrapper_zip.c
index eaaa73c..09cfb89 100644
--- a/DocFormats/platform/src/Wrapper_zip.c
+++ b/DocFormats/platform/src/Wrapper_zip.c
@@ -126,10 +126,12 @@ static int readDirectory(FILE *zipFile, DFextZipHandleP zipHandle)
return -1;
// Save global information
- zipDirEntry = zipHandle->zipFileEntries + (i * sizeof(zipDirEntry));
- zipDirEntry->compressedSize = recDir->compressedSize;
- zipDirEntry->fileNameLength = recDir->fileNameLength;
- zipDirEntry->uncompressedSize = recDir->uncompressedSize;
+ zipDirEntry = zipHandle->zipFileEntries + (i * sizeof(zipDirEntry));
+ zipDirEntry->compressedSize = recDir->compressedSize;
+ zipDirEntry->fileNameLength = recDir->fileNameLength;
+ zipDirEntry->uncompressedSize = recDir->uncompressedSize;
+ zipDirEntry->compressionMethod = recDir->compressionMethod;
+ zipDirEntry->offset = recDir->relativeOffsetOflocalHeader;
// Add filename
zipDirEntry->fileName = xmalloc(zipDirEntry->fileNameLength + 1);
@@ -148,32 +150,6 @@ static int readDirectory(FILE *zipFile, DFextZipHandleP zipHandle)
-static int buildDirectory(FILE *zipFile, DFextZipHandleP zipHandle, int zipDirSize, int zipDirOffset)
-{
-
-#if 0
- JZGlobalFileHeader fileHeader;
- JZFileHeader header;
- int i;
-
-
- for (i = 0; i<endRecord->numEntries; i++) {
-
- // Construct JZFileHeader from global file header
- memcpy(&header, &fileHeader.compressionMethod, sizeof(header));
- header.offset = fileHeader.relativeOffsetOflocalHeader;
-
- if (!callback(zip, i, &header, (char *)jzBuffer))
- break; // end if callback returns zero
- }
-
- return Z_OK;
-#endif
- return 0;
-}
-
-
-
DFextZipHandleP DFextZipOpen(const char *zipFilename) {
DFextZipHandleP zipHandle = xmalloc(sizeof(DFextZipHandle));