diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/XlsxReaderWriter.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/XlsxReaderWriter.xcscheme index b5d0731..f4dbcfb 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/XlsxReaderWriter.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/XlsxReaderWriter.xcscheme @@ -20,6 +20,20 @@ ReferencedContainer = "container:"> + + + + + + + + -#else -#import -#endif - -#import -#import - -#import "CollectingDelegate.h" -#import "CancelDelegate.h" -#import "ProgressDelegate.h" - -@interface SSZipArchiveTests : XCTestCase -@end - -@interface NSString (SSZipArchive) -- (NSString *)_sanitizedPath; -@end - -@implementation SSZipArchiveTests - -int twentyMB = 20 * 1024 * 1024; - -- (void)setUp { - [super setUp]; -} - -- (void)tearDown { - [super tearDown]; - [[NSFileManager defaultManager] removeItemAtPath:[self _cachesPath:nil] error:nil]; -} - - -- (void)testZipping { - // use extracted files from [-testUnzipping] - [self testUnzipping]; - - NSString *inputPath = [self _cachesPath:@"Regular"]; - NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"], - [inputPath stringByAppendingPathComponent:@"LICENSE"]]; - - NSString *outputPath = [self _cachesPath:@"Zipped"]; - - NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"]; - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths]; - - XCTAssertTrue(success, @"create zip failure"); - // TODO: Make sure the files are actually zipped. They are, but the test should be better. - XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created"); - - BOOL protected = [SSZipArchive isFilePasswordProtectedAtPath:archivePath]; - XCTAssertFalse(protected, @"has no password"); -} - - -- (void)testZippingWithPassword { - // use extracted files from [-testUnzipping] - [self testUnzipping]; - - NSString *inputPath = [self _cachesPath:@"Regular"]; - NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"], - [inputPath stringByAppendingPathComponent:@"LICENSE"]]; - - NSString *outputPath = [self _cachesPath:@"Zipped"]; - - NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"]; - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths withPassword:@"dolphins🐋"]; - - XCTAssertTrue(success, @"create zip failure"); - // TODO: Make sure the files are actually zipped. They are, but the test should be better. - XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created"); - - BOOL protected = [SSZipArchive isFilePasswordProtectedAtPath:archivePath]; - XCTAssertTrue(protected, @"has password"); -} - - -- (void)testZippingWithZeroLengthPassword { - // use extracted files from [-testUnzipping] - [self testUnzipping]; - - NSString *inputPath = [self _cachesPath:@"Regular"]; - NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"], - [inputPath stringByAppendingPathComponent:@"LICENSE"]]; - - NSString *outputPath = [self _cachesPath:@"Zipped"]; - - NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"]; - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths withPassword:@""]; - - XCTAssertTrue(success, @"create zip failure"); - // TODO: Make sure the files are actually zipped. They are, but the test should be better. - XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created"); - - BOOL protected = [SSZipArchive isFilePasswordProtectedAtPath:archivePath]; - XCTAssertTrue(protected, @"has password"); -} - - -- (void)testDirectoryZipping { - // use Unicode as folder (has a file in root and a file in subfolder) - [self testUnzippingWithUnicodeFilenameInside]; - NSString *inputPath = [self _cachesPath:@"Unicode"]; - - NSString *outputPath = [self _cachesPath:@"FolderZipped"]; - NSString *archivePath = [outputPath stringByAppendingPathComponent:@"ArchiveWithFolders.zip"]; - - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withContentsOfDirectory:inputPath]; - XCTAssertTrue(success, @"create zip failure"); - XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Folder Archive created"); -} - -- (void)testMultipleZippping{ - NSArray *inputPaths = @[[[NSBundle bundleForClass: [self class]]pathForResource:@"0" ofType:@"m4a"], - [[NSBundle bundleForClass: [self class]]pathForResource:@"1" ofType:@"m4a"], - [[NSBundle bundleForClass: [self class]]pathForResource:@"2" ofType:@"m4a"], - [[NSBundle bundleForClass: [self class]]pathForResource:@"3" ofType:@"m4a"], - [[NSBundle bundleForClass: [self class]]pathForResource:@"4" ofType:@"m4a"], - [[NSBundle bundleForClass: [self class]]pathForResource:@"5" ofType:@"m4a"], - [[NSBundle bundleForClass: [self class]]pathForResource:@"6" ofType:@"m4a"], - [[NSBundle bundleForClass: [self class]]pathForResource:@"7" ofType:@"m4a"] - ]; - NSString *outputPath = [self _cachesPath:@"Zipped"]; - - // this is a monster - // if testing on iOS, within 30 loops it will fail; however, on OS X, it may take about 900 loops - for (int test = 0; test < 20; test++) - { - // Zipping - NSString *archivePath = [outputPath stringByAppendingPathComponent:[NSString stringWithFormat:@"queue_test_%d.zip", test]]; - - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths]; - XCTAssertTrue(success, @"create zip failure"); - - long long threshold = 510000; // 510kB:size slightly smaller than a successful zip, but much larger than a failed one - long long fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil][NSFileSize] longLongValue]; - XCTAssertTrue(fileSize > threshold, @"zipping failed at %@!", archivePath); - } -} - -- (void)testUnzipping { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Regular"]; - - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped"); - - testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped"); -} - -- (void)testSmallFileUnzipping { - NSString *zipPath = [[NSBundle bundleForClass: [self class]] pathForResource:@"TestArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Regular"]; - - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped"); - - testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped"); -} - --(void)testAppendingToZip { - // zip files and create "CreatedArchive.zip" - [self testZipping]; - - NSString *outputPath = [self _cachesPath:@"Zipped"]; - NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"]; - long long initialFileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:NULL][NSFileSize] longLongValue]; - - SSZipArchive* zip = [[SSZipArchive alloc] initWithPath:archivePath]; - - BOOL didOpenForAppending = [zip openForAppending]; - XCTAssertTrue(didOpenForAppending, @"Opened for appending"); - - NSData* testData = [@"test contents" dataUsingEncoding:NSUTF8StringEncoding]; - BOOL didAppendFile = [zip writeData:testData filename:@"testData.txt" withPassword:NULL]; - XCTAssertTrue(didAppendFile, @"Did add file"); - - BOOL didClose = [zip close]; - XCTAssertTrue(didClose, @"Can close zip"); - - // TODO: Make sure the files are actually zipped. They are, but the test should be better. - XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created"); - - long long fileSizeAfterAppend = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:NULL][NSFileSize] longLongValue]; - XCTAssertGreaterThan(fileSizeAfterAppend, initialFileSize); -} - -- (void)testUnzippingProgress { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Progress"]; - - ProgressDelegate *delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - // 4 events: the first, then for each of the two files one, then the final event - XCTAssertTrue(4 == [delegate->progressEvents count], @"Expected 4 progress events"); - XCTAssertTrue(0 == [delegate->progressEvents[0] intValue]); - XCTAssertTrue(619 == [delegate->progressEvents[1] intValue]); - XCTAssertTrue(1114 == [delegate->progressEvents[2] intValue]); - XCTAssertTrue(1436 == [delegate->progressEvents[3] intValue]); -} - - -- (void)testUnzippingWithPassword { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Password"]; - - NSError *error = nil; - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd" error:&error delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped"); - - testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped"); -} - -- (void)testUnzippingWithAESPassword { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestAESPasswordArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Password"]; - - NSError *error = nil; - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd" error:&error delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *testPath = [outputPath stringByAppendingPathComponent:@"README.md"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped"); - - testPath = [outputPath stringByAppendingPathComponent:@"LICENSE.txt"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped"); -} - -- (void)testUnzippingWithInvalidPassword { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Password"]; - - NSError *error = nil; - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:@"passw0rd123" error:&error delegate:delegate]; - XCTAssertFalse(success, @"unzip failure"); - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"]; - XCTAssertFalse([fileManager fileExistsAtPath:testPath], @"Readme not unzipped"); - - testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"]; - XCTAssertFalse([fileManager fileExistsAtPath:testPath], @"LICENSE not unzipped"); -} - - -- (void)testIsPasswordInvalidForArchiveAtPath { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"]; - - NSError *error = nil; - - BOOL fileHasValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd" error:&error]; - - XCTAssertTrue(fileHasValidPassword, @"Valid password reports false."); - - BOOL fileHasInvalidValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd123" error:&error]; - - XCTAssertFalse(fileHasInvalidValidPassword, @"Invalid password reports true."); -} - -- (void)testIsFilePasswordProtectedAtPath { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"]; - - BOOL protected = [SSZipArchive isFilePasswordProtectedAtPath:zipPath]; - XCTAssertFalse(protected, @"has no password"); - - - NSString *zipWithPasswordPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"]; - - protected = [SSZipArchive isFilePasswordProtectedAtPath:zipWithPasswordPath]; - XCTAssertTrue(protected, @"has password"); -} - -- (void)testZippingAndUnzippingWithUnicodePassword { - - /********** Zipping ********/ - - // use extracted files from [-testUnzipping] - [self testUnzipping]; - NSString *inputPath = [self _cachesPath:@"Regular"]; - NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"], - [inputPath stringByAppendingPathComponent:@"LICENSE"]]; - - NSString *outputPath = [self _cachesPath:@"Zipped"]; - - NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedUnicodePasswordArchive.zip"]; - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths withPassword:@"ꊐ⌒Ⅳ🤐"]; - - XCTAssertTrue(success, @"create zip failure"); - XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created"); - - /********** Unzipping ********/ - - outputPath = [self _cachesPath:@"UnicodePassword"]; - - NSError *error = nil; - id delegate = [ProgressDelegate new]; - success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath overwrite:YES password:@"ꊐ⌒Ⅳ🤐" error:&error delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped"); - - testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"]; - XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped"); -} - - -- (void)testUnzippingTruncatedFileFix { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IncorrectHeaders" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"IncorrectHeaders"]; - - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSString *intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5"; - - NSString *filePath = [outputPath stringByAppendingPathComponent:@"IncorrectHeaders/Readme.txt"]; - NSData *data = [NSData dataWithContentsOfFile:filePath]; - - NSString *actualReadmeTxtMD5 = [self _calculateMD5Digest:data]; - XCTAssertTrue([actualReadmeTxtMD5 isEqualToString:intendedReadmeTxtMD5], @"Readme.txt MD5 digest should match original."); -} - - -- (void)testUnzippingWithSymlinkedFileInside { - - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"SymbolicLink"]; - - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSString *testSymlink = [outputPath stringByAppendingPathComponent:@"SymbolicLink/Xcode.app"]; - - NSError *error = nil; - NSDictionary *info = [[NSFileManager defaultManager] attributesOfItemAtPath: testSymlink error: &error]; - BOOL fileIsSymbolicLink = info[NSFileType] == NSFileTypeSymbolicLink; - XCTAssertTrue(fileIsSymbolicLink, @"Symbolic links should persist from the original archive to the outputted files."); -} - -- (void)testUnzippingWithRelativeSymlink { - - NSString *resourceName = @"RelativeSymbolicLink"; - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:resourceName ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:resourceName]; - - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - // Determine where the symlinks are - NSString *subfolderName = @"symlinks"; - NSString *testBasePath = [NSString pathWithComponents:@[outputPath]]; - NSString *testSymlinkFolder = [NSString pathWithComponents:@[testBasePath, subfolderName, @"folderSymlink"]]; - NSString *testSymlinkFile = [NSString pathWithComponents:@[testBasePath, subfolderName, @"fileSymlink"]]; - - NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:testSymlinkFile error: nil]; - BOOL fileIsSymbolicLink = fileAttributes[NSFileType] == NSFileTypeSymbolicLink; - XCTAssertTrue(fileIsSymbolicLink, @"Relative symbolic links should persist from the original archive to the outputted files."); - - NSDictionary *folderAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:testSymlinkFolder error: nil]; - BOOL folderIsSymbolicLink = folderAttributes[NSFileType] == NSFileTypeSymbolicLink; - XCTAssertTrue(folderIsSymbolicLink, @"Relative symbolic links should persist from the original archive to the outputted files."); -} - -- (void)testUnzippingWithUnicodeFilenameInside { - - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Unicode" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Unicode"]; - - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - bool unicodeFilenameWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Accént.txt"]]; - - bool unicodeFolderWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Fólder/Nothing.txt"]]; - - XCTAssertTrue(unicodeFilenameWasExtracted, @"Files with filenames in unicode should be extracted properly."); - XCTAssertTrue(unicodeFolderWasExtracted, @"Folders with names in unicode should be extracted propertly."); -} - -/// Issue #507 -- (void)testZippingWithUnicodeFilenameInside { - - NSString *workPath = [self _cachesPath:@"UnicodeZipping"]; - NSString *filePath = [workPath stringByAppendingPathComponent:@"17 What I’ve Been Looking For.pdf"]; - NSString *zipPath = [workPath stringByAppendingPathComponent:@"UnicodeZipping.zip"]; - [[NSFileManager defaultManager] createFileAtPath:filePath contents:nil attributes:nil]; - - BOOL success = [SSZipArchive createZipFileAtPath:zipPath withFilesAtPaths:@[filePath]]; - XCTAssertTrue(success, @"zip failure"); - - [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil]; - success = [SSZipArchive unzipFileAtPath:zipPath toDestination:workPath delegate:nil]; - XCTAssertTrue(success, @"unzip failure"); - - bool unicodeFilenameWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:filePath]; - XCTAssertTrue(unicodeFilenameWasExtracted, @"Files with filenames in unicode should be extracted properly."); -} - -- (void)testZippingEmptyArchive { - - NSString *inputPath = [self _cachesPath:@"Empty"]; - XCTAssert(![[NSFileManager defaultManager] enumeratorAtPath:inputPath].nextObject, @"The Empty cache folder should always be empty."); - NSString *outputPath = [self _cachesPath:@"Zipped"]; - NSString *zipPath = [outputPath stringByAppendingPathComponent:@"Empty.zip"]; - NSString *zipPath2 = [outputPath stringByAppendingPathComponent:@"EmptyWithParentDirectory.zip"]; - - BOOL success = [SSZipArchive createZipFileAtPath:zipPath withContentsOfDirectory:inputPath keepParentDirectory:NO]; - XCTAssertTrue(success, @"create zip failure"); - success = [SSZipArchive createZipFileAtPath:zipPath2 withContentsOfDirectory:inputPath keepParentDirectory:YES]; - XCTAssertTrue(success, @"create zip failure"); - long long fileSize = [[[NSFileManager defaultManager] attributesOfItemAtPath:zipPath error:nil][NSFileSize] longLongValue]; - long long fileSize2 = [[[NSFileManager defaultManager] attributesOfItemAtPath:zipPath2 error:nil][NSFileSize] longLongValue]; - XCTAssert(fileSize < fileSize2, @"keepParentDirectory should produce a strictly bigger archive."); -} - -- (void)testZippingAndUnzippingEmptyDirectoryWithPassword { - - NSString *inputPath = [self _cachesPath:@"Empty"]; - XCTAssert(![[NSFileManager defaultManager] enumeratorAtPath:inputPath].nextObject, @"The Empty cache folder should always be empty."); - NSString *outputPath = [self _cachesPath:@"Zipped"]; - NSString *zipPath = [outputPath stringByAppendingPathComponent:@"EmptyWithParentDirectory.zip"]; - - BOOL success = [SSZipArchive createZipFileAtPath:zipPath withContentsOfDirectory:inputPath keepParentDirectory:YES withPassword:@"password"]; - XCTAssertTrue(success, @"create zip failure"); - - outputPath = [self _cachesPath:@"EmptyDirectory"]; - - // unzipping a directory doesn't require a password - id delegate = [ProgressDelegate new]; - success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath overwrite:YES password:nil error:nil delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); -} - -- (void)testUnzippingEmptyArchive { - - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Empty" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Empty"]; - - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:nil]; - XCTAssertTrue(success, @"unzip failure"); -} - -- (void)testZippingAndUnzippingForDate { - - // use extracted files from [-testUnzipping] - [self testUnzipping]; - NSString *inputPath = [self _cachesPath:@"Regular"]; - NSArray *inputPaths = @[[inputPath stringByAppendingPathComponent:@"Readme.markdown"]]; - - NSDictionary *originalFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[inputPath stringByAppendingPathComponent:@"Readme.markdown"] error:nil]; - - NSString *outputPath = [self _cachesPath:@"ZippedDate"]; - NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"]; - - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths]; - XCTAssertTrue(success, @"create zip failure"); - id delegate = [ProgressDelegate new]; - success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSDictionary *createdFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[outputPath stringByAppendingPathComponent:@"Readme.markdown"] error:nil]; - - XCTAssertEqualObjects(originalFileAttributes[NSFileCreationDate], createdFileAttributes[@"NSFileCreationDate"], @"Original file creationDate should match created one"); -} - - -- (void)testZippingAndUnzippingForPermissions { - // File we're going to test permissions on before and after zipping - NSString *targetFile = @"/Contents/MacOS/TestProject"; - - - /********** Zipping ********/ - - // The .app file we're going to zip up - NSString *inputFile = [[NSBundle bundleForClass: [self class]] pathForResource:@"PermissionsTestApp" ofType:@"app"]; - - // The path to the target file in the app before zipping - NSString *targetFilePreZipPath = [inputFile stringByAppendingPathComponent:targetFile]; - - // Atribtues for the target file before zipping - NSDictionary *preZipAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:targetFilePreZipPath error:nil]; - - // Directory to output our created zip file - NSString *outputDir = [self _cachesPath:@"PermissionsTest"]; - // The path to where the archive shall be created - NSString *archivePath = [outputDir stringByAppendingPathComponent:@"TestAppArchive.zip"]; - - // Create the zip file using the contents of the .app file as the input - BOOL success = [SSZipArchive createZipFileAtPath:archivePath withContentsOfDirectory:inputFile]; - XCTAssertTrue(success, @"create zip failure"); - - /********** Un-zipping *******/ - - // Using this newly created zip file, unzip it - success = [SSZipArchive unzipFileAtPath:archivePath toDestination:outputDir]; - XCTAssertTrue(success, @"unzip failure"); - - // Get the path to the target file after unzipping - NSString *targetFilePath = [outputDir stringByAppendingPathComponent:@"/Contents/MacOS/TestProject"]; - - // Get the file attributes of the target file following the unzipping - NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:targetFilePath error:nil]; - - - NSInteger permissions = ((NSNumber *)fileAttributes[NSFilePosixPermissions]).longValue; - NSInteger preZipPermissions = ((NSNumber *)preZipAttributes[NSFilePosixPermissions]).longValue; - - // Compare the value of the permissions attribute to assert equality - XCTAssertEqual(permissions, preZipPermissions, @"File permissions should be retained during compression and de-compression"); -} - -- (void)testUnzippingWithCancel { - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Cancel1"]; - - CancelDelegate *delegate = [[CancelDelegate alloc] init]; - delegate.numFilesToUnzip = 1; - - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertFalse(success); - XCTAssertEqual(delegate.numFilesUnzipped, 1); - XCTAssertFalse(delegate.didUnzipArchive); - XCTAssertNotEqual(delegate.loaded, delegate.total); - - outputPath = [self _cachesPath:@"Cancel2"]; - - delegate = [[CancelDelegate alloc] init]; - delegate.numFilesToUnzip = 1000; - - success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - XCTAssertEqual(delegate.numFilesUnzipped, 2); - XCTAssertTrue(delegate.didUnzipArchive); - XCTAssertEqual(delegate.loaded, delegate.total); -} - -// Commented out to avoid checking in several gig file into the repository. Simply add a file named -// `LargeArchive.zip` to the project and uncomment out these lines to test. -// -//- (void)testUnzippingLargeFiles { -// NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"LargeArchive" ofType:@"zip"]; -// NSString *outputPath = [self _cachesPath:@"Large"]; -// -// BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath]; -// XCTAssertTrue(success, @"unzip failure"); -//} - --(void)testShouldProvidePathOfUnzippedFileInDelegateCallback { - CollectingDelegate *collector = [CollectingDelegate new]; - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Regular"]; - - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:collector]; - XCTAssertTrue(success, @"unzip failure"); - - XCTAssertEqualObjects(collector.files[0], [outputPath stringByAppendingString:@"/LICENSE"]); - XCTAssertEqualObjects(collector.files[1], [outputPath stringByAppendingString:@"/Readme.markdown"]); -} - -- (void)testUnzippingFileWithPathTraversalName { - - // This zip archive contains a file titled '../../../../../../../../../../..//tmp/test.txt'. SSZipArchive should - // ignore the path traversing and write the file to "tmp/test.txt" - NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"PathTraversal" ofType:@"zip"]; - NSString *outputPath = [self _cachesPath:@"Traversal"]; - - id delegate = [ProgressDelegate new]; - BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:delegate]; - XCTAssertTrue(success, @"unzip failure"); - - NSString *expectedFile = [outputPath stringByAppendingPathComponent:@"tmp/test.txt"]; - BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:expectedFile]; - - XCTAssertTrue(fileExists, @"Path traversal characters should not be followed when unarchiving a file"); -} - -- (void)testPathSanitation { - NSDictionary *tests = - @{ - // path traversal - @"../../../../../../../../../../../tmp/test.txt": @"tmp/test.txt", - // path traversal, Windows style - @"..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp\\test.txt": @"tmp/test.txt", - // relative path - @"a/b/../c.txt": @"a/c.txt", - // path traversal without slash - @"..": @"", - // permissions override - @"./": @"", - @".": @"", - // unicode and spaces in folder name and file name - @"example/../à: 𝚨 󌞑/你 好.txt": @"à: 𝚨 󌞑/你 好.txt", - // unicode that looks like '.' or '/' in ascii decomposition - @"a/ğ/../b": @"a/b", - @"a/⸮/b/.ⸯ/c/⼮./d": @"a/⸮/b/.ⸯ/c/⼮./d", - // scheme in name - @"file:a/../../../usr/bin": @"usr/bin", - }; - for (NSString *str in tests) { - //NSLog(@"%@", str); - XCTAssertTrue([tests[str] isEqualToString:[str _sanitizedPath]], @"Path should be sanitized for traversal"); - } -} - -// This tests whether the payload size of the zip file containing 4.8Gb of files with compression 0 is correct, -// and creates a zip file containing 240 20Mb sized files with multiple compression levels. It then unpacks the file and checks whether -// the same number of files is present in the unpacked folder. -- (void)testPayloadSizeCorrectAndUnpackFileNo { - long long int iterations = 240; - NSString *unpackPath = [self _cachesPath:@"Unpacked/testFile"]; - NSNumber *goldenSize = [NSNumber numberWithLongLong:iterations * twentyMB]; - NSData *data = [self get20MbNSData]; - NSString *filenName = @"TestFile.zip"; - NSString *filePath = [NSString stringWithFormat:@"%@%@", [self _cachesPath:@""], filenName]; - NSString *password = @"TestPW"; - - SSZipArchive *archive = [[SSZipArchive alloc] initWithPath:filePath]; - [archive open]; - - for (int i = 0; i < iterations; i++) { - NSString *fileName = [NSString stringWithFormat:@"File_%i", i]; - [archive writeData:data filename:fileName compressionLevel:0 password:password AES:true]; - } - - bool close = [archive close]; - - NSNumber *fileSize = [SSZipArchive payloadSizeForArchiveAtPath:filePath error:nil]; - - XCTAssertTrue(close, "Should be able to close the archive."); - XCTAssertTrue(fileSize.longLongValue == goldenSize.longLongValue, - "Payload size should be equal to the sum of the size of all files included."); - - [SSZipArchive unzipFileAtPath:filePath toDestination:unpackPath overwrite:true password:password error:nil]; - long int noFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:unpackPath error:nil].count; - - XCTAssertTrue(iterations == noFiles, "All files should be present in the exported directory"); -} - -//PR #560 -- (void)testSymlinkZippingWithFilesAtPaths { - NSString *outputDir = [self _cachesPath:@"ZippingSymlinkWithFilesAtPaths"]; - - //directory - NSString *directory = [outputDir stringByAppendingPathComponent:@"directory"]; - BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:NULL]; - XCTAssertTrue(success); - - //write real file - NSString *realFilePath = [directory stringByAppendingPathComponent:@"originfile"]; - success = [@"Hello World!" writeToFile:realFilePath atomically:NO encoding:NSUTF8StringEncoding error:NULL]; - XCTAssertTrue(success); - - //create symlink to real file - NSString *symlinkPath = [directory stringByAppendingPathComponent:@"linkfile"]; - success = [[NSFileManager defaultManager] createSymbolicLinkAtPath:symlinkPath withDestinationPath:realFilePath error:NULL]; - XCTAssertTrue(success); - - NSArray *files = @[realFilePath,symlinkPath]; - - //zipping - NSString *archivePath = [outputDir stringByAppendingPathComponent:@"SymlinkZippingWithFilesAtPaths.zip"]; - success = [SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:files withPassword:nil keepSymlinks:YES]; - XCTAssertTrue(success); - - //remove files in directory dir, to make sure what we check is unzipped - success = [[NSFileManager defaultManager] removeItemAtPath:directory error:NULL]; - XCTAssertTrue(success); - success = [[NSFileManager defaultManager] createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:NULL]; - XCTAssertTrue(success); - - //unzip - success = [SSZipArchive unzipFileAtPath:archivePath toDestination:directory]; - XCTAssertTrue(success); - - //check if it's still a symlink - NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:symlinkPath error:NULL]; - NSString *fileType = attr[NSFileType]; - XCTAssertTrue([fileType isEqualToString:NSFileTypeSymbolicLink]); - - //check symlink points correctly - NSString *realFilePathUnzip = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:symlinkPath error:NULL]; - XCTAssertEqualObjects(realFilePath, realFilePathUnzip); -} - -//PR #560 -- (void)testSymlinkZippingWithContentsOfDirectory { - NSString *outputDir = [self _cachesPath:@"ZippingSymlinkWithContentsOfDirectory"]; - - //directory - NSString *directory = [outputDir stringByAppendingPathComponent:@"directory"]; - BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:NULL]; - XCTAssertTrue(success); - - //write real file - NSString *realFilePath = [directory stringByAppendingPathComponent:@"origin"]; - success = [@"Hello World!" writeToFile:realFilePath atomically:NO encoding:NSUTF8StringEncoding error:NULL]; - XCTAssertTrue(success); - - //create symlink to real file - NSString *symlinkPath = [directory stringByAppendingPathComponent:@"link"]; - success = [[NSFileManager defaultManager] createSymbolicLinkAtPath:symlinkPath withDestinationPath:realFilePath error:NULL]; - XCTAssertTrue(success); - - //zipping - NSString *archivePath = [outputDir stringByAppendingPathComponent:@"SymlinkZippingWithContentsOfDirectory.zip"]; - success = [SSZipArchive createZipFileAtPath:archivePath - withContentsOfDirectory:directory - keepParentDirectory:NO - compressionLevel:-1 - password:nil - AES:YES - progressHandler:nil - keepSymlinks:YES]; - XCTAssertTrue(success); - - //remove files in directory dir, to make sure what we check is unzipped - success = [[NSFileManager defaultManager] removeItemAtPath:directory error:NULL]; - XCTAssertTrue(success); - success = [[NSFileManager defaultManager] createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:NULL]; - XCTAssertTrue(success); - - //unzip - success = [SSZipArchive unzipFileAtPath:archivePath toDestination:directory]; - XCTAssertTrue(success); - - //check if it's still a symlink - NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:symlinkPath error:NULL]; - NSString *fileType = attr[NSFileType]; - XCTAssertTrue([fileType isEqualToString:NSFileTypeSymbolicLink]); - - //check symlink points correctly - NSString *realFilePathUnzip = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:symlinkPath error:NULL]; - XCTAssertEqualObjects(realFilePath, realFilePathUnzip); -} - - - -#pragma mark - Private - -// Returns 20Mb of data --(NSData*)get20MbNSData { - NSMutableData* theData = [NSMutableData dataWithCapacity:twentyMB]; - for (long long int i = 0; i < twentyMB/4; i++) { - u_int32_t randomBits = arc4random(); - [theData appendBytes:(void *)&randomBits length:4]; - } - return theData; -} - - -- (NSString *)_cachesPath:(NSString *)directory { - NSString *path = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject - stringByAppendingPathComponent:@"com.samsoffes.ssziparchive.tests"]; - if (directory) { - path = [path stringByAppendingPathComponent:directory]; - } - - [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil]; - - return path; -} - - -// Taken from https://github.com/samsoffes/sstoolkit/blob/master/SSToolkit/NSData+SSToolkitAdditions.m -- (NSString *)_calculateMD5Digest:(NSData *)data { - unsigned char digest[CC_MD5_DIGEST_LENGTH], i; - CC_MD5(data.bytes, (unsigned int)data.length, digest); - NSMutableString *ms = [NSMutableString string]; - for (i = 0; i < CC_MD5_DIGEST_LENGTH; i++) { - [ms appendFormat: @"%02x", (int)(digest[i])]; - } - return [ms copy]; -} - -@end diff --git a/Carthage/Checkouts/ZipArchive/Example/Podfile.lock b/Carthage/Checkouts/ZipArchive/Example/Podfile.lock deleted file mode 100644 index b70281d..0000000 --- a/Carthage/Checkouts/ZipArchive/Example/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - SSZipArchive (2.4.1) - -DEPENDENCIES: - - SSZipArchive (from `..`) - -EXTERNAL SOURCES: - SSZipArchive: - :path: ".." - -SPEC CHECKSUMS: - SSZipArchive: 5232069783e7495861062b54ab3b7f8d4426bbb6 - -PODFILE CHECKSUM: d64f92b7d189c903da3c73a5a6841f4d9a98bde7 - -COCOAPODS: 1.10.1 diff --git a/Carthage/Checkouts/ZipArchive/README.md b/Carthage/Checkouts/ZipArchive/README.md deleted file mode 100644 index 737d21a..0000000 --- a/Carthage/Checkouts/ZipArchive/README.md +++ /dev/null @@ -1,88 +0,0 @@ -[![CI](https://github.com/ZipArchive/ZipArchive/workflows/CI/badge.svg)](https://github.com/ZipArchive/ZipArchive/actions?query=workflow%3ACI) - -# SSZipArchive - -ZipArchive is a simple utility class for zipping and unzipping files on iOS, macOS and tvOS. - -- Unzip zip files; -- Unzip password protected zip files; -- Unzip AES encrypted zip files; -- Create zip files; -- Create large (> 4.3Gb) files; -- Create password protected zip files; -- Create AES encrypted zip files; -- Choose compression level; -- Zip-up NSData instances. (with a filename) - -## Installation and Setup - -*The main release branch is configured to support Objective-C and Swift 3+.* - -SSZipArchive works on Xcode 7-11 and above, iOS 9-13 and above, tvOS 9 and above, macOS 10.9-10.15 and above, watchOS 2 and above. - -### CocoaPods -In your Podfile: -`pod 'SSZipArchive'` - -You should define your minimum deployment target explicitly, like: -`platform :ios, '9.0'` - -Recommended CocoaPods version should be at least CocoaPods 1.7.5. - -### SPM -Add a Swift Package reference to https://github.com/ZipArchive/ZipArchive.git (SSZipArchive 2.3.0 and higher or master) - -### Carthage -In your Cartfile: -`github "ZipArchive/ZipArchive"` - -Note: We are no longer releasing a Carthage pre-built package as of 2.2.3. Developers are encouraged to build one themselves. - -### Manual - -1. Add the `SSZipArchive` and `minizip` folders to your project. -2. Add the `libz` and `libiconv` libraries to your target. -3. Add the `Security` framework to your target. -4. Add the following GCC_PREPROCESSOR_DEFINITIONS: `HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB $(inherited)`. - -SSZipArchive requires ARC. - -## Usage - -### Objective-C - -```objective-c - -//Import "#import " for SPM/Carthage, and "#import " for CocoaPods. - -// Create -[SSZipArchive createZipFileAtPath:zipPath withContentsOfDirectory:sampleDataPath]; - -// Unzip -[SSZipArchive unzipFileAtPath:zipPath toDestination:unzipPath]; -``` - -### Swift - -```swift -//Import "import ZipArchive" for SPM/Carthage, and "import SSZipArchive" for CocoaPods. - -// Create -SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath) - -// Unzip -SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath) -``` - -## License - -SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [minizip-ng (formally minizip)](https://github.com/zlib-ng/minizip-ng) 3.0.2 is licensed under the [Zlib license](https://www.zlib.net/zlib_license.html). - -## Acknowledgments - -* Big thanks to *aish* for creating [ZipArchive](https://code.google.com/archive/p/ziparchive/). The project that inspired SSZipArchive. -* Thank you [@soffes](https://github.com/soffes) for the actual name of SSZipArchive. -* Thank you [@randomsequence](https://github.com/randomsequence) for implementing the creation support tech. -* Thank you [@johnezang](https://github.com/johnezang) for all his amazing help along the way. -* Thank you [@nmoinvaz](https://github.com/nmoinvaz) for minizip-ng (formally minizip), the core of ZipArchive. -* Thank you to [all the contributors](https://github.com/ZipArchive/ZipArchive/graphs/contributors). diff --git a/Carthage/Checkouts/ZipArchive/Release-Instructions.md b/Carthage/Checkouts/ZipArchive/Release-Instructions.md deleted file mode 100644 index 179fb46..0000000 --- a/Carthage/Checkouts/ZipArchive/Release-Instructions.md +++ /dev/null @@ -1,52 +0,0 @@ -# New ZipArchive release - -The following steps should be taken by project maintainers when they create a new release. - -1. Create a new release and tag for the release. - - - Tags should be in the form of vMajor.Minor.Revision - - - Release names should be more human readable: Version Major.Minor.Revision - -2. Update the podspec and test it - - - *pod lib lint SSZipArchive.podspec* - -3. Push the pod to the trunk - - - *pod trunk push SSZipArchive.podspec* - - -Note: We are no longer releasing a Carthage release as of 2.2.3. Developers are encouraged to build one themselves. - - -# Minizip-ng (formally minizip) update - -The following steps should be taken by project maintainers when they update minizip files. - -1. Source is at https://github.com/zlib-ng/minizip-ng. -2. Have cmake: -`brew install cmake` -3. Run cmake on minizip repo with our desired configuration: -`cmake . -DMZ_BZIP2=OFF -DMZ_LZMA=OFF` -4. Look at the file `./CMakeFiles/minizip.dir/DependInfo.cmake` it will give you the following information: -- The list of C files that we need to include. - -Note: It will suggest we include libcomp and that only works on macos 10.11 and up, so the .c and .h file should not be included until we bump the min os versions. - -5. Look at the file `./CMakeFiles/minizip.dir/flags.make` it will give you the following information: - -- The list of compiler flags that we need to include - -Note: These should not be changed unless you have issues compiling or we bump the min os versions. - -HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB - -With the exception of the last two: "MZ_ZIP_SIGNING" "_POSIX_C_SOURCE=200112L" - -With later version of minizip it will want to switch to libcomp it will suggest we include libcomp and that only works on macos 10.11 and up. - -6. Set those flags in SSZipArchive.podspec (for CocoaPods) and in ZipArchive.xcodeproj (for Carthage) -7. Replace the .h and .c files with the latest ones, except for `mz_compat.h`, which is customized to expose some struct in SSZipCommon.h and to provide support for optional aes. - -Note: we can also use `cmake -G Xcode . -DMZ_BZIP2=OFF -DMZ_LZMA=OFF` to get the list of files to include in an xcodeproj of its own, from where we can remove unneeded `zip.h` and `unzip.h`. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive.podspec b/Carthage/Checkouts/ZipArchive/SSZipArchive.podspec deleted file mode 100644 index c299931..0000000 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive.podspec +++ /dev/null @@ -1,20 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'SSZipArchive' - s.version = '2.4.2' - s.summary = 'Utility class for zipping and unzipping files on iOS, tvOS, watchOS, and macOS.' - s.description = 'SSZipArchive is a simple utility class for zipping and unzipping files on iOS, tvOS, watchOS, and macOS. It supports AES and PKWARE encryption.' - s.homepage = 'https://github.com/ZipArchive/ZipArchive' - s.license = { :type => 'MIT', :file => 'LICENSE.txt' } - s.authors = { 'Sam Soffes' => 'sam@soff.es', 'Joshua Hudson' => nil, 'Antoine Cœur' => nil } - s.source = { :git => 'https://github.com/ZipArchive/ZipArchive.git', :tag => "v#{s.version}" } - s.ios.deployment_target = '9.0' - s.tvos.deployment_target = '9.0' - s.osx.deployment_target = '10.9' - s.watchos.deployment_target = '2.0' - s.source_files = 'SSZipArchive/*.{m,h}', 'SSZipArchive/include/*.{m,h}', 'SSZipArchive/minizip/*.{c,h}' - s.public_header_files = 'SSZipArchive/*.h' - s.libraries = 'z', 'iconv' - s.framework = 'Security' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', - 'GCC_PREPROCESSOR_DEFINITIONS' => 'HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB' } -end diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/include/ZipArchive.h b/Carthage/Checkouts/ZipArchive/SSZipArchive/include/ZipArchive.h deleted file mode 100644 index e81fc9b..0000000 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/include/ZipArchive.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// ZipArchive.h -// ZipArchive -// -// Created by Serhii Mumriak on 12/1/15. -// - -#import - -//! Project version number for ZipArchive. -FOUNDATION_EXPORT double ZipArchiveVersionNumber; - -//! Project version string for ZipArchive. -FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - -// This is to account for the many different ways this library gets imported. -#if __has_include() -#import -#elif __has_include("../SSZipArchive.h") -#import "../SSZipArchive.h" -#else -#import "SSZipArchive.h" -#endif diff --git a/Carthage/Checkouts/ZipArchive/ZipArchive.xcodeproj/project.pbxproj b/Carthage/Checkouts/ZipArchive/ZipArchive.xcodeproj/project.pbxproj deleted file mode 100644 index 7273993..0000000 --- a/Carthage/Checkouts/ZipArchive/ZipArchive.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1067 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3775F3492276B14400A1840B /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3252276B14100A1840B /* mz_strm_pkcrypt.c */; }; - 3775F34A2276B14400A1840B /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3252276B14100A1840B /* mz_strm_pkcrypt.c */; }; - 3775F34B2276B14400A1840B /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3252276B14100A1840B /* mz_strm_pkcrypt.c */; }; - 3775F34C2276B14400A1840B /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3252276B14100A1840B /* mz_strm_pkcrypt.c */; }; - 3775F3552276B14400A1840B /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3282276B14100A1840B /* mz_compat.c */; }; - 3775F3562276B14400A1840B /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3282276B14100A1840B /* mz_compat.c */; }; - 3775F3572276B14400A1840B /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3282276B14100A1840B /* mz_compat.c */; }; - 3775F3582276B14400A1840B /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3282276B14100A1840B /* mz_compat.c */; }; - 3775F35D2276B14400A1840B /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32A2276B14100A1840B /* mz_strm_os.h */; }; - 3775F35E2276B14400A1840B /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32A2276B14100A1840B /* mz_strm_os.h */; }; - 3775F35F2276B14400A1840B /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32A2276B14100A1840B /* mz_strm_os.h */; }; - 3775F3602276B14400A1840B /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32A2276B14100A1840B /* mz_strm_os.h */; }; - 3775F3612276B14400A1840B /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32B2276B14200A1840B /* mz_os.c */; }; - 3775F3622276B14400A1840B /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32B2276B14200A1840B /* mz_os.c */; }; - 3775F3632276B14400A1840B /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32B2276B14200A1840B /* mz_os.c */; }; - 3775F3642276B14400A1840B /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32B2276B14200A1840B /* mz_os.c */; }; - 3775F3652276B14400A1840B /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32C2276B14200A1840B /* mz.h */; }; - 3775F3662276B14400A1840B /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32C2276B14200A1840B /* mz.h */; }; - 3775F3672276B14400A1840B /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32C2276B14200A1840B /* mz.h */; }; - 3775F3682276B14400A1840B /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32C2276B14200A1840B /* mz.h */; }; - 3775F36D2276B14400A1840B /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32E2276B14200A1840B /* mz_crypt.c */; }; - 3775F36E2276B14400A1840B /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32E2276B14200A1840B /* mz_crypt.c */; }; - 3775F36F2276B14400A1840B /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32E2276B14200A1840B /* mz_crypt.c */; }; - 3775F3702276B14400A1840B /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F32E2276B14200A1840B /* mz_crypt.c */; }; - 3775F3712276B14400A1840B /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32F2276B14200A1840B /* mz_os.h */; }; - 3775F3722276B14400A1840B /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32F2276B14200A1840B /* mz_os.h */; }; - 3775F3732276B14400A1840B /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32F2276B14200A1840B /* mz_os.h */; }; - 3775F3742276B14400A1840B /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F32F2276B14200A1840B /* mz_os.h */; }; - 3775F3792276B14400A1840B /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3312276B14200A1840B /* mz_strm_split.h */; }; - 3775F37A2276B14400A1840B /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3312276B14200A1840B /* mz_strm_split.h */; }; - 3775F37B2276B14400A1840B /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3312276B14200A1840B /* mz_strm_split.h */; }; - 3775F37C2276B14400A1840B /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3312276B14200A1840B /* mz_strm_split.h */; }; - 3775F37D2276B14400A1840B /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3322276B14200A1840B /* mz_strm_wzaes.h */; }; - 3775F37E2276B14400A1840B /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3322276B14200A1840B /* mz_strm_wzaes.h */; }; - 3775F37F2276B14400A1840B /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3322276B14200A1840B /* mz_strm_wzaes.h */; }; - 3775F3802276B14400A1840B /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3322276B14200A1840B /* mz_strm_wzaes.h */; }; - 3775F3812276B14400A1840B /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3332276B14200A1840B /* mz_zip_rw.c */; }; - 3775F3822276B14400A1840B /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3332276B14200A1840B /* mz_zip_rw.c */; }; - 3775F3832276B14400A1840B /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3332276B14200A1840B /* mz_zip_rw.c */; }; - 3775F3842276B14400A1840B /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3332276B14200A1840B /* mz_zip_rw.c */; }; - 3775F3852276B14400A1840B /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3342276B14200A1840B /* mz_strm_mem.c */; }; - 3775F3862276B14400A1840B /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3342276B14200A1840B /* mz_strm_mem.c */; }; - 3775F3872276B14400A1840B /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3342276B14200A1840B /* mz_strm_mem.c */; }; - 3775F3882276B14400A1840B /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3342276B14200A1840B /* mz_strm_mem.c */; }; - 3775F3892276B14400A1840B /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3352276B14200A1840B /* mz_strm_pkcrypt.h */; }; - 3775F38A2276B14400A1840B /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3352276B14200A1840B /* mz_strm_pkcrypt.h */; }; - 3775F38B2276B14400A1840B /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3352276B14200A1840B /* mz_strm_pkcrypt.h */; }; - 3775F38C2276B14400A1840B /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3352276B14200A1840B /* mz_strm_pkcrypt.h */; }; - 3775F38D2276B14400A1840B /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3362276B14200A1840B /* mz_strm_split.c */; }; - 3775F38E2276B14400A1840B /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3362276B14200A1840B /* mz_strm_split.c */; }; - 3775F38F2276B14400A1840B /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3362276B14200A1840B /* mz_strm_split.c */; }; - 3775F3902276B14400A1840B /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3362276B14200A1840B /* mz_strm_split.c */; }; - 3775F3912276B14400A1840B /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3372276B14200A1840B /* mz_compat.h */; }; - 3775F3922276B14400A1840B /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3372276B14200A1840B /* mz_compat.h */; }; - 3775F3932276B14400A1840B /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3372276B14200A1840B /* mz_compat.h */; }; - 3775F3942276B14400A1840B /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3372276B14200A1840B /* mz_compat.h */; }; - 3775F3952276B14400A1840B /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3382276B14200A1840B /* mz_zip_rw.h */; }; - 3775F3962276B14400A1840B /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3382276B14200A1840B /* mz_zip_rw.h */; }; - 3775F3972276B14400A1840B /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3382276B14200A1840B /* mz_zip_rw.h */; }; - 3775F3982276B14400A1840B /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3382276B14200A1840B /* mz_zip_rw.h */; }; - 3775F3992276B14400A1840B /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3392276B14200A1840B /* mz_strm_buf.c */; }; - 3775F39A2276B14400A1840B /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3392276B14200A1840B /* mz_strm_buf.c */; }; - 3775F39B2276B14400A1840B /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3392276B14200A1840B /* mz_strm_buf.c */; }; - 3775F39C2276B14400A1840B /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3392276B14200A1840B /* mz_strm_buf.c */; }; - 3775F39D2276B14400A1840B /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33A2276B14200A1840B /* mz_strm_zlib.c */; }; - 3775F39E2276B14400A1840B /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33A2276B14200A1840B /* mz_strm_zlib.c */; }; - 3775F39F2276B14400A1840B /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33A2276B14200A1840B /* mz_strm_zlib.c */; }; - 3775F3A02276B14400A1840B /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33A2276B14200A1840B /* mz_strm_zlib.c */; }; - 3775F3A12276B14400A1840B /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33B2276B14200A1840B /* mz_strm.h */; }; - 3775F3A22276B14400A1840B /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33B2276B14200A1840B /* mz_strm.h */; }; - 3775F3A32276B14400A1840B /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33B2276B14200A1840B /* mz_strm.h */; }; - 3775F3A42276B14400A1840B /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33B2276B14200A1840B /* mz_strm.h */; }; - 3775F3A52276B14400A1840B /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33C2276B14300A1840B /* mz_zip.c */; }; - 3775F3A62276B14400A1840B /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33C2276B14300A1840B /* mz_zip.c */; }; - 3775F3A72276B14400A1840B /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33C2276B14300A1840B /* mz_zip.c */; }; - 3775F3A82276B14400A1840B /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33C2276B14300A1840B /* mz_zip.c */; }; - 3775F3A92276B14400A1840B /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33D2276B14300A1840B /* mz_strm_buf.h */; }; - 3775F3AA2276B14400A1840B /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33D2276B14300A1840B /* mz_strm_buf.h */; }; - 3775F3AB2276B14400A1840B /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33D2276B14300A1840B /* mz_strm_buf.h */; }; - 3775F3AC2276B14400A1840B /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33D2276B14300A1840B /* mz_strm_buf.h */; }; - 3775F3AD2276B14400A1840B /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33E2276B14300A1840B /* mz_os_posix.c */; }; - 3775F3AE2276B14400A1840B /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33E2276B14300A1840B /* mz_os_posix.c */; }; - 3775F3AF2276B14400A1840B /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33E2276B14300A1840B /* mz_os_posix.c */; }; - 3775F3B02276B14400A1840B /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F33E2276B14300A1840B /* mz_os_posix.c */; }; - 3775F3B12276B14400A1840B /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33F2276B14300A1840B /* mz_crypt.h */; }; - 3775F3B22276B14400A1840B /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33F2276B14300A1840B /* mz_crypt.h */; }; - 3775F3B32276B14400A1840B /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33F2276B14300A1840B /* mz_crypt.h */; }; - 3775F3B42276B14400A1840B /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F33F2276B14300A1840B /* mz_crypt.h */; }; - 3775F3B92276B14400A1840B /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3412276B14300A1840B /* mz_zip.h */; }; - 3775F3BA2276B14400A1840B /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3412276B14300A1840B /* mz_zip.h */; }; - 3775F3BB2276B14400A1840B /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3412276B14300A1840B /* mz_zip.h */; }; - 3775F3BC2276B14400A1840B /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3412276B14300A1840B /* mz_zip.h */; }; - 3775F3BD2276B14400A1840B /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3422276B14300A1840B /* mz_strm_mem.h */; }; - 3775F3BE2276B14400A1840B /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3422276B14300A1840B /* mz_strm_mem.h */; }; - 3775F3BF2276B14400A1840B /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3422276B14300A1840B /* mz_strm_mem.h */; }; - 3775F3C02276B14400A1840B /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3422276B14300A1840B /* mz_strm_mem.h */; }; - 3775F3C12276B14400A1840B /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3432276B14300A1840B /* mz_strm_os_posix.c */; }; - 3775F3C22276B14400A1840B /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3432276B14300A1840B /* mz_strm_os_posix.c */; }; - 3775F3C32276B14400A1840B /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3432276B14300A1840B /* mz_strm_os_posix.c */; }; - 3775F3C42276B14400A1840B /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3432276B14300A1840B /* mz_strm_os_posix.c */; }; - 3775F3C92276B14400A1840B /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3452276B14300A1840B /* mz_strm_zlib.h */; }; - 3775F3CA2276B14400A1840B /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3452276B14300A1840B /* mz_strm_zlib.h */; }; - 3775F3CB2276B14400A1840B /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3452276B14300A1840B /* mz_strm_zlib.h */; }; - 3775F3CC2276B14400A1840B /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 3775F3452276B14300A1840B /* mz_strm_zlib.h */; }; - 3775F3CD2276B14400A1840B /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3462276B14300A1840B /* mz_strm.c */; }; - 3775F3CE2276B14400A1840B /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3462276B14300A1840B /* mz_strm.c */; }; - 3775F3CF2276B14400A1840B /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3462276B14300A1840B /* mz_strm.c */; }; - 3775F3D02276B14400A1840B /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3462276B14300A1840B /* mz_strm.c */; }; - 3775F3D52276B14400A1840B /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3482276B14400A1840B /* mz_strm_wzaes.c */; }; - 3775F3D62276B14400A1840B /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3482276B14400A1840B /* mz_strm_wzaes.c */; }; - 3775F3D72276B14400A1840B /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3482276B14400A1840B /* mz_strm_wzaes.c */; }; - 3775F3D82276B14400A1840B /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 3775F3482276B14400A1840B /* mz_strm_wzaes.c */; }; - 3775F4262276C5C100A1840B /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3775F4252276C5C100A1840B /* libiconv.tbd */; }; - 3775F4282276C5D500A1840B /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3775F4272276C5D500A1840B /* libz.tbd */; }; - 378439B2227ABC7B000BC165 /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 378439B1227ABC7B000BC165 /* mz_crypt_apple.c */; }; - 378439B3227ABC7B000BC165 /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 378439B1227ABC7B000BC165 /* mz_crypt_apple.c */; }; - 378439B4227ABC7B000BC165 /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 378439B1227ABC7B000BC165 /* mz_crypt_apple.c */; }; - 378439B5227ABC7B000BC165 /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 378439B1227ABC7B000BC165 /* mz_crypt_apple.c */; }; - 378439B7227ABD2B000BC165 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439B6227ABD2B000BC165 /* Security.framework */; }; - 378439BC227ABDC2000BC165 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439BB227ABDC2000BC165 /* Security.framework */; }; - 378439BE227ABDD0000BC165 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439BD227ABDD0000BC165 /* Security.framework */; }; - 378439C0227ABDDF000BC165 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439BF227ABDDF000BC165 /* Security.framework */; }; - 378439C2227ABFFE000BC165 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439C1227ABFFE000BC165 /* libiconv.tbd */; }; - 378439C4227AC006000BC165 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439C3227AC006000BC165 /* libz.tbd */; }; - 378439C6227AC017000BC165 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439C5227AC017000BC165 /* libiconv.tbd */; }; - 378439C8227AC01F000BC165 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439C7227AC01F000BC165 /* libz.tbd */; }; - 378439CA227AC02B000BC165 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439C9227AC02B000BC165 /* libiconv.tbd */; }; - 378439CC227AC031000BC165 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 378439CB227AC031000BC165 /* libz.tbd */; }; - 37952C321F63B6FB00DD6677 /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 37952C331F63B70000DD6677 /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; }; - 37952C341F63B71400DD6677 /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 37952C881F63BBD500DD6677 /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 37952C891F63BBDA00DD6677 /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; }; - 37952C8B1F63BBE400DD6677 /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 93CE5D5E227FE5C50003464F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CE5D5D227FE5C50003464F /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 93CE5D5F227FE5C50003464F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CE5D5D227FE5C50003464F /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 93CE5D60227FE5C50003464F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CE5D5D227FE5C50003464F /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 93CE5D61227FE5C50003464F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CE5D5D227FE5C50003464F /* SSZipCommon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AFF75A2D1C3727F000F450AC /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AFF75A2E1C37280200F450AC /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AFF75A2F1C37280200F450AC /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; }; - B423AE6B1C0DF7950004A2F1 /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE481C0DF7950004A2F1 /* SSZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B423AE6C1C0DF7950004A2F1 /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = B423AE491C0DF7950004A2F1 /* SSZipArchive.m */; }; - B423AE6D1C0DF7950004A2F1 /* ZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 3775F3252276B14100A1840B /* mz_strm_pkcrypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_pkcrypt.c; sourceTree = ""; }; - 3775F3282276B14100A1840B /* mz_compat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_compat.c; sourceTree = ""; }; - 3775F32A2276B14100A1840B /* mz_strm_os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_os.h; sourceTree = ""; }; - 3775F32B2276B14200A1840B /* mz_os.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_os.c; sourceTree = ""; }; - 3775F32C2276B14200A1840B /* mz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz.h; sourceTree = ""; }; - 3775F32E2276B14200A1840B /* mz_crypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_crypt.c; sourceTree = ""; }; - 3775F32F2276B14200A1840B /* mz_os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_os.h; sourceTree = ""; }; - 3775F3312276B14200A1840B /* mz_strm_split.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_split.h; sourceTree = ""; }; - 3775F3322276B14200A1840B /* mz_strm_wzaes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_wzaes.h; sourceTree = ""; }; - 3775F3332276B14200A1840B /* mz_zip_rw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_zip_rw.c; sourceTree = ""; }; - 3775F3342276B14200A1840B /* mz_strm_mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_mem.c; sourceTree = ""; }; - 3775F3352276B14200A1840B /* mz_strm_pkcrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_pkcrypt.h; sourceTree = ""; }; - 3775F3362276B14200A1840B /* mz_strm_split.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_split.c; sourceTree = ""; }; - 3775F3372276B14200A1840B /* mz_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_compat.h; sourceTree = ""; }; - 3775F3382276B14200A1840B /* mz_zip_rw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_zip_rw.h; sourceTree = ""; }; - 3775F3392276B14200A1840B /* mz_strm_buf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_buf.c; sourceTree = ""; }; - 3775F33A2276B14200A1840B /* mz_strm_zlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_zlib.c; sourceTree = ""; }; - 3775F33B2276B14200A1840B /* mz_strm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm.h; sourceTree = ""; }; - 3775F33C2276B14300A1840B /* mz_zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_zip.c; sourceTree = ""; }; - 3775F33D2276B14300A1840B /* mz_strm_buf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_buf.h; sourceTree = ""; }; - 3775F33E2276B14300A1840B /* mz_os_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_os_posix.c; sourceTree = ""; }; - 3775F33F2276B14300A1840B /* mz_crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_crypt.h; sourceTree = ""; }; - 3775F3412276B14300A1840B /* mz_zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_zip.h; sourceTree = ""; }; - 3775F3422276B14300A1840B /* mz_strm_mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_mem.h; sourceTree = ""; }; - 3775F3432276B14300A1840B /* mz_strm_os_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_os_posix.c; sourceTree = ""; }; - 3775F3452276B14300A1840B /* mz_strm_zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_zlib.h; sourceTree = ""; }; - 3775F3462276B14300A1840B /* mz_strm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm.c; sourceTree = ""; }; - 3775F3482276B14400A1840B /* mz_strm_wzaes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_wzaes.c; sourceTree = ""; }; - 3775F4252276C5C100A1840B /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; }; - 3775F4272276C5D500A1840B /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - 378439B1227ABC7B000BC165 /* mz_crypt_apple.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_crypt_apple.c; sourceTree = ""; }; - 378439B6227ABD2B000BC165 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS5.2.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; - 378439BB227ABDC2000BC165 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.2.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; - 378439BD227ABDD0000BC165 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; - 378439BF227ABDDF000BC165 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; - 378439C1227ABFFE000BC165 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; - 378439C3227AC006000BC165 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; - 378439C5227AC017000BC165 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.2.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; - 378439C7227AC01F000BC165 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.2.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; - 378439C9227AC02B000BC165 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS5.2.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; - 378439CB227AC031000BC165 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS5.2.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; - 37952C261F63B50D00DD6677 /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 37952C5E1F63BB7100DD6677 /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 93CE5D5D227FE5C50003464F /* SSZipCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipCommon.h; sourceTree = ""; }; - AFF75A241C37279600F450AC /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B423AE1A1C0DF76A0004A2F1 /* ZipArchive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZipArchive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B423AE3D1C0DF7950004A2F1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B423AE481C0DF7950004A2F1 /* SSZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipArchive.h; sourceTree = ""; }; - B423AE491C0DF7950004A2F1 /* SSZipArchive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSZipArchive.m; sourceTree = ""; }; - B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipArchive.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 37952C221F63B50D00DD6677 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 378439C6227AC017000BC165 /* libiconv.tbd in Frameworks */, - 378439C8227AC01F000BC165 /* libz.tbd in Frameworks */, - 378439BC227ABDC2000BC165 /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 37952C5A1F63BB7100DD6677 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 378439CA227AC02B000BC165 /* libiconv.tbd in Frameworks */, - 378439CC227AC031000BC165 /* libz.tbd in Frameworks */, - 378439B7227ABD2B000BC165 /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AFF75A201C37279600F450AC /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 378439C2227ABFFE000BC165 /* libiconv.tbd in Frameworks */, - 378439C4227AC006000BC165 /* libz.tbd in Frameworks */, - 378439BE227ABDD0000BC165 /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B423AE161C0DF76A0004A2F1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F4262276C5C100A1840B /* libiconv.tbd in Frameworks */, - 3775F4282276C5D500A1840B /* libz.tbd in Frameworks */, - 378439C0227ABDDF000BC165 /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3775F4242276C5C000A1840B /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3775F4252276C5C100A1840B /* libiconv.tbd */, - 378439C1227ABFFE000BC165 /* libiconv.tbd */, - 378439C5227AC017000BC165 /* libiconv.tbd */, - 378439C9227AC02B000BC165 /* libiconv.tbd */, - 3775F4272276C5D500A1840B /* libz.tbd */, - 378439C3227AC006000BC165 /* libz.tbd */, - 378439C7227AC01F000BC165 /* libz.tbd */, - 378439CB227AC031000BC165 /* libz.tbd */, - 378439BF227ABDDF000BC165 /* Security.framework */, - 378439BD227ABDD0000BC165 /* Security.framework */, - 378439BB227ABDC2000BC165 /* Security.framework */, - 378439B6227ABD2B000BC165 /* Security.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 579FC27523292ABA007FEA3C /* include */ = { - isa = PBXGroup; - children = ( - B423AE4A1C0DF7950004A2F1 /* ZipArchive.h */, - ); - path = include; - sourceTree = ""; - }; - B423AE101C0DF76A0004A2F1 = { - isa = PBXGroup; - children = ( - B423AE251C0DF7950004A2F1 /* SSZipArchive */, - 3775F4242276C5C000A1840B /* Frameworks */, - B423AE1B1C0DF76A0004A2F1 /* Products */, - ); - sourceTree = ""; - }; - B423AE1B1C0DF76A0004A2F1 /* Products */ = { - isa = PBXGroup; - children = ( - B423AE1A1C0DF76A0004A2F1 /* ZipArchive.framework */, - AFF75A241C37279600F450AC /* ZipArchive.framework */, - 37952C261F63B50D00DD6677 /* ZipArchive.framework */, - 37952C5E1F63BB7100DD6677 /* ZipArchive.framework */, - ); - name = Products; - sourceTree = ""; - }; - B423AE251C0DF7950004A2F1 /* SSZipArchive */ = { - isa = PBXGroup; - children = ( - B423AE481C0DF7950004A2F1 /* SSZipArchive.h */, - 93CE5D5D227FE5C50003464F /* SSZipCommon.h */, - B423AE491C0DF7950004A2F1 /* SSZipArchive.m */, - B423AE3D1C0DF7950004A2F1 /* Info.plist */, - 579FC27523292ABA007FEA3C /* include */, - B423AE3E1C0DF7950004A2F1 /* minizip */, - ); - path = SSZipArchive; - sourceTree = ""; - }; - B423AE3E1C0DF7950004A2F1 /* minizip */ = { - isa = PBXGroup; - children = ( - 3775F3282276B14100A1840B /* mz_compat.c */, - 3775F3372276B14200A1840B /* mz_compat.h */, - 378439B1227ABC7B000BC165 /* mz_crypt_apple.c */, - 3775F32E2276B14200A1840B /* mz_crypt.c */, - 3775F33F2276B14300A1840B /* mz_crypt.h */, - 3775F33E2276B14300A1840B /* mz_os_posix.c */, - 3775F32B2276B14200A1840B /* mz_os.c */, - 3775F32F2276B14200A1840B /* mz_os.h */, - 3775F3392276B14200A1840B /* mz_strm_buf.c */, - 3775F33D2276B14300A1840B /* mz_strm_buf.h */, - 3775F3342276B14200A1840B /* mz_strm_mem.c */, - 3775F3422276B14300A1840B /* mz_strm_mem.h */, - 3775F3432276B14300A1840B /* mz_strm_os_posix.c */, - 3775F32A2276B14100A1840B /* mz_strm_os.h */, - 3775F3252276B14100A1840B /* mz_strm_pkcrypt.c */, - 3775F3352276B14200A1840B /* mz_strm_pkcrypt.h */, - 3775F3362276B14200A1840B /* mz_strm_split.c */, - 3775F3312276B14200A1840B /* mz_strm_split.h */, - 3775F3482276B14400A1840B /* mz_strm_wzaes.c */, - 3775F3322276B14200A1840B /* mz_strm_wzaes.h */, - 3775F33A2276B14200A1840B /* mz_strm_zlib.c */, - 3775F3452276B14300A1840B /* mz_strm_zlib.h */, - 3775F3462276B14300A1840B /* mz_strm.c */, - 3775F33B2276B14200A1840B /* mz_strm.h */, - 3775F3332276B14200A1840B /* mz_zip_rw.c */, - 3775F3382276B14200A1840B /* mz_zip_rw.h */, - 3775F33C2276B14300A1840B /* mz_zip.c */, - 3775F3412276B14300A1840B /* mz_zip.h */, - 3775F32C2276B14200A1840B /* mz.h */, - ); - path = minizip; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 37952C231F63B50D00DD6677 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3CB2276B14400A1840B /* mz_strm_zlib.h in Headers */, - 3775F3A32276B14400A1840B /* mz_strm.h in Headers */, - 3775F3AB2276B14400A1840B /* mz_strm_buf.h in Headers */, - 3775F3732276B14400A1840B /* mz_os.h in Headers */, - 3775F3672276B14400A1840B /* mz.h in Headers */, - 3775F3B32276B14400A1840B /* mz_crypt.h in Headers */, - 3775F37B2276B14400A1840B /* mz_strm_split.h in Headers */, - 3775F3BB2276B14400A1840B /* mz_zip.h in Headers */, - 3775F3BF2276B14400A1840B /* mz_strm_mem.h in Headers */, - 37952C321F63B6FB00DD6677 /* SSZipArchive.h in Headers */, - 3775F38B2276B14400A1840B /* mz_strm_pkcrypt.h in Headers */, - 3775F35F2276B14400A1840B /* mz_strm_os.h in Headers */, - 3775F3972276B14400A1840B /* mz_zip_rw.h in Headers */, - 3775F3932276B14400A1840B /* mz_compat.h in Headers */, - 93CE5D60227FE5C50003464F /* SSZipCommon.h in Headers */, - 3775F37F2276B14400A1840B /* mz_strm_wzaes.h in Headers */, - 37952C341F63B71400DD6677 /* ZipArchive.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 37952C5B1F63BB7100DD6677 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3CC2276B14400A1840B /* mz_strm_zlib.h in Headers */, - 3775F3A42276B14400A1840B /* mz_strm.h in Headers */, - 3775F3AC2276B14400A1840B /* mz_strm_buf.h in Headers */, - 3775F3742276B14400A1840B /* mz_os.h in Headers */, - 3775F3682276B14400A1840B /* mz.h in Headers */, - 3775F3B42276B14400A1840B /* mz_crypt.h in Headers */, - 3775F37C2276B14400A1840B /* mz_strm_split.h in Headers */, - 3775F3BC2276B14400A1840B /* mz_zip.h in Headers */, - 3775F3C02276B14400A1840B /* mz_strm_mem.h in Headers */, - 37952C881F63BBD500DD6677 /* SSZipArchive.h in Headers */, - 3775F38C2276B14400A1840B /* mz_strm_pkcrypt.h in Headers */, - 37952C8B1F63BBE400DD6677 /* ZipArchive.h in Headers */, - 3775F3602276B14400A1840B /* mz_strm_os.h in Headers */, - 3775F3982276B14400A1840B /* mz_zip_rw.h in Headers */, - 93CE5D61227FE5C50003464F /* SSZipCommon.h in Headers */, - 3775F3942276B14400A1840B /* mz_compat.h in Headers */, - 3775F3802276B14400A1840B /* mz_strm_wzaes.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AFF75A211C37279600F450AC /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3CA2276B14400A1840B /* mz_strm_zlib.h in Headers */, - 3775F3A22276B14400A1840B /* mz_strm.h in Headers */, - 3775F3AA2276B14400A1840B /* mz_strm_buf.h in Headers */, - 3775F3722276B14400A1840B /* mz_os.h in Headers */, - 3775F3662276B14400A1840B /* mz.h in Headers */, - 3775F3B22276B14400A1840B /* mz_crypt.h in Headers */, - 3775F37A2276B14400A1840B /* mz_strm_split.h in Headers */, - 3775F3BA2276B14400A1840B /* mz_zip.h in Headers */, - 3775F3BE2276B14400A1840B /* mz_strm_mem.h in Headers */, - AFF75A2D1C3727F000F450AC /* ZipArchive.h in Headers */, - 3775F38A2276B14400A1840B /* mz_strm_pkcrypt.h in Headers */, - AFF75A2E1C37280200F450AC /* SSZipArchive.h in Headers */, - 3775F35E2276B14400A1840B /* mz_strm_os.h in Headers */, - 3775F3962276B14400A1840B /* mz_zip_rw.h in Headers */, - 93CE5D5F227FE5C50003464F /* SSZipCommon.h in Headers */, - 3775F3922276B14400A1840B /* mz_compat.h in Headers */, - 3775F37E2276B14400A1840B /* mz_strm_wzaes.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B423AE171C0DF76A0004A2F1 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3C92276B14400A1840B /* mz_strm_zlib.h in Headers */, - 3775F3A12276B14400A1840B /* mz_strm.h in Headers */, - 93CE5D5E227FE5C50003464F /* SSZipCommon.h in Headers */, - 3775F3A92276B14400A1840B /* mz_strm_buf.h in Headers */, - 3775F3712276B14400A1840B /* mz_os.h in Headers */, - 3775F3652276B14400A1840B /* mz.h in Headers */, - 3775F3B12276B14400A1840B /* mz_crypt.h in Headers */, - 3775F3792276B14400A1840B /* mz_strm_split.h in Headers */, - 3775F3B92276B14400A1840B /* mz_zip.h in Headers */, - 3775F3BD2276B14400A1840B /* mz_strm_mem.h in Headers */, - B423AE6D1C0DF7950004A2F1 /* ZipArchive.h in Headers */, - B423AE6B1C0DF7950004A2F1 /* SSZipArchive.h in Headers */, - 3775F3892276B14400A1840B /* mz_strm_pkcrypt.h in Headers */, - 3775F35D2276B14400A1840B /* mz_strm_os.h in Headers */, - 3775F3952276B14400A1840B /* mz_zip_rw.h in Headers */, - 3775F3912276B14400A1840B /* mz_compat.h in Headers */, - 3775F37D2276B14400A1840B /* mz_strm_wzaes.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 37952C251F63B50D00DD6677 /* ZipArchive-tvos */ = { - isa = PBXNativeTarget; - buildConfigurationList = 37952C2D1F63B50D00DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-tvos" */; - buildPhases = ( - 37952C211F63B50D00DD6677 /* Sources */, - 37952C221F63B50D00DD6677 /* Frameworks */, - 37952C231F63B50D00DD6677 /* Headers */, - 37952C241F63B50D00DD6677 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "ZipArchive-tvos"; - productName = ZipArchive; - productReference = 37952C261F63B50D00DD6677 /* ZipArchive.framework */; - productType = "com.apple.product-type.framework"; - }; - 37952C5D1F63BB7100DD6677 /* ZipArchive-watchos */ = { - isa = PBXNativeTarget; - buildConfigurationList = 37952C651F63BB7100DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-watchos" */; - buildPhases = ( - 37952C591F63BB7100DD6677 /* Sources */, - 37952C5A1F63BB7100DD6677 /* Frameworks */, - 37952C5B1F63BB7100DD6677 /* Headers */, - 37952C5C1F63BB7100DD6677 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "ZipArchive-watchos"; - productName = ZipArchive; - productReference = 37952C5E1F63BB7100DD6677 /* ZipArchive.framework */; - productType = "com.apple.product-type.framework"; - }; - AFF75A231C37279600F450AC /* ZipArchive-Mac */ = { - isa = PBXNativeTarget; - buildConfigurationList = AFF75A291C37279600F450AC /* Build configuration list for PBXNativeTarget "ZipArchive-Mac" */; - buildPhases = ( - AFF75A1F1C37279600F450AC /* Sources */, - AFF75A201C37279600F450AC /* Frameworks */, - AFF75A211C37279600F450AC /* Headers */, - AFF75A221C37279600F450AC /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "ZipArchive-Mac"; - productName = "ZipArchive-Mac"; - productReference = AFF75A241C37279600F450AC /* ZipArchive.framework */; - productType = "com.apple.product-type.framework"; - }; - B423AE191C0DF76A0004A2F1 /* ZipArchive-iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = B423AE221C0DF76A0004A2F1 /* Build configuration list for PBXNativeTarget "ZipArchive-iOS" */; - buildPhases = ( - B423AE151C0DF76A0004A2F1 /* Sources */, - B423AE161C0DF76A0004A2F1 /* Frameworks */, - B423AE171C0DF76A0004A2F1 /* Headers */, - B423AE181C0DF76A0004A2F1 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "ZipArchive-iOS"; - productName = ZipArchive; - productReference = B423AE1A1C0DF76A0004A2F1 /* ZipArchive.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - B423AE111C0DF76A0004A2F1 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 1200; - ORGANIZATIONNAME = smumryak; - TargetAttributes = { - 37952C251F63B50D00DD6677 = { - CreatedOnToolsVersion = 8.3.3; - }; - 37952C5D1F63BB7100DD6677 = { - CreatedOnToolsVersion = 8.3.3; - }; - AFF75A231C37279600F450AC = { - CreatedOnToolsVersion = 7.2; - }; - B423AE191C0DF76A0004A2F1 = { - CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0820; - }; - }; - }; - buildConfigurationList = B423AE141C0DF76A0004A2F1 /* Build configuration list for PBXProject "ZipArchive" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = B423AE101C0DF76A0004A2F1; - productRefGroup = B423AE1B1C0DF76A0004A2F1 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - B423AE191C0DF76A0004A2F1 /* ZipArchive-iOS */, - AFF75A231C37279600F450AC /* ZipArchive-Mac */, - 37952C251F63B50D00DD6677 /* ZipArchive-tvos */, - 37952C5D1F63BB7100DD6677 /* ZipArchive-watchos */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 37952C241F63B50D00DD6677 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 37952C5C1F63BB7100DD6677 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AFF75A221C37279600F450AC /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B423AE181C0DF76A0004A2F1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 37952C211F63B50D00DD6677 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3AF2276B14400A1840B /* mz_os_posix.c in Sources */, - 3775F3872276B14400A1840B /* mz_strm_mem.c in Sources */, - 3775F3D72276B14400A1840B /* mz_strm_wzaes.c in Sources */, - 3775F3A72276B14400A1840B /* mz_zip.c in Sources */, - 3775F36F2276B14400A1840B /* mz_crypt.c in Sources */, - 3775F38F2276B14400A1840B /* mz_strm_split.c in Sources */, - 37952C331F63B70000DD6677 /* SSZipArchive.m in Sources */, - 3775F34B2276B14400A1840B /* mz_strm_pkcrypt.c in Sources */, - 3775F3CF2276B14400A1840B /* mz_strm.c in Sources */, - 3775F3572276B14400A1840B /* mz_compat.c in Sources */, - 378439B4227ABC7B000BC165 /* mz_crypt_apple.c in Sources */, - 3775F39F2276B14400A1840B /* mz_strm_zlib.c in Sources */, - 3775F3832276B14400A1840B /* mz_zip_rw.c in Sources */, - 3775F3632276B14400A1840B /* mz_os.c in Sources */, - 3775F3C32276B14400A1840B /* mz_strm_os_posix.c in Sources */, - 3775F39B2276B14400A1840B /* mz_strm_buf.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 37952C591F63BB7100DD6677 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3B02276B14400A1840B /* mz_os_posix.c in Sources */, - 3775F3882276B14400A1840B /* mz_strm_mem.c in Sources */, - 3775F3D82276B14400A1840B /* mz_strm_wzaes.c in Sources */, - 37952C891F63BBDA00DD6677 /* SSZipArchive.m in Sources */, - 3775F3A82276B14400A1840B /* mz_zip.c in Sources */, - 3775F3702276B14400A1840B /* mz_crypt.c in Sources */, - 3775F3902276B14400A1840B /* mz_strm_split.c in Sources */, - 3775F34C2276B14400A1840B /* mz_strm_pkcrypt.c in Sources */, - 3775F3D02276B14400A1840B /* mz_strm.c in Sources */, - 3775F3582276B14400A1840B /* mz_compat.c in Sources */, - 378439B5227ABC7B000BC165 /* mz_crypt_apple.c in Sources */, - 3775F3A02276B14400A1840B /* mz_strm_zlib.c in Sources */, - 3775F3842276B14400A1840B /* mz_zip_rw.c in Sources */, - 3775F3642276B14400A1840B /* mz_os.c in Sources */, - 3775F3C42276B14400A1840B /* mz_strm_os_posix.c in Sources */, - 3775F39C2276B14400A1840B /* mz_strm_buf.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AFF75A1F1C37279600F450AC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3AE2276B14400A1840B /* mz_os_posix.c in Sources */, - 3775F3862276B14400A1840B /* mz_strm_mem.c in Sources */, - 3775F3D62276B14400A1840B /* mz_strm_wzaes.c in Sources */, - 3775F3A62276B14400A1840B /* mz_zip.c in Sources */, - 3775F36E2276B14400A1840B /* mz_crypt.c in Sources */, - 3775F38E2276B14400A1840B /* mz_strm_split.c in Sources */, - AFF75A2F1C37280200F450AC /* SSZipArchive.m in Sources */, - 3775F34A2276B14400A1840B /* mz_strm_pkcrypt.c in Sources */, - 3775F3CE2276B14400A1840B /* mz_strm.c in Sources */, - 3775F3562276B14400A1840B /* mz_compat.c in Sources */, - 378439B3227ABC7B000BC165 /* mz_crypt_apple.c in Sources */, - 3775F39E2276B14400A1840B /* mz_strm_zlib.c in Sources */, - 3775F3822276B14400A1840B /* mz_zip_rw.c in Sources */, - 3775F3622276B14400A1840B /* mz_os.c in Sources */, - 3775F3C22276B14400A1840B /* mz_strm_os_posix.c in Sources */, - 3775F39A2276B14400A1840B /* mz_strm_buf.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B423AE151C0DF76A0004A2F1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3775F3AD2276B14400A1840B /* mz_os_posix.c in Sources */, - 3775F3852276B14400A1840B /* mz_strm_mem.c in Sources */, - 3775F3D52276B14400A1840B /* mz_strm_wzaes.c in Sources */, - 3775F3A52276B14400A1840B /* mz_zip.c in Sources */, - 3775F36D2276B14400A1840B /* mz_crypt.c in Sources */, - 3775F38D2276B14400A1840B /* mz_strm_split.c in Sources */, - 3775F3492276B14400A1840B /* mz_strm_pkcrypt.c in Sources */, - 3775F3CD2276B14400A1840B /* mz_strm.c in Sources */, - 3775F3552276B14400A1840B /* mz_compat.c in Sources */, - 3775F39D2276B14400A1840B /* mz_strm_zlib.c in Sources */, - 378439B2227ABC7B000BC165 /* mz_crypt_apple.c in Sources */, - 3775F3812276B14400A1840B /* mz_zip_rw.c in Sources */, - 3775F3612276B14400A1840B /* mz_os.c in Sources */, - 3775F3C12276B14400A1840B /* mz_strm_os_posix.c in Sources */, - B423AE6C1C0DF7950004A2F1 /* SSZipArchive.m in Sources */, - 3775F3992276B14400A1840B /* mz_strm_buf.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 37952C2B1F63B50D00DD6677 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = SSZipArchive/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Debug; - }; - 37952C2C1F63B50D00DD6677 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - COPY_PHASE_STRIP = NO; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = SSZipArchive/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Release; - }; - 37952C631F63BB7100DD6677 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = SSZipArchive/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Debug; - }; - 37952C641F63BB7100DD6677 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - COPY_PHASE_STRIP = NO; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = SSZipArchive/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Release; - }; - AFF75A2A1C37279600F450AC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/SSZipArchive/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - AFF75A2B1C37279600F450AC /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/SSZipArchive/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Release; - }; - B423AE201C0DF76A0004A2F1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - HAVE_INTTYPES_H, - HAVE_PKCRYPT, - HAVE_STDINT_H, - HAVE_WZAES, - HAVE_ZLIB, - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - B423AE211C0DF76A0004A2F1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - HAVE_INTTYPES_H, - HAVE_PKCRYPT, - HAVE_STDINT_H, - HAVE_WZAES, - HAVE_ZLIB, - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - B423AE231C0DF76A0004A2F1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = SSZipArchive/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - B423AE241C0DF76A0004A2F1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = SSZipArchive/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.ziparchive.ZipArchive; - PRODUCT_NAME = "$(PROJECT_NAME)"; - SKIP_INSTALL = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 37952C2D1F63B50D00DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-tvos" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 37952C2B1F63B50D00DD6677 /* Debug */, - 37952C2C1F63B50D00DD6677 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 37952C651F63BB7100DD6677 /* Build configuration list for PBXNativeTarget "ZipArchive-watchos" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 37952C631F63BB7100DD6677 /* Debug */, - 37952C641F63BB7100DD6677 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AFF75A291C37279600F450AC /* Build configuration list for PBXNativeTarget "ZipArchive-Mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AFF75A2A1C37279600F450AC /* Debug */, - AFF75A2B1C37279600F450AC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B423AE141C0DF76A0004A2F1 /* Build configuration list for PBXProject "ZipArchive" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B423AE201C0DF76A0004A2F1 /* Debug */, - B423AE211C0DF76A0004A2F1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B423AE221C0DF76A0004A2F1 /* Build configuration list for PBXNativeTarget "ZipArchive-iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B423AE231C0DF76A0004A2F1 /* Debug */, - B423AE241C0DF76A0004A2F1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = B423AE111C0DF76A0004A2F1 /* Project object */; -} diff --git a/Demo-cocoapods/Demo.xcodeproj/project.pbxproj b/Demo-cocoapods/Demo.xcodeproj/project.pbxproj index 1ce49e8..f2bfb3e 100644 --- a/Demo-cocoapods/Demo.xcodeproj/project.pbxproj +++ b/Demo-cocoapods/Demo.xcodeproj/project.pbxproj @@ -184,12 +184,10 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Demo/Pods-Demo-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework", "${BUILT_PRODUCTS_DIR}/XlsxReaderWriter/XlsxReaderWriter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/XlsxReaderWriter.framework", ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Package.swift b/Package.swift index 7d4ffc0..61209aa 100644 --- a/Package.swift +++ b/Package.swift @@ -15,21 +15,40 @@ let package = Package( .library( name: "XlsxReaderWriter", targets: ["XlsxReaderWriter"]), - ], - dependencies: [ - .package(url: "https://github.com/ZipArchive/ZipArchive", .exact("2.3.0")), ], targets: [ .target( name: "XlsxReaderWriter", - dependencies: [ - .product(name: "ZipArchive", package: "ZipArchive"), - ], + exclude: ["minizip/LICENSE"], publicHeadersPath: ".", cSettings: [ .headerSearchPath("XlsxReaderWriter"), .headerSearchPath("."), - ] - ) + .headerSearchPath("minizip"), + ], + linkerSettings: [ + .linkedLibrary("z"), + .linkedLibrary("iconv") + ]), + .testTarget( + name: "XlsxReaderWriterSwiftTests", + dependencies: [ + .target(name: "XlsxReaderWriter"), + ], + resources: [ + .copy("Resources/photo-1415226481302-c40f24f4d45e.jpeg"), + .copy("Resources/testWorkbook.xlsx"), + ]), + .testTarget( + name: "XlsxReaderWriterTests", + dependencies: [ + .target(name: "XlsxReaderWriter"), + ], + resources: [ + .copy("Resources/photo-1415226481302-c40f24f4d45e.jpeg"), + .copy("Resources/testWorkbook.xlsx"), + .copy("Resources/testWorkbook2.xlsx"), + .copy("Resources/google.xlsx"), + ]), ] ) diff --git a/Sources/XlsxReaderWriter/Implementation/Additions/NSDictionary/NSDictionary+OpenXMLDictionaryParser.m b/Sources/XlsxReaderWriter/Implementation/Additions/NSDictionary/NSDictionary+OpenXMLDictionaryParser.m deleted file mode 100644 index 49d147f..0000000 --- a/Sources/XlsxReaderWriter/Implementation/Additions/NSDictionary/NSDictionary+OpenXMLDictionaryParser.m +++ /dev/null @@ -1,42 +0,0 @@ -// -// NSDictionary+OpenXMLDictionaryParser.m -// BRAXlsxReaderWriter -// -// Created by René BIGOT on 19/06/2014. -// Copyright (c) 2014 René Bigot. All rights reserved. -// - -#import -#import - -@implementation NSDictionary (OpenXMLDictionaryParser) - -+ (NSDictionary *)dictionaryWithOpenXmlParser:(NSXMLParser *)parser { - XlsxReaderXMLDictionaryParser *dictionaryParser = [[XlsxReaderXMLDictionaryParser sharedInstance] copy]; - [dictionaryParser setStripEmptyNodes:NO]; - [dictionaryParser setTrimWhiteSpace:NO]; - return [dictionaryParser dictionaryWithParser:parser]; -} - -+ (NSDictionary *)dictionaryWithOpenXmlData:(NSData *)data { - XlsxReaderXMLDictionaryParser *dictionaryParser = [[XlsxReaderXMLDictionaryParser sharedInstance] copy]; - [dictionaryParser setStripEmptyNodes:NO]; - [dictionaryParser setTrimWhiteSpace:NO]; - return [dictionaryParser dictionaryWithData:data]; -} - -+ (NSDictionary *)dictionaryWithOpenXmlString:(NSString *)string { - XlsxReaderXMLDictionaryParser *dictionaryParser = [[XlsxReaderXMLDictionaryParser sharedInstance] copy]; - [dictionaryParser setStripEmptyNodes:NO]; - [dictionaryParser setTrimWhiteSpace:NO]; - return [dictionaryParser dictionaryWithString:string]; -} - -+ (NSDictionary *)dictionaryWithOpenXmlFile:(NSString *)path { - XlsxReaderXMLDictionaryParser *dictionaryParser = [[XlsxReaderXMLDictionaryParser sharedInstance] copy]; - [dictionaryParser setStripEmptyNodes:NO]; - [dictionaryParser setTrimWhiteSpace:NO]; - return [dictionaryParser dictionaryWithFile:path]; -} - -@end diff --git a/Sources/XlsxReaderWriter/Implementation/Additions/NSDictionary/XlsxReaderXMLDictionary.m b/Sources/XlsxReaderWriter/Implementation/Additions/NSDictionary/XlsxReaderXMLDictionary.m index 60d4d1e..bbdd4b0 100644 --- a/Sources/XlsxReaderWriter/Implementation/Additions/NSDictionary/XlsxReaderXMLDictionary.m +++ b/Sources/XlsxReaderWriter/Implementation/Additions/NSDictionary/XlsxReaderXMLDictionary.m @@ -50,6 +50,17 @@ @interface XlsxReaderXMLDictionaryParser () @end +@implementation XlsxReaderXMLDictionaryParser (OpenXMLDictionaryParser) + ++ (NSDictionary *)dictionaryWithOpenXmlString:(NSString *)string { + XlsxReaderXMLDictionaryParser *dictionaryParser = [[XlsxReaderXMLDictionaryParser sharedInstance] copy]; + [dictionaryParser setStripEmptyNodes:NO]; + [dictionaryParser setTrimWhiteSpace:NO]; + return [dictionaryParser dictionaryWithString:string]; +} + +@end + @implementation XlsxReaderXMLDictionaryParser + (XlsxReaderXMLDictionaryParser *)sharedInstance diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/BRAOfficeDocumentPackage.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/BRAOfficeDocumentPackage.m index c917f34..7c5a0bd 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/BRAOfficeDocumentPackage.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/BRAOfficeDocumentPackage.m @@ -14,12 +14,7 @@ #import #import #import - -#if COCOAPODS -@import SSZipArchive; -#else -@import ZipArchive; -#endif +#import "SSZipArchive.h" @interface BRAOfficeDocumentPackage () @property (nonatomic, strong) BRAContentTypes * contentTypes; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Calc chain/BRACalcChain.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Calc chain/BRACalcChain.m index ace53fc..59107b2 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Calc chain/BRACalcChain.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Calc chain/BRACalcChain.m @@ -31,7 +31,7 @@ - (NSString *)targetFormat { - (void)loadXmlContents { [super loadXmlContents]; - NSDictionary *openXmlAttributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + NSDictionary *openXmlAttributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; NSArray *calcChainCellArray = [openXmlAttributes xlsxReaderArrayValueForKeyPath:@"c"]; @@ -131,7 +131,7 @@ - (void)didRemoveColumnsAtIndexes:(NSIndexSet *)indexes { } - (NSString *)xmlRepresentation { - NSMutableDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; + NSMutableDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; NSString *xmlHeader = @"\r\n"; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Comments/BRAComments.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Comments/BRAComments.m index 9d577d6..24f02e5 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Comments/BRAComments.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Comments/BRAComments.m @@ -30,7 +30,7 @@ - (NSString *)targetFormat { - (void)loadXmlContents { [super loadXmlContents]; - NSDictionary *openXmlAttributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + NSDictionary *openXmlAttributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; NSArray *commentsArray = [openXmlAttributes xlsxReaderArrayValueForKeyPath:@"commentList.comment"]; @@ -131,7 +131,7 @@ - (void)didRemoveColumnsAtIndexes:(NSIndexSet *)indexes { } - (NSString *)xmlRepresentation { - NSMutableDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; + NSMutableDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; NSString *xmlHeader = @"\r\n"; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Content types/BRAContentTypes.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Content types/BRAContentTypes.m index 8ac4b85..9c8fedb 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Content types/BRAContentTypes.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Content types/BRAContentTypes.m @@ -8,17 +8,17 @@ #import #import -#import #import #import #import +#import @implementation BRAContentTypes - (void)loadXmlContents { [super loadXmlContents]; - NSDictionary *attributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + NSDictionary *attributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; NSMutableArray *defaultExtensions = [[NSMutableArray alloc] init]; for (NSDictionary *attributesDict in attributes[@"Default"]) { diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Drawing/BRADrawing.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Drawing/BRADrawing.m index 019ce29..8782f3f 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Drawing/BRADrawing.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Drawing/BRADrawing.m @@ -47,7 +47,7 @@ - (void)loadXmlContents { - (void)addWorksheetDrawingsForAnchorType:(NSString *)anchorType { NSMutableArray *worksheetDrawings = [_worksheetDrawings mutableCopy]; - NSDictionary *attributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + NSDictionary *attributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; NSArray *wsDrArray = [attributes xlsxReaderArrayValueForKeyPath:anchorType]; @@ -241,7 +241,7 @@ - (void)didRemoveColumnsAtIndexes:(NSIndexSet *)indexes { #pragma mark - - (NSString *)xmlRepresentation { - NSMutableDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; + NSMutableDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; NSString *xmlHeader = @"\r\n"; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Shared strings/BRASharedStrings.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Shared strings/BRASharedStrings.m index 209d5d6..c2641b5 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Shared strings/BRASharedStrings.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Shared strings/BRASharedStrings.m @@ -30,7 +30,7 @@ - (NSString *)targetFormat { - (void)loadXmlContents { [super loadXmlContents]; - NSDictionary *attributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + NSDictionary *attributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; NSArray *siArray = [attributes xlsxReaderArrayValueForKeyPath:@"si"]; @@ -64,7 +64,7 @@ - (void)setStyles:(BRAStyles *)styles { #pragma mark - - (NSString *)xmlRepresentation { - NSMutableDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableDeepCopy; + NSMutableDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableDeepCopy; NSString *xmlHeader = @"\r\n"; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Styles/BRAStyles.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Styles/BRAStyles.m index b3738a6..3aee257 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Styles/BRAStyles.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Styles/BRAStyles.m @@ -15,6 +15,7 @@ #import #import #import +#import @implementation BRAStyles @@ -33,7 +34,7 @@ - (NSString *)targetFormat { - (void)loadXmlContents { [super loadXmlContents]; - _attributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + _attributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; //Read indexed colors NSMutableArray *indexedColors = [BRANativeColor defaultIndexedColors].mutableCopy; @@ -315,7 +316,7 @@ - (NSDictionary *)defaultNumberFormats { #pragma mark - - (NSString *)xmlRepresentation { - NSMutableDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableDeepCopy; + NSMutableDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableDeepCopy; NSString *xmlHeader = @"\r\n"; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Theme/BRATheme.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Theme/BRATheme.m index b60540b..bbbe02a 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Theme/BRATheme.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Theme/BRATheme.m @@ -42,7 +42,7 @@ - (NSString *)targetFormat { - (void)loadXmlContents { [super loadXmlContents]; - NSDictionary *colorsScheme = [[NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation] xlsxReaderDictionaryValueForKeyPath:@"a:themeElements.a:clrScheme"]; + NSDictionary *colorsScheme = [[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation] xlsxReaderDictionaryValueForKeyPath:@"a:themeElements.a:clrScheme"]; _colors = @[ [self colorNamed:S00 inColorScheme:colorsScheme], diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Workbook/BRAOfficeDocument.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Workbook/BRAOfficeDocument.m index b107b9c..97c535c 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Workbook/BRAOfficeDocument.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Workbook/BRAOfficeDocument.m @@ -51,7 +51,7 @@ - (void)loadXmlContents { //Sheets NSMutableArray *sheets = [[NSMutableArray alloc] init]; - NSDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + NSDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; for (NSDictionary *openXmlAttributes in [dictionaryRepresentation xlsxReaderArrayValueForKeyPath:@"sheets.sheet"]) { [sheets addObject:[[BRASheet alloc] initWithOpenXmlAttributes:openXmlAttributes]]; @@ -175,7 +175,7 @@ - (NSString *)sheetIdForNewSheet { } - (NSString *)xmlRepresentation { - NSMutableDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; + NSMutableDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; NSString *xmlHeader = @"\r\n"; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Worksheet/BRAWorksheet.m b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Worksheet/BRAWorksheet.m index e5352ac..9846612 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Worksheet/BRAWorksheet.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/OPC Package/Worksheet/BRAWorksheet.m @@ -45,7 +45,7 @@ - (NSString *)targetFormat { - (void)loadXmlContents { [super loadXmlContents]; - NSMutableDictionary *openXmlAttributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableDeepCopy; + NSMutableDictionary *openXmlAttributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableDeepCopy; //Get dimension NSString *rangeReference = [openXmlAttributes valueForKeyPath:@"dimension._ref"]; @@ -134,7 +134,7 @@ - (void)loadXmlContents { #pragma mark - - (NSString *)xmlRepresentation { - NSMutableDictionary *dictionaryRepresentation = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; + NSMutableDictionary *dictionaryRepresentation =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation].mutableCopy; NSString *xmlHeader = @"\r\n"; diff --git a/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/BRAOpenXmlElement.m b/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/BRAOpenXmlElement.m index cd1ce9f..e26c067 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/BRAOpenXmlElement.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/BRAOpenXmlElement.m @@ -9,7 +9,6 @@ #import #import #import -#import @implementation BRAOpenXmlElement diff --git a/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/Sub Element/BRAOpenXmlSubElement.m b/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/Sub Element/BRAOpenXmlSubElement.m index 4b888ce..89e8dbf 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/Sub Element/BRAOpenXmlSubElement.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Element/Sub Element/BRAOpenXmlSubElement.m @@ -13,7 +13,6 @@ #import #import #import -#import #import @implementation BRAOpenXmlSubElement diff --git a/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Relationships/BRARelationships.m b/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Relationships/BRARelationships.m index ec008ae..817bd42 100644 --- a/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Relationships/BRARelationships.m +++ b/Sources/XlsxReaderWriter/Implementation/Document/Shared/Abstract classes/Relationships/BRARelationships.m @@ -18,7 +18,7 @@ @implementation BRARelationships - (void)loadXmlContents { [super loadXmlContents]; - NSDictionary *attributes = [NSDictionary dictionaryWithOpenXmlString:_xmlRepresentation]; + NSDictionary *attributes =[XlsxReaderXMLDictionaryParser dictionaryWithOpenXmlString:_xmlRepresentation]; _relationshipsArray = [[NSMutableArray alloc] init]; diff --git a/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAElementWithRelationships.h b/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAElementWithRelationships.h index d4cd9f7..a8b400e 100644 --- a/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAElementWithRelationships.h +++ b/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAElementWithRelationships.h @@ -8,7 +8,6 @@ @import Foundation; #import -#import @class BRARelationships; diff --git a/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAPlatformSpecificDefines.h b/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAPlatformSpecificDefines.h index 9b5a0b9..b63c5d0 100644 --- a/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAPlatformSpecificDefines.h +++ b/Sources/XlsxReaderWriter/XlsxReaderWriter/BRAPlatformSpecificDefines.h @@ -1,3 +1,4 @@ +#import #if TARGET_OS_IPHONE diff --git a/Sources/XlsxReaderWriter/XlsxReaderWriter/NSDictionary+OpenXMLDictionaryParser.h b/Sources/XlsxReaderWriter/XlsxReaderWriter/NSDictionary+OpenXMLDictionaryParser.h deleted file mode 100644 index b84744d..0000000 --- a/Sources/XlsxReaderWriter/XlsxReaderWriter/NSDictionary+OpenXMLDictionaryParser.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// NSDictionary+OpenXMLDictionaryParser.h -// BRAXlsxReaderWriter -// -// Created by René BIGOT on 19/06/2014. -// Copyright (c) 2014 René Bigot. All rights reserved. -// - -@import Foundation; - -@class NSXMLParser; - -@interface NSDictionary (OpenXMLDictionaryParser) - -+ (NSDictionary *)dictionaryWithOpenXmlParser:(NSXMLParser *)parser; -+ (NSDictionary *)dictionaryWithOpenXmlData:(NSData *)data; -+ (NSDictionary *)dictionaryWithOpenXmlString:(NSString *)string; -+ (NSDictionary *)dictionaryWithOpenXmlFile:(NSString *)path; - -@end diff --git a/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderWriter-swift-bridge.h b/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderWriter-swift-bridge.h index 6b94640..544620a 100644 --- a/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderWriter-swift-bridge.h +++ b/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderWriter-swift-bridge.h @@ -42,5 +42,4 @@ #import #import #import -#import #import diff --git a/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderXMLDictionary.h b/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderXMLDictionary.h index 26732d6..b798abe 100644 --- a/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderXMLDictionary.h +++ b/Sources/XlsxReaderWriter/XlsxReaderWriter/XlsxReaderXMLDictionary.h @@ -108,6 +108,12 @@ static NSString *const XlsxReaderXMLDictionaryAttributePrefix = @"_"; @end +@interface XlsxReaderXMLDictionaryParser (OpenXMLDictionaryParser) + ++ (NSDictionary *)dictionaryWithOpenXmlString:(NSString *)string; + +@end + NS_ASSUME_NONNULL_END diff --git a/Sources/XlsxReaderWriter/minizip/LICENSE b/Sources/XlsxReaderWriter/minizip/LICENSE new file mode 100644 index 0000000..3b6c4e1 --- /dev/null +++ b/Sources/XlsxReaderWriter/minizip/LICENSE @@ -0,0 +1,17 @@ +Condition of use and distribution are the same as zlib: + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgement in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipArchive.h b/Sources/XlsxReaderWriter/minizip/SSZipArchive.h similarity index 85% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipArchive.h rename to Sources/XlsxReaderWriter/minizip/SSZipArchive.h index 242b9a7..d2dd3fa 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipArchive.h +++ b/Sources/XlsxReaderWriter/minizip/SSZipArchive.h @@ -3,13 +3,12 @@ // SSZipArchive // // Created by Sam Soffes on 7/21/10. +// Copyright (c) Sam Soffes 2010-2015. All rights reserved. // -#ifndef _SSZIPARCHIVE_H -#define _SSZIPARCHIVE_H - -#import +#define HAVE_ZLIB +@import Foundation; #import "SSZipCommon.h" NS_ASSUME_NONNULL_BEGIN @@ -96,7 +95,6 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { // with optional password, default encryption is AES // don't use AES if you need compatibility with native macOS unzip and Archive Utility + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password; -+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password; + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password; + (BOOL)createZipFileAtPath:(NSString *)path @@ -111,22 +109,10 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { password:(nullable NSString *)password AES:(BOOL)aes progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; -//suport symlink compress --file -+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password keepSymlinks:(BOOL)keeplinks; -//suport symlink compress --directory -+ (BOOL)createZipFileAtPath:(NSString *)path - withContentsOfDirectory:(NSString *)directoryPath - keepParentDirectory:(BOOL)keepParentDirectory - compressionLevel:(int)compressionLevel - password:(nullable NSString *)password - AES:(BOOL)aes - progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler - keepSymlinks:(BOOL)keeplinks; - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER; - (BOOL)open; -- (BOOL)openForAppending; /// write empty folder - (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password; @@ -134,8 +120,6 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { - (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password; - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password; - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; -///write symlink files -- (BOOL)writeSymlinkFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; /// write data - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password; - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; @@ -161,5 +145,3 @@ typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { @end NS_ASSUME_NONNULL_END - -#endif /* _SSZIPARCHIVE_H */ diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipArchive.m b/Sources/XlsxReaderWriter/minizip/SSZipArchive.m similarity index 89% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipArchive.m rename to Sources/XlsxReaderWriter/minizip/SSZipArchive.m index 7184d10..8435abc 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipArchive.m +++ b/Sources/XlsxReaderWriter/minizip/SSZipArchive.m @@ -3,12 +3,12 @@ // SSZipArchive // // Created by Sam Soffes on 7/21/10. +// Copyright (c) Sam Soffes 2010-2015. All rights reserved. // #import "SSZipArchive.h" -#include "minizip/mz_compat.h" -#include "minizip/mz_zip.h" -#include "minizip/mz_os.h" +#include "mz_compat.h" +#include "mz_zip.h" #include #include @@ -19,11 +19,6 @@ int _zipOpenEntry(zipFile entry, NSString *name, const zip_fileinfo *zipfi, int level, NSString *password, BOOL aes); BOOL _fileIsSymbolicLink(const unz_file_info *fileInfo); -#ifndef API_AVAILABLE -// Xcode 7- compatibility -#define API_AVAILABLE(...) -#endif - @interface NSData(SSZipArchive) - (NSString *)_base64RFC4648 API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); - (NSString *)_hexString; @@ -760,22 +755,13 @@ + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString * return [SSZipArchive createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirectory withPassword:nil]; } -+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password { - return [self createZipFileAtPath:path withFilesAtPaths:paths withPassword:password progressHandler:nil]; -} - -+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler ++ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(NSString *)password { SSZipArchive *zipArchive = [[SSZipArchive alloc] initWithPath:path]; BOOL success = [zipArchive open]; if (success) { - NSUInteger total = paths.count, complete = 0; for (NSString *filePath in paths) { success &= [zipArchive writeFile:filePath withPassword:password]; - if (progressHandler) { - complete++; - progressHandler(complete, total); - } } success &= [zipArchive close]; } @@ -857,135 +843,6 @@ + (BOOL)createZipFileAtPath:(NSString *)path return success; } -+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password keepSymlinks:(BOOL)keeplinks { - if (!keeplinks) { - return [SSZipArchive createZipFileAtPath:path withFilesAtPaths:paths withPassword:password]; - } else { - SSZipArchive *zipArchive = [[SSZipArchive alloc] initWithPath:path]; - BOOL success = [zipArchive open]; - if (success) { - for (NSString *filePath in paths) { - //is symlink - if (mz_os_is_symlink(filePath.fileSystemRepresentation) == MZ_OK) { - success &= [zipArchive writeSymlinkFileAtPath:filePath withFileName:nil compressionLevel:Z_DEFAULT_COMPRESSION password:password AES:YES]; - } else { - success &= [zipArchive writeFile:filePath withPassword:password]; - } - } - success &= [zipArchive close]; - } - return success; - } -} - -+ (BOOL)createZipFileAtPath:(NSString *)path - withContentsOfDirectory:(NSString *)directoryPath - keepParentDirectory:(BOOL)keepParentDirectory - compressionLevel:(int)compressionLevel - password:(nullable NSString *)password - AES:(BOOL)aes - progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler - keepSymlinks:(BOOL)keeplinks { - if (!keeplinks) { - return [SSZipArchive createZipFileAtPath:path - withContentsOfDirectory:directoryPath - keepParentDirectory:keepParentDirectory - compressionLevel:compressionLevel - password:password - AES:aes - progressHandler:progressHandler]; - } else { - SSZipArchive *zipArchive = [[SSZipArchive alloc] initWithPath:path]; - BOOL success = [zipArchive open]; - if (success) { - // use a local fileManager (queue/thread compatibility) - NSFileManager *fileManager = [[NSFileManager alloc] init]; - NSDirectoryEnumerator *dirEnumerator = [fileManager enumeratorAtPath:directoryPath]; - NSArray *allObjects = dirEnumerator.allObjects; - NSUInteger total = allObjects.count, complete = 0; - if (keepParentDirectory && !total) { - allObjects = @[@""]; - total = 1; - } - for (__strong NSString *fileName in allObjects) { - NSString *fullFilePath = [directoryPath stringByAppendingPathComponent:fileName]; - - if (keepParentDirectory) { - fileName = [directoryPath.lastPathComponent stringByAppendingPathComponent:fileName]; - } - //is symlink - BOOL isSymlink = NO; - if (mz_os_is_symlink(fullFilePath.fileSystemRepresentation) == MZ_OK) - isSymlink = YES; - BOOL isDir; - [fileManager fileExistsAtPath:fullFilePath isDirectory:&isDir]; - if (!isDir || isSymlink) { - // file or symlink - if (!isSymlink) { - success &= [zipArchive writeFileAtPath:fullFilePath withFileName:fileName compressionLevel:compressionLevel password:password AES:aes]; - } else { - success &= [zipArchive writeSymlinkFileAtPath:fullFilePath withFileName:fileName compressionLevel:compressionLevel password:password AES:aes]; - } - } else { - // directory - if (![fileManager enumeratorAtPath:fullFilePath].nextObject) { - // empty directory - success &= [zipArchive writeFolderAtPath:fullFilePath withFolderName:fileName withPassword:password]; - } - } - if (progressHandler) { - complete++; - progressHandler(complete, total); - } - } - success &= [zipArchive close]; - } - return success; - } -} - -- (BOOL)writeSymlinkFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes -{ - NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened"); - //read symlink - char link_path[1024]; - int32_t err = MZ_OK; - err = mz_os_read_symlink(path.fileSystemRepresentation, link_path, sizeof(link_path)); - if (err != MZ_OK) { - NSLog(@"[SSZipArchive] Failed to read sylink"); - return NO; - } - - if (!fileName) { - fileName = path.lastPathComponent; - } - - zip_fileinfo zipInfo = {}; - [SSZipArchive zipInfo:&zipInfo setAttributesOfItemAtPath:path]; - - //unpdate zipInfo.external_fa - uint32_t target_attrib = 0; - uint32_t src_attrib = 0; - uint32_t src_sys = 0; - mz_os_get_file_attribs(path.fileSystemRepresentation, &src_attrib); - src_sys = MZ_HOST_SYSTEM(MZ_VERSION_MADEBY); - - if ((src_sys != MZ_HOST_SYSTEM_MSDOS) && (src_sys != MZ_HOST_SYSTEM_WINDOWS_NTFS)) { - /* High bytes are OS specific attributes, low byte is always DOS attributes */ - if (mz_zip_attrib_convert(src_sys, src_attrib, MZ_HOST_SYSTEM_MSDOS, &target_attrib) == MZ_OK) - zipInfo.external_fa = target_attrib; - zipInfo.external_fa |= (src_attrib << 16); - } else { - zipInfo.external_fa = src_attrib; - } - - uint16_t version_madeby = 3 << 8;//UNIX - int error = zipOpenNewFileInZip5(_zip, fileName.fileSystemRepresentation, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, compressionLevel, 0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, password.UTF8String, aes, version_madeby, 0, 0); - zipWriteInFileInZip(_zip, link_path, (uint32_t)strlen(link_path)); - zipCloseFileInZip(_zip); - return error == ZIP_OK; -} - // disabling `init` because designated initializer is `initWithPath:` - (instancetype)init { @throw nil; } @@ -1006,13 +863,6 @@ - (BOOL)open return (NULL != _zip); } -- (BOOL)openForAppending -{ - NSAssert((_zip == NULL), @"Attempting to open an archive which is already open"); - _zip = zipOpen(_path.fileSystemRepresentation, APPEND_STATUS_ADDINZIP); - return (NULL != _zip); -} - - (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password { NSAssert((_zip != NULL), @"Attempting to write to an archive which was never opened"); diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipCommon.h b/Sources/XlsxReaderWriter/minizip/SSZipCommon.h similarity index 98% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipCommon.h rename to Sources/XlsxReaderWriter/minizip/SSZipCommon.h index 78fa282..c31edcd 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/SSZipCommon.h +++ b/Sources/XlsxReaderWriter/minizip/SSZipCommon.h @@ -1,5 +1,3 @@ -#ifndef SSZipCommon -#define SSZipCommon // typedefs moved from mz_compat.h to here for public access @@ -65,4 +63,3 @@ typedef struct unz_file_info_s uint64_t disk_offset; } unz_file_info; -#endif diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz.h b/Sources/XlsxReaderWriter/minizip/mz.h similarity index 89% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz.h rename to Sources/XlsxReaderWriter/minizip/mz.h index 88ca47d..c0f54a1 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz.h +++ b/Sources/XlsxReaderWriter/minizip/mz.h @@ -1,8 +1,9 @@ /* mz.h -- Errors codes, zip flags and magic - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -14,8 +15,7 @@ /***************************************************************************/ /* MZ_VERSION */ -#define MZ_VERSION ("3.0.2") -#define MZ_VERSION_BUILD (030002) +#define MZ_VERSION ("2.9.2") /* MZ_ERROR */ #define MZ_OK (0) /* zlib */ @@ -64,8 +64,6 @@ #define MZ_COMPRESS_METHOD_DEFLATE (8) #define MZ_COMPRESS_METHOD_BZIP2 (12) #define MZ_COMPRESS_METHOD_LZMA (14) -#define MZ_COMPRESS_METHOD_ZSTD (93) -#define MZ_COMPRESS_METHOD_XZ (95) #define MZ_COMPRESS_METHOD_AES (99) #define MZ_COMPRESS_LEVEL_DEFAULT (-1) @@ -141,13 +139,13 @@ #define MZ_UNUSED(SYMBOL) ((void)SYMBOL) #ifndef MZ_CUSTOM_ALLOC -#define MZ_ALLOC(SIZE) (malloc((SIZE))) +#define MZ_ALLOC(SIZE) (malloc(SIZE)) #endif #ifndef MZ_CUSTOM_FREE #define MZ_FREE(PTR) (free(PTR)) #endif -#if defined(_WIN32) && defined(MZ_EXPORTS) +#if defined(_WINDOWS) && defined(MZ_EXPORTS) #define MZ_EXPORT __declspec(dllexport) #else #define MZ_EXPORT @@ -160,12 +158,8 @@ #include /* memset, strncpy, strlen */ #include -#if defined(HAVE_STDINT_H) +#ifdef HAVE_STDINT_H # include -#elif defined(__has_include) -# if __has_include() -# include -# endif #endif #ifndef __INT8_TYPE__ @@ -193,32 +187,16 @@ typedef unsigned int uint32_t; typedef unsigned long long uint64_t; #endif -#if defined(HAVE_INTTYPES_H) +#ifdef HAVE_INTTYPES_H # include -#elif defined(__has_include) -# if __has_include() -# include -# endif #endif #ifndef PRId8 # define PRId8 "hhd" #endif -#ifndef PRIu8 -# define PRIu8 "hhu" -#endif -#ifndef PRIx8 -# define PRIx8 "hhx" -#endif #ifndef PRId16 # define PRId16 "hd" #endif -#ifndef PRIu16 -# define PRIu16 "hu" -#endif -#ifndef PRIx16 -# define PRIx16 "hx" -#endif #ifndef PRId32 # define PRId32 "d" #endif @@ -228,25 +206,25 @@ typedef unsigned long long uint64_t; #ifndef PRIx32 # define PRIx32 "x" #endif -#if ULONG_MAX == 0xfffffffful +#if ULONG_MAX == 4294967295UL # ifndef PRId64 -# define PRId64 "ld" +# define PRId64 "lld" # endif # ifndef PRIu64 -# define PRIu64 "lu" +# define PRIu64 "llu" # endif # ifndef PRIx64 -# define PRIx64 "lx" +# define PRIx64 "llx" # endif #else # ifndef PRId64 -# define PRId64 "lld" +# define PRId64 "ld" # endif # ifndef PRIu64 -# define PRIu64 "llu" +# define PRIu64 "lu" # endif # ifndef PRIx64 -# define PRIx64 "llx" +# define PRIx64 "lx" # endif #endif diff --git a/Sources/XlsxReaderWriter/minizip/mz_compat.c b/Sources/XlsxReaderWriter/minizip/mz_compat.c new file mode 100644 index 0000000..759e30b --- /dev/null +++ b/Sources/XlsxReaderWriter/minizip/mz_compat.c @@ -0,0 +1,991 @@ +/* mz_compat.c -- Backwards compatible interface for older versions + Version 2.8.9, July 4, 2019 + part of the MiniZip project + + Copyright (C) 2010-2019 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip + Copyright (C) 1998-2010 Gilles Vollant + https://www.winimage.com/zLibDll/minizip.html + + This program is distributed under the terms of the same license as zlib. + See the accompanying LICENSE file for the full text of the license. +*/ + + +#include "mz.h" +#include "mz_os.h" +#include "mz_strm.h" +#include "mz_strm_mem.h" +#include "mz_strm_os.h" +#include "mz_strm_zlib.h" +#include "mz_zip.h" + +#include /* SEEK */ + +#include "mz_compat.h" + +/***************************************************************************/ + +typedef struct mz_compat_s { + void *stream; + void *handle; + uint64_t entry_index; + int64_t entry_pos; + int64_t total_out; +} mz_compat; + +/***************************************************************************/ + +static int32_t zipConvertAppendToStreamMode(int append) +{ + int32_t mode = MZ_OPEN_MODE_WRITE; + switch (append) + { + case APPEND_STATUS_CREATE: + mode |= MZ_OPEN_MODE_CREATE; + break; + case APPEND_STATUS_CREATEAFTER: + mode |= MZ_OPEN_MODE_CREATE | MZ_OPEN_MODE_APPEND; + break; + case APPEND_STATUS_ADDINZIP: + mode |= MZ_OPEN_MODE_READ | MZ_OPEN_MODE_APPEND; + break; + } + return mode; +} + +zipFile zipOpen(const char *path, int append) +{ + zlib_filefunc64_def pzlib = mz_stream_os_get_interface(); + return zipOpen2(path, append, NULL, &pzlib); +} + +zipFile zipOpen64(const void *path, int append) +{ + zlib_filefunc64_def pzlib = mz_stream_os_get_interface(); + return zipOpen2(path, append, NULL, &pzlib); +} + +zipFile zipOpen2(const char *path, int append, const char **globalcomment, + zlib_filefunc_def *pzlib_filefunc_def) +{ + return zipOpen2_64(path, append, globalcomment, pzlib_filefunc_def); +} + +zipFile zipOpen2_64(const void *path, int append, const char **globalcomment, + zlib_filefunc64_def *pzlib_filefunc_def) +{ + zipFile zip = NULL; + int32_t mode = zipConvertAppendToStreamMode(append); + void *stream = NULL; + + if (pzlib_filefunc_def) + { + if (mz_stream_create(&stream, (mz_stream_vtbl *)*pzlib_filefunc_def) == NULL) + return NULL; + } + else + { + if (mz_stream_os_create(&stream) == NULL) + return NULL; + } + + if (mz_stream_open(stream, path, mode) != MZ_OK) + { + mz_stream_delete(&stream); + return NULL; + } + + zip = zipOpen_MZ(stream, append, globalcomment); + + if (zip == NULL) + { + mz_stream_delete(&stream); + return NULL; + } + + return zip; +} + +zipFile zipOpen_MZ(void *stream, int append, const char **globalcomment) +{ + mz_compat *compat = NULL; + int32_t err = MZ_OK; + int32_t mode = zipConvertAppendToStreamMode(append); + void *handle = NULL; + + mz_zip_create(&handle); + err = mz_zip_open(handle, stream, mode); + + if (err != MZ_OK) + { + mz_zip_delete(&handle); + return NULL; + } + + if (globalcomment != NULL) + mz_zip_get_comment(handle, globalcomment); + + compat = (mz_compat *)MZ_ALLOC(sizeof(mz_compat)); + if (compat != NULL) + { + compat->handle = handle; + compat->stream = stream; + } + else + { + mz_zip_delete(&handle); + } + + return (zipFile)compat; +} + +int zipOpenNewFileInZip5(zipFile file, const char *filename, const zip_fileinfo *zipfi, + const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global, + uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level, + int raw, int windowBits, int memLevel, int strategy, const char *password, + signed char aes, uint16_t version_madeby, uint16_t flag_base, int zip64) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file file_info; + uint64_t dos_date = 0; + + MZ_UNUSED(strategy); + MZ_UNUSED(memLevel); + MZ_UNUSED(windowBits); + MZ_UNUSED(size_extrafield_local); + MZ_UNUSED(extrafield_local); + + if (compat == NULL) + return ZIP_PARAMERROR; + + memset(&file_info, 0, sizeof(file_info)); + + if (zipfi != NULL) + { + if (zipfi->mz_dos_date != 0) + dos_date = zipfi->mz_dos_date; + else + dos_date = mz_zip_tm_to_dosdate(&zipfi->tmz_date); + + file_info.modified_date = mz_zip_dosdate_to_time_t(dos_date); + file_info.external_fa = zipfi->external_fa; + file_info.internal_fa = zipfi->internal_fa; + } + + if (filename == NULL) + filename = "-"; + + file_info.compression_method = compression_method; + file_info.filename = filename; + /* file_info.extrafield_local = extrafield_local; */ + /* file_info.extrafield_local_size = size_extrafield_local; */ + file_info.extrafield = extrafield_global; + file_info.extrafield_size = size_extrafield_global; + file_info.version_madeby = version_madeby; + file_info.comment = comment; + file_info.flag = flag_base; + if (zip64) + file_info.zip64 = MZ_ZIP64_FORCE; + else + file_info.zip64 = MZ_ZIP64_DISABLE; +#ifdef HAVE_WZAES + if ((aes && password != NULL) || (raw && (file_info.flag & MZ_ZIP_FLAG_ENCRYPTED))) + file_info.aes_version = MZ_AES_VERSION; +#endif + + return mz_zip_entry_write_open(compat->handle, &file_info, (int16_t)level, (uint8_t)raw, password); +} + +int zipWriteInFileInZip(zipFile file, const void *buf, uint32_t len) +{ + mz_compat *compat = (mz_compat *)file; + int32_t written = 0; + if (compat == NULL || len >= INT32_MAX) + return ZIP_PARAMERROR; + written = mz_zip_entry_write(compat->handle, buf, (int32_t)len); + if ((written < 0) || ((uint32_t)written != len)) + return ZIP_ERRNO; + return ZIP_OK; +} + +int zipCloseFileInZipRaw(zipFile file, uint32_t uncompressed_size, uint32_t crc32) +{ + return zipCloseFileInZipRaw64(file, uncompressed_size, crc32); +} + +int zipCloseFileInZipRaw64(zipFile file, int64_t uncompressed_size, uint32_t crc32) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return ZIP_PARAMERROR; + return mz_zip_entry_close_raw(compat->handle, uncompressed_size, crc32); +} + +int zipCloseFileInZip(zipFile file) +{ + return zipCloseFileInZip64(file); +} + +int zipCloseFileInZip64(zipFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return ZIP_PARAMERROR; + return mz_zip_entry_close(compat->handle); +} + +int zipClose(zipFile file, const char *global_comment) +{ + return zipClose_64(file, global_comment); +} + +int zipClose_64(zipFile file, const char *global_comment) +{ + return zipClose2_64(file, global_comment, MZ_VERSION_MADEBY); +} + +int zipClose2_64(zipFile file, const char *global_comment, uint16_t version_madeby) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + + if (compat->handle != NULL) + err = zipClose2_MZ(file, global_comment, version_madeby); + + if (compat->stream != NULL) + { + mz_stream_close(compat->stream); + mz_stream_delete(&compat->stream); + } + + MZ_FREE(compat); + + return err; +} + +/* Only closes the zip handle, does not close the stream */ +int zipClose_MZ(zipFile file, const char *global_comment) +{ + return zipClose2_MZ(file, global_comment, MZ_VERSION_MADEBY); +} + +/* Only closes the zip handle, does not close the stream */ +int zipClose2_MZ(zipFile file, const char *global_comment, uint16_t version_madeby) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + + if (compat == NULL) + return ZIP_PARAMERROR; + if (compat->handle == NULL) + return err; + + if (global_comment != NULL) + mz_zip_set_comment(compat->handle, global_comment); + + mz_zip_set_version_madeby(compat->handle, version_madeby); + err = mz_zip_close(compat->handle); + mz_zip_delete(&compat->handle); + + return err; +} + +void* zipGetStream(zipFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return NULL; + return (void *)compat->stream; +} + +/***************************************************************************/ + +unzFile unzOpen(const char *path) +{ + return unzOpen64(path); +} + +unzFile unzOpen64(const void *path) +{ + zlib_filefunc64_def pzlib = mz_stream_os_get_interface(); + return unzOpen2(path, &pzlib); +} + +unzFile unzOpen2(const char *path, zlib_filefunc_def *pzlib_filefunc_def) +{ + return unzOpen2_64(path, pzlib_filefunc_def); +} + +unzFile unzOpen2_64(const void *path, zlib_filefunc64_def *pzlib_filefunc_def) +{ + unzFile unz = NULL; + void *stream = NULL; + + if (pzlib_filefunc_def) + { + if (mz_stream_create(&stream, (mz_stream_vtbl *)*pzlib_filefunc_def) == NULL) + return NULL; + } + else + { + if (mz_stream_os_create(&stream) == NULL) + return NULL; + } + + if (mz_stream_open(stream, path, MZ_OPEN_MODE_READ) != MZ_OK) + { + mz_stream_delete(&stream); + return NULL; + } + + unz = unzOpen_MZ(stream); + if (unz == NULL) + { + mz_stream_delete(&stream); + return NULL; + } + return unz; +} + +unzFile unzOpen_MZ(void *stream) +{ + mz_compat *compat = NULL; + int32_t err = MZ_OK; + void *handle = NULL; + + mz_zip_create(&handle); + err = mz_zip_open(handle, stream, MZ_OPEN_MODE_READ); + + if (err != MZ_OK) + { + mz_zip_delete(&handle); + return NULL; + } + + compat = (mz_compat *)MZ_ALLOC(sizeof(mz_compat)); + if (compat != NULL) + { + compat->handle = handle; + compat->stream = stream; + + mz_zip_goto_first_entry(compat->handle); + } + else + { + mz_zip_delete(&handle); + } + + return (unzFile)compat; +} + +int unzClose(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + + if (compat == NULL) + return UNZ_PARAMERROR; + + if (compat->handle != NULL) + err = unzClose_MZ(file); + + if (compat->stream != NULL) + { + mz_stream_close(compat->stream); + mz_stream_delete(&compat->stream); + } + + MZ_FREE(compat); + + return err; +} + +/* Only closes the zip handle, does not close the stream */ +int unzClose_MZ(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + + if (compat == NULL) + return UNZ_PARAMERROR; + + err = mz_zip_close(compat->handle); + mz_zip_delete(&compat->handle); + + return err; +} + +int unzGetGlobalInfo(unzFile file, unz_global_info* pglobal_info32) +{ + mz_compat *compat = (mz_compat *)file; + unz_global_info64 global_info64; + int32_t err = MZ_OK; + + memset(pglobal_info32, 0, sizeof(unz_global_info)); + if (compat == NULL) + return UNZ_PARAMERROR; + + err = unzGetGlobalInfo64(file, &global_info64); + if (err == MZ_OK) + { + pglobal_info32->number_entry = (uint32_t)global_info64.number_entry; + pglobal_info32->size_comment = global_info64.size_comment; + pglobal_info32->number_disk_with_CD = global_info64.number_disk_with_CD; + } + return err; +} + +int unzGetGlobalInfo64(unzFile file, unz_global_info64 *pglobal_info) +{ + mz_compat *compat = (mz_compat *)file; + const char *comment_ptr = NULL; + int32_t err = MZ_OK; + + memset(pglobal_info, 0, sizeof(unz_global_info64)); + if (compat == NULL) + return UNZ_PARAMERROR; + err = mz_zip_get_comment(compat->handle, &comment_ptr); + if (err == MZ_OK) + pglobal_info->size_comment = (uint16_t)strlen(comment_ptr); + if ((err == MZ_OK) || (err == MZ_EXIST_ERROR)) + err = mz_zip_get_number_entry(compat->handle, &pglobal_info->number_entry); + if (err == MZ_OK) + err = mz_zip_get_disk_number_with_cd(compat->handle, &pglobal_info->number_disk_with_CD); + return err; +} + +int unzGetGlobalComment(unzFile file, char *comment, uint16_t comment_size) +{ + mz_compat *compat = (mz_compat *)file; + const char *comment_ptr = NULL; + int32_t err = MZ_OK; + + if (comment == NULL || comment_size == 0) + return UNZ_PARAMERROR; + err = mz_zip_get_comment(compat->handle, &comment_ptr); + if (err == MZ_OK) + { + strncpy(comment, comment_ptr, comment_size - 1); + comment[comment_size - 1] = 0; + } + return err; +} + +int unzOpenCurrentFile3(unzFile file, int *method, int *level, int raw, const char *password) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file *file_info = NULL; + int32_t err = MZ_OK; + void *stream = NULL; + + if (compat == NULL) + return UNZ_PARAMERROR; + if (method != NULL) + *method = 0; + if (level != NULL) + *level = 0; + + compat->total_out = 0; + err = mz_zip_entry_read_open(compat->handle, (uint8_t)raw, password); + if (err == MZ_OK) + err = mz_zip_entry_get_info(compat->handle, &file_info); + if (err == MZ_OK) + { + if (method != NULL) + { + *method = file_info->compression_method; + } + + if (level != NULL) + { + *level = 6; + switch (file_info->flag & 0x06) + { + case MZ_ZIP_FLAG_DEFLATE_SUPER_FAST: + *level = 1; + break; + case MZ_ZIP_FLAG_DEFLATE_FAST: + *level = 2; + break; + case MZ_ZIP_FLAG_DEFLATE_MAX: + *level = 9; + break; + } + } + } + if (err == MZ_OK) + err = mz_zip_get_stream(compat->handle, &stream); + if (err == MZ_OK) + compat->entry_pos = mz_stream_tell(stream); + return err; +} + +int unzOpenCurrentFile(unzFile file) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +int unzOpenCurrentFilePassword(unzFile file, const char *password) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +int unzOpenCurrentFile2(unzFile file, int *method, int *level, int raw) +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +int unzReadCurrentFile(unzFile file, void *buf, uint32_t len) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + if (compat == NULL || len >= INT32_MAX) + return UNZ_PARAMERROR; + err = mz_zip_entry_read(compat->handle, buf, (int32_t)len); + if (err > 0) + compat->total_out += (uint32_t)err; + return err; +} + +int unzCloseCurrentFile(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + if (compat == NULL) + return UNZ_PARAMERROR; + err = mz_zip_entry_close(compat->handle); + return err; +} + +int unzGetCurrentFileInfo(unzFile file, unz_file_info *pfile_info, char *filename, + uint16_t filename_size, void *extrafield, uint16_t extrafield_size, char *comment, uint16_t comment_size) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file *file_info = NULL; + uint16_t bytes_to_copy = 0; + int32_t err = MZ_OK; + + if (compat == NULL) + return UNZ_PARAMERROR; + + err = mz_zip_entry_get_info(compat->handle, &file_info); + + if ((err == MZ_OK) && (pfile_info != NULL)) + { + pfile_info->version = file_info->version_madeby; + pfile_info->version_needed = file_info->version_needed; + pfile_info->flag = file_info->flag; + pfile_info->compression_method = file_info->compression_method; + pfile_info->mz_dos_date = mz_zip_time_t_to_dos_date(file_info->modified_date); + //mz_zip_time_t_to_tm(file_info->modified_date, &pfile_info->tmu_date); + //pfile_info->tmu_date.tm_year += 1900; + pfile_info->crc = file_info->crc; + + pfile_info->size_filename = file_info->filename_size; + pfile_info->size_file_extra = file_info->extrafield_size; + pfile_info->size_file_comment = file_info->comment_size; + + pfile_info->disk_num_start = (uint16_t)file_info->disk_number; + pfile_info->internal_fa = file_info->internal_fa; + pfile_info->external_fa = file_info->external_fa; + + pfile_info->compressed_size = (uint32_t)file_info->compressed_size; + pfile_info->uncompressed_size = (uint32_t)file_info->uncompressed_size; + + if (filename_size > 0 && filename != NULL && file_info->filename != NULL) + { + bytes_to_copy = filename_size; + if (bytes_to_copy > file_info->filename_size) + bytes_to_copy = file_info->filename_size; + memcpy(filename, file_info->filename, bytes_to_copy); + if (bytes_to_copy < filename_size) + filename[bytes_to_copy] = 0; + } + if (extrafield_size > 0 && extrafield != NULL) + { + bytes_to_copy = extrafield_size; + if (bytes_to_copy > file_info->extrafield_size) + bytes_to_copy = file_info->extrafield_size; + memcpy(extrafield, file_info->extrafield, bytes_to_copy); + } + if (comment_size > 0 && comment != NULL && file_info->comment != NULL) + { + bytes_to_copy = comment_size; + if (bytes_to_copy > file_info->comment_size) + bytes_to_copy = file_info->comment_size; + memcpy(comment, file_info->comment, bytes_to_copy); + if (bytes_to_copy < comment_size) + comment[bytes_to_copy] = 0; + } + } + return err; +} + +int unzGetCurrentFileInfo64(unzFile file, unz_file_info64 * pfile_info, char *filename, + uint16_t filename_size, void *extrafield, uint16_t extrafield_size, char *comment, uint16_t comment_size) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file *file_info = NULL; + uint16_t bytes_to_copy = 0; + int32_t err = MZ_OK; + + if (compat == NULL) + return UNZ_PARAMERROR; + + err = mz_zip_entry_get_info(compat->handle, &file_info); + + if ((err == MZ_OK) && (pfile_info != NULL)) + { + pfile_info->version = file_info->version_madeby; + pfile_info->version_needed = file_info->version_needed; + pfile_info->flag = file_info->flag; + pfile_info->compression_method = file_info->compression_method; + pfile_info->mz_dos_date = mz_zip_time_t_to_dos_date(file_info->modified_date); + //mz_zip_time_t_to_tm(file_info->modified_date, &pfile_info->tmu_date); + //pfile_info->tmu_date.tm_year += 1900; + pfile_info->crc = file_info->crc; + + pfile_info->size_filename = file_info->filename_size; + pfile_info->size_file_extra = file_info->extrafield_size; + pfile_info->size_file_comment = file_info->comment_size; + + pfile_info->disk_num_start = file_info->disk_number; + pfile_info->internal_fa = file_info->internal_fa; + pfile_info->external_fa = file_info->external_fa; + + pfile_info->compressed_size = (uint64_t)file_info->compressed_size; + pfile_info->uncompressed_size = (uint64_t)file_info->uncompressed_size; + + if (filename_size > 0 && filename != NULL && file_info->filename != NULL) + { + bytes_to_copy = filename_size; + if (bytes_to_copy > file_info->filename_size) + bytes_to_copy = file_info->filename_size; + memcpy(filename, file_info->filename, bytes_to_copy); + if (bytes_to_copy < filename_size) + filename[bytes_to_copy] = 0; + } + + if (extrafield_size > 0 && extrafield != NULL) + { + bytes_to_copy = extrafield_size; + if (bytes_to_copy > file_info->extrafield_size) + bytes_to_copy = file_info->extrafield_size; + memcpy(extrafield, file_info->extrafield, bytes_to_copy); + } + + if (comment_size > 0 && comment != NULL && file_info->comment != NULL) + { + bytes_to_copy = comment_size; + if (bytes_to_copy > file_info->comment_size) + bytes_to_copy = file_info->comment_size; + memcpy(comment, file_info->comment, bytes_to_copy); + if (bytes_to_copy < comment_size) + comment[bytes_to_copy] = 0; + } + } + return err; +} + +int unzGoToFirstFile(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return UNZ_PARAMERROR; + compat->entry_index = 0; + return mz_zip_goto_first_entry(compat->handle); +} + +int unzGoToNextFile(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + if (compat == NULL) + return UNZ_PARAMERROR; + err = mz_zip_goto_next_entry(compat->handle); + if (err != MZ_END_OF_LIST) + compat->entry_index += 1; + return err; +} + +int unzLocateFile(unzFile file, const char *filename, unzFileNameComparer filename_compare_func) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file *file_info = NULL; + uint64_t preserve_index = 0; + int32_t err = MZ_OK; + int32_t result = 0; + + if (compat == NULL) + return UNZ_PARAMERROR; + + preserve_index = compat->entry_index; + + err = mz_zip_goto_first_entry(compat->handle); + while (err == MZ_OK) + { + err = mz_zip_entry_get_info(compat->handle, &file_info); + if (err != MZ_OK) + break; + + if (filename_compare_func != NULL) + result = filename_compare_func(file, filename, file_info->filename); + else + result = strcmp(filename, file_info->filename); + + if (result == 0) + return MZ_OK; + + err = mz_zip_goto_next_entry(compat->handle); + } + + compat->entry_index = preserve_index; + return err; +} + +/***************************************************************************/ + +int unzGetFilePos(unzFile file, unz_file_pos *file_pos) +{ + mz_compat *compat = (mz_compat *)file; + int32_t offset = 0; + + if (compat == NULL || file_pos == NULL) + return UNZ_PARAMERROR; + + offset = unzGetOffset(file); + if (offset < 0) + return offset; + + file_pos->pos_in_zip_directory = (uint32_t)offset; + file_pos->num_of_file = (uint32_t)compat->entry_index; + return MZ_OK; +} + +int unzGoToFilePos(unzFile file, unz_file_pos *file_pos) +{ + mz_compat *compat = (mz_compat *)file; + unz64_file_pos file_pos64; + + if (compat == NULL || file_pos == NULL) + return UNZ_PARAMERROR; + + file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; + file_pos64.num_of_file = file_pos->num_of_file; + + return unzGoToFilePos64(file, &file_pos64); +} + +int unzGetFilePos64(unzFile file, unz64_file_pos *file_pos) +{ + mz_compat *compat = (mz_compat *)file; + int64_t offset = 0; + + if (compat == NULL || file_pos == NULL) + return UNZ_PARAMERROR; + + offset = unzGetOffset64(file); + if (offset < 0) + return (int)offset; + + file_pos->pos_in_zip_directory = offset; + file_pos->num_of_file = compat->entry_index; + return UNZ_OK; +} + +int unzGoToFilePos64(unzFile file, const unz64_file_pos *file_pos) +{ + mz_compat *compat = (mz_compat *)file; + int32_t err = MZ_OK; + + if (compat == NULL || file_pos == NULL) + return UNZ_PARAMERROR; + + err = mz_zip_goto_entry(compat->handle, file_pos->pos_in_zip_directory); + if (err == MZ_OK) + compat->entry_index = file_pos->num_of_file; + return err; +} + +int32_t unzGetOffset(unzFile file) +{ + return (int32_t)unzGetOffset64(file); +} + +int64_t unzGetOffset64(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return UNZ_PARAMERROR; + return mz_zip_get_entry(compat->handle); +} + +int unzSetOffset(unzFile file, uint32_t pos) +{ + return unzSetOffset64(file, pos); +} + +int unzSetOffset64(unzFile file, int64_t pos) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return UNZ_PARAMERROR; + return (int)mz_zip_goto_entry(compat->handle, pos); +} + +int unzGetLocalExtrafield(unzFile file, void *buf, unsigned int len) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file *file_info = NULL; + int32_t err = MZ_OK; + int32_t bytes_to_copy = 0; + + if (compat == NULL || buf == NULL || len >= INT32_MAX) + return UNZ_PARAMERROR; + + err = mz_zip_entry_get_local_info(compat->handle, &file_info); + if (err != MZ_OK) + return err; + + bytes_to_copy = (int32_t)len; + if (bytes_to_copy > file_info->extrafield_size) + bytes_to_copy = file_info->extrafield_size; + + memcpy(buf, file_info->extrafield, bytes_to_copy); + return MZ_OK; +} + +int64_t unztell(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return UNZ_PARAMERROR; + return (int64_t)compat->total_out; +} + +int32_t unzTell(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return UNZ_PARAMERROR; + return (int32_t)compat->total_out; +} + +int64_t unzTell64(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return UNZ_PARAMERROR; + return (int64_t)compat->total_out; +} + +int unzSeek(unzFile file, int32_t offset, int origin) +{ + return unzSeek64(file, offset, origin); +} + +int unzSeek64(unzFile file, int64_t offset, int origin) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file *file_info = NULL; + int64_t position = 0; + int32_t err = MZ_OK; + void *stream = NULL; + + if (compat == NULL) + return UNZ_PARAMERROR; + err = mz_zip_entry_get_info(compat->handle, &file_info); + if (err != MZ_OK) + return err; + if (file_info->compression_method != MZ_COMPRESS_METHOD_STORE) + return UNZ_ERRNO; + + if (origin == SEEK_SET) + position = offset; + else if (origin == SEEK_CUR) + position = compat->total_out + offset; + else if (origin == SEEK_END) + position = (int64_t)file_info->compressed_size + offset; + else + return UNZ_PARAMERROR; + + if (position > (int64_t)file_info->compressed_size) + return UNZ_PARAMERROR; + + err = mz_zip_get_stream(compat->handle, &stream); + if (err == MZ_OK) + err = mz_stream_seek(stream, compat->entry_pos + position, MZ_SEEK_SET); + if (err == MZ_OK) + compat->total_out = position; + return err; +} + +int unzEndOfFile(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + mz_zip_file *file_info = NULL; + int32_t err = MZ_OK; + + if (compat == NULL) + return UNZ_PARAMERROR; + err = mz_zip_entry_get_info(compat->handle, &file_info); + if (err != MZ_OK) + return err; + if (compat->total_out == (int64_t)file_info->uncompressed_size) + return 1; + return 0; +} + +void* unzGetStream(unzFile file) +{ + mz_compat *compat = (mz_compat *)file; + if (compat == NULL) + return NULL; + return (void *)compat->stream; +} + +/***************************************************************************/ + +void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + *pzlib_filefunc_def = mz_stream_os_get_interface(); +} + +void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + *pzlib_filefunc_def = mz_stream_os_get_interface(); +} + +void fill_win32_filefunc(zlib_filefunc_def *pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + *pzlib_filefunc_def = mz_stream_os_get_interface(); +} + +void fill_win32_filefunc64(zlib_filefunc64_def *pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + *pzlib_filefunc_def = mz_stream_os_get_interface(); +} + +void fill_win32_filefunc64A(zlib_filefunc64_def *pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + *pzlib_filefunc_def = mz_stream_os_get_interface(); +} + +void fill_win32_filefunc64W(zlib_filefunc64_def *pzlib_filefunc_def) +{ + /* NOTE: You should no longer pass in widechar string to open function */ + if (pzlib_filefunc_def != NULL) + *pzlib_filefunc_def = mz_stream_os_get_interface(); +} + +void fill_memory_filefunc(zlib_filefunc_def *pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + *pzlib_filefunc_def = mz_stream_mem_get_interface(); +} diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_compat.h b/Sources/XlsxReaderWriter/minizip/mz_compat.h similarity index 99% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_compat.h rename to Sources/XlsxReaderWriter/minizip/mz_compat.h index 3253eb9..ad44fef 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_compat.h +++ b/Sources/XlsxReaderWriter/minizip/mz_compat.h @@ -13,9 +13,10 @@ #ifndef MZ_COMPAT_H #define MZ_COMPAT_H +#define HAVE_ZLIB #include "mz.h" -#include "../SSZipCommon.h" +#include "SSZipCommon.h" #ifdef __cplusplus extern "C" { diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt.c b/Sources/XlsxReaderWriter/minizip/mz_crypt.c similarity index 93% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt.c rename to Sources/XlsxReaderWriter/minizip/mz_crypt.c index dd2cd42..2a01a49 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt.c +++ b/Sources/XlsxReaderWriter/minizip/mz_crypt.c @@ -1,16 +1,17 @@ /* mz_crypt.c -- Crypto/hash functions - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. */ +#define HAVE_ZLIB #include "mz.h" -#include "mz_os.h" #include "mz_crypt.h" #if defined(HAVE_ZLIB) @@ -41,13 +42,8 @@ /***************************************************************************/ -#if defined(MZ_ZIP_NO_CRYPTO) -int32_t mz_crypt_rand(uint8_t *buf, int32_t size) { - return mz_os_rand(buf, size); -} -#endif - -uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size) { +uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size) +{ #if defined(HAVE_ZLIB) return (uint32_t)ZLIB_PREFIX(crc32)((z_crc_t)value, buf, (uInt)size); #elif defined(HAVE_LZMA) @@ -100,7 +96,8 @@ uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size) }; value = ~value; - while (size > 0) { + while (size > 0) + { value = (value >> 8) ^ crc32_table[(value ^ *buf) & 0xFF]; buf += 1; @@ -111,9 +108,10 @@ uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size) #endif } -#if defined(HAVE_WZAES) +#ifndef MZ_ZIP_NO_ENCRYPTION int32_t mz_crypt_pbkdf2(uint8_t *password, int32_t password_length, uint8_t *salt, - int32_t salt_length, int32_t iteration_count, uint8_t *key, int32_t key_length) { + int32_t salt_length, int32_t iteration_count, uint8_t *key, int32_t key_length) +{ void *hmac1 = NULL; void *hmac2 = NULL; void *hmac3 = NULL; @@ -146,7 +144,8 @@ int32_t mz_crypt_pbkdf2(uint8_t *password, int32_t password_length, uint8_t *sa block_count = 1 + ((uint16_t)key_length - 1) / MZ_HASH_SHA1_SIZE; - for (i = 0; (err == MZ_OK) && (i < block_count); i += 1) { + for (i = 0; (err == MZ_OK) && (i < block_count); i += 1) + { memset(ux, 0, sizeof(ux)); err = mz_crypt_hmac_copy(hmac2, hmac3); @@ -158,7 +157,8 @@ int32_t mz_crypt_pbkdf2(uint8_t *password, int32_t password_length, uint8_t *sa uu[2] = (uint8_t)((i + 1) >> 8); uu[3] = (uint8_t)(i + 1); - for (j = 0, k = 4; j < iteration_count; j += 1) { + for (j = 0, k = 4; j < iteration_count; j += 1) + { err = mz_crypt_hmac_update(hmac3, uu, k); if (err == MZ_OK) err = mz_crypt_hmac_end(hmac3, uu, sizeof(uu)); diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt.h b/Sources/XlsxReaderWriter/minizip/mz_crypt.h similarity index 94% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt.h rename to Sources/XlsxReaderWriter/minizip/mz_crypt.h index 59a193c..1f972e8 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt.h +++ b/Sources/XlsxReaderWriter/minizip/mz_crypt.h @@ -1,8 +1,9 @@ /* mz_crypt.h -- Crypto/hash functions - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt_apple.c b/Sources/XlsxReaderWriter/minizip/mz_crypt_apple.c similarity index 89% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt_apple.c rename to Sources/XlsxReaderWriter/minizip/mz_crypt_apple.c index 4519753..e8fa897 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_crypt_apple.c +++ b/Sources/XlsxReaderWriter/minizip/mz_crypt_apple.c @@ -1,8 +1,9 @@ /* mz_crypt_apple.c -- Crypto/hash functions for Apple - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -20,7 +21,8 @@ /***************************************************************************/ -int32_t mz_crypt_rand(uint8_t *buf, int32_t size) { +int32_t mz_crypt_rand(uint8_t *buf, int32_t size) +{ if (SecRandomCopyBytes(kSecRandomDefault, size, buf) != errSecSuccess) return 0; return size; @@ -38,14 +40,16 @@ typedef struct mz_crypt_sha_s { /***************************************************************************/ -void mz_crypt_sha_reset(void *handle) { +void mz_crypt_sha_reset(void *handle) +{ mz_crypt_sha *sha = (mz_crypt_sha *)handle; sha->error = 0; sha->initialized = 0; } -int32_t mz_crypt_sha_begin(void *handle) { +int32_t mz_crypt_sha_begin(void *handle) +{ mz_crypt_sha *sha = (mz_crypt_sha *)handle; if (sha == NULL) @@ -67,7 +71,8 @@ int32_t mz_crypt_sha_begin(void *handle) { return MZ_OK; } -int32_t mz_crypt_sha_update(void *handle, const void *buf, int32_t size) { +int32_t mz_crypt_sha_update(void *handle, const void *buf, int32_t size) +{ mz_crypt_sha *sha = (mz_crypt_sha *)handle; if (sha == NULL || buf == NULL || !sha->initialized) @@ -84,17 +89,21 @@ int32_t mz_crypt_sha_update(void *handle, const void *buf, int32_t size) { return size; } -int32_t mz_crypt_sha_end(void *handle, uint8_t *digest, int32_t digest_size) { +int32_t mz_crypt_sha_end(void *handle, uint8_t *digest, int32_t digest_size) +{ mz_crypt_sha *sha = (mz_crypt_sha *)handle; if (sha == NULL || digest == NULL || !sha->initialized) return MZ_PARAM_ERROR; - if (sha->algorithm == MZ_HASH_SHA1) { + if (sha->algorithm == MZ_HASH_SHA1) + { if (digest_size < MZ_HASH_SHA1_SIZE) return MZ_BUF_ERROR; sha->error = CC_SHA1_Final(digest, &sha->ctx1); - } else { + } + else + { if (digest_size < MZ_HASH_SHA256_SIZE) return MZ_BUF_ERROR; sha->error = CC_SHA256_Final(digest, &sha->ctx256); @@ -106,16 +115,19 @@ int32_t mz_crypt_sha_end(void *handle, uint8_t *digest, int32_t digest_size) { return MZ_OK; } -void mz_crypt_sha_set_algorithm(void *handle, uint16_t algorithm) { +void mz_crypt_sha_set_algorithm(void *handle, uint16_t algorithm) +{ mz_crypt_sha *sha = (mz_crypt_sha *)handle; sha->algorithm = algorithm; } -void *mz_crypt_sha_create(void **handle) { +void *mz_crypt_sha_create(void **handle) +{ mz_crypt_sha *sha = NULL; sha = (mz_crypt_sha *)MZ_ALLOC(sizeof(mz_crypt_sha)); - if (sha != NULL) { + if (sha != NULL) + { memset(sha, 0, sizeof(mz_crypt_sha)); sha->algorithm = MZ_HASH_SHA256; } @@ -125,12 +137,14 @@ void *mz_crypt_sha_create(void **handle) { return sha; } -void mz_crypt_sha_delete(void **handle) { +void mz_crypt_sha_delete(void **handle) +{ mz_crypt_sha *sha = NULL; if (handle == NULL) return; sha = (mz_crypt_sha *)*handle; - if (sha != NULL) { + if (sha != NULL) + { mz_crypt_sha_reset(*handle); MZ_FREE(sha); } @@ -147,7 +161,8 @@ typedef struct mz_crypt_aes_s { /***************************************************************************/ -void mz_crypt_aes_reset(void *handle) { +void mz_crypt_aes_reset(void *handle) +{ mz_crypt_aes *aes = (mz_crypt_aes *)handle; if (aes->crypt != NULL) @@ -155,7 +170,8 @@ void mz_crypt_aes_reset(void *handle) { aes->crypt = NULL; } -int32_t mz_crypt_aes_encrypt(void *handle, uint8_t *buf, int32_t size) { +int32_t mz_crypt_aes_encrypt(void *handle, uint8_t *buf, int32_t size) +{ mz_crypt_aes *aes = (mz_crypt_aes *)handle; size_t data_moved = 0; @@ -172,7 +188,8 @@ int32_t mz_crypt_aes_encrypt(void *handle, uint8_t *buf, int32_t size) { return size; } -int32_t mz_crypt_aes_decrypt(void *handle, uint8_t *buf, int32_t size) { +int32_t mz_crypt_aes_decrypt(void *handle, uint8_t *buf, int32_t size) +{ mz_crypt_aes *aes = (mz_crypt_aes *)handle; size_t data_moved = 0; @@ -189,7 +206,8 @@ int32_t mz_crypt_aes_decrypt(void *handle, uint8_t *buf, int32_t size) { return size; } -int32_t mz_crypt_aes_set_encrypt_key(void *handle, const void *key, int32_t key_length) { +int32_t mz_crypt_aes_set_encrypt_key(void *handle, const void *key, int32_t key_length) +{ mz_crypt_aes *aes = (mz_crypt_aes *)handle; @@ -207,7 +225,8 @@ int32_t mz_crypt_aes_set_encrypt_key(void *handle, const void *key, int32_t key_ return MZ_OK; } -int32_t mz_crypt_aes_set_decrypt_key(void *handle, const void *key, int32_t key_length) { +int32_t mz_crypt_aes_set_decrypt_key(void *handle, const void *key, int32_t key_length) +{ mz_crypt_aes *aes = (mz_crypt_aes *)handle; @@ -225,12 +244,14 @@ int32_t mz_crypt_aes_set_decrypt_key(void *handle, const void *key, int32_t key_ return MZ_OK; } -void mz_crypt_aes_set_mode(void *handle, int32_t mode) { +void mz_crypt_aes_set_mode(void *handle, int32_t mode) +{ mz_crypt_aes *aes = (mz_crypt_aes *)handle; aes->mode = mode; } -void *mz_crypt_aes_create(void **handle) { +void *mz_crypt_aes_create(void **handle) +{ mz_crypt_aes *aes = NULL; aes = (mz_crypt_aes *)MZ_ALLOC(sizeof(mz_crypt_aes)); @@ -242,12 +263,14 @@ void *mz_crypt_aes_create(void **handle) { return aes; } -void mz_crypt_aes_delete(void **handle) { +void mz_crypt_aes_delete(void **handle) +{ mz_crypt_aes *aes = NULL; if (handle == NULL) return; aes = (mz_crypt_aes *)*handle; - if (aes != NULL) { + if (aes != NULL) + { mz_crypt_aes_reset(*handle); MZ_FREE(aes); } @@ -265,18 +288,21 @@ typedef struct mz_crypt_hmac_s { /***************************************************************************/ -static void mz_crypt_hmac_free(void *handle) { +static void mz_crypt_hmac_free(void *handle) +{ mz_crypt_hmac *hmac = (mz_crypt_hmac *)handle; memset(&hmac->ctx, 0, sizeof(hmac->ctx)); } -void mz_crypt_hmac_reset(void *handle) { +void mz_crypt_hmac_reset(void *handle) +{ mz_crypt_hmac *hmac = (mz_crypt_hmac *)handle; mz_crypt_hmac_free(handle); hmac->error = 0; } -int32_t mz_crypt_hmac_init(void *handle, const void *key, int32_t key_length) { +int32_t mz_crypt_hmac_init(void *handle, const void *key, int32_t key_length) +{ mz_crypt_hmac *hmac = (mz_crypt_hmac *)handle; CCHmacAlgorithm algorithm = 0; @@ -296,7 +322,8 @@ int32_t mz_crypt_hmac_init(void *handle, const void *key, int32_t key_length) { return MZ_OK; } -int32_t mz_crypt_hmac_update(void *handle, const void *buf, int32_t size) { +int32_t mz_crypt_hmac_update(void *handle, const void *buf, int32_t size) +{ mz_crypt_hmac *hmac = (mz_crypt_hmac *)handle; if (hmac == NULL || buf == NULL) @@ -306,17 +333,21 @@ int32_t mz_crypt_hmac_update(void *handle, const void *buf, int32_t size) { return MZ_OK; } -int32_t mz_crypt_hmac_end(void *handle, uint8_t *digest, int32_t digest_size) { +int32_t mz_crypt_hmac_end(void *handle, uint8_t *digest, int32_t digest_size) +{ mz_crypt_hmac *hmac = (mz_crypt_hmac *)handle; if (hmac == NULL || digest == NULL) return MZ_PARAM_ERROR; - if (hmac->algorithm == MZ_HASH_SHA1) { + if (hmac->algorithm == MZ_HASH_SHA1) + { if (digest_size < MZ_HASH_SHA1_SIZE) return MZ_BUF_ERROR; CCHmacFinal(&hmac->ctx, digest); - } else { + } + else + { if (digest_size < MZ_HASH_SHA256_SIZE) return MZ_BUF_ERROR; CCHmacFinal(&hmac->ctx, digest); @@ -325,12 +356,14 @@ int32_t mz_crypt_hmac_end(void *handle, uint8_t *digest, int32_t digest_size) { return MZ_OK; } -void mz_crypt_hmac_set_algorithm(void *handle, uint16_t algorithm) { +void mz_crypt_hmac_set_algorithm(void *handle, uint16_t algorithm) +{ mz_crypt_hmac *hmac = (mz_crypt_hmac *)handle; hmac->algorithm = algorithm; } -int32_t mz_crypt_hmac_copy(void *src_handle, void *target_handle) { +int32_t mz_crypt_hmac_copy(void *src_handle, void *target_handle) +{ mz_crypt_hmac *source = (mz_crypt_hmac *)src_handle; mz_crypt_hmac *target = (mz_crypt_hmac *)target_handle; @@ -341,11 +374,13 @@ int32_t mz_crypt_hmac_copy(void *src_handle, void *target_handle) { return MZ_OK; } -void *mz_crypt_hmac_create(void **handle) { +void *mz_crypt_hmac_create(void **handle) +{ mz_crypt_hmac *hmac = NULL; hmac = (mz_crypt_hmac *)MZ_ALLOC(sizeof(mz_crypt_hmac)); - if (hmac != NULL) { + if (hmac != NULL) + { memset(hmac, 0, sizeof(mz_crypt_hmac)); hmac->algorithm = MZ_HASH_SHA256; } @@ -355,12 +390,14 @@ void *mz_crypt_hmac_create(void **handle) { return hmac; } -void mz_crypt_hmac_delete(void **handle) { +void mz_crypt_hmac_delete(void **handle) +{ mz_crypt_hmac *hmac = NULL; if (handle == NULL) return; hmac = (mz_crypt_hmac *)*handle; - if (hmac != NULL) { + if (hmac != NULL) + { mz_crypt_hmac_free(*handle); MZ_FREE(hmac); } @@ -371,7 +408,8 @@ void mz_crypt_hmac_delete(void **handle) { #if defined(MZ_ZIP_SIGNING) int32_t mz_crypt_sign(uint8_t *message, int32_t message_size, uint8_t *cert_data, int32_t cert_data_size, - const char *cert_pwd, uint8_t **signature, int32_t *signature_size) { + const char *cert_pwd, uint8_t **signature, int32_t *signature_size) +{ CFStringRef password_ref = NULL; CFDictionaryRef options_dict = NULL; CFDictionaryRef identity_trust = NULL; @@ -406,10 +444,12 @@ int32_t mz_crypt_sign(uint8_t *message, int32_t message_size, uint8_t *cert_data identity = (SecIdentityRef)CFDictionaryGetValue(identity_trust, kSecImportItemIdentity); if (identity) trust = (SecTrustRef)CFDictionaryGetValue(identity_trust, kSecImportItemTrust); - if (trust) { + if (trust) + { status = CMSEncodeContent(identity, NULL, NULL, FALSE, 0, message, message_size, &signature_out); - if (status == errSecSuccess) { + if (status == errSecSuccess) + { *signature_size = CFDataGetLength(signature_out); *signature = (uint8_t *)MZ_ALLOC(*signature_size); @@ -433,7 +473,8 @@ int32_t mz_crypt_sign(uint8_t *message, int32_t message_size, uint8_t *cert_data return err; } -int32_t mz_crypt_sign_verify(uint8_t *message, int32_t message_size, uint8_t *signature, int32_t signature_size) { +int32_t mz_crypt_sign_verify(uint8_t *message, int32_t message_size, uint8_t *signature, int32_t signature_size) +{ CMSDecoderRef decoder = NULL; CMSSignerStatus signer_status = 0; CFDataRef message_out = NULL; @@ -455,20 +496,24 @@ int32_t mz_crypt_sign_verify(uint8_t *message, int32_t message_size, uint8_t *si if (status == errSecSuccess) trust_policy = SecPolicyCreateBasicX509(); - if (status == errSecSuccess && trust_policy) { + if (status == errSecSuccess && trust_policy) + { CMSDecoderGetNumSigners(decoder, &signer_count); if (signer_count > 0) err = MZ_OK; - for (i = 0; i < signer_count; i += 1) { + for (i = 0; i < signer_count; i += 1) + { status = CMSDecoderCopySignerStatus(decoder, i, trust_policy, TRUE, &signer_status, NULL, &verify_status); - if (status != errSecSuccess || verify_status != 0 || signer_status != kCMSSignerValid) { + if (status != errSecSuccess || verify_status != 0 || signer_status != kCMSSignerValid) + { err = MZ_SIGN_ERROR; break; } } } - if (err == MZ_OK) { + if (err == MZ_OK) + { status = CMSDecoderCopyContent(decoder, &message_out); if ((status != errSecSuccess) || (CFDataGetLength(message_out) != message_size) || diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os.c b/Sources/XlsxReaderWriter/minizip/mz_os.c similarity index 79% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os.c rename to Sources/XlsxReaderWriter/minizip/mz_os.c index f96befe..a36e367 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os.c +++ b/Sources/XlsxReaderWriter/minizip/mz_os.c @@ -1,8 +1,9 @@ /* mz_os.c -- System functions - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip Copyright (C) 1998-2010 Gilles Vollant https://www.winimage.com/zLibDll/minizip.html @@ -20,7 +21,8 @@ /***************************************************************************/ -int32_t mz_path_combine(char *path, const char *join, int32_t max_path) { +int32_t mz_path_combine(char *path, const char *join, int32_t max_path) +{ int32_t path_len = 0; if (path == NULL || join == NULL || max_path == 0) @@ -28,10 +30,13 @@ int32_t mz_path_combine(char *path, const char *join, int32_t max_path) { path_len = (int32_t)strlen(path); - if (path_len == 0) { + if (path_len == 0) + { strncpy(path, join, max_path - 1); path[max_path - 1] = 0; - } else { + } + else + { mz_path_append_slash(path, max_path, MZ_PATH_SLASH_PLATFORM); strncat(path, join, max_path - path_len); } @@ -39,20 +44,24 @@ int32_t mz_path_combine(char *path, const char *join, int32_t max_path) { return MZ_OK; } -int32_t mz_path_append_slash(char *path, int32_t max_path, char slash) { +int32_t mz_path_append_slash(char *path, int32_t max_path, char slash) +{ int32_t path_len = (int32_t)strlen(path); if ((path_len + 2) >= max_path) return MZ_BUF_ERROR; - if (path[path_len - 1] != '\\' && path[path_len - 1] != '/') { + if (path[path_len - 1] != '\\' && path[path_len - 1] != '/') + { path[path_len] = slash; path[path_len + 1] = 0; } return MZ_OK; } -int32_t mz_path_remove_slash(char *path) { +int32_t mz_path_remove_slash(char *path) +{ int32_t path_len = (int32_t)strlen(path); - while (path_len > 0) { + while (path_len > 0) + { if (path[path_len - 1] == '\\' || path[path_len - 1] == '/') path[path_len - 1] = 0; else @@ -63,32 +72,39 @@ int32_t mz_path_remove_slash(char *path) { return MZ_OK; } -int32_t mz_path_has_slash(const char *path) { +int32_t mz_path_has_slash(const char *path) +{ int32_t path_len = (int32_t)strlen(path); if (path[path_len - 1] != '\\' && path[path_len - 1] != '/') return MZ_EXIST_ERROR; return MZ_OK; } -int32_t mz_path_convert_slashes(char *path, char slash) { +int32_t mz_path_convert_slashes(char *path, char slash) +{ int32_t i = 0; - for (i = 0; i < (int32_t)strlen(path); i += 1) { + for (i = 0; i < (int32_t)strlen(path); i += 1) + { if (path[i] == '\\' || path[i] == '/') path[i] = slash; } return MZ_OK; } -int32_t mz_path_compare_wc(const char *path, const char *wildcard, uint8_t ignore_case) { - while (*path != 0) { - switch (*wildcard) { +int32_t mz_path_compare_wc(const char *path, const char *wildcard, uint8_t ignore_case) +{ + while (*path != 0) + { + switch (*wildcard) + { case '*': if (*(wildcard + 1) == 0) return MZ_OK; - while (*path != 0) { + while (*path != 0) + { if (mz_path_compare_wc(path, (wildcard + 1), ignore_case) == MZ_OK) return MZ_OK; @@ -102,10 +118,13 @@ int32_t mz_path_compare_wc(const char *path, const char *wildcard, uint8_t ignor if ((*path == '\\' && *wildcard == '/') || (*path == '/' && *wildcard == '\\')) break; - if (ignore_case) { + if (ignore_case) + { if (tolower(*path) != tolower(*wildcard)) return MZ_EXIST_ERROR; - } else { + } + else + { if (*path != *wildcard) return MZ_EXIST_ERROR; } @@ -123,7 +142,8 @@ int32_t mz_path_compare_wc(const char *path, const char *wildcard, uint8_t ignor return MZ_OK; } -int32_t mz_path_resolve(const char *path, char *output, int32_t max_output) { +int32_t mz_path_resolve(const char *path, char *output, int32_t max_output) +{ const char *source = path; const char *check = output; char *target = output; @@ -132,22 +152,27 @@ int32_t mz_path_resolve(const char *path, char *output, int32_t max_output) { if (max_output <= 0) return MZ_PARAM_ERROR; - while (*source != 0 && max_output > 1) { + while (*source != 0 && max_output > 1) + { check = source; if ((*check == '\\') || (*check == '/')) check += 1; - if ((source == path) || (target == output) || (check != source)) { + if ((source == path) || (target == output) || (check != source)) + { /* Skip double paths */ - if ((*check == '\\') || (*check == '/')) { + if ((*check == '\\') || (*check == '/')) + { source += 1; continue; } - if (*check == '.') { + if ((*check != 0) && (*check == '.')) + { check += 1; /* Remove . if at end of string and not at the beginning */ - if ((*check == 0) && (source != path && target != output)) { + if ((*check == 0) && (source != path && target != output)) + { /* Copy last slash */ *target = *source; target += 1; @@ -156,7 +181,8 @@ int32_t mz_path_resolve(const char *path, char *output, int32_t max_output) { continue; } /* Remove . if not at end of string */ - else if ((*check == '\\') || (*check == '/')) { + else if ((*check == '\\') || (*check == '/')) + { source += (check - source); /* Skip slash if at beginning of string */ if (target == output && *source != 0) @@ -164,21 +190,26 @@ int32_t mz_path_resolve(const char *path, char *output, int32_t max_output) { continue; } /* Go to parent directory .. */ - else if (*check == '.') { + else if (*check == '.') + { check += 1; - if ((*check == 0) || (*check == '\\' || *check == '/')) { + if ((*check == 0) || (*check == '\\' || *check == '/')) + { source += (check - source); /* Search backwards for previous slash */ - if (target != output) { + if (target != output) + { target -= 1; - do { + do + { if ((*target == '\\') || (*target == '/')) break; target -= 1; max_output += 1; - } while (target > output); + } + while (target > output); } if ((target == output) && (*source != 0)) @@ -208,7 +239,8 @@ int32_t mz_path_resolve(const char *path, char *output, int32_t max_output) { return MZ_OK; } -int32_t mz_path_remove_filename(char *path) { +int32_t mz_path_remove_filename(char *path) +{ char *path_ptr = NULL; if (path == NULL) @@ -216,8 +248,10 @@ int32_t mz_path_remove_filename(char *path) { path_ptr = path + strlen(path) - 1; - while (path_ptr > path) { - if ((*path_ptr == '/') || (*path_ptr == '\\')) { + while (path_ptr > path) + { + if ((*path_ptr == '/') || (*path_ptr == '\\')) + { *path_ptr = 0; break; } @@ -231,7 +265,8 @@ int32_t mz_path_remove_filename(char *path) { return MZ_OK; } -int32_t mz_path_remove_extension(char *path) { +int32_t mz_path_remove_extension(char *path) +{ char *path_ptr = NULL; if (path == NULL) @@ -239,10 +274,12 @@ int32_t mz_path_remove_extension(char *path) { path_ptr = path + strlen(path) - 1; - while (path_ptr > path) { + while (path_ptr > path) + { if ((*path_ptr == '/') || (*path_ptr == '\\')) break; - if (*path_ptr == '.') { + if (*path_ptr == '.') + { *path_ptr = 0; break; } @@ -256,7 +293,8 @@ int32_t mz_path_remove_extension(char *path) { return MZ_OK; } -int32_t mz_path_get_filename(const char *path, const char **filename) { +int32_t mz_path_get_filename(const char *path, const char **filename) +{ const char *match = NULL; if (path == NULL || filename == NULL) @@ -264,7 +302,8 @@ int32_t mz_path_get_filename(const char *path, const char **filename) { *filename = NULL; - for (match = path; *match != 0; match += 1) { + for (match = path; *match != 0; match += 1) + { if ((*match == '\\') || (*match == '/')) *filename = match + 1; } @@ -275,7 +314,8 @@ int32_t mz_path_get_filename(const char *path, const char **filename) { return MZ_OK; } -int32_t mz_dir_make(const char *path) { +int32_t mz_dir_make(const char *path) +{ int32_t err = MZ_OK; int16_t len = 0; char *current_dir = NULL; @@ -295,9 +335,11 @@ int32_t mz_dir_make(const char *path) { mz_path_remove_slash(current_dir); err = mz_os_make_dir(current_dir); - if (err != MZ_OK) { + if (err != MZ_OK) + { match = current_dir + 1; - while (1) { + while (1) + { while (*match != 0 && *match != '\\' && *match != '/') match += 1; hold = *match; @@ -318,7 +360,8 @@ int32_t mz_dir_make(const char *path) { return err; } -int32_t mz_file_get_crc(const char *path, uint32_t *result_crc) { +int32_t mz_file_get_crc(const char *path, uint32_t *result_crc) +{ void *stream = NULL; uint32_t crc32 = 0; int32_t read = 0; @@ -329,17 +372,21 @@ int32_t mz_file_get_crc(const char *path, uint32_t *result_crc) { err = mz_stream_os_open(stream, path, MZ_OPEN_MODE_READ); - if (err == MZ_OK) { - do { + if (err == MZ_OK) + { + do + { read = mz_stream_os_read(stream, buf, sizeof(buf)); - if (read < 0) { + if (read < 0) + { err = read; break; } crc32 = mz_crypt_crc32_update(crc32, buf, read); - } while ((err == MZ_OK) && (read > 0)); + } + while ((err == MZ_OK) && (read > 0)); mz_stream_os_close(stream); } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os.h b/Sources/XlsxReaderWriter/minizip/mz_os.h similarity index 96% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os.h rename to Sources/XlsxReaderWriter/minizip/mz_os.h index b3e2a58..6065430 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os.h +++ b/Sources/XlsxReaderWriter/minizip/mz_os.h @@ -1,8 +1,9 @@ /* mz_os.h -- System functions - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -21,13 +22,13 @@ extern "C" { # define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_OSX_DARWIN) #elif defined(__riscos__) # define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_RISCOS) +#elif defined(__unix__) +# define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_UNIX) #elif defined(_WIN32) # define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_WINDOWS_NTFS) -#else -# define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_UNIX) #endif -#if defined(HAVE_LZMA) || defined(HAVE_LIBCOMP) +#if defined(HAVE_LZMA) # define MZ_VERSION_MADEBY_ZIP_VERSION (63) #elif defined(HAVE_WZAES) # define MZ_VERSION_MADEBY_ZIP_VERSION (51) diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os_posix.c b/Sources/XlsxReaderWriter/minizip/mz_os_posix.c similarity index 70% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os_posix.c rename to Sources/XlsxReaderWriter/minizip/mz_os_posix.c index 576943d..46c6fc4 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_os_posix.c +++ b/Sources/XlsxReaderWriter/minizip/mz_os_posix.c @@ -1,8 +1,9 @@ /* mz_os_posix.c -- System functions for posix - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -14,14 +15,12 @@ #include /* rename */ #include -#if defined(HAVE_ICONV) #include -#endif #include #include -#ifndef _WIN32 +#if defined(__APPLE__) || defined(__unix__) || defined(__riscos__) # include # include #endif @@ -30,21 +29,10 @@ # include #endif -#if defined(HAVE_GETRANDOM) -# include -#endif -#if defined(HAVE_LIBBSD) -# include -# ifndef __u_char_defined - typedef unsigned char u_char; -# endif -# include /* arc4random_buf */ -#endif - /***************************************************************************/ -#if defined(HAVE_ICONV) -uint8_t *mz_os_utf8_string_create(const char *string, int32_t encoding) { +uint8_t *mz_os_utf8_string_create(const char *string, int32_t encoding) +{ iconv_t cd; const char *from_encoding = NULL; size_t result = 0; @@ -78,7 +66,8 @@ uint8_t *mz_os_utf8_string_create(const char *string, int32_t encoding) { string_utf8 = (uint8_t *)MZ_ALLOC((int32_t)(string_utf8_size + 1)); string_utf8_ptr = string_utf8; - if (string_utf8) { + if (string_utf8) + { memset(string_utf8, 0, string_utf8_size + 1); result = iconv(cd, (char **)&string, &string_length, @@ -87,29 +76,19 @@ uint8_t *mz_os_utf8_string_create(const char *string, int32_t encoding) { iconv_close(cd); - if (result == (size_t)-1) { + if (result == (size_t)-1) + { MZ_FREE(string_utf8); string_utf8 = NULL; } return string_utf8; } -#else -uint8_t *mz_os_utf8_string_create(const char *string, int32_t encoding) { - size_t string_length = 0; - uint8_t *string_copy = NULL; - - string_length = strlen(string); - string_copy = (uint8_t *)MZ_ALLOC((int32_t)(string_length + 1)); - strncpy((char *)string_copy, string, string_length); - string_copy[string_length] = 0; - - return string_copy; -} -#endif -void mz_os_utf8_string_delete(uint8_t **string) { - if (string != NULL) { +void mz_os_utf8_string_delete(uint8_t **string) +{ + if (string != NULL) + { MZ_FREE(*string); *string = NULL; } @@ -117,50 +96,14 @@ void mz_os_utf8_string_delete(uint8_t **string) { /***************************************************************************/ -#if defined(HAVE_ARC4RANDOM_BUF) -int32_t mz_os_rand(uint8_t *buf, int32_t size) { - if (size < 0) - return 0; - arc4random_buf(buf, (uint32_t)size); - return size; -} -#elif defined(HAVE_ARC4RANDOM) -int32_t mz_os_rand(uint8_t *buf, int32_t size) { - int32_t left = size; - for (; left > 2; left -= 3, buf += 3) { - uint32_t val = arc4random(); - - buf[0] = (val) & 0xFF; - buf[1] = (val >> 8) & 0xFF; - buf[2] = (val >> 16) & 0xFF; - } - for (; left > 0; left--, buf++) { - *buf = arc4random() & 0xFF; - } - return size - left; -} -#elif defined(HAVE_GETRANDOM) -int32_t mz_os_rand(uint8_t *buf, int32_t size) { - int32_t left = size; - int32_t written = 0; - - while (left > 0) { - written = getrandom(buf, left, 0); - if (written < 0) - return MZ_INTERNAL_ERROR; - - buf += written; - left -= written; - } - return size - left; -} -#else -int32_t mz_os_rand(uint8_t *buf, int32_t size) { +int32_t mz_os_rand(uint8_t *buf, int32_t size) +{ static unsigned calls = 0; int32_t i = 0; /* Ensure different random header each time */ - if (++calls == 1) { + if (++calls == 1) + { #define PI_SEED 3141592654UL srand((unsigned)(time(NULL) ^ PI_SEED)); } @@ -170,23 +113,25 @@ int32_t mz_os_rand(uint8_t *buf, int32_t size) { return size; } -#endif -int32_t mz_os_rename(const char *source_path, const char *target_path) { +int32_t mz_os_rename(const char *source_path, const char *target_path) +{ if (rename(source_path, target_path) == -1) return MZ_EXIST_ERROR; return MZ_OK; } -int32_t mz_os_unlink(const char *path) { +int32_t mz_os_unlink(const char *path) +{ if (unlink(path) == -1) return MZ_EXIST_ERROR; return MZ_OK; } -int32_t mz_os_file_exists(const char *path) { +int32_t mz_os_file_exists(const char *path) +{ struct stat path_stat; memset(&path_stat, 0, sizeof(path_stat)); @@ -195,11 +140,13 @@ int32_t mz_os_file_exists(const char *path) { return MZ_EXIST_ERROR; } -int64_t mz_os_get_file_size(const char *path) { +int64_t mz_os_get_file_size(const char *path) +{ struct stat path_stat; memset(&path_stat, 0, sizeof(path_stat)); - if (stat(path, &path_stat) == 0) { + if (stat(path, &path_stat) == 0) + { /* Stat returns size taken up by directory entry, so return 0 */ if (S_ISDIR(path_stat.st_mode)) return 0; @@ -210,7 +157,8 @@ int64_t mz_os_get_file_size(const char *path) { return 0; } -int32_t mz_os_get_file_date(const char *path, time_t *modified_date, time_t *accessed_date, time_t *creation_date) { +int32_t mz_os_get_file_date(const char *path, time_t *modified_date, time_t *accessed_date, time_t *creation_date) +{ struct stat path_stat; char *name = NULL; size_t len = 0; @@ -218,14 +166,16 @@ int32_t mz_os_get_file_date(const char *path, time_t *modified_date, time_t *acc memset(&path_stat, 0, sizeof(path_stat)); - if (strcmp(path, "-") != 0) { + if (strcmp(path, "-") != 0) + { /* Not all systems allow stat'ing a file with / appended */ len = strlen(path); name = (char *)malloc(len + 1); strncpy(name, path, len + 1); mz_path_remove_slash(name); - if (stat(name, &path_stat) == 0) { + if (stat(name, &path_stat) == 0) + { if (modified_date != NULL) *modified_date = path_stat.st_mtime; if (accessed_date != NULL) @@ -243,7 +193,8 @@ int32_t mz_os_get_file_date(const char *path, time_t *modified_date, time_t *acc return err; } -int32_t mz_os_set_file_date(const char *path, time_t modified_date, time_t accessed_date, time_t creation_date) { +int32_t mz_os_set_file_date(const char *path, time_t modified_date, time_t accessed_date, time_t creation_date) +{ struct utimbuf ut; ut.actime = accessed_date; @@ -258,7 +209,8 @@ int32_t mz_os_set_file_date(const char *path, time_t modified_date, time_t acces return MZ_OK; } -int32_t mz_os_get_file_attribs(const char *path, uint32_t *attributes) { +int32_t mz_os_get_file_attribs(const char *path, uint32_t *attributes) +{ struct stat path_stat; int32_t err = MZ_OK; @@ -269,7 +221,8 @@ int32_t mz_os_get_file_attribs(const char *path, uint32_t *attributes) { return err; } -int32_t mz_os_set_file_attribs(const char *path, uint32_t attributes) { +int32_t mz_os_set_file_attribs(const char *path, uint32_t attributes) +{ int32_t err = MZ_OK; if (chmod(path, (mode_t)attributes) == -1) @@ -278,7 +231,8 @@ int32_t mz_os_set_file_attribs(const char *path, uint32_t attributes) { return err; } -int32_t mz_os_make_dir(const char *path) { +int32_t mz_os_make_dir(const char *path) +{ int32_t err = 0; err = mkdir(path, 0755); @@ -289,17 +243,20 @@ int32_t mz_os_make_dir(const char *path) { return MZ_OK; } -DIR* mz_os_open_dir(const char *path) { +DIR* mz_os_open_dir(const char *path) +{ return opendir(path); } -struct dirent* mz_os_read_dir(DIR *dir) { +struct dirent* mz_os_read_dir(DIR *dir) +{ if (dir == NULL) return NULL; return readdir(dir); } -int32_t mz_os_close_dir(DIR *dir) { +int32_t mz_os_close_dir(DIR *dir) +{ if (dir == NULL) return MZ_PARAM_ERROR; if (closedir(dir) == -1) @@ -307,7 +264,8 @@ int32_t mz_os_close_dir(DIR *dir) { return MZ_OK; } -int32_t mz_os_is_dir(const char *path) { +int32_t mz_os_is_dir(const char *path) +{ struct stat path_stat; memset(&path_stat, 0, sizeof(path_stat)); @@ -318,7 +276,8 @@ int32_t mz_os_is_dir(const char *path) { return MZ_EXIST_ERROR; } -int32_t mz_os_is_symlink(const char *path) { +int32_t mz_os_is_symlink(const char *path) +{ struct stat path_stat; memset(&path_stat, 0, sizeof(path_stat)); @@ -329,13 +288,15 @@ int32_t mz_os_is_symlink(const char *path) { return MZ_EXIST_ERROR; } -int32_t mz_os_make_symlink(const char *path, const char *target_path) { +int32_t mz_os_make_symlink(const char *path, const char *target_path) +{ if (symlink(target_path, path) != 0) return MZ_INTERNAL_ERROR; return MZ_OK; } -int32_t mz_os_read_symlink(const char *path, char *target_path, int32_t max_target_path) { +int32_t mz_os_read_symlink(const char *path, char *target_path, int32_t max_target_path) +{ size_t length = 0; length = (size_t)readlink(path, target_path, max_target_path - 1); @@ -346,7 +307,8 @@ int32_t mz_os_read_symlink(const char *path, char *target_path, int32_t max_targ return MZ_OK; } -uint64_t mz_os_ms_time(void) { +uint64_t mz_os_ms_time(void) +{ struct timespec ts; #if defined(__APPLE__) diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm.c b/Sources/XlsxReaderWriter/minizip/mz_strm.c similarity index 84% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm.c rename to Sources/XlsxReaderWriter/minizip/mz_strm.c index da7d587..af123ae 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm.c @@ -1,8 +1,9 @@ /* mz_strm.c -- Stream interface - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -17,21 +18,24 @@ /***************************************************************************/ -int32_t mz_stream_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_open(void *stream, const char *path, int32_t mode) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->open == NULL) return MZ_STREAM_ERROR; return strm->vtbl->open(strm, path, mode); } -int32_t mz_stream_is_open(void *stream) { +int32_t mz_stream_is_open(void *stream) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->is_open == NULL) return MZ_STREAM_ERROR; return strm->vtbl->is_open(strm); } -int32_t mz_stream_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_read(void *stream, void *buf, int32_t size) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->read == NULL) return MZ_PARAM_ERROR; @@ -40,16 +44,19 @@ int32_t mz_stream_read(void *stream, void *buf, int32_t size) { return strm->vtbl->read(strm, buf, size); } -static int32_t mz_stream_read_value(void *stream, uint64_t *value, int32_t len) { +static int32_t mz_stream_read_value(void *stream, uint64_t *value, int32_t len) +{ uint8_t buf[8]; int32_t n = 0; int32_t i = 0; *value = 0; - if (mz_stream_read(stream, buf, len) == len) { + if (mz_stream_read(stream, buf, len) == len) + { for (n = 0; n < len; n += 1, i += 8) *value += ((uint64_t)buf[n]) << i; - } else if (mz_stream_error(stream)) + } + else if (mz_stream_error(stream)) return MZ_STREAM_ERROR; else return MZ_END_OF_STREAM; @@ -57,7 +64,8 @@ static int32_t mz_stream_read_value(void *stream, uint64_t *value, int32_t len) return MZ_OK; } -int32_t mz_stream_read_uint8(void *stream, uint8_t *value) { +int32_t mz_stream_read_uint8(void *stream, uint8_t *value) +{ int32_t err = MZ_OK; uint64_t value64 = 0; @@ -68,7 +76,8 @@ int32_t mz_stream_read_uint8(void *stream, uint8_t *value) { return err; } -int32_t mz_stream_read_uint16(void *stream, uint16_t *value) { +int32_t mz_stream_read_uint16(void *stream, uint16_t *value) +{ int32_t err = MZ_OK; uint64_t value64 = 0; @@ -79,7 +88,8 @@ int32_t mz_stream_read_uint16(void *stream, uint16_t *value) { return err; } -int32_t mz_stream_read_uint32(void *stream, uint32_t *value) { +int32_t mz_stream_read_uint32(void *stream, uint32_t *value) +{ int32_t err = MZ_OK; uint64_t value64 = 0; @@ -90,15 +100,18 @@ int32_t mz_stream_read_uint32(void *stream, uint32_t *value) { return err; } -int32_t mz_stream_read_int64(void *stream, int64_t *value) { +int32_t mz_stream_read_int64(void *stream, int64_t *value) +{ return mz_stream_read_value(stream, (uint64_t *)value, sizeof(uint64_t)); } -int32_t mz_stream_read_uint64(void *stream, uint64_t *value) { +int32_t mz_stream_read_uint64(void *stream, uint64_t *value) +{ return mz_stream_read_value(stream, value, sizeof(uint64_t)); } -int32_t mz_stream_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_write(void *stream, const void *buf, int32_t size) +{ mz_stream *strm = (mz_stream *)stream; if (size == 0) return size; @@ -109,16 +122,19 @@ int32_t mz_stream_write(void *stream, const void *buf, int32_t size) { return strm->vtbl->write(strm, buf, size); } -static int32_t mz_stream_write_value(void *stream, uint64_t value, int32_t len) { +static int32_t mz_stream_write_value(void *stream, uint64_t value, int32_t len) +{ uint8_t buf[8]; int32_t n = 0; - for (n = 0; n < len; n += 1) { + for (n = 0; n < len; n += 1) + { buf[n] = (uint8_t)(value & 0xff); value >>= 8; } - if (value != 0) { + if (value != 0) + { /* Data overflow - hack for ZIP64 (X Roche) */ for (n = 0; n < len; n += 1) buf[n] = 0xff; @@ -130,36 +146,44 @@ static int32_t mz_stream_write_value(void *stream, uint64_t value, int32_t len) return MZ_OK; } -int32_t mz_stream_write_uint8(void *stream, uint8_t value) { +int32_t mz_stream_write_uint8(void *stream, uint8_t value) +{ return mz_stream_write_value(stream, value, sizeof(uint8_t)); } -int32_t mz_stream_write_uint16(void *stream, uint16_t value) { +int32_t mz_stream_write_uint16(void *stream, uint16_t value) +{ return mz_stream_write_value(stream, value, sizeof(uint16_t)); } -int32_t mz_stream_write_uint32(void *stream, uint32_t value) { +int32_t mz_stream_write_uint32(void *stream, uint32_t value) +{ return mz_stream_write_value(stream, value, sizeof(uint32_t)); } -int32_t mz_stream_write_int64(void *stream, int64_t value) { +int32_t mz_stream_write_int64(void *stream, int64_t value) +{ return mz_stream_write_value(stream, (uint64_t)value, sizeof(uint64_t)); } -int32_t mz_stream_write_uint64(void *stream, uint64_t value) { +int32_t mz_stream_write_uint64(void *stream, uint64_t value) +{ return mz_stream_write_value(stream, value, sizeof(uint64_t)); } -int32_t mz_stream_copy(void *target, void *source, int32_t len) { +int32_t mz_stream_copy(void *target, void *source, int32_t len) +{ return mz_stream_copy_stream(target, NULL, source, NULL, len); } -int32_t mz_stream_copy_to_end(void *target, void *source) { +int32_t mz_stream_copy_to_end(void *target, void *source) +{ return mz_stream_copy_stream_to_end(target, NULL, source, NULL); } int32_t mz_stream_copy_stream(void *target, mz_stream_write_cb write_cb, void *source, - mz_stream_read_cb read_cb, int32_t len) { + mz_stream_read_cb read_cb, int32_t len) +{ uint8_t buf[16384]; int32_t bytes_to_copy = 0; int32_t read = 0; @@ -170,7 +194,8 @@ int32_t mz_stream_copy_stream(void *target, mz_stream_write_cb write_cb, void *s if (read_cb == NULL) read_cb = mz_stream_read; - while (len > 0) { + while (len > 0) + { bytes_to_copy = len; if (bytes_to_copy > (int32_t)sizeof(buf)) bytes_to_copy = sizeof(buf); @@ -187,7 +212,8 @@ int32_t mz_stream_copy_stream(void *target, mz_stream_write_cb write_cb, void *s } int32_t mz_stream_copy_stream_to_end(void *target, mz_stream_write_cb write_cb, void *source, - mz_stream_read_cb read_cb) { + mz_stream_read_cb read_cb) +{ uint8_t buf[16384]; int32_t read = 0; int32_t written = 0; @@ -198,7 +224,8 @@ int32_t mz_stream_copy_stream_to_end(void *target, mz_stream_write_cb write_cb, read_cb = mz_stream_read; read = read_cb(source, buf, sizeof(buf)); - while (read > 0) { + while (read > 0) + { written = write_cb(target, buf, read); if (written != read) return MZ_STREAM_ERROR; @@ -211,7 +238,8 @@ int32_t mz_stream_copy_stream_to_end(void *target, mz_stream_write_cb write_cb, return MZ_OK; } -int64_t mz_stream_tell(void *stream) { +int64_t mz_stream_tell(void *stream) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->tell == NULL) return MZ_PARAM_ERROR; @@ -220,7 +248,8 @@ int64_t mz_stream_tell(void *stream) { return strm->vtbl->tell(strm); } -int32_t mz_stream_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->seek == NULL) return MZ_PARAM_ERROR; @@ -231,7 +260,8 @@ int32_t mz_stream_seek(void *stream, int64_t offset, int32_t origin) { return strm->vtbl->seek(strm, offset, origin); } -int32_t mz_stream_find(void *stream, const void *find, int32_t find_size, int64_t max_seek, int64_t *position) { +int32_t mz_stream_find(void *stream, const void *find, int32_t find_size, int64_t max_seek, int64_t *position) +{ uint8_t buf[MZ_STREAM_FIND_SIZE]; int32_t buf_pos = 0; int32_t read_size = sizeof(buf); @@ -252,7 +282,8 @@ int32_t mz_stream_find(void *stream, const void *find, int32_t find_size, int64_ start_pos = mz_stream_tell(stream); - while (read_pos < max_seek) { + while (read_pos < max_seek) + { if (read_size > (int32_t)(max_seek - read_pos - buf_pos) && (max_seek - read_pos - buf_pos) < (int64_t)sizeof(buf)) read_size = (int32_t)(max_seek - read_pos - buf_pos); @@ -260,7 +291,8 @@ int32_t mz_stream_find(void *stream, const void *find, int32_t find_size, int64_ if ((read <= 0) || (read + buf_pos < find_size)) break; - for (i = 0; i <= read + buf_pos - find_size; i += 1) { + for (i = 0; i <= read + buf_pos - find_size; i += 1) + { if (memcmp(&buf[i], find, find_size) != 0) continue; @@ -275,7 +307,8 @@ int32_t mz_stream_find(void *stream, const void *find, int32_t find_size, int64_ return MZ_OK; } - if (first) { + if (first) + { read -= find_size; read_size -= find_size; buf_pos = find_size; @@ -289,7 +322,8 @@ int32_t mz_stream_find(void *stream, const void *find, int32_t find_size, int64_ return MZ_EXIST_ERROR; } -int32_t mz_stream_find_reverse(void *stream, const void *find, int32_t find_size, int64_t max_seek, int64_t *position) { +int32_t mz_stream_find_reverse(void *stream, const void *find, int32_t find_size, int64_t max_seek, int64_t *position) +{ uint8_t buf[MZ_STREAM_FIND_SIZE]; int32_t buf_pos = 0; int32_t read_size = MZ_STREAM_FIND_SIZE; @@ -310,7 +344,8 @@ int32_t mz_stream_find_reverse(void *stream, const void *find, int32_t find_size start_pos = mz_stream_tell(stream); - while (read_pos < max_seek) { + while (read_pos < max_seek) + { if (read_size > (int32_t)(max_seek - read_pos) && (max_seek - read_pos) < (int64_t)sizeof(buf)) read_size = (int32_t)(max_seek - read_pos); @@ -322,7 +357,8 @@ int32_t mz_stream_find_reverse(void *stream, const void *find, int32_t find_size if (read + buf_pos < MZ_STREAM_FIND_SIZE) memmove(buf + MZ_STREAM_FIND_SIZE - (read + buf_pos), buf, read); - for (i = find_size; i <= (read + buf_pos); i += 1) { + for (i = find_size; i <= (read + buf_pos); i += 1) + { if (memcmp(&buf[MZ_STREAM_FIND_SIZE - i], find, find_size) != 0) continue; @@ -337,7 +373,8 @@ int32_t mz_stream_find_reverse(void *stream, const void *find, int32_t find_size return MZ_OK; } - if (first) { + if (first) + { read -= find_size; read_size -= find_size; buf_pos = find_size; @@ -354,7 +391,8 @@ int32_t mz_stream_find_reverse(void *stream, const void *find, int32_t find_size return MZ_EXIST_ERROR; } -int32_t mz_stream_close(void *stream) { +int32_t mz_stream_close(void *stream) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->close == NULL) return MZ_PARAM_ERROR; @@ -363,41 +401,47 @@ int32_t mz_stream_close(void *stream) { return strm->vtbl->close(strm); } -int32_t mz_stream_error(void *stream) { +int32_t mz_stream_error(void *stream) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->error == NULL) return MZ_PARAM_ERROR; return strm->vtbl->error(strm); } -int32_t mz_stream_set_base(void *stream, void *base) { +int32_t mz_stream_set_base(void *stream, void *base) +{ mz_stream *strm = (mz_stream *)stream; strm->base = (mz_stream *)base; return MZ_OK; } -void* mz_stream_get_interface(void *stream) { +void* mz_stream_get_interface(void *stream) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL) return NULL; return (void *)strm->vtbl; } -int32_t mz_stream_get_prop_int64(void *stream, int32_t prop, int64_t *value) { +int32_t mz_stream_get_prop_int64(void *stream, int32_t prop, int64_t *value) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->get_prop_int64 == NULL) return MZ_PARAM_ERROR; return strm->vtbl->get_prop_int64(stream, prop, value); } -int32_t mz_stream_set_prop_int64(void *stream, int32_t prop, int64_t value) { +int32_t mz_stream_set_prop_int64(void *stream, int32_t prop, int64_t value) +{ mz_stream *strm = (mz_stream *)stream; if (strm == NULL || strm->vtbl == NULL || strm->vtbl->set_prop_int64 == NULL) return MZ_PARAM_ERROR; return strm->vtbl->set_prop_int64(stream, prop, value); } -void *mz_stream_create(void **stream, mz_stream_vtbl *vtbl) { +void *mz_stream_create(void **stream, mz_stream_vtbl *vtbl) +{ if (stream == NULL) return NULL; if (vtbl == NULL || vtbl->create == NULL) @@ -405,7 +449,8 @@ void *mz_stream_create(void **stream, mz_stream_vtbl *vtbl) { return vtbl->create(stream); } -void mz_stream_delete(void **stream) { +void mz_stream_delete(void **stream) +{ mz_stream *strm = NULL; if (stream == NULL) return; @@ -426,7 +471,8 @@ typedef struct mz_stream_raw_s { /***************************************************************************/ -int32_t mz_stream_raw_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_raw_open(void *stream, const char *path, int32_t mode) +{ MZ_UNUSED(stream); MZ_UNUSED(path); MZ_UNUSED(mode); @@ -434,24 +480,28 @@ int32_t mz_stream_raw_open(void *stream, const char *path, int32_t mode) { return MZ_OK; } -int32_t mz_stream_raw_is_open(void *stream) { +int32_t mz_stream_raw_is_open(void *stream) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; return mz_stream_is_open(raw->stream.base); } -int32_t mz_stream_raw_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_raw_read(void *stream, void *buf, int32_t size) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; int32_t bytes_to_read = size; int32_t read = 0; - if (raw->max_total_in > 0) { + if (raw->max_total_in > 0) + { if ((int64_t)bytes_to_read > (raw->max_total_in - raw->total_in)) bytes_to_read = (int32_t)(raw->max_total_in - raw->total_in); } read = mz_stream_read(raw->stream.base, buf, bytes_to_read); - if (read > 0) { + if (read > 0) + { raw->total_in += read; raw->total_out += read; } @@ -459,13 +509,15 @@ int32_t mz_stream_raw_read(void *stream, void *buf, int32_t size) { return read; } -int32_t mz_stream_raw_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_raw_write(void *stream, const void *buf, int32_t size) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; int32_t written = 0; written = mz_stream_write(raw->stream.base, buf, size); - if (written > 0) { + if (written > 0) + { raw->total_out += written; raw->total_in += written; } @@ -473,29 +525,35 @@ int32_t mz_stream_raw_write(void *stream, const void *buf, int32_t size) { return written; } -int64_t mz_stream_raw_tell(void *stream) { +int64_t mz_stream_raw_tell(void *stream) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; return mz_stream_tell(raw->stream.base); } -int32_t mz_stream_raw_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_raw_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; return mz_stream_seek(raw->stream.base, offset, origin); } -int32_t mz_stream_raw_close(void *stream) { +int32_t mz_stream_raw_close(void *stream) +{ MZ_UNUSED(stream); return MZ_OK; } -int32_t mz_stream_raw_error(void *stream) { +int32_t mz_stream_raw_error(void *stream) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; return mz_stream_error(raw->stream.base); } -int32_t mz_stream_raw_get_prop_int64(void *stream, int32_t prop, int64_t *value) { +int32_t mz_stream_raw_get_prop_int64(void *stream, int32_t prop, int64_t *value) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_IN: *value = raw->total_in; return MZ_OK; @@ -506,9 +564,11 @@ int32_t mz_stream_raw_get_prop_int64(void *stream, int32_t prop, int64_t *value) return MZ_EXIST_ERROR; } -int32_t mz_stream_raw_set_prop_int64(void *stream, int32_t prop, int64_t value) { +int32_t mz_stream_raw_set_prop_int64(void *stream, int32_t prop, int64_t value) +{ mz_stream_raw *raw = (mz_stream_raw *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_IN_MAX: raw->max_total_in = value; return MZ_OK; @@ -535,11 +595,13 @@ static mz_stream_vtbl mz_stream_raw_vtbl = { /***************************************************************************/ -void *mz_stream_raw_create(void **stream) { +void *mz_stream_raw_create(void **stream) +{ mz_stream_raw *raw = NULL; raw = (mz_stream_raw *)MZ_ALLOC(sizeof(mz_stream_raw)); - if (raw != NULL) { + if (raw != NULL) + { memset(raw, 0, sizeof(mz_stream_raw)); raw->stream.vtbl = &mz_stream_raw_vtbl; } @@ -549,7 +611,8 @@ void *mz_stream_raw_create(void **stream) { return raw; } -void mz_stream_raw_delete(void **stream) { +void mz_stream_raw_delete(void **stream) +{ mz_stream_raw *raw = NULL; if (stream == NULL) return; diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm.h b/Sources/XlsxReaderWriter/minizip/mz_strm.h similarity index 96% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm.h rename to Sources/XlsxReaderWriter/minizip/mz_strm.h index 8b0027c..4853557 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm.h @@ -1,8 +1,9 @@ /* mz_strm.h -- Stream interface - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -26,7 +27,7 @@ extern "C" { #define MZ_STREAM_PROP_DISK_SIZE (7) #define MZ_STREAM_PROP_DISK_NUMBER (8) #define MZ_STREAM_PROP_COMPRESS_LEVEL (9) -#define MZ_STREAM_PROP_COMPRESS_METHOD (10) +#define MZ_STREAM_PROP_COMPRESS_ALGORITHM (10) #define MZ_STREAM_PROP_COMPRESS_WINDOW (11) /***************************************************************************/ @@ -50,7 +51,8 @@ typedef int32_t (*mz_stream_find_cb) (void *stream, const void *find, /***************************************************************************/ -typedef struct mz_stream_vtbl_s { +typedef struct mz_stream_vtbl_s +{ mz_stream_open_cb open; mz_stream_is_open_cb is_open; mz_stream_read_cb read; diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_buf.c b/Sources/XlsxReaderWriter/minizip/mz_strm_buf.c similarity index 77% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_buf.c rename to Sources/XlsxReaderWriter/minizip/mz_strm_buf.c index 1dfdfdf..9390b9d 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_buf.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_buf.c @@ -1,10 +1,11 @@ /* mz_strm_buf.c -- Stream for buffering reads/writes - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project This version of ioapi is designed to buffer IO. - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -59,7 +60,8 @@ typedef struct mz_stream_buffered_s { /***************************************************************************/ -static int32_t mz_stream_buffered_reset(void *stream) { +static int32_t mz_stream_buffered_reset(void *stream) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; buffered->readbuf_len = 0; @@ -71,19 +73,22 @@ static int32_t mz_stream_buffered_reset(void *stream) { return MZ_OK; } -int32_t mz_stream_buffered_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_buffered_open(void *stream, const char *path, int32_t mode) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; mz_stream_buffered_print("Buffered - Open (mode %" PRId32 ")\n", mode); mz_stream_buffered_reset(buffered); return mz_stream_open(buffered->stream.base, path, mode); } -int32_t mz_stream_buffered_is_open(void *stream) { +int32_t mz_stream_buffered_is_open(void *stream) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; return mz_stream_is_open(buffered->stream.base); } -static int32_t mz_stream_buffered_flush(void *stream, int32_t *written) { +static int32_t mz_stream_buffered_flush(void *stream, int32_t *written) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; int32_t total_bytes_written = 0; int32_t bytes_to_write = buffered->writebuf_len; @@ -92,7 +97,8 @@ static int32_t mz_stream_buffered_flush(void *stream, int32_t *written) { *written = 0; - while (bytes_left_to_write > 0) { + while (bytes_left_to_write > 0) + { bytes_written = mz_stream_write(buffered->stream.base, buffered->writebuf + (bytes_to_write - bytes_left_to_write), bytes_left_to_write); @@ -116,29 +122,29 @@ static int32_t mz_stream_buffered_flush(void *stream, int32_t *written) { return MZ_OK; } -int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; int32_t buf_len = 0; int32_t bytes_to_read = 0; int32_t bytes_to_copy = 0; int32_t bytes_left_to_read = size; int32_t bytes_read = 0; - int32_t bytes_flushed = 0; mz_stream_buffered_print("Buffered - Read (size %" PRId32 " pos %" PRId64 ")\n", size, buffered->position); - if (buffered->writebuf_len > 0) { - int64_t position = buffered->position + buffered->writebuf_pos - - mz_stream_buffered_print("Buffered - Switch from write to read, flushing (pos %" PRId64 ")\n", position); - - mz_stream_buffered_flush(stream, &bytes_flushed); - mz_stream_buffered_seek(stream, position, MZ_SEEK_SET); + if (buffered->writebuf_len > 0) + { + mz_stream_buffered_print("Buffered - Switch from write to read, not yet supported (pos %" PRId64 ")\n", + buffered->position); } - while (bytes_left_to_read > 0) { - if ((buffered->readbuf_len == 0) || (buffered->readbuf_pos == buffered->readbuf_len)) { - if (buffered->readbuf_len == sizeof(buffered->readbuf)) { + while (bytes_left_to_read > 0) + { + if ((buffered->readbuf_len == 0) || (buffered->readbuf_pos == buffered->readbuf_len)) + { + if (buffered->readbuf_len == sizeof(buffered->readbuf)) + { buffered->readbuf_pos = 0; buffered->readbuf_len = 0; } @@ -159,7 +165,8 @@ int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size) { break; } - if ((buffered->readbuf_len - buffered->readbuf_pos) > 0) { + if ((buffered->readbuf_len - buffered->readbuf_pos) > 0) + { bytes_to_copy = buffered->readbuf_len - buffered->readbuf_pos; if (bytes_to_copy > bytes_left_to_read) bytes_to_copy = bytes_left_to_read; @@ -180,7 +187,8 @@ int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size) { return size - bytes_left_to_read; } -int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; int32_t bytes_to_write = size; int32_t bytes_left_to_write = size; @@ -193,7 +201,8 @@ int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size) { mz_stream_buffered_print("Buffered - Write (size %" PRId32 " len %" PRId32 " pos %" PRId64 ")\n", size, buffered->writebuf_len, buffered->position); - if (buffered->readbuf_len > 0) { + if (buffered->readbuf_len > 0) + { buffered->position -= buffered->readbuf_len; buffered->position += buffered->readbuf_pos; @@ -207,7 +216,8 @@ int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size) { return err; } - while (bytes_left_to_write > 0) { + while (bytes_left_to_write > 0) + { bytes_used = buffered->writebuf_len; if (bytes_used > buffered->writebuf_pos) bytes_used = buffered->writebuf_pos; @@ -215,7 +225,8 @@ int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size) { if (bytes_to_copy > bytes_left_to_write) bytes_to_copy = bytes_left_to_write; - if (bytes_to_copy == 0) { + if (bytes_to_copy == 0) + { err = mz_stream_buffered_flush(stream, &bytes_flushed); if (err != MZ_OK) return err; @@ -242,7 +253,8 @@ int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size) { return size - bytes_left_to_write; } -int64_t mz_stream_buffered_tell(void *stream) { +int64_t mz_stream_buffered_tell(void *stream) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; int64_t position = mz_stream_tell(buffered->stream.base); @@ -258,7 +270,8 @@ int64_t mz_stream_buffered_tell(void *stream) { return position; } -int32_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; int32_t bytes_flushed = 0; int32_t err = MZ_OK; @@ -266,59 +279,69 @@ int32_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin) { mz_stream_buffered_print("Buffered - Seek (origin %" PRId32 " offset %" PRId64 " pos %" PRId64 ")\n", origin, offset, buffered->position); - switch (origin) { - case MZ_SEEK_SET: + switch (origin) + { + case MZ_SEEK_SET: + + if (buffered->writebuf_len > 0) + { + if ((offset >= buffered->position) && (offset <= buffered->position + buffered->writebuf_len)) + { + buffered->writebuf_pos = (int32_t)(offset - buffered->position); + return MZ_OK; + } + } - if ((buffered->readbuf_len > 0) && (offset < buffered->position) && - (offset >= buffered->position - buffered->readbuf_len)) { - buffered->readbuf_pos = (int32_t)(offset - (buffered->position - buffered->readbuf_len)); - return MZ_OK; - } - if (buffered->writebuf_len > 0) { - if ((offset >= buffered->position) && (offset <= buffered->position + buffered->writebuf_len)) { - buffered->writebuf_pos = (int32_t)(offset - buffered->position); + if ((buffered->readbuf_len > 0) && (offset < buffered->position) && + (offset >= buffered->position - buffered->readbuf_len)) + { + buffered->readbuf_pos = (int32_t)(offset - (buffered->position - buffered->readbuf_len)); return MZ_OK; } - } - err = mz_stream_buffered_flush(stream, &bytes_flushed); - if (err != MZ_OK) - return err; + err = mz_stream_buffered_flush(stream, &bytes_flushed); + if (err != MZ_OK) + return err; - buffered->position = offset; - break; + buffered->position = offset; + break; - case MZ_SEEK_CUR: + case MZ_SEEK_CUR: - if (buffered->readbuf_len > 0) { - if (offset <= ((int64_t)buffered->readbuf_len - buffered->readbuf_pos)) { - buffered->readbuf_pos += (uint32_t)offset; - return MZ_OK; + if (buffered->readbuf_len > 0) + { + if (offset <= ((int64_t)buffered->readbuf_len - buffered->readbuf_pos)) + { + buffered->readbuf_pos += (uint32_t)offset; + return MZ_OK; + } + offset -= ((int64_t)buffered->readbuf_len - buffered->readbuf_pos); + buffered->position += offset; } - offset -= ((int64_t)buffered->readbuf_len - buffered->readbuf_pos); - buffered->position += offset; - } - if (buffered->writebuf_len > 0) { - if (offset <= ((int64_t)buffered->writebuf_len - buffered->writebuf_pos)) { - buffered->writebuf_pos += (uint32_t)offset; - return MZ_OK; + if (buffered->writebuf_len > 0) + { + if (offset <= ((int64_t)buffered->writebuf_len - buffered->writebuf_pos)) + { + buffered->writebuf_pos += (uint32_t)offset; + return MZ_OK; + } + /* offset -= (buffered->writebuf_len - buffered->writebuf_pos); */ } - /* offset -= (buffered->writebuf_len - buffered->writebuf_pos); */ - } - err = mz_stream_buffered_flush(stream, &bytes_flushed); - if (err != MZ_OK) - return err; + err = mz_stream_buffered_flush(stream, &bytes_flushed); + if (err != MZ_OK) + return err; - break; + break; - case MZ_SEEK_END: + case MZ_SEEK_END: - if (buffered->writebuf_len > 0) { - buffered->writebuf_pos = buffered->writebuf_len; - return MZ_OK; - } - break; + if (buffered->writebuf_len > 0) + { + buffered->writebuf_pos = buffered->writebuf_len; + return MZ_OK; + } + break; } buffered->readbuf_len = 0; @@ -329,19 +352,22 @@ int32_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin) { return mz_stream_seek(buffered->stream.base, offset, origin); } -int32_t mz_stream_buffered_close(void *stream) { +int32_t mz_stream_buffered_close(void *stream) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; int32_t bytes_flushed = 0; mz_stream_buffered_flush(stream, &bytes_flushed); mz_stream_buffered_print("Buffered - Close (flushed %" PRId32 ")\n", bytes_flushed); - if (buffered->readbuf_hits + buffered->readbuf_misses > 0) { + if (buffered->readbuf_hits + buffered->readbuf_misses > 0) + { mz_stream_buffered_print("Buffered - Read efficiency %.02f%%\n", (buffered->readbuf_hits / ((float)buffered->readbuf_hits + buffered->readbuf_misses)) * 100); } - if (buffered->writebuf_hits + buffered->writebuf_misses > 0) { + if (buffered->writebuf_hits + buffered->writebuf_misses > 0) + { mz_stream_buffered_print("Buffered - Write efficiency %.02f%%\n", (buffered->writebuf_hits / ((float)buffered->writebuf_hits + buffered->writebuf_misses)) * 100); } @@ -351,16 +377,19 @@ int32_t mz_stream_buffered_close(void *stream) { return mz_stream_close(buffered->stream.base); } -int32_t mz_stream_buffered_error(void *stream) { +int32_t mz_stream_buffered_error(void *stream) +{ mz_stream_buffered *buffered = (mz_stream_buffered *)stream; return mz_stream_error(buffered->stream.base); } -void *mz_stream_buffered_create(void **stream) { +void *mz_stream_buffered_create(void **stream) +{ mz_stream_buffered *buffered = NULL; buffered = (mz_stream_buffered *)MZ_ALLOC(sizeof(mz_stream_buffered)); - if (buffered != NULL) { + if (buffered != NULL) + { memset(buffered, 0, sizeof(mz_stream_buffered)); buffered->stream.vtbl = &mz_stream_buffered_vtbl; } @@ -370,7 +399,8 @@ void *mz_stream_buffered_create(void **stream) { return buffered; } -void mz_stream_buffered_delete(void **stream) { +void mz_stream_buffered_delete(void **stream) +{ mz_stream_buffered *buffered = NULL; if (stream == NULL) return; @@ -380,6 +410,7 @@ void mz_stream_buffered_delete(void **stream) { *stream = NULL; } -void *mz_stream_buffered_get_interface(void) { +void *mz_stream_buffered_get_interface(void) +{ return (void *)&mz_stream_buffered_vtbl; } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_buf.h b/Sources/XlsxReaderWriter/minizip/mz_strm_buf.h similarity index 88% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_buf.h rename to Sources/XlsxReaderWriter/minizip/mz_strm_buf.h index b71e6e4..8920acd 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_buf.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_buf.h @@ -1,10 +1,11 @@ /* mz_strm_buf.h -- Stream for buffering reads/writes - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project This version of ioapi is designed to buffer IO. - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_mem.c b/Sources/XlsxReaderWriter/minizip/mz_strm_mem.c similarity index 83% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_mem.c rename to Sources/XlsxReaderWriter/minizip/mz_strm_mem.c index f4a882d..6f34225 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_mem.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_mem.c @@ -1,13 +1,14 @@ /* mz_strm_mem.c -- Stream for memory access - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project This interface is designed to access memory rather than files. We do use a region of memory to put data in to and take it out of. Based on Unzip ioapi.c version 0.22, May 19th, 2003 - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip Copyright (C) 2003 Justin Fletcher Copyright (C) 1998-2003 Gilles Vollant https://www.winimage.com/zLibDll/minizip.html @@ -52,7 +53,8 @@ typedef struct mz_stream_mem_s { /***************************************************************************/ -static int32_t mz_stream_mem_set_size(void *stream, int32_t size) { +static int32_t mz_stream_mem_set_size(void *stream, int32_t size) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; int32_t new_size = size; uint8_t *new_buf = NULL; @@ -62,7 +64,8 @@ static int32_t mz_stream_mem_set_size(void *stream, int32_t size) { if (new_buf == NULL) return MZ_BUF_ERROR; - if (mem->buffer) { + if (mem->buffer) + { memcpy(new_buf, mem->buffer, mem->size); MZ_FREE(mem->buffer); } @@ -72,7 +75,8 @@ static int32_t mz_stream_mem_set_size(void *stream, int32_t size) { return MZ_OK; } -int32_t mz_stream_mem_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_mem_open(void *stream, const char *path, int32_t mode) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; int32_t err = MZ_OK; @@ -90,14 +94,16 @@ int32_t mz_stream_mem_open(void *stream, const char *path, int32_t mode) { return err; } -int32_t mz_stream_mem_is_open(void *stream) { +int32_t mz_stream_mem_is_open(void *stream) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; if (mem->buffer == NULL) return MZ_OPEN_ERROR; return MZ_OK; } -int32_t mz_stream_mem_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_mem_read(void *stream, void *buf, int32_t size) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; if (size > mem->size - mem->position) @@ -114,7 +120,8 @@ int32_t mz_stream_mem_read(void *stream, void *buf, int32_t size) { return size; } -int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; int32_t new_size = 0; int32_t err = MZ_OK; @@ -122,8 +129,10 @@ int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size) { if (size == 0) return size; - if (size > mem->size - mem->position) { - if (mem->mode & MZ_OPEN_MODE_CREATE) { + if (size > mem->size - mem->position) + { + if (mem->mode & MZ_OPEN_MODE_CREATE) + { new_size = mem->size; if (size < mem->grow_size) new_size += mem->grow_size; @@ -133,7 +142,9 @@ int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size) { err = mz_stream_mem_set_size(stream, new_size); if (err != MZ_OK) return err; - } else { + } + else + { size = mem->size - mem->position; } } @@ -147,38 +158,44 @@ int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size) { return size; } -int64_t mz_stream_mem_tell(void *stream) { +int64_t mz_stream_mem_tell(void *stream) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; return mem->position; } -int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; int64_t new_pos = 0; int32_t err = MZ_OK; - switch (origin) { - case MZ_SEEK_CUR: - new_pos = mem->position + offset; - break; - case MZ_SEEK_END: - new_pos = mem->limit + offset; - break; - case MZ_SEEK_SET: - new_pos = offset; - break; - default: - return MZ_SEEK_ERROR; + switch (origin) + { + case MZ_SEEK_CUR: + new_pos = mem->position + offset; + break; + case MZ_SEEK_END: + new_pos = mem->limit + offset; + break; + case MZ_SEEK_SET: + new_pos = offset; + break; + default: + return MZ_SEEK_ERROR; } - if (new_pos > mem->size) { + if (new_pos > mem->size) + { if ((mem->mode & MZ_OPEN_MODE_CREATE) == 0) return MZ_SEEK_ERROR; err = mz_stream_mem_set_size(stream, (int32_t)new_pos); if (err != MZ_OK) return err; - } else if (new_pos < 0) { + } + else if (new_pos < 0) + { return MZ_SEEK_ERROR; } @@ -186,32 +203,37 @@ int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin) { return MZ_OK; } -int32_t mz_stream_mem_close(void *stream) { +int32_t mz_stream_mem_close(void *stream) +{ MZ_UNUSED(stream); /* We never return errors */ return MZ_OK; } -int32_t mz_stream_mem_error(void *stream) { +int32_t mz_stream_mem_error(void *stream) +{ MZ_UNUSED(stream); /* We never return errors */ return MZ_OK; } -void mz_stream_mem_set_buffer(void *stream, void *buf, int32_t size) { +void mz_stream_mem_set_buffer(void *stream, void *buf, int32_t size) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; mem->buffer = (uint8_t *)buf; mem->size = size; mem->limit = size; } -int32_t mz_stream_mem_get_buffer(void *stream, const void **buf) { +int32_t mz_stream_mem_get_buffer(void *stream, const void **buf) +{ return mz_stream_mem_get_buffer_at(stream, 0, buf); } -int32_t mz_stream_mem_get_buffer_at(void *stream, int64_t position, const void **buf) { +int32_t mz_stream_mem_get_buffer_at(void *stream, int64_t position, const void **buf) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; if (buf == NULL || position < 0 || mem->size < position || mem->buffer == NULL) return MZ_SEEK_ERROR; @@ -219,31 +241,37 @@ int32_t mz_stream_mem_get_buffer_at(void *stream, int64_t position, const void * return MZ_OK; } -int32_t mz_stream_mem_get_buffer_at_current(void *stream, const void **buf) { +int32_t mz_stream_mem_get_buffer_at_current(void *stream, const void **buf) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; return mz_stream_mem_get_buffer_at(stream, mem->position, buf); } -void mz_stream_mem_get_buffer_length(void *stream, int32_t *length) { +void mz_stream_mem_get_buffer_length(void *stream, int32_t *length) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; *length = mem->limit; } -void mz_stream_mem_set_buffer_limit(void *stream, int32_t limit) { +void mz_stream_mem_set_buffer_limit(void *stream, int32_t limit) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; mem->limit = limit; } -void mz_stream_mem_set_grow_size(void *stream, int32_t grow_size) { +void mz_stream_mem_set_grow_size(void *stream, int32_t grow_size) +{ mz_stream_mem *mem = (mz_stream_mem *)stream; mem->grow_size = grow_size; } -void *mz_stream_mem_create(void **stream) { +void *mz_stream_mem_create(void **stream) +{ mz_stream_mem *mem = NULL; mem = (mz_stream_mem *)MZ_ALLOC(sizeof(mz_stream_mem)); - if (mem != NULL) { + if (mem != NULL) + { memset(mem, 0, sizeof(mz_stream_mem)); mem->stream.vtbl = &mz_stream_mem_vtbl; mem->grow_size = 4096; @@ -254,12 +282,14 @@ void *mz_stream_mem_create(void **stream) { return mem; } -void mz_stream_mem_delete(void **stream) { +void mz_stream_mem_delete(void **stream) +{ mz_stream_mem *mem = NULL; if (stream == NULL) return; mem = (mz_stream_mem *)*stream; - if (mem != NULL) { + if (mem != NULL) + { if ((mem->mode & MZ_OPEN_MODE_CREATE) && (mem->buffer != NULL)) MZ_FREE(mem->buffer); MZ_FREE(mem); @@ -267,6 +297,7 @@ void mz_stream_mem_delete(void **stream) { *stream = NULL; } -void *mz_stream_mem_get_interface(void) { +void *mz_stream_mem_get_interface(void) +{ return (void *)&mz_stream_mem_vtbl; } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_mem.h b/Sources/XlsxReaderWriter/minizip/mz_strm_mem.h similarity index 91% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_mem.h rename to Sources/XlsxReaderWriter/minizip/mz_strm_mem.h index 5bfa13d..f33ea65 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_mem.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_mem.h @@ -1,8 +1,9 @@ /* mz_strm_mem.h -- Stream for memory access - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_os.h b/Sources/XlsxReaderWriter/minizip/mz_strm_os.h similarity index 87% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_os.h rename to Sources/XlsxReaderWriter/minizip/mz_strm_os.h index 614e255..8095858 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_os.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_os.h @@ -1,8 +1,9 @@ /* mz_sstrm_os.h -- Stream for filesystem access - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_os_posix.c b/Sources/XlsxReaderWriter/minizip/mz_strm_os_posix.c similarity index 78% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_os_posix.c rename to Sources/XlsxReaderWriter/minizip/mz_strm_os_posix.c index f0b5bd3..fa3f877 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_os_posix.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_os_posix.c @@ -1,8 +1,9 @@ /* mz_strm_posix.c -- Stream for filesystem access for posix/linux - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson http://result42.com @@ -59,7 +60,8 @@ static mz_stream_vtbl mz_stream_os_vtbl = { /***************************************************************************/ -typedef struct mz_stream_posix_s { +typedef struct mz_stream_posix_s +{ mz_stream stream; int32_t error; FILE *handle; @@ -67,7 +69,8 @@ typedef struct mz_stream_posix_s { /***************************************************************************/ -int32_t mz_stream_os_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_os_open(void *stream, const char *path, int32_t mode) +{ mz_stream_posix *posix = (mz_stream_posix *)stream; const char *mode_fopen = NULL; @@ -84,7 +87,8 @@ int32_t mz_stream_os_open(void *stream, const char *path, int32_t mode) { return MZ_OPEN_ERROR; posix->handle = fopen64(path, mode_fopen); - if (posix->handle == NULL) { + if (posix->handle == NULL) + { posix->error = errno; return MZ_OPEN_ERROR; } @@ -95,62 +99,72 @@ int32_t mz_stream_os_open(void *stream, const char *path, int32_t mode) { return MZ_OK; } -int32_t mz_stream_os_is_open(void *stream) { +int32_t mz_stream_os_is_open(void *stream) +{ mz_stream_posix *posix = (mz_stream_posix*)stream; if (posix->handle == NULL) return MZ_OPEN_ERROR; return MZ_OK; } -int32_t mz_stream_os_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_os_read(void *stream, void *buf, int32_t size) +{ mz_stream_posix *posix = (mz_stream_posix*)stream; int32_t read = (int32_t)fread(buf, 1, (size_t)size, posix->handle); - if (read < size && ferror(posix->handle)) { + if (read < size && ferror(posix->handle)) + { posix->error = errno; return MZ_READ_ERROR; } return read; } -int32_t mz_stream_os_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_os_write(void *stream, const void *buf, int32_t size) +{ mz_stream_posix *posix = (mz_stream_posix*)stream; int32_t written = (int32_t)fwrite(buf, 1, (size_t)size, posix->handle); - if (written < size && ferror(posix->handle)) { + if (written < size && ferror(posix->handle)) + { posix->error = errno; return MZ_WRITE_ERROR; } return written; } -int64_t mz_stream_os_tell(void *stream) { +int64_t mz_stream_os_tell(void *stream) +{ mz_stream_posix *posix = (mz_stream_posix*)stream; int64_t position = ftello64(posix->handle); - if (position == -1) { + if (position == -1) + { posix->error = errno; return MZ_TELL_ERROR; } return position; } -int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream_posix *posix = (mz_stream_posix*)stream; int32_t fseek_origin = 0; - switch (origin) { - case MZ_SEEK_CUR: - fseek_origin = SEEK_CUR; - break; - case MZ_SEEK_END: - fseek_origin = SEEK_END; - break; - case MZ_SEEK_SET: - fseek_origin = SEEK_SET; - break; - default: - return MZ_SEEK_ERROR; + switch (origin) + { + case MZ_SEEK_CUR: + fseek_origin = SEEK_CUR; + break; + case MZ_SEEK_END: + fseek_origin = SEEK_END; + break; + case MZ_SEEK_SET: + fseek_origin = SEEK_SET; + break; + default: + return MZ_SEEK_ERROR; } - if (fseeko64(posix->handle, offset, fseek_origin) != 0) { + if (fseeko64(posix->handle, offset, fseek_origin) != 0) + { posix->error = errno; return MZ_SEEK_ERROR; } @@ -158,30 +172,36 @@ int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) { return MZ_OK; } -int32_t mz_stream_os_close(void *stream) { +int32_t mz_stream_os_close(void *stream) +{ mz_stream_posix *posix = (mz_stream_posix*)stream; int32_t closed = 0; - if (posix->handle != NULL) { + if (posix->handle != NULL) + { closed = fclose(posix->handle); posix->handle = NULL; } - if (closed != 0) { + if (closed != 0) + { posix->error = errno; return MZ_CLOSE_ERROR; } return MZ_OK; } -int32_t mz_stream_os_error(void *stream) { +int32_t mz_stream_os_error(void *stream) +{ mz_stream_posix *posix = (mz_stream_posix*)stream; return posix->error; } -void *mz_stream_os_create(void **stream) { +void *mz_stream_os_create(void **stream) +{ mz_stream_posix *posix = NULL; posix = (mz_stream_posix *)MZ_ALLOC(sizeof(mz_stream_posix)); - if (posix != NULL) { + if (posix != NULL) + { memset(posix, 0, sizeof(mz_stream_posix)); posix->stream.vtbl = &mz_stream_os_vtbl; } @@ -191,7 +211,8 @@ void *mz_stream_os_create(void **stream) { return posix; } -void mz_stream_os_delete(void **stream) { +void mz_stream_os_delete(void **stream) +{ mz_stream_posix *posix = NULL; if (stream == NULL) return; @@ -201,6 +222,7 @@ void mz_stream_os_delete(void **stream) { *stream = NULL; } -void *mz_stream_os_get_interface(void) { +void *mz_stream_os_get_interface(void) +{ return (void *)&mz_stream_os_vtbl; } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_pkcrypt.c b/Sources/XlsxReaderWriter/minizip/mz_strm_pkcrypt.c similarity index 88% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_pkcrypt.c rename to Sources/XlsxReaderWriter/minizip/mz_strm_pkcrypt.c index 41c762f..114d2b5 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_pkcrypt.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_pkcrypt.c @@ -1,8 +1,9 @@ /* mz_strm_pkcrypt.c -- Code for traditional PKWARE encryption - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip Copyright (C) 1998-2005 Gilles Vollant Modifications for Info-ZIP crypting https://www.winimage.com/zLibDll/minizip.html @@ -72,7 +73,8 @@ typedef struct mz_stream_pkcrypt_s { /***************************************************************************/ -static uint8_t mz_stream_pkcrypt_decrypt_byte(void *stream) { +static uint8_t mz_stream_pkcrypt_decrypt_byte(void *stream) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an */ @@ -83,7 +85,8 @@ static uint8_t mz_stream_pkcrypt_decrypt_byte(void *stream) { return (uint8_t)(((temp * (temp ^ 1)) >> 8) & 0xff); } -static uint8_t mz_stream_pkcrypt_update_keys(void *stream, uint8_t c) { +static uint8_t mz_stream_pkcrypt_update_keys(void *stream, uint8_t c) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; uint8_t buf = c; @@ -99,14 +102,16 @@ static uint8_t mz_stream_pkcrypt_update_keys(void *stream, uint8_t c) { return (uint8_t)c; } -static void mz_stream_pkcrypt_init_keys(void *stream, const char *password) { +static void mz_stream_pkcrypt_init_keys(void *stream, const char *password) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; pkcrypt->keys[0] = 305419896L; pkcrypt->keys[1] = 591751049L; pkcrypt->keys[2] = 878082192L; - while (*password != 0) { + while (*password != 0) + { mz_stream_pkcrypt_update_keys(stream, (uint8_t)*password); password += 1; } @@ -114,7 +119,8 @@ static void mz_stream_pkcrypt_init_keys(void *stream, const char *password) { /***************************************************************************/ -int32_t mz_stream_pkcrypt_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_pkcrypt_open(void *stream, const char *path, int32_t mode) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; uint16_t t = 0; int16_t i = 0; @@ -137,7 +143,14 @@ int32_t mz_stream_pkcrypt_open(void *stream, const char *path, int32_t mode) { mz_stream_pkcrypt_init_keys(stream, password); - if (mode & MZ_OPEN_MODE_WRITE) { + if (mode & MZ_OPEN_MODE_WRITE) + { +#ifdef MZ_ZIP_NO_COMPRESSION + MZ_UNUSED(t); + MZ_UNUSED(i); + + return MZ_SUPPORT_ERROR; +#else /* First generate RAND_HEAD_LEN - 2 random bytes. */ mz_crypt_rand(header, MZ_PKCRYPT_HEADER_SIZE - 2); @@ -152,7 +165,18 @@ int32_t mz_stream_pkcrypt_open(void *stream, const char *path, int32_t mode) { return MZ_WRITE_ERROR; pkcrypt->total_out += MZ_PKCRYPT_HEADER_SIZE; - } else if (mode & MZ_OPEN_MODE_READ) { +#endif + } + else if (mode & MZ_OPEN_MODE_READ) + { +#ifdef MZ_ZIP_NO_DECOMPRESSION + MZ_UNUSED(t); + MZ_UNUSED(i); + MZ_UNUSED(verify1); + MZ_UNUSED(verify2); + + return MZ_SUPPORT_ERROR; +#else if (mz_stream_read(pkcrypt->stream.base, header, sizeof(header)) != sizeof(header)) return MZ_READ_ERROR; @@ -168,20 +192,23 @@ int32_t mz_stream_pkcrypt_open(void *stream, const char *path, int32_t mode) { return MZ_PASSWORD_ERROR; pkcrypt->total_in += MZ_PKCRYPT_HEADER_SIZE; +#endif } pkcrypt->initialized = 1; return MZ_OK; } -int32_t mz_stream_pkcrypt_is_open(void *stream) { +int32_t mz_stream_pkcrypt_is_open(void *stream) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; if (pkcrypt->initialized == 0) return MZ_OPEN_ERROR; return MZ_OK; } -int32_t mz_stream_pkcrypt_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_pkcrypt_read(void *stream, void *buf, int32_t size) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; uint8_t *buf_ptr = (uint8_t *)buf; int32_t bytes_to_read = size; @@ -203,7 +230,8 @@ int32_t mz_stream_pkcrypt_read(void *stream, void *buf, int32_t size) { return read; } -int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; const uint8_t *buf_ptr = (const uint8_t *)buf; int32_t bytes_to_write = sizeof(pkcrypt->buffer); @@ -215,11 +243,13 @@ int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size) { if (size < 0) return MZ_PARAM_ERROR; - do { + do + { if (bytes_to_write > (size - total_written)) bytes_to_write = (size - total_written); - for (i = 0; i < bytes_to_write; i += 1) { + for (i = 0; i < bytes_to_write; i += 1) + { pkcrypt->buffer[i] = mz_stream_pkcrypt_encode(stream, *buf_ptr, t); buf_ptr += 1; } @@ -229,53 +259,63 @@ int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size) { return written; total_written += written; - } while (total_written < size && written > 0); + } + while (total_written < size && written > 0); pkcrypt->total_out += total_written; return total_written; } -int64_t mz_stream_pkcrypt_tell(void *stream) { +int64_t mz_stream_pkcrypt_tell(void *stream) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; return mz_stream_tell(pkcrypt->stream.base); } -int32_t mz_stream_pkcrypt_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_pkcrypt_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; return mz_stream_seek(pkcrypt->stream.base, offset, origin); } -int32_t mz_stream_pkcrypt_close(void *stream) { +int32_t mz_stream_pkcrypt_close(void *stream) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; pkcrypt->initialized = 0; return MZ_OK; } -int32_t mz_stream_pkcrypt_error(void *stream) { +int32_t mz_stream_pkcrypt_error(void *stream) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; return pkcrypt->error; } -void mz_stream_pkcrypt_set_password(void *stream, const char *password) { +void mz_stream_pkcrypt_set_password(void *stream, const char *password) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; pkcrypt->password = password; } -void mz_stream_pkcrypt_set_verify(void *stream, uint8_t verify1, uint8_t verify2) { +void mz_stream_pkcrypt_set_verify(void *stream, uint8_t verify1, uint8_t verify2) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; pkcrypt->verify1 = verify1; pkcrypt->verify2 = verify2; } -void mz_stream_pkcrypt_get_verify(void *stream, uint8_t *verify1, uint8_t *verify2) { +void mz_stream_pkcrypt_get_verify(void *stream, uint8_t *verify1, uint8_t *verify2) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; *verify1 = pkcrypt->verify1; *verify2 = pkcrypt->verify2; } -int32_t mz_stream_pkcrypt_get_prop_int64(void *stream, int32_t prop, int64_t *value) { +int32_t mz_stream_pkcrypt_get_prop_int64(void *stream, int32_t prop, int64_t *value) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_IN: *value = pkcrypt->total_in; break; @@ -297,9 +337,11 @@ int32_t mz_stream_pkcrypt_get_prop_int64(void *stream, int32_t prop, int64_t *va return MZ_OK; } -int32_t mz_stream_pkcrypt_set_prop_int64(void *stream, int32_t prop, int64_t value) { +int32_t mz_stream_pkcrypt_set_prop_int64(void *stream, int32_t prop, int64_t value) +{ mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_IN_MAX: pkcrypt->max_total_in = value; break; @@ -309,11 +351,13 @@ int32_t mz_stream_pkcrypt_set_prop_int64(void *stream, int32_t prop, int64_t val return MZ_OK; } -void *mz_stream_pkcrypt_create(void **stream) { +void *mz_stream_pkcrypt_create(void **stream) +{ mz_stream_pkcrypt *pkcrypt = NULL; pkcrypt = (mz_stream_pkcrypt *)MZ_ALLOC(sizeof(mz_stream_pkcrypt)); - if (pkcrypt != NULL) { + if (pkcrypt != NULL) + { memset(pkcrypt, 0, sizeof(mz_stream_pkcrypt)); pkcrypt->stream.vtbl = &mz_stream_pkcrypt_vtbl; } @@ -323,7 +367,8 @@ void *mz_stream_pkcrypt_create(void **stream) { return pkcrypt; } -void mz_stream_pkcrypt_delete(void **stream) { +void mz_stream_pkcrypt_delete(void **stream) +{ mz_stream_pkcrypt *pkcrypt = NULL; if (stream == NULL) return; @@ -333,6 +378,7 @@ void mz_stream_pkcrypt_delete(void **stream) { *stream = NULL; } -void *mz_stream_pkcrypt_get_interface(void) { +void *mz_stream_pkcrypt_get_interface(void) +{ return (void *)&mz_stream_pkcrypt_vtbl; } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_pkcrypt.h b/Sources/XlsxReaderWriter/minizip/mz_strm_pkcrypt.h similarity index 91% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_pkcrypt.h rename to Sources/XlsxReaderWriter/minizip/mz_strm_pkcrypt.h index 453f1f9..571c70d 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_pkcrypt.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_pkcrypt.h @@ -1,8 +1,9 @@ /* mz_strm_pkcrypt.h -- Code for traditional PKWARE encryption - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_split.c b/Sources/XlsxReaderWriter/minizip/mz_strm_split.c similarity index 86% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_split.c rename to Sources/XlsxReaderWriter/minizip/mz_strm_split.c index 12c8bda..8ef11ee 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_split.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_split.c @@ -1,8 +1,9 @@ /* mz_strm_split.c -- Stream for split files - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -72,7 +73,8 @@ typedef struct mz_stream_split_s { /***************************************************************************/ -static int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk) { +static int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk) +{ mz_stream_split *split = (mz_stream_split *)stream; uint32_t magic = 0; int64_t position = 0; @@ -82,7 +84,8 @@ static int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk) { /* Check if we are reading or writing a disk part or the cd disk */ - if (number_disk >= 0) { + if (number_disk >= 0) + { if ((split->mode & MZ_OPEN_MODE_WRITE) == 0) disk_part = MZ_OPEN_MODE_READ; else if (split->disk_size > 0) @@ -90,15 +93,19 @@ static int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk) { } /* Construct disk path */ - if (disk_part > 0) { - for (i = (int32_t)strlen(split->path_disk) - 1; i >= 0; i -= 1) { + if (disk_part > 0) + { + for (i = (int32_t)strlen(split->path_disk) - 1; i >= 0; i -= 1) + { if (split->path_disk[i] != '.') continue; snprintf(&split->path_disk[i], split->path_disk_size - (uint32_t)i, ".z%02" PRId32, number_disk + 1); break; } - } else { + } + else + { strncpy(split->path_disk, split->path_cd, split->path_disk_size - 1); split->path_disk[split->path_disk_size - 1] = 0; } @@ -112,20 +119,26 @@ static int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk) { if (err == MZ_OK) err = mz_stream_open(split->stream.base, split->path_disk, split->mode); - if (err == MZ_OK) { + if (err == MZ_OK) + { split->total_in_disk = 0; split->total_out_disk = 0; split->current_disk = number_disk; - if (split->mode & MZ_OPEN_MODE_WRITE) { - if ((split->current_disk == 0) && (split->disk_size > 0)) { + if (split->mode & MZ_OPEN_MODE_WRITE) + { + if ((split->current_disk == 0) && (split->disk_size > 0)) + { err = mz_stream_write_uint32(split->stream.base, MZ_ZIP_MAGIC_DISKHEADER); split->total_out_disk += 4; split->total_out += split->total_out_disk; } - } else if (split->mode & MZ_OPEN_MODE_READ) { - if (split->current_disk == 0) { + } + else if (split->mode & MZ_OPEN_MODE_READ) + { + if (split->current_disk == 0) + { err = mz_stream_read_uint32(split->stream.base, &magic); if (magic != MZ_ZIP_MAGIC_DISKHEADER) err = MZ_FORMAT_ERROR; @@ -133,7 +146,8 @@ static int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk) { } } - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Get the size of the current disk we are on */ position = mz_stream_tell(split->stream.base); mz_stream_seek(split->stream.base, 0, MZ_SEEK_END); @@ -146,7 +160,8 @@ static int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk) { return err; } -static int32_t mz_stream_split_close_disk(void *stream) { +static int32_t mz_stream_split_close_disk(void *stream) +{ mz_stream_split *split = (mz_stream_split *)stream; if (mz_stream_is_open(split->stream.base) != MZ_OK) @@ -156,19 +171,24 @@ static int32_t mz_stream_split_close_disk(void *stream) { return mz_stream_close(split->stream.base); } -static int32_t mz_stream_split_goto_disk(void *stream, int32_t number_disk) { +static int32_t mz_stream_split_goto_disk(void *stream, int32_t number_disk) +{ mz_stream_split *split = (mz_stream_split *)stream; int32_t err = MZ_OK; int32_t err_is_open = MZ_OK; err_is_open = mz_stream_is_open(split->stream.base); - if ((split->disk_size == 0) && (split->mode & MZ_OPEN_MODE_WRITE)) { + if ((split->disk_size == 0) && (split->mode & MZ_OPEN_MODE_WRITE)) + { if (err_is_open != MZ_OK) err = mz_stream_split_open_disk(stream, number_disk); - } else if ((number_disk != split->current_disk) || (err_is_open != MZ_OK)) { + } + else if ((number_disk != split->current_disk) || (err_is_open != MZ_OK)) + { err = mz_stream_split_close_disk(stream); - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_split_open_disk(stream, number_disk); if (err == MZ_OK) split->number_disk = number_disk; @@ -178,7 +198,8 @@ static int32_t mz_stream_split_goto_disk(void *stream, int32_t number_disk) { return err; } -int32_t mz_stream_split_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_split_open(void *stream, const char *path, int32_t mode) +{ mz_stream_split *split = (mz_stream_split *)stream; int32_t number_disk = 0; @@ -198,7 +219,8 @@ int32_t mz_stream_split_open(void *stream, const char *path, int32_t mode) { split->path_disk_size = (uint32_t)strlen(path) + 10; split->path_disk = (char *)MZ_ALLOC(split->path_disk_size); - if (split->path_disk == NULL) { + if (split->path_disk == NULL) + { MZ_FREE(split->path_cd); return MZ_MEM_ERROR; } @@ -206,10 +228,13 @@ int32_t mz_stream_split_open(void *stream, const char *path, int32_t mode) { strncpy(split->path_disk, path, split->path_disk_size - 1); split->path_disk[split->path_disk_size - 1] = 0; - if ((mode & MZ_OPEN_MODE_WRITE) && ((mode & MZ_OPEN_MODE_APPEND) == 0)) { + if ((mode & MZ_OPEN_MODE_WRITE) && ((mode & MZ_OPEN_MODE_APPEND) == 0)) + { number_disk = 0; split->current_disk = -1; - } else { + } + else + { number_disk = -1; split->current_disk = 0; } @@ -217,14 +242,16 @@ int32_t mz_stream_split_open(void *stream, const char *path, int32_t mode) { return mz_stream_split_goto_disk(stream, number_disk); } -int32_t mz_stream_split_is_open(void *stream) { +int32_t mz_stream_split_is_open(void *stream) +{ mz_stream_split *split = (mz_stream_split *)stream; if (split->is_open != 1) return MZ_OPEN_ERROR; return MZ_OK; } -int32_t mz_stream_split_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_split_read(void *stream, void *buf, int32_t size) +{ mz_stream_split *split = (mz_stream_split *)stream; int32_t bytes_left = size; int32_t read = 0; @@ -235,18 +262,21 @@ int32_t mz_stream_split_read(void *stream, void *buf, int32_t size) { if (err != MZ_OK) return err; - while (bytes_left > 0) { + while (bytes_left > 0) + { read = mz_stream_read(split->stream.base, buf_ptr, bytes_left); mz_stream_split_print("Split - Read disk - %" PRId32 "\n", read); if (read < 0) return read; - if (read == 0) { + if (read == 0) + { if (split->current_disk < 0) /* No more disks to goto */ break; err = mz_stream_split_goto_disk(stream, split->current_disk + 1); - if (err == MZ_EXIST_ERROR) { + if (err == MZ_EXIST_ERROR) + { split->current_disk = -1; break; } @@ -262,7 +292,8 @@ int32_t mz_stream_split_read(void *stream, void *buf, int32_t size) { return size - bytes_left; } -int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size) +{ mz_stream_split *split = (mz_stream_split *)stream; int64_t position = 0; int32_t written = 0; @@ -275,12 +306,15 @@ int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size) { position = mz_stream_tell(split->stream.base); - while (bytes_left > 0) { + while (bytes_left > 0) + { bytes_to_write = bytes_left; - if (split->disk_size > 0) { + if (split->disk_size > 0) + { if ((split->total_out_disk == split->disk_size && split->total_out > 0) || - (split->number_disk == -1 && split->number_disk != split->current_disk)) { + (split->number_disk == -1 && split->number_disk != split->current_disk)) + { if (split->number_disk != -1) number_disk = split->current_disk + 1; @@ -289,7 +323,8 @@ int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size) { return err; } - if (split->number_disk != -1) { + if (split->number_disk != -1) + { bytes_avail = (int32_t)(split->disk_size - split->total_out_disk); if (bytes_to_write > bytes_avail) bytes_to_write = bytes_avail; @@ -308,7 +343,8 @@ int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size) { split->total_out += written; split->total_out_disk += written; - if (position == split->current_disk_size) { + if (position == split->current_disk_size) + { split->current_disk_size += written; position = split->current_disk_size; } @@ -317,7 +353,8 @@ int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size) { return size - bytes_left; } -int64_t mz_stream_split_tell(void *stream) { +int64_t mz_stream_split_tell(void *stream) +{ mz_stream_split *split = (mz_stream_split *)stream; int32_t err = MZ_OK; err = mz_stream_split_goto_disk(stream, split->number_disk); @@ -326,7 +363,8 @@ int64_t mz_stream_split_tell(void *stream) { return mz_stream_tell(split->stream.base); } -int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream_split *split = (mz_stream_split *)stream; int64_t disk_left = 0; int64_t position = 0; @@ -339,11 +377,13 @@ int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin) { mz_stream_split_print("Split - Seek disk - %" PRId64 " (origin %" PRId32 ")\n", offset, origin); - if ((origin == MZ_SEEK_CUR) && (split->number_disk != -1)) { + if ((origin == MZ_SEEK_CUR) && (split->number_disk != -1)) + { position = mz_stream_tell(split->stream.base); disk_left = split->current_disk_size - position; - while (offset > disk_left) { + while (offset > disk_left) + { err = mz_stream_split_goto_disk(stream, split->current_disk + 1); if (err != MZ_OK) return err; @@ -356,7 +396,8 @@ int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin) { return mz_stream_seek(split->stream.base, offset, origin); } -int32_t mz_stream_split_close(void *stream) { +int32_t mz_stream_split_close(void *stream) +{ mz_stream_split *split = (mz_stream_split *)stream; int32_t err = MZ_OK; @@ -365,14 +406,17 @@ int32_t mz_stream_split_close(void *stream) { return err; } -int32_t mz_stream_split_error(void *stream) { +int32_t mz_stream_split_error(void *stream) +{ mz_stream_split *split = (mz_stream_split *)stream; return mz_stream_error(split->stream.base); } -int32_t mz_stream_split_get_prop_int64(void *stream, int32_t prop, int64_t *value) { +int32_t mz_stream_split_get_prop_int64(void *stream, int32_t prop, int64_t *value) +{ mz_stream_split *split = (mz_stream_split *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_OUT: *value = split->total_out; break; @@ -388,9 +432,11 @@ int32_t mz_stream_split_get_prop_int64(void *stream, int32_t prop, int64_t *valu return MZ_OK; } -int32_t mz_stream_split_set_prop_int64(void *stream, int32_t prop, int64_t value) { +int32_t mz_stream_split_set_prop_int64(void *stream, int32_t prop, int64_t value) +{ mz_stream_split *split = (mz_stream_split *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_DISK_NUMBER: split->number_disk = (int32_t)value; break; @@ -403,11 +449,13 @@ int32_t mz_stream_split_set_prop_int64(void *stream, int32_t prop, int64_t value return MZ_OK; } -void *mz_stream_split_create(void **stream) { +void *mz_stream_split_create(void **stream) +{ mz_stream_split *split = NULL; split = (mz_stream_split *)MZ_ALLOC(sizeof(mz_stream_split)); - if (split != NULL) { + if (split != NULL) + { memset(split, 0, sizeof(mz_stream_split)); split->stream.vtbl = &mz_stream_split_vtbl; } @@ -417,12 +465,14 @@ void *mz_stream_split_create(void **stream) { return split; } -void mz_stream_split_delete(void **stream) { +void mz_stream_split_delete(void **stream) +{ mz_stream_split *split = NULL; if (stream == NULL) return; split = (mz_stream_split *)*stream; - if (split != NULL) { + if (split != NULL) + { if (split->path_cd) MZ_FREE(split->path_cd); if (split->path_disk) @@ -433,6 +483,7 @@ void mz_stream_split_delete(void **stream) { *stream = NULL; } -void *mz_stream_split_get_interface(void) { +void *mz_stream_split_get_interface(void) +{ return (void *)&mz_stream_split_vtbl; } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_split.h b/Sources/XlsxReaderWriter/minizip/mz_strm_split.h similarity index 89% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_split.h rename to Sources/XlsxReaderWriter/minizip/mz_strm_split.h index da404da..6a6bd5e 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_split.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_split.h @@ -1,8 +1,9 @@ /* mz_strm_split.h -- Stream for split files - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_wzaes.c b/Sources/XlsxReaderWriter/minizip/mz_strm_wzaes.c similarity index 88% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_wzaes.c rename to Sources/XlsxReaderWriter/minizip/mz_strm_wzaes.c index fd01199..c44ddc9 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_wzaes.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_wzaes.c @@ -1,8 +1,9 @@ /* mz_strm_wzaes.c -- Stream for WinZip AES encryption - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip Copyright (C) 1998-2010 Brian Gladman, Worcester, UK This program is distributed under the terms of the same license as zlib. @@ -63,7 +64,8 @@ typedef struct mz_stream_wzaes_s { /***************************************************************************/ -int32_t mz_stream_wzaes_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_wzaes_open(void *stream, const char *path, int32_t mode) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; uint16_t salt_length = 0; uint16_t password_length = 0; @@ -94,11 +96,22 @@ int32_t mz_stream_wzaes_open(void *stream, const char *path, int32_t mode) { salt_length = MZ_AES_SALT_LENGTH(wzaes->encryption_mode); - if (mode & MZ_OPEN_MODE_WRITE) { + if (mode & MZ_OPEN_MODE_WRITE) + { +#ifdef MZ_ZIP_NO_COMPRESSION + return MZ_SUPPORT_ERROR; +#else mz_crypt_rand(salt_value, salt_length); - } else if (mode & MZ_OPEN_MODE_READ) { +#endif + } + else if (mode & MZ_OPEN_MODE_READ) + { +#ifdef MZ_ZIP_NO_DECOMPRESSION + return MZ_SUPPORT_ERROR; +#else if (mz_stream_read(wzaes->stream.base, salt_value, salt_length) != salt_length) return MZ_READ_ERROR; +#endif } key_length = MZ_AES_KEY_LENGTH(wzaes->encryption_mode); @@ -123,7 +136,8 @@ int32_t mz_stream_wzaes_open(void *stream, const char *path, int32_t mode) { memcpy(verify, kbuf + (2 * key_length), MZ_AES_PW_VERIFY_SIZE); - if (mode & MZ_OPEN_MODE_WRITE) { + if (mode & MZ_OPEN_MODE_WRITE) + { if (mz_stream_write(wzaes->stream.base, salt_value, salt_length) != salt_length) return MZ_WRITE_ERROR; @@ -133,7 +147,9 @@ int32_t mz_stream_wzaes_open(void *stream, const char *path, int32_t mode) { return MZ_WRITE_ERROR; wzaes->total_out += MZ_AES_PW_VERIFY_SIZE; - } else if (mode & MZ_OPEN_MODE_READ) { + } + else if (mode & MZ_OPEN_MODE_READ) + { wzaes->total_in += salt_length; if (mz_stream_read(wzaes->stream.base, verify_expected, MZ_AES_PW_VERIFY_SIZE) != MZ_AES_PW_VERIFY_SIZE) @@ -151,21 +167,25 @@ int32_t mz_stream_wzaes_open(void *stream, const char *path, int32_t mode) { return MZ_OK; } -int32_t mz_stream_wzaes_is_open(void *stream) { +int32_t mz_stream_wzaes_is_open(void *stream) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; if (wzaes->initialized == 0) return MZ_OPEN_ERROR; return MZ_OK; } -static int32_t mz_stream_wzaes_ctr_encrypt(void *stream, uint8_t *buf, int32_t size) { +static int32_t mz_stream_wzaes_ctr_encrypt(void *stream, uint8_t *buf, int32_t size) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; uint32_t pos = wzaes->crypt_pos; uint32_t i = 0; int32_t err = MZ_OK; - while (i < (uint32_t)size) { - if (pos == MZ_AES_BLOCK_SIZE) { + while (i < (uint32_t)size) + { + if (pos == MZ_AES_BLOCK_SIZE) + { uint32_t j = 0; /* Increment encryption nonce */ @@ -185,7 +205,8 @@ static int32_t mz_stream_wzaes_ctr_encrypt(void *stream, uint8_t *buf, int32_t s return err; } -int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; int64_t max_total_in = 0; int32_t bytes_to_read = size; @@ -197,7 +218,8 @@ int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size) { read = mz_stream_read(wzaes->stream.base, buf, bytes_to_read); - if (read > 0) { + if (read > 0) + { mz_crypt_hmac_update(wzaes->hmac, (uint8_t *)buf, read); mz_stream_wzaes_ctr_encrypt(stream, (uint8_t *)buf, read); @@ -207,7 +229,8 @@ int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size) { return read; } -int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; const uint8_t *buf_ptr = (const uint8_t *)buf; int32_t bytes_to_write = sizeof(wzaes->buffer); @@ -217,7 +240,8 @@ int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size) { if (size < 0) return MZ_PARAM_ERROR; - do { + do + { if (bytes_to_write > (size - total_written)) bytes_to_write = (size - total_written); @@ -232,35 +256,42 @@ int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size) { return written; total_written += written; - } while (total_written < size && written > 0); + } + while (total_written < size && written > 0); wzaes->total_out += total_written; return total_written; } -int64_t mz_stream_wzaes_tell(void *stream) { +int64_t mz_stream_wzaes_tell(void *stream) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; return mz_stream_tell(wzaes->stream.base); } -int32_t mz_stream_wzaes_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_wzaes_seek(void *stream, int64_t offset, int32_t origin) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; return mz_stream_seek(wzaes->stream.base, offset, origin); } -int32_t mz_stream_wzaes_close(void *stream) { +int32_t mz_stream_wzaes_close(void *stream) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; uint8_t expected_hash[MZ_AES_AUTHCODE_SIZE]; uint8_t computed_hash[MZ_HASH_SHA1_SIZE]; mz_crypt_hmac_end(wzaes->hmac, computed_hash, sizeof(computed_hash)); - if (wzaes->mode & MZ_OPEN_MODE_WRITE) { + if (wzaes->mode & MZ_OPEN_MODE_WRITE) + { if (mz_stream_write(wzaes->stream.base, computed_hash, MZ_AES_AUTHCODE_SIZE) != MZ_AES_AUTHCODE_SIZE) return MZ_WRITE_ERROR; wzaes->total_out += MZ_AES_AUTHCODE_SIZE; - } else if (wzaes->mode & MZ_OPEN_MODE_READ) { + } + else if (wzaes->mode & MZ_OPEN_MODE_READ) + { if (mz_stream_read(wzaes->stream.base, expected_hash, MZ_AES_AUTHCODE_SIZE) != MZ_AES_AUTHCODE_SIZE) return MZ_READ_ERROR; @@ -275,24 +306,29 @@ int32_t mz_stream_wzaes_close(void *stream) { return MZ_OK; } -int32_t mz_stream_wzaes_error(void *stream) { +int32_t mz_stream_wzaes_error(void *stream) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; return wzaes->error; } -void mz_stream_wzaes_set_password(void *stream, const char *password) { +void mz_stream_wzaes_set_password(void *stream, const char *password) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; wzaes->password = password; } -void mz_stream_wzaes_set_encryption_mode(void *stream, int16_t encryption_mode) { +void mz_stream_wzaes_set_encryption_mode(void *stream, int16_t encryption_mode) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; wzaes->encryption_mode = encryption_mode; } -int32_t mz_stream_wzaes_get_prop_int64(void *stream, int32_t prop, int64_t *value) { +int32_t mz_stream_wzaes_get_prop_int64(void *stream, int32_t prop, int64_t *value) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_IN: *value = wzaes->total_in; break; @@ -314,9 +350,11 @@ int32_t mz_stream_wzaes_get_prop_int64(void *stream, int32_t prop, int64_t *valu return MZ_OK; } -int32_t mz_stream_wzaes_set_prop_int64(void *stream, int32_t prop, int64_t value) { +int32_t mz_stream_wzaes_set_prop_int64(void *stream, int32_t prop, int64_t value) +{ mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_IN_MAX: wzaes->max_total_in = value; break; @@ -326,11 +364,13 @@ int32_t mz_stream_wzaes_set_prop_int64(void *stream, int32_t prop, int64_t value return MZ_OK; } -void *mz_stream_wzaes_create(void **stream) { +void *mz_stream_wzaes_create(void **stream) +{ mz_stream_wzaes *wzaes = NULL; wzaes = (mz_stream_wzaes *)MZ_ALLOC(sizeof(mz_stream_wzaes)); - if (wzaes != NULL) { + if (wzaes != NULL) + { memset(wzaes, 0, sizeof(mz_stream_wzaes)); wzaes->stream.vtbl = &mz_stream_wzaes_vtbl; wzaes->encryption_mode = MZ_AES_ENCRYPTION_MODE_256; @@ -344,12 +384,14 @@ void *mz_stream_wzaes_create(void **stream) { return wzaes; } -void mz_stream_wzaes_delete(void **stream) { +void mz_stream_wzaes_delete(void **stream) +{ mz_stream_wzaes *wzaes = NULL; if (stream == NULL) return; wzaes = (mz_stream_wzaes *)*stream; - if (wzaes != NULL) { + if (wzaes != NULL) + { mz_crypt_aes_delete(&wzaes->aes); mz_crypt_hmac_delete(&wzaes->hmac); MZ_FREE(wzaes); @@ -357,6 +399,7 @@ void mz_stream_wzaes_delete(void **stream) { *stream = NULL; } -void *mz_stream_wzaes_get_interface(void) { +void *mz_stream_wzaes_get_interface(void) +{ return (void *)&mz_stream_wzaes_vtbl; } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_wzaes.h b/Sources/XlsxReaderWriter/minizip/mz_strm_wzaes.h similarity index 90% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_wzaes.h rename to Sources/XlsxReaderWriter/minizip/mz_strm_wzaes.h index e27f112..e663a1b 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_wzaes.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_wzaes.h @@ -1,8 +1,9 @@ /* mz_strm_wzaes.h -- Stream for WinZIP AES encryption - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_zlib.c b/Sources/XlsxReaderWriter/minizip/mz_strm_zlib.c similarity index 84% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_zlib.c rename to Sources/XlsxReaderWriter/minizip/mz_strm_zlib.c index e83bbac..c016adf 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_zlib.c +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_zlib.c @@ -1,8 +1,9 @@ /* mz_strm_zlib.c -- Stream for zlib inflate/deflate - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -72,7 +73,8 @@ typedef struct mz_stream_zlib_s { /***************************************************************************/ -int32_t mz_stream_zlib_open(void *stream, const char *path, int32_t mode) { +int32_t mz_stream_zlib_open(void *stream, const char *path, int32_t mode) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; MZ_UNUSED(path); @@ -87,7 +89,8 @@ int32_t mz_stream_zlib_open(void *stream, const char *path, int32_t mode) { zlib->total_in = 0; zlib->total_out = 0; - if (mode & MZ_OPEN_MODE_WRITE) { + if (mode & MZ_OPEN_MODE_WRITE) + { #ifdef MZ_ZIP_NO_COMPRESSION return MZ_SUPPORT_ERROR; #else @@ -97,7 +100,9 @@ int32_t mz_stream_zlib_open(void *stream, const char *path, int32_t mode) { zlib->error = ZLIB_PREFIX(deflateInit2)(&zlib->zstream, (int8_t)zlib->level, Z_DEFLATED, zlib->window_bits, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); #endif - } else if (mode & MZ_OPEN_MODE_READ) { + } + else if (mode & MZ_OPEN_MODE_READ) + { #ifdef MZ_ZIP_NO_DECOMPRESSION return MZ_SUPPORT_ERROR; #else @@ -116,14 +121,16 @@ int32_t mz_stream_zlib_open(void *stream, const char *path, int32_t mode) { return MZ_OK; } -int32_t mz_stream_zlib_is_open(void *stream) { +int32_t mz_stream_zlib_is_open(void *stream) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; if (zlib->initialized != 1) return MZ_OPEN_ERROR; return MZ_OK; } -int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size) { +int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size) +{ #ifdef MZ_ZIP_NO_DECOMPRESSION MZ_UNUSED(stream); MZ_UNUSED(buf); @@ -147,9 +154,12 @@ int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size) { zlib->zstream.next_out = (Bytef*)buf; zlib->zstream.avail_out = (uInt)size; - do { - if (zlib->zstream.avail_in == 0) { - if (zlib->max_total_in > 0) { + do + { + if (zlib->zstream.avail_in == 0) + { + if (zlib->max_total_in > 0) + { if ((int64_t)bytes_to_read > (zlib->max_total_in - zlib->total_in)) bytes_to_read = (int32_t)(zlib->max_total_in - zlib->total_in); } @@ -167,7 +177,8 @@ int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size) { total_out_before = zlib->zstream.total_out; err = ZLIB_PREFIX(inflate)(&zlib->zstream, Z_SYNC_FLUSH); - if ((err >= Z_OK) && (zlib->zstream.msg != NULL)) { + if ((err >= Z_OK) && (zlib->zstream.msg != NULL)) + { zlib->error = Z_DATA_ERROR; break; } @@ -186,13 +197,16 @@ int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size) { if (err == Z_STREAM_END) break; - if (err != Z_OK) { + if (err != Z_OK) + { zlib->error = err; break; } - } while (zlib->zstream.avail_out > 0); + } + while (zlib->zstream.avail_out > 0); - if (zlib->error != 0) { + if (zlib->error != 0) + { /* Zlib errors are compatible with MZ */ return zlib->error; } @@ -202,14 +216,16 @@ int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size) { } #ifndef MZ_ZIP_NO_COMPRESSION -static int32_t mz_stream_zlib_flush(void *stream) { +static int32_t mz_stream_zlib_flush(void *stream) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; if (mz_stream_write(zlib->stream.base, zlib->buffer, zlib->buffer_len) != zlib->buffer_len) return MZ_WRITE_ERROR; return MZ_OK; } -static int32_t mz_stream_zlib_deflate(void *stream, int flush) { +static int32_t mz_stream_zlib_deflate(void *stream, int flush) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; uint64_t total_out_before = 0; uint64_t total_out_after = 0; @@ -217,8 +233,10 @@ static int32_t mz_stream_zlib_deflate(void *stream, int flush) { int32_t err = Z_OK; - do { - if (zlib->zstream.avail_out == 0) { + do + { + if (zlib->zstream.avail_out == 0) + { err = mz_stream_zlib_flush(zlib); if (err != MZ_OK) return err; @@ -240,46 +258,47 @@ static int32_t mz_stream_zlib_deflate(void *stream, int flush) { if (err == Z_STREAM_END) break; - if (err != Z_OK) { + if (err != Z_OK) + { zlib->error = err; return MZ_DATA_ERROR; } - } while ((zlib->zstream.avail_in > 0) || (flush == Z_FINISH && err == Z_OK)); + } + while ((zlib->zstream.avail_in > 0) || (flush == Z_FINISH && err == Z_OK)); return MZ_OK; } #endif -int32_t mz_stream_zlib_write(void *stream, const void *buf, int32_t size) { +int32_t mz_stream_zlib_write(void *stream, const void *buf, int32_t size) +{ + mz_stream_zlib *zlib = (mz_stream_zlib *)stream; + int32_t err = size; + #ifdef MZ_ZIP_NO_COMPRESSION - MZ_UNUSED(stream); + MZ_UNUSED(zlib); MZ_UNUSED(buf); - MZ_UNUSED(size); - return MZ_SUPPORT_ERROR; + err = MZ_SUPPORT_ERROR; #else - mz_stream_zlib *zlib = (mz_stream_zlib *)stream; - int32_t err = MZ_OK; - zlib->zstream.next_in = (Bytef*)(intptr_t)buf; zlib->zstream.avail_in = (uInt)size; - err = mz_stream_zlib_deflate(stream, Z_NO_FLUSH); - if (err != MZ_OK) { - return err; - } + mz_stream_zlib_deflate(stream, Z_NO_FLUSH); zlib->total_in += size; - return size; #endif + return err; } -int64_t mz_stream_zlib_tell(void *stream) { +int64_t mz_stream_zlib_tell(void *stream) +{ MZ_UNUSED(stream); return MZ_TELL_ERROR; } -int32_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin) { +int32_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin) +{ MZ_UNUSED(stream); MZ_UNUSED(offset); MZ_UNUSED(origin); @@ -287,11 +306,13 @@ int32_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin) { return MZ_SEEK_ERROR; } -int32_t mz_stream_zlib_close(void *stream) { +int32_t mz_stream_zlib_close(void *stream) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; - if (zlib->mode & MZ_OPEN_MODE_WRITE) { + if (zlib->mode & MZ_OPEN_MODE_WRITE) + { #ifdef MZ_ZIP_NO_COMPRESSION return MZ_SUPPORT_ERROR; #else @@ -300,7 +321,9 @@ int32_t mz_stream_zlib_close(void *stream) { ZLIB_PREFIX(deflateEnd)(&zlib->zstream); #endif - } else if (zlib->mode & MZ_OPEN_MODE_READ) { + } + else if (zlib->mode & MZ_OPEN_MODE_READ) + { #ifdef MZ_ZIP_NO_DECOMPRESSION return MZ_SUPPORT_ERROR; #else @@ -315,14 +338,17 @@ int32_t mz_stream_zlib_close(void *stream) { return MZ_OK; } -int32_t mz_stream_zlib_error(void *stream) { +int32_t mz_stream_zlib_error(void *stream) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; return zlib->error; } -int32_t mz_stream_zlib_get_prop_int64(void *stream, int32_t prop, int64_t *value) { +int32_t mz_stream_zlib_get_prop_int64(void *stream, int32_t prop, int64_t *value) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_TOTAL_IN: *value = zlib->total_in; break; @@ -337,16 +363,18 @@ int32_t mz_stream_zlib_get_prop_int64(void *stream, int32_t prop, int64_t *value break; case MZ_STREAM_PROP_COMPRESS_WINDOW: *value = zlib->window_bits; - break; + break; default: return MZ_EXIST_ERROR; } return MZ_OK; } -int32_t mz_stream_zlib_set_prop_int64(void *stream, int32_t prop, int64_t value) { +int32_t mz_stream_zlib_set_prop_int64(void *stream, int32_t prop, int64_t value) +{ mz_stream_zlib *zlib = (mz_stream_zlib *)stream; - switch (prop) { + switch (prop) + { case MZ_STREAM_PROP_COMPRESS_LEVEL: zlib->level = (int16_t)value; break; @@ -362,11 +390,13 @@ int32_t mz_stream_zlib_set_prop_int64(void *stream, int32_t prop, int64_t value) return MZ_OK; } -void *mz_stream_zlib_create(void **stream) { +void *mz_stream_zlib_create(void **stream) +{ mz_stream_zlib *zlib = NULL; zlib = (mz_stream_zlib *)MZ_ALLOC(sizeof(mz_stream_zlib)); - if (zlib != NULL) { + if (zlib != NULL) + { memset(zlib, 0, sizeof(mz_stream_zlib)); zlib->stream.vtbl = &mz_stream_zlib_vtbl; zlib->level = Z_DEFAULT_COMPRESSION; @@ -378,7 +408,8 @@ void *mz_stream_zlib_create(void **stream) { return zlib; } -void mz_stream_zlib_delete(void **stream) { +void mz_stream_zlib_delete(void **stream) +{ mz_stream_zlib *zlib = NULL; if (stream == NULL) return; @@ -388,6 +419,7 @@ void mz_stream_zlib_delete(void **stream) { *stream = NULL; } -void *mz_stream_zlib_get_interface(void) { +void *mz_stream_zlib_get_interface(void) +{ return (void *)&mz_stream_zlib_vtbl; } diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_zlib.h b/Sources/XlsxReaderWriter/minizip/mz_strm_zlib.h similarity index 89% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_zlib.h rename to Sources/XlsxReaderWriter/minizip/mz_strm_zlib.h index 47f7480..ab80ee2 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_strm_zlib.h +++ b/Sources/XlsxReaderWriter/minizip/mz_strm_zlib.h @@ -1,8 +1,9 @@ /* mz_strm_zlib.h -- Stream for zlib inflate/deflate - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip.c b/Sources/XlsxReaderWriter/minizip/mz_zip.c similarity index 83% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip.c rename to Sources/XlsxReaderWriter/minizip/mz_zip.c index d359336..e7232da 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip.c +++ b/Sources/XlsxReaderWriter/minizip/mz_zip.c @@ -1,8 +1,9 @@ /* zip.c -- Zip manipulation - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip Copyright (C) 2009-2010 Mathias Svensson Modifications for Zip64 support http://result42.com @@ -15,6 +16,7 @@ See the accompanying LICENSE file for the full text of the license. */ +#define HAVE_ZLIB #include "mz.h" #include "mz_crypt.h" @@ -38,9 +40,6 @@ #ifdef HAVE_ZLIB # include "mz_strm_zlib.h" #endif -#ifdef HAVE_ZSTD -# include "mz_strm_zstd.h" -#endif #include "mz_zip.h" @@ -73,7 +72,6 @@ #define MZ_ZIP_SIZE_MAX_DATA_DESCRIPTOR (24) #define MZ_ZIP_OFFSET_CRC_SIZES (14) -#define MZ_ZIP_UNCOMPR_SIZE64_CUSHION (2 * 1024 * 1024) #ifndef MZ_ZIP_EOCD_MAX_BACK #define MZ_ZIP_EOCD_MAX_BACK (1 << 20) @@ -81,7 +79,8 @@ /***************************************************************************/ -typedef struct mz_zip_s { +typedef struct mz_zip_s +{ mz_zip_file file_info; mz_zip_file local_file_info; @@ -128,7 +127,8 @@ typedef struct mz_zip_s { /***************************************************************************/ /* Locate the end of central directory */ -static int32_t mz_zip_search_eocd(void *stream, int64_t *central_pos) { +static int32_t mz_zip_search_eocd(void *stream, int64_t *central_pos) +{ int64_t file_size = 0; int64_t max_back = MZ_ZIP_EOCD_MAX_BACK; uint8_t find[4] = MZ_ZIP_MAGIC_ENDHEADERU8; @@ -147,7 +147,8 @@ static int32_t mz_zip_search_eocd(void *stream, int64_t *central_pos) { } /* Locate the end of central directory 64 of a zip file */ -static int32_t mz_zip_search_zip64_eocd(void *stream, const int64_t end_central_offset, int64_t *central_pos) { +static int32_t mz_zip_search_zip64_eocd(void *stream, const int64_t end_central_offset, int64_t *central_pos) +{ int64_t offset = 0; uint32_t value32 = 0; int32_t err = MZ_OK; @@ -158,7 +159,8 @@ static int32_t mz_zip_search_zip64_eocd(void *stream, const int64_t end_central_ /* Zip64 end of central directory locator */ err = mz_stream_seek(stream, end_central_offset - MZ_ZIP_SIZE_CD_LOCATOR64, MZ_SEEK_SET); /* Read locator signature */ - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint32(stream, &value32); if (value32 != MZ_ZIP_MAGIC_ENDLOCHEADER64) err = MZ_FORMAT_ERROR; @@ -176,7 +178,8 @@ static int32_t mz_zip_search_zip64_eocd(void *stream, const int64_t end_central_ if (err == MZ_OK) err = mz_stream_seek(stream, (int64_t)offset, MZ_SEEK_SET); /* The signature */ - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint32(stream, &value32); if (value32 != MZ_ZIP_MAGIC_ENDHEADER64) err = MZ_FORMAT_ERROR; @@ -188,18 +191,9 @@ static int32_t mz_zip_search_zip64_eocd(void *stream, const int64_t end_central_ return err; } -/* Get PKWARE traditional encryption verifier */ -static uint16_t mz_zip_get_pk_verify(uint32_t dos_date, uint64_t crc, uint16_t flag) -{ - /* Info-ZIP modification to ZipCrypto format: if bit 3 of the general - * purpose bit flag is set, it uses high byte of 16-bit File Time. */ - if (flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR) - return ((dos_date >> 16) & 0xff) << 8 | ((dos_date >> 8) & 0xff); - return ((crc >> 16) & 0xff) << 8 | ((crc >> 24) & 0xff); -} - /* Get info about the current file in the zip file */ -static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file *file_info, void *file_extra_stream) { +static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file *file_info, void *file_extra_stream) +{ uint64_t ntfs_time = 0; uint32_t reserved = 0; uint32_t magic = 0; @@ -235,7 +229,8 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file err = MZ_FORMAT_ERROR; /* Read header fields */ - if (err == MZ_OK) { + if (err == MZ_OK) + { if (!local) err = mz_stream_read_uint16(stream, &file_info->version_madeby); if (err == MZ_OK) @@ -244,23 +239,20 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file err = mz_stream_read_uint16(stream, &file_info->flag); if (err == MZ_OK) err = mz_stream_read_uint16(stream, &file_info->compression_method); - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint32(stream, &dos_date); file_info->modified_date = mz_zip_dosdate_to_time_t(dos_date); } if (err == MZ_OK) err = mz_stream_read_uint32(stream, &file_info->crc); -#ifdef HAVE_PKCRYPT - if (err == MZ_OK && file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) { - /* Use dos_date from header instead of derived from time in zip extensions */ - file_info->pk_verify = mz_zip_get_pk_verify(dos_date, file_info->crc, file_info->flag); - } -#endif - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint32(stream, &value32); file_info->compressed_size = value32; } - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint32(stream, &value32); file_info->uncompressed_size = value32; } @@ -268,10 +260,12 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file err = mz_stream_read_uint16(stream, &file_info->filename_size); if (err == MZ_OK) err = mz_stream_read_uint16(stream, &file_info->extrafield_size); - if (!local) { + if (!local) + { if (err == MZ_OK) err = mz_stream_read_uint16(stream, &file_info->comment_size); - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint16(stream, &value16); file_info->disk_number = value16; } @@ -279,7 +273,8 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file err = mz_stream_read_uint16(stream, &file_info->internal_fa); if (err == MZ_OK) err = mz_stream_read_uint32(stream, &file_info->external_fa); - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint32(stream, &value32); file_info->disk_offset = value32; } @@ -308,11 +303,13 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file /* Overwrite if we encounter UNIX1 extra block */ mz_stream_write_uint8(file_extra_stream, 0); - if ((err == MZ_OK) && (file_info->extrafield_size > 0)) { + if ((err == MZ_OK) && (file_info->extrafield_size > 0)) + { /* Seek to and parse the extra field */ err = mz_stream_seek(file_extra_stream, extrafield_pos, MZ_SEEK_SET); - while ((err == MZ_OK) && (field_pos + 4 <= file_info->extrafield_size)) { + while ((err == MZ_OK) && (field_pos + 4 <= file_info->extrafield_size)) + { err = mz_zip_extrafield_read(file_extra_stream, &field_type, &field_length); if (err != MZ_OK) break; @@ -323,18 +320,22 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file field_length = (uint16_t)(file_info->extrafield_size - field_pos); /* Read ZIP64 extra field */ - if ((field_type == MZ_ZIP_EXTENSION_ZIP64) && (field_length >= 8)) { - if ((err == MZ_OK) && (file_info->uncompressed_size == UINT32_MAX)) { + if ((field_type == MZ_ZIP_EXTENSION_ZIP64) && (field_length >= 8)) + { + if ((err == MZ_OK) && (file_info->uncompressed_size == UINT32_MAX)) + { err = mz_stream_read_int64(file_extra_stream, &file_info->uncompressed_size); if (file_info->uncompressed_size < 0) err = MZ_FORMAT_ERROR; } - if ((err == MZ_OK) && (file_info->compressed_size == UINT32_MAX)) { + if ((err == MZ_OK) && (file_info->compressed_size == UINT32_MAX)) + { err = mz_stream_read_int64(file_extra_stream, &file_info->compressed_size); if (file_info->compressed_size < 0) err = MZ_FORMAT_ERROR; } - if ((err == MZ_OK) && (file_info->disk_offset == UINT32_MAX)) { + if ((err == MZ_OK) && (file_info->disk_offset == UINT32_MAX)) + { err = mz_stream_read_int64(file_extra_stream, &file_info->disk_offset); if (file_info->disk_offset < 0) err = MZ_FORMAT_ERROR; @@ -343,30 +344,37 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file err = mz_stream_read_uint32(file_extra_stream, &file_info->disk_number); } /* Read NTFS extra field */ - else if ((field_type == MZ_ZIP_EXTENSION_NTFS) && (field_length > 4)) { + else if ((field_type == MZ_ZIP_EXTENSION_NTFS) && (field_length > 4)) + { if (err == MZ_OK) err = mz_stream_read_uint32(file_extra_stream, &reserved); field_length_read = 4; - while ((err == MZ_OK) && (field_length_read + 4 <= field_length)) { + while ((err == MZ_OK) && (field_length_read + 4 <= field_length)) + { err = mz_stream_read_uint16(file_extra_stream, &ntfs_attrib_id); if (err == MZ_OK) err = mz_stream_read_uint16(file_extra_stream, &ntfs_attrib_size); field_length_read += 4; - if ((err == MZ_OK) && (ntfs_attrib_id == 0x01) && (ntfs_attrib_size == 24)) { + if ((err == MZ_OK) && (ntfs_attrib_id == 0x01) && (ntfs_attrib_size == 24)) + { err = mz_stream_read_uint64(file_extra_stream, &ntfs_time); mz_zip_ntfs_to_unix_time(ntfs_time, &file_info->modified_date); - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint64(file_extra_stream, &ntfs_time); mz_zip_ntfs_to_unix_time(ntfs_time, &file_info->accessed_date); } - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint64(file_extra_stream, &ntfs_time); mz_zip_ntfs_to_unix_time(ntfs_time, &file_info->creation_date); } - } else if ((err == MZ_OK) && (field_length_read + ntfs_attrib_size <= field_length)) { + } + else if ((err == MZ_OK) && (field_length_read + ntfs_attrib_size <= field_length)) + { err = mz_stream_seek(file_extra_stream, ntfs_attrib_size, MZ_SEEK_CUR); } @@ -374,13 +382,16 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file } } /* Read UNIX1 extra field */ - else if ((field_type == MZ_ZIP_EXTENSION_UNIX1) && (field_length >= 12)) { - if (err == MZ_OK) { + else if ((field_type == MZ_ZIP_EXTENSION_UNIX1) && (field_length >= 12)) + { + if (err == MZ_OK) + { err = mz_stream_read_uint32(file_extra_stream, &value32); if (err == MZ_OK && file_info->accessed_date == 0) file_info->accessed_date = value32; } - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint32(file_extra_stream, &value32); if (err == MZ_OK && file_info->modified_date == 0) file_info->modified_date = value32; @@ -393,12 +404,15 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file /* Copy linkname to end of file extra stream so we can return null terminated string */ linkname_size = field_length - 12; - if ((err == MZ_OK) && (linkname_size > 0)) { + if ((err == MZ_OK) && (linkname_size > 0)) + { linkname = (char *)MZ_ALLOC(linkname_size); - if (linkname != NULL) { + if (linkname != NULL) + { if (mz_stream_read(file_extra_stream, linkname, linkname_size) != linkname_size) err = MZ_READ_ERROR; - if (err == MZ_OK) { + if (err == MZ_OK) + { saved_pos = mz_stream_tell(file_extra_stream); mz_stream_seek(file_extra_stream, linkname_pos, MZ_SEEK_SET); @@ -413,7 +427,8 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file } #ifdef HAVE_WZAES /* Read AES extra field */ - else if ((field_type == MZ_ZIP_EXTENSION_AES) && (field_length == 7)) { + else if ((field_type == MZ_ZIP_EXTENSION_AES) && (field_length == 7)) + { uint8_t value8 = 0; /* Verify version info */ err = mz_stream_read_uint16(file_extra_stream, &value16); @@ -430,17 +445,20 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file if ((char)value8 != 'E') err = MZ_FORMAT_ERROR; /* Get AES encryption strength and actual compression method */ - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint8(file_extra_stream, &value8); file_info->aes_encryption_mode = value8; } - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_uint16(file_extra_stream, &value16); file_info->compression_method = value16; } } #endif - else if (field_length > 0) { + else if (field_length > 0) + { err = mz_stream_seek(file_extra_stream, field_length, MZ_SEEK_CUR); } @@ -464,12 +482,14 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file if (file_info->linkname == NULL) file_info->linkname = ""; - if (err == MZ_OK) { + if (err == MZ_OK) + { mz_zip_print("Zip - Entry - Read header - %s (local %" PRId8 ")\n", file_info->filename, local); mz_zip_print("Zip - Entry - Read header compress (ucs %" PRId64 " cs %" PRId64 " crc 0x%08" PRIx32 ")\n", file_info->uncompressed_size, file_info->compressed_size, file_info->crc); - if (!local) { + if (!local) + { mz_zip_print("Zip - Entry - Read header disk (disk %" PRIu32 " offset %" PRId64 ")\n", file_info->disk_number, file_info->disk_offset); } @@ -480,7 +500,8 @@ static int32_t mz_zip_entry_read_header(void *stream, uint8_t local, mz_zip_file return err; } -static int32_t mz_zip_entry_read_descriptor(void *stream, uint8_t zip64, uint32_t *crc32, int64_t *compressed_size, int64_t *uncompressed_size) { +static int32_t mz_zip_entry_read_descriptor(void *stream, uint8_t zip64, uint32_t *crc32, int64_t *compressed_size, int64_t *uncompressed_size) +{ uint32_t value32 = 0; int64_t value64 = 0; int32_t err = MZ_OK; @@ -493,12 +514,16 @@ static int32_t mz_zip_entry_read_descriptor(void *stream, uint8_t zip64, uint32_ err = mz_stream_read_uint32(stream, &value32); if ((err == MZ_OK) && (crc32 != NULL)) *crc32 = value32; - if (err == MZ_OK) { + if (err == MZ_OK) + { /* If zip 64 extension is enabled then read as 8 byte */ - if (!zip64) { + if (!zip64) + { err = mz_stream_read_uint32(stream, &value32); value64 = value32; - } else { + } + else + { err = mz_stream_read_int64(stream, &value64); if (value64 < 0) err = MZ_FORMAT_ERROR; @@ -506,11 +531,15 @@ static int32_t mz_zip_entry_read_descriptor(void *stream, uint8_t zip64, uint32_ if ((err == MZ_OK) && (compressed_size != NULL)) *compressed_size = value64; } - if (err == MZ_OK) { - if (!zip64) { + if (err == MZ_OK) + { + if (!zip64) + { err = mz_stream_read_uint32(stream, &value32); value64 = value32; - } else { + } + else + { err = mz_stream_read_int64(stream, &value64); if (value64 < 0) err = MZ_FORMAT_ERROR; @@ -522,7 +551,8 @@ static int32_t mz_zip_entry_read_descriptor(void *stream, uint8_t zip64, uint32_ return err; } -static int32_t mz_zip_entry_write_crc_sizes(void *stream, uint8_t zip64, uint8_t mask, mz_zip_file *file_info) { +static int32_t mz_zip_entry_write_crc_sizes(void *stream, uint8_t mask, mz_zip_file *file_info) +{ int32_t err = MZ_OK; if (mask) @@ -530,72 +560,27 @@ static int32_t mz_zip_entry_write_crc_sizes(void *stream, uint8_t zip64, uint8_t else err = mz_stream_write_uint32(stream, file_info->crc); /* crc */ - /* For backwards-compatibility with older zip applications we set all sizes to UINT32_MAX - * when zip64 is needed, instead of only setting sizes larger than UINT32_MAX. */ - - if (err == MZ_OK) { - if (zip64) /* compr size */ + if (err == MZ_OK) + { + if (file_info->compressed_size >= UINT32_MAX) /* compr size */ err = mz_stream_write_uint32(stream, UINT32_MAX); else err = mz_stream_write_uint32(stream, (uint32_t)file_info->compressed_size); } - if (err == MZ_OK) { - if (mask) /* uncompr size */ - err = mz_stream_write_uint32(stream, 0); - else if (zip64) + if (err == MZ_OK) + { + if (file_info->uncompressed_size >= UINT32_MAX) /* uncompr size */ err = mz_stream_write_uint32(stream, UINT32_MAX); + else if (mask) + err = mz_stream_write_uint32(stream, 0); else err = mz_stream_write_uint32(stream, (uint32_t)file_info->uncompressed_size); } return err; } -static int32_t mz_zip_entry_needs_zip64(mz_zip_file *file_info, uint8_t local, uint8_t *zip64) { - uint32_t max_uncompressed_size = UINT32_MAX; - uint8_t needs_zip64 = 0; - - if (zip64 == NULL) - return MZ_PARAM_ERROR; - - *zip64 = 0; - - if (local) { - /* At local header we might not know yet whether compressed size will overflow unsigned - 32-bit integer which might happen for high entropy data so we give it some cushion */ - - max_uncompressed_size -= MZ_ZIP_UNCOMPR_SIZE64_CUSHION; - } - - needs_zip64 = (file_info->uncompressed_size >= max_uncompressed_size) || - (file_info->compressed_size >= UINT32_MAX); - - if (!local) { - /* Disk offset and number only used in central directory header */ - needs_zip64 |= (file_info->disk_offset >= UINT32_MAX) || - (file_info->disk_number >= UINT16_MAX); - } - - if (file_info->zip64 == MZ_ZIP64_AUTO) { - /* If uncompressed size is unknown, assume zip64 for 64-bit data descriptors */ - if (local && file_info->uncompressed_size == 0) { - /* Don't use zip64 for local header directory entries */ - if (mz_zip_attrib_is_dir(file_info->external_fa, file_info->version_madeby) != MZ_OK) { - *zip64 = 1; - } - } - *zip64 |= needs_zip64; - } else if (file_info->zip64 == MZ_ZIP64_FORCE) { - *zip64 = 1; - } else if (file_info->zip64 == MZ_ZIP64_DISABLE) { - /* Zip64 extension is required to zip file */ - if (needs_zip64) - return MZ_PARAM_ERROR; - } - - return MZ_OK; -} - -static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_file *file_info) { +static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_file *file_info) +{ uint64_t ntfs_time = 0; uint32_t reserved = 0; uint32_t dos_date = 0; @@ -627,29 +612,45 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil if ((local) && (file_info->flag & MZ_ZIP_FLAG_MASK_LOCAL_INFO)) mask = 1; - /* Determine if zip64 extra field is necessary */ - err = mz_zip_entry_needs_zip64(file_info, local, &zip64); - if (err != MZ_OK) - return err; + /* Calculate extra field sizes */ + if (file_info->uncompressed_size >= UINT32_MAX) + field_length_zip64 += 8; + if (file_info->compressed_size >= UINT32_MAX) + field_length_zip64 += 8; + if (file_info->disk_offset >= UINT32_MAX) + field_length_zip64 += 8; - /* Start calculating extra field sizes */ - if (zip64) { - /* Both compressed and uncompressed sizes must be included (at least in local header) */ - field_length_zip64 = 8 + 8; - if ((!local) && (file_info->disk_offset >= UINT32_MAX)) - field_length_zip64 += 8; + if (file_info->zip64 == MZ_ZIP64_AUTO) + { + /* If uncompressed size is unknown, assume zip64 for 64-bit data descriptors */ + zip64 = (local && file_info->uncompressed_size == 0) || (field_length_zip64 > 0); + } + else if (file_info->zip64 == MZ_ZIP64_FORCE) + { + zip64 = 1; + } + else if (file_info->zip64 == MZ_ZIP64_DISABLE) + { + /* Zip64 extension is required to zip file */ + if (field_length_zip64 > 0) + return MZ_PARAM_ERROR; + } + if (zip64) + { extrafield_size += 4; extrafield_size += field_length_zip64; } /* Calculate extra field size and check for duplicates */ - if (file_info->extrafield_size > 0) { + if (file_info->extrafield_size > 0) + { mz_stream_mem_create(&file_extra_stream); mz_stream_mem_set_buffer(file_extra_stream, (void *)file_info->extrafield, file_info->extrafield_size); - do { + do + { err_mem = mz_stream_read_uint16(file_extra_stream, &field_type); if (err_mem == MZ_OK) err_mem = mz_stream_read_uint16(file_extra_stream, &field_length); @@ -667,12 +668,15 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil if (err_mem == MZ_OK) err_mem = mz_stream_seek(file_extra_stream, field_length, MZ_SEEK_CUR); - } while (err_mem == MZ_OK); + } + while (err_mem == MZ_OK); } #ifdef HAVE_WZAES - if (!skip_aes) { - if ((file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) && (file_info->aes_version)) { + if (!skip_aes) + { + if ((file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) && (file_info->aes_version)) + { field_length_aes = 1 + 1 + 1 + 2 + 2; extrafield_size += 4 + field_length_aes; } @@ -684,13 +688,15 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil /* NTFS timestamps */ if ((file_info->modified_date != 0) && (file_info->accessed_date != 0) && - (file_info->creation_date != 0) && (!mask)) { + (file_info->creation_date != 0) && (!mask)) + { field_length_ntfs = 8 + 8 + 8 + 4 + 2 + 2; extrafield_size += 4 + field_length_ntfs; } /* Unix1 symbolic links */ - if (file_info->linkname != NULL && *file_info->linkname != 0) { + if (file_info->linkname != NULL && *file_info->linkname != 0) + { linkname_size = (uint16_t)strlen(file_info->linkname); field_length_unix1 = 12 + linkname_size; extrafield_size += 4 + field_length_unix1; @@ -698,16 +704,19 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil if (local) err = mz_stream_write_uint32(stream, MZ_ZIP_MAGIC_LOCALHEADER); - else { + else + { err = mz_stream_write_uint32(stream, MZ_ZIP_MAGIC_CENTRALHEADER); if (err == MZ_OK) err = mz_stream_write_uint16(stream, file_info->version_madeby); } /* Calculate version needed to extract */ - if (err == MZ_OK) { + if (err == MZ_OK) + { version_needed = file_info->version_needed; - if (version_needed == 0) { + if (version_needed == 0) + { version_needed = 20; if (zip64) version_needed = 45; @@ -715,9 +724,8 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil if ((file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) && (file_info->aes_version)) version_needed = 51; #endif -#if defined(HAVE_LZMA) || defined(HAVE_LIBCOMP) - if ((file_info->compression_method == MZ_COMPRESS_METHOD_LZMA) || - (file_info->compression_method == MZ_COMPRESS_METHOD_XZ)) +#ifdef HAVE_LZMA + if (file_info->compression_method == MZ_COMPRESS_METHOD_LZMA) version_needed = 63; #endif } @@ -725,7 +733,8 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil } if (err == MZ_OK) err = mz_stream_write_uint16(stream, file_info->flag); - if (err == MZ_OK) { + if (err == MZ_OK) + { #ifdef HAVE_WZAES if ((file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) && (file_info->aes_version)) err = mz_stream_write_uint16(stream, MZ_COMPRESS_METHOD_AES); @@ -733,20 +742,27 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil #endif err = mz_stream_write_uint16(stream, file_info->compression_method); } - if (err == MZ_OK) { + if (err == MZ_OK) + { if (file_info->modified_date != 0 && !mask) dos_date = mz_zip_time_t_to_dos_date(file_info->modified_date); err = mz_stream_write_uint32(stream, dos_date); } if (err == MZ_OK) - err = mz_zip_entry_write_crc_sizes(stream, zip64, mask, file_info); + err = mz_zip_entry_write_crc_sizes(stream, mask, file_info); - if (mask) { + if (mask) + { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wall" snprintf(masked_name, sizeof(masked_name), "%" PRIx32 "_%" PRIx64, file_info->disk_number, file_info->disk_offset); filename = masked_name; - } else { +#pragma GCC diagnostic pop + } + else + { filename = file_info->filename; } @@ -754,7 +770,8 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil filename_size += filename_length; if ((mz_zip_attrib_is_dir(file_info->external_fa, file_info->version_madeby) == MZ_OK) && - ((filename[filename_length - 1] != '/') && (filename[filename_length - 1] != '\\'))) { + ((filename[filename_length - 1] != '/') && (filename[filename_length - 1] != '\\'))) + { filename_size += 1; write_end_slash = 1; } @@ -764,8 +781,10 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil if (err == MZ_OK) err = mz_stream_write_uint16(stream, extrafield_size); - if (!local) { - if (file_info->comment != NULL) { + if (!local) + { + if (file_info->comment != NULL) + { comment_size = (int32_t)strlen(file_info->comment); if (comment_size > UINT16_MAX) comment_size = UINT16_MAX; @@ -778,7 +797,8 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil err = mz_stream_write_uint16(stream, file_info->internal_fa); if (err == MZ_OK) err = mz_stream_write_uint32(stream, file_info->external_fa); - if (err == MZ_OK) { + if (err == MZ_OK) + { if (file_info->disk_offset >= UINT32_MAX) err = mz_stream_write_uint32(stream, UINT32_MAX); else @@ -786,7 +806,8 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil } } - if (err == MZ_OK) { + if (err == MZ_OK) + { if (mz_stream_write(stream, filename, filename_length) != filename_length) err = MZ_WRITE_ERROR; @@ -795,24 +816,54 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil err = mz_stream_write_uint8(stream, '/'); } - /* Write ZIP64 extra field first so we can update sizes later if data descriptor not used */ - if ((err == MZ_OK) && (zip64)) { + if (file_info->extrafield_size > 0) + { + err_mem = mz_stream_mem_seek(file_extra_stream, 0, MZ_SEEK_SET); + while (err == MZ_OK && err_mem == MZ_OK) + { + err_mem = mz_stream_read_uint16(file_extra_stream, &field_type); + if (err_mem == MZ_OK) + err_mem = mz_stream_read_uint16(file_extra_stream, &field_length); + if (err_mem != MZ_OK) + break; + + /* Prefer our zip 64, ntfs, unix1 extensions over incoming */ + if (field_type == MZ_ZIP_EXTENSION_ZIP64 || field_type == MZ_ZIP_EXTENSION_NTFS || + field_type == MZ_ZIP_EXTENSION_UNIX1) + { + err_mem = mz_stream_seek(file_extra_stream, field_length, MZ_SEEK_CUR); + continue; + } + + err = mz_stream_write_uint16(stream, field_type); + if (err == MZ_OK) + err = mz_stream_write_uint16(stream, field_length); + if (err == MZ_OK) + err = mz_stream_copy(stream, file_extra_stream, field_length); + } + + mz_stream_mem_delete(&file_extra_stream); + } + + /* Write ZIP64 extra field */ + if ((err == MZ_OK) && (zip64)) + { err = mz_zip_extrafield_write(stream, MZ_ZIP_EXTENSION_ZIP64, field_length_zip64); - if (err == MZ_OK) { + if ((err == MZ_OK) && (file_info->uncompressed_size >= UINT32_MAX)) + { if (mask) err = mz_stream_write_int64(stream, 0); else err = mz_stream_write_int64(stream, file_info->uncompressed_size); } - if (err == MZ_OK) + if ((err == MZ_OK) && (file_info->compressed_size >= UINT32_MAX)) err = mz_stream_write_int64(stream, file_info->compressed_size); - if ((err == MZ_OK) && (!local) && (file_info->disk_offset >= UINT32_MAX)) + if ((err == MZ_OK) && (file_info->disk_offset >= UINT32_MAX)) err = mz_stream_write_int64(stream, file_info->disk_offset); - if ((err == MZ_OK) && (!local) && (file_info->disk_number >= UINT16_MAX)) - err = mz_stream_write_uint32(stream, file_info->disk_number); } /* Write NTFS extra field */ - if ((err == MZ_OK) && (field_length_ntfs > 0)) { + if ((err == MZ_OK) && (field_length_ntfs > 0)) + { err = mz_zip_extrafield_write(stream, MZ_ZIP_EXTENSION_NTFS, field_length_ntfs); if (err == MZ_OK) err = mz_stream_write_uint32(stream, reserved); @@ -820,21 +871,25 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil err = mz_stream_write_uint16(stream, 0x01); if (err == MZ_OK) err = mz_stream_write_uint16(stream, field_length_ntfs - 8); - if (err == MZ_OK) { + if (err == MZ_OK) + { mz_zip_unix_to_ntfs_time(file_info->modified_date, &ntfs_time); err = mz_stream_write_uint64(stream, ntfs_time); } - if (err == MZ_OK) { + if (err == MZ_OK) + { mz_zip_unix_to_ntfs_time(file_info->accessed_date, &ntfs_time); err = mz_stream_write_uint64(stream, ntfs_time); } - if (err == MZ_OK) { + if (err == MZ_OK) + { mz_zip_unix_to_ntfs_time(file_info->creation_date, &ntfs_time); err = mz_stream_write_uint64(stream, ntfs_time); } } /* Write UNIX extra block extra field */ - if ((err == MZ_OK) && (field_length_unix1 > 0)) { + if ((err == MZ_OK) && (field_length_unix1 > 0)) + { err = mz_zip_extrafield_write(stream, MZ_ZIP_EXTENSION_UNIX1, field_length_unix1); if (err == MZ_OK) err = mz_stream_write_uint32(stream, (uint32_t)file_info->accessed_date); @@ -844,14 +899,16 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil err = mz_stream_write_uint16(stream, 0); if (err == MZ_OK) /* Group id */ err = mz_stream_write_uint16(stream, 0); - if (err == MZ_OK && linkname_size > 0) { + if (err == MZ_OK && linkname_size > 0) + { if (mz_stream_write(stream, file_info->linkname, linkname_size) != linkname_size) err = MZ_WRITE_ERROR; } } #ifdef HAVE_WZAES /* Write AES extra field */ - if ((err == MZ_OK) && (!skip_aes) && (file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) && (file_info->aes_version)) { + if ((err == MZ_OK) && (!skip_aes) && (file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) && (file_info->aes_version)) + { err = mz_zip_extrafield_write(stream, MZ_ZIP_EXTENSION_AES, field_length_aes); if (err == MZ_OK) err = mz_stream_write_uint16(stream, file_info->aes_version); @@ -865,34 +922,8 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil err = mz_stream_write_uint16(stream, file_info->compression_method); } #endif - - if (file_info->extrafield_size > 0) { - err_mem = mz_stream_mem_seek(file_extra_stream, 0, MZ_SEEK_SET); - while (err == MZ_OK && err_mem == MZ_OK) { - err_mem = mz_stream_read_uint16(file_extra_stream, &field_type); - if (err_mem == MZ_OK) - err_mem = mz_stream_read_uint16(file_extra_stream, &field_length); - if (err_mem != MZ_OK) - break; - - /* Prefer our zip 64, ntfs, unix1 extensions over incoming */ - if (field_type == MZ_ZIP_EXTENSION_ZIP64 || field_type == MZ_ZIP_EXTENSION_NTFS || - field_type == MZ_ZIP_EXTENSION_UNIX1) { - err_mem = mz_stream_seek(file_extra_stream, field_length, MZ_SEEK_CUR); - continue; - } - - err = mz_stream_write_uint16(stream, field_type); - if (err == MZ_OK) - err = mz_stream_write_uint16(stream, field_length); - if (err == MZ_OK) - err = mz_stream_copy(stream, file_extra_stream, field_length); - } - - mz_stream_mem_delete(&file_extra_stream); - } - - if ((err == MZ_OK) && (!local) && (file_info->comment != NULL)) { + if ((err == MZ_OK) && (!local) && (file_info->comment != NULL)) + { if (mz_stream_write(stream, file_info->comment, file_info->comment_size) != file_info->comment_size) err = MZ_WRITE_ERROR; } @@ -900,7 +931,8 @@ static int32_t mz_zip_entry_write_header(void *stream, uint8_t local, mz_zip_fil return err; } -static int32_t mz_zip_entry_write_descriptor(void *stream, uint8_t zip64, uint32_t crc32, int64_t compressed_size, int64_t uncompressed_size) { +static int32_t mz_zip_entry_write_descriptor(void *stream, uint8_t zip64, uint32_t crc32, int64_t compressed_size, int64_t uncompressed_size) +{ int32_t err = MZ_OK; err = mz_stream_write_uint32(stream, MZ_ZIP_MAGIC_DATADESCRIPTOR); @@ -908,14 +940,16 @@ static int32_t mz_zip_entry_write_descriptor(void *stream, uint8_t zip64, uint32 err = mz_stream_write_uint32(stream, crc32); /* Store data descriptor as 8 bytes if zip 64 extension enabled */ - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Zip 64 extension is enabled when uncompressed size is > UINT32_MAX */ if (!zip64) err = mz_stream_write_uint32(stream, (uint32_t)compressed_size); else err = mz_stream_write_int64(stream, compressed_size); } - if (err == MZ_OK) { + if (err == MZ_OK) + { if (!zip64) err = mz_stream_write_uint32(stream, (uint32_t)uncompressed_size); else @@ -925,9 +959,11 @@ static int32_t mz_zip_entry_write_descriptor(void *stream, uint8_t zip64, uint32 return err; } -static int32_t mz_zip_read_cd(void *handle) { +static int32_t mz_zip_read_cd(void *handle) +{ mz_zip *zip = (mz_zip *)handle; uint64_t number_entry_cd64 = 0; + uint64_t number_entry = 0; uint64_t number_entry_cd = 0; int64_t eocd_pos = 0; int64_t eocd_pos64 = 0; @@ -945,7 +981,8 @@ static int32_t mz_zip_read_cd(void *handle) { /* Read and cache central directory records */ err = mz_zip_search_eocd(zip->stream, &eocd_pos); - if (err == MZ_OK) { + if (err == MZ_OK) + { /* The signature, already checked */ err = mz_stream_read_uint32(zip->stream, &value32); /* Number of this disk */ @@ -978,9 +1015,11 @@ static int32_t mz_zip_read_cd(void *handle) { /* Zip file global comment length */ if (err == MZ_OK) err = mz_stream_read_uint16(zip->stream, &comment_size); - if ((err == MZ_OK) && (comment_size > 0)) { + if ((err == MZ_OK) && (comment_size > 0)) + { zip->comment = (char *)MZ_ALLOC(comment_size + 1); - if (zip->comment != NULL) { + if (zip->comment != NULL) + { comment_read = mz_stream_read(zip->stream, zip->comment, comment_size); /* Don't fail if incorrect comment length read, not critical */ if (comment_read < 0) @@ -989,9 +1028,11 @@ static int32_t mz_zip_read_cd(void *handle) { } } - if ((err == MZ_OK) && ((number_entry_cd == UINT16_MAX) || (zip->cd_offset == UINT32_MAX))) { + if ((err == MZ_OK) && ((number_entry_cd == UINT16_MAX) || (zip->cd_offset == UINT32_MAX))) + { /* Format should be Zip64, as the central directory or file size is too large */ - if (mz_zip_search_zip64_eocd(zip->stream, eocd_pos, &eocd_pos64) == MZ_OK) { + if (mz_zip_search_zip64_eocd(zip->stream, eocd_pos, &eocd_pos64) == MZ_OK) + { eocd_pos = eocd_pos64; err = mz_stream_seek(zip->stream, eocd_pos, MZ_SEEK_SET); @@ -1015,32 +1056,37 @@ static int32_t mz_zip_read_cd(void *handle) { err = mz_stream_read_uint32(zip->stream, &zip->disk_number_with_cd); /* Total number of entries in the central directory on this disk */ if (err == MZ_OK) - err = mz_stream_read_uint64(zip->stream, &zip->number_entry); + err = mz_stream_read_uint64(zip->stream, &number_entry); /* Total number of entries in the central directory */ if (err == MZ_OK) err = mz_stream_read_uint64(zip->stream, &number_entry_cd64); - if (zip->number_entry != number_entry_cd64) - err = MZ_FORMAT_ERROR; + if (number_entry == UINT32_MAX) + zip->number_entry = number_entry_cd64; /* Size of the central directory */ - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_int64(zip->stream, &zip->cd_size); if (zip->cd_size < 0) err = MZ_FORMAT_ERROR; } /* Offset of start of central directory with respect to the starting disk number */ - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_read_int64(zip->stream, &zip->cd_offset); if (zip->cd_offset < 0) err = MZ_FORMAT_ERROR; } - } else if ((zip->number_entry == UINT16_MAX) || (number_entry_cd != zip->number_entry) || - (zip->cd_size == UINT16_MAX) || (zip->cd_offset == UINT32_MAX)) { + } + else if ((zip->number_entry == UINT16_MAX) || (number_entry_cd != zip->number_entry) || + (zip->cd_size == UINT16_MAX) || (zip->cd_offset == UINT32_MAX)) + { err = MZ_FORMAT_ERROR; } } } - if (err == MZ_OK) { + if (err == MZ_OK) + { mz_zip_print("Zip - Read cd (disk %" PRId32 " entries %" PRId64 " offset %" PRId64 " size %" PRId64 ")\n", zip->disk_number_with_cd, zip->number_entry, zip->cd_offset, zip->cd_size); @@ -1048,7 +1094,8 @@ static int32_t mz_zip_read_cd(void *handle) { err = mz_stream_seek(zip->stream, zip->cd_offset, MZ_SEEK_SET); if (err == MZ_OK) err = mz_stream_read_uint32(zip->stream, &zip->cd_signature); - if ((err == MZ_OK) && (zip->cd_signature != MZ_ZIP_MAGIC_CENTRALHEADER)) { + if ((err == MZ_OK) && (zip->cd_signature != MZ_ZIP_MAGIC_CENTRALHEADER)) + { /* If cd exists in large file and no zip-64 support, error for recover */ if (eocd_pos > UINT32_MAX && eocd_pos64 == 0) err = MZ_FORMAT_ERROR; @@ -1057,7 +1104,8 @@ static int32_t mz_zip_read_cd(void *handle) { err = mz_stream_seek(zip->stream, eocd_pos - zip->cd_size, MZ_SEEK_SET); if (err == MZ_OK) err = mz_stream_read_uint32(zip->stream, &zip->cd_signature); - if ((err == MZ_OK) && (zip->cd_signature == MZ_ZIP_MAGIC_CENTRALHEADER)) { + if ((err == MZ_OK) && (zip->cd_signature == MZ_ZIP_MAGIC_CENTRALHEADER)) + { /* If found compensate for incorrect locations */ value64i = zip->cd_offset; @@ -1068,11 +1116,15 @@ static int32_t mz_zip_read_cd(void *handle) { } } - if (err == MZ_OK) { - if (eocd_pos < zip->cd_offset) { + if (err == MZ_OK) + { + if (eocd_pos < zip->cd_offset) + { /* End of central dir should always come after central dir */ err = MZ_FORMAT_ERROR; - } else if ((uint64_t)eocd_pos < (uint64_t)zip->cd_offset + zip->cd_size) { + } + else if (eocd_pos < zip->cd_offset + zip->cd_size) + { /* Truncate size of cd if incorrect size or offset provided */ zip->cd_size = eocd_pos - zip->cd_offset; } @@ -1081,7 +1133,8 @@ static int32_t mz_zip_read_cd(void *handle) { return err; } -static int32_t mz_zip_write_cd(void *handle) { +static int32_t mz_zip_write_cd(void *handle) +{ mz_zip *zip = (mz_zip *)handle; int64_t zip64_eocd_pos_inzip = 0; int64_t disk_number = 0; @@ -1098,7 +1151,8 @@ static int32_t mz_zip_write_cd(void *handle) { if (mz_stream_get_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_SIZE, &disk_size) == MZ_OK && disk_size > 0) zip->disk_number_with_cd += 1; mz_stream_set_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, -1); - if ((zip->disk_number_with_cd > 0) && (zip->open_mode & MZ_OPEN_MODE_APPEND)) { + if ((zip->disk_number_with_cd > 0) && (zip->open_mode & MZ_OPEN_MODE_APPEND)) + { // Overwrite existing central directory if using split disks mz_stream_seek(zip->stream, 0, MZ_SEEK_SET); } @@ -1113,13 +1167,15 @@ static int32_t mz_zip_write_cd(void *handle) { mz_zip_print("Zip - Write cd (disk %" PRId32 " entries %" PRId64 " offset %" PRId64 " size %" PRId64 ")\n", zip->disk_number_with_cd, zip->number_entry, zip->cd_offset, zip->cd_size); - if (zip->cd_size == 0 && zip->number_entry > 0) { + if (zip->cd_size == 0 && zip->number_entry > 0) + { // Zip does not contain central directory, open with recovery option return MZ_FORMAT_ERROR; } /* Write the ZIP64 central directory header */ - if (zip->cd_offset >= UINT32_MAX || zip->number_entry > UINT16_MAX) { + if (zip->cd_offset >= UINT32_MAX || zip->number_entry > UINT16_MAX) + { zip64_eocd_pos_inzip = mz_stream_tell(zip->stream); err = mz_stream_write_uint32(zip->stream, MZ_ZIP_MAGIC_ENDHEADER64); @@ -1177,14 +1233,16 @@ static int32_t mz_zip_write_cd(void *handle) { if (err == MZ_OK) err = mz_stream_write_uint16(zip->stream, (uint16_t)zip->disk_number_with_cd); /* Total number of entries in the central dir on this disk */ - if (err == MZ_OK) { + if (err == MZ_OK) + { if (zip->number_entry >= UINT16_MAX) err = mz_stream_write_uint16(zip->stream, UINT16_MAX); else err = mz_stream_write_uint16(zip->stream, (uint16_t)zip->number_entry); } /* Total number of entries in the central dir */ - if (err == MZ_OK) { + if (err == MZ_OK) + { if (zip->number_entry >= UINT16_MAX) err = mz_stream_write_uint16(zip->stream, UINT16_MAX); else @@ -1194,7 +1252,8 @@ static int32_t mz_zip_write_cd(void *handle) { if (err == MZ_OK) err = mz_stream_write_uint32(zip->stream, (uint32_t)zip->cd_size); /* Offset of start of central directory with respect to the starting disk number */ - if (err == MZ_OK) { + if (err == MZ_OK) + { if (zip->cd_offset >= UINT32_MAX) err = mz_stream_write_uint32(zip->stream, UINT32_MAX); else @@ -1202,21 +1261,24 @@ static int32_t mz_zip_write_cd(void *handle) { } /* Write global comment */ - if (zip->comment != NULL) { + if (zip->comment != NULL) + { comment_size = (int32_t)strlen(zip->comment); if (comment_size > UINT16_MAX) comment_size = UINT16_MAX; } if (err == MZ_OK) err = mz_stream_write_uint16(zip->stream, (uint16_t)comment_size); - if (err == MZ_OK) { + if (err == MZ_OK) + { if (mz_stream_write(zip->stream, zip->comment, comment_size) != comment_size) err = MZ_READ_ERROR; } return err; } -static int32_t mz_zip_recover_cd(void *handle) { +static int32_t mz_zip_recover_cd(void *handle) +{ mz_zip *zip = (mz_zip *)handle; mz_zip_file local_file_info; void *local_file_info_stream = NULL; @@ -1246,10 +1308,12 @@ static int32_t mz_zip_recover_cd(void *handle) { /* Determine if we are on a split disk or not */ mz_stream_set_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, 0); - if (mz_stream_tell(zip->stream) < 0) { + if (mz_stream_tell(zip->stream) < 0) + { mz_stream_set_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, -1); mz_stream_seek(zip->stream, 0, MZ_SEEK_SET); - } else + } + else disk_number_with_cd = 1; if (mz_stream_is_open(cd_mem_stream) != MZ_OK) @@ -1258,12 +1322,14 @@ static int32_t mz_zip_recover_cd(void *handle) { mz_stream_mem_create(&local_file_info_stream); mz_stream_mem_open(local_file_info_stream, NULL, MZ_OPEN_MODE_CREATE); - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_stream_find(zip->stream, (const void *)local_header_magic, sizeof(local_header_magic), INT64_MAX, &next_header_pos); } - while (err == MZ_OK && !eof) { + while (err == MZ_OK && !eof) + { /* Get current offset and disk number for central dir record */ disk_offset = mz_stream_tell(zip->stream); mz_stream_get_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, &disk_number); @@ -1281,23 +1347,27 @@ static int32_t mz_zip_recover_cd(void *handle) { compressed_pos = mz_stream_tell(zip->stream); - if ((err == MZ_OK) && (local_file_info.compressed_size > 0)) { + if ((err == MZ_OK) && (local_file_info.compressed_size > 0)) + { mz_stream_seek(zip->stream, local_file_info.compressed_size, MZ_SEEK_CUR); } - for (;;) { + while (1) + { /* Search for the next local header */ err = mz_stream_find(zip->stream, (const void *)local_header_magic, sizeof(local_header_magic), INT64_MAX, &next_header_pos); - if (err == MZ_EXIST_ERROR) { + if (err == MZ_EXIST_ERROR) + { mz_stream_seek(zip->stream, compressed_pos, MZ_SEEK_SET); /* Search for central dir if no local header found */ err = mz_stream_find(zip->stream, (const void *)central_header_magic, sizeof(central_header_magic), INT64_MAX, &next_header_pos); - if (err == MZ_EXIST_ERROR) { + if (err == MZ_EXIST_ERROR) + { /* Get end of stream if no central header found */ mz_stream_seek(zip->stream, 0, MZ_SEEK_END); next_header_pos = mz_stream_tell(zip->stream); @@ -1306,11 +1376,13 @@ static int32_t mz_zip_recover_cd(void *handle) { eof = 1; } - if (local_file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR || local_file_info.compressed_size == 0) { + if (local_file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR || local_file_info.compressed_size == 0) + { /* Search backwards for the descriptor, seeking too far back will be incorrect if compressed size is small */ err = mz_stream_find_reverse(zip->stream, (const void *)descriptor_magic, sizeof(descriptor_magic), MZ_ZIP_SIZE_MAX_DATA_DESCRIPTOR, &descriptor_pos); - if (err == MZ_OK) { + if (err == MZ_OK) + { if (mz_zip_extrafield_contains(local_file_info.extrafield, local_file_info.extrafield_size, MZ_ZIP_EXTENSION_ZIP64, NULL) == MZ_OK) zip64 = 1; @@ -1318,7 +1390,8 @@ static int32_t mz_zip_recover_cd(void *handle) { err = mz_zip_entry_read_descriptor(zip->stream, zip64, &crc32, &compressed_size, &uncompressed_size); - if (err == MZ_OK) { + if (err == MZ_OK) + { if (local_file_info.crc == 0) local_file_info.crc = crc32; if (local_file_info.compressed_size == 0) @@ -1328,15 +1401,17 @@ static int32_t mz_zip_recover_cd(void *handle) { } compressed_end_pos = descriptor_pos; - } else if (eof) { - compressed_end_pos = next_header_pos; - } else if (local_file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR) { + } + else if (local_file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR) + { /* Wrong local file entry found, keep searching */ next_header_pos += 1; mz_stream_seek(zip->stream, next_header_pos, MZ_SEEK_SET); continue; } - } else { + } + else + { compressed_end_pos = next_header_pos; } @@ -1345,9 +1420,11 @@ static int32_t mz_zip_recover_cd(void *handle) { compressed_size = compressed_end_pos - compressed_pos; - if (compressed_size > UINT32_MAX) { + if (compressed_size > UINT32_MAX) + { /* Update sizes if 4GB file is written with no ZIP64 support */ - if (local_file_info.uncompressed_size < UINT32_MAX) { + if (local_file_info.uncompressed_size < UINT32_MAX) + { local_file_info.compressed_size = compressed_size; local_file_info.uncompressed_size = 0; } @@ -1385,11 +1462,13 @@ static int32_t mz_zip_recover_cd(void *handle) { return MZ_OK; } -void *mz_zip_create(void **handle) { +void *mz_zip_create(void **handle) +{ mz_zip *zip = NULL; zip = (mz_zip *)MZ_ALLOC(sizeof(mz_zip)); - if (zip != NULL) { + if (zip != NULL) + { memset(zip, 0, sizeof(mz_zip)); zip->data_descriptor = 1; } @@ -1399,18 +1478,21 @@ void *mz_zip_create(void **handle) { return zip; } -void mz_zip_delete(void **handle) { +void mz_zip_delete(void **handle) +{ mz_zip *zip = NULL; if (handle == NULL) return; zip = (mz_zip *)*handle; - if (zip != NULL) { + if (zip != NULL) + { MZ_FREE(zip); } *handle = NULL; } -int32_t mz_zip_open(void *handle, void *stream, int32_t mode) { +int32_t mz_zip_open(void *handle, void *stream, int32_t mode) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; @@ -1424,51 +1506,68 @@ int32_t mz_zip_open(void *handle, void *stream, int32_t mode) { mz_stream_mem_create(&zip->cd_mem_stream); - if (mode & MZ_OPEN_MODE_WRITE) { + if (mode & MZ_OPEN_MODE_WRITE) + { mz_stream_mem_open(zip->cd_mem_stream, NULL, MZ_OPEN_MODE_CREATE); zip->cd_stream = zip->cd_mem_stream; - } else { + } + else + { zip->cd_stream = stream; } - if ((mode & MZ_OPEN_MODE_READ) || (mode & MZ_OPEN_MODE_APPEND)) { - if ((mode & MZ_OPEN_MODE_CREATE) == 0) { + if ((mode & MZ_OPEN_MODE_READ) || (mode & MZ_OPEN_MODE_APPEND)) + { + if ((mode & MZ_OPEN_MODE_CREATE) == 0) + { err = mz_zip_read_cd(zip); - if (err != MZ_OK) { + if (err != MZ_OK) + { mz_zip_print("Zip - Error detected reading cd (%" PRId32 ")\n", err); if (zip->recover && mz_zip_recover_cd(zip) == MZ_OK) err = MZ_OK; } } - if ((err == MZ_OK) && (mode & MZ_OPEN_MODE_APPEND)) { - if (zip->cd_size > 0) { + if ((err == MZ_OK) && (mode & MZ_OPEN_MODE_APPEND)) + { + if (zip->cd_size > 0) + { /* Store central directory in memory */ err = mz_stream_seek(zip->stream, zip->cd_offset, MZ_SEEK_SET); if (err == MZ_OK) err = mz_stream_copy(zip->cd_mem_stream, zip->stream, (int32_t)zip->cd_size); if (err == MZ_OK) err = mz_stream_seek(zip->stream, zip->cd_offset, MZ_SEEK_SET); - } else { - if (zip->cd_signature == MZ_ZIP_MAGIC_ENDHEADER) { + } + else + { + if (zip->cd_signature == MZ_ZIP_MAGIC_ENDHEADER) + { /* If tiny zip then overwrite end header */ err = mz_stream_seek(zip->stream, zip->cd_offset, MZ_SEEK_SET); - } else { + } + else + { /* If no central directory, append new zip to end of file */ err = mz_stream_seek(zip->stream, 0, MZ_SEEK_END); } } - if (zip->disk_number_with_cd > 0) { + if (zip->disk_number_with_cd > 0) + { /* Move to last disk to begin appending */ mz_stream_set_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, zip->disk_number_with_cd - 1); } - } else { + } + else + { zip->cd_start_pos = zip->cd_offset; } } - if (err != MZ_OK) { + if (err != MZ_OK) + { mz_zip_close(zip); return err; } @@ -1485,7 +1584,8 @@ int32_t mz_zip_open(void *handle, void *stream, int32_t mode) { return err; } -int32_t mz_zip_close(void *handle) { +int32_t mz_zip_close(void *handle) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; @@ -1500,21 +1600,25 @@ int32_t mz_zip_close(void *handle) { if ((err == MZ_OK) && (zip->open_mode & MZ_OPEN_MODE_WRITE)) err = mz_zip_write_cd(handle); - if (zip->cd_mem_stream != NULL) { + if (zip->cd_mem_stream != NULL) + { mz_stream_close(zip->cd_mem_stream); mz_stream_delete(&zip->cd_mem_stream); } - if (zip->file_info_stream != NULL) { + if (zip->file_info_stream != NULL) + { mz_stream_mem_close(zip->file_info_stream); mz_stream_mem_delete(&zip->file_info_stream); } - if (zip->local_file_info_stream != NULL) { + if (zip->local_file_info_stream != NULL) + { mz_stream_mem_close(zip->local_file_info_stream); mz_stream_mem_delete(&zip->local_file_info_stream); } - if (zip->comment) { + if (zip->comment) + { MZ_FREE(zip->comment); zip->comment = NULL; } @@ -1525,7 +1629,8 @@ int32_t mz_zip_close(void *handle) { return err; } -int32_t mz_zip_get_comment(void *handle, const char **comment) { +int32_t mz_zip_get_comment(void *handle, const char **comment) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || comment == NULL) return MZ_PARAM_ERROR; @@ -1535,7 +1640,8 @@ int32_t mz_zip_get_comment(void *handle, const char **comment) { return MZ_OK; } -int32_t mz_zip_set_comment(void *handle, const char *comment) { +int32_t mz_zip_set_comment(void *handle, const char *comment) +{ mz_zip *zip = (mz_zip *)handle; int32_t comment_size = 0; if (zip == NULL || comment == NULL) @@ -1553,7 +1659,8 @@ int32_t mz_zip_set_comment(void *handle, const char *comment) { return MZ_OK; } -int32_t mz_zip_get_version_madeby(void *handle, uint16_t *version_madeby) { +int32_t mz_zip_get_version_madeby(void *handle, uint16_t *version_madeby) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || version_madeby == NULL) return MZ_PARAM_ERROR; @@ -1561,7 +1668,8 @@ int32_t mz_zip_get_version_madeby(void *handle, uint16_t *version_madeby) { return MZ_OK; } -int32_t mz_zip_set_version_madeby(void *handle, uint16_t version_madeby) { +int32_t mz_zip_set_version_madeby(void *handle, uint16_t version_madeby) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) return MZ_PARAM_ERROR; @@ -1569,7 +1677,8 @@ int32_t mz_zip_set_version_madeby(void *handle, uint16_t version_madeby) { return MZ_OK; } -int32_t mz_zip_set_recover(void *handle, uint8_t recover) { +int32_t mz_zip_set_recover(void *handle, uint8_t recover) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) return MZ_PARAM_ERROR; @@ -1577,7 +1686,8 @@ int32_t mz_zip_set_recover(void *handle, uint8_t recover) { return MZ_OK; } -int32_t mz_zip_set_data_descriptor(void *handle, uint8_t data_descriptor) { +int32_t mz_zip_set_data_descriptor(void *handle, uint8_t data_descriptor) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) return MZ_PARAM_ERROR; @@ -1585,7 +1695,8 @@ int32_t mz_zip_set_data_descriptor(void *handle, uint8_t data_descriptor) { return MZ_OK; } -int32_t mz_zip_get_stream(void *handle, void **stream) { +int32_t mz_zip_get_stream(void *handle, void **stream) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || stream == NULL) return MZ_PARAM_ERROR; @@ -1595,7 +1706,8 @@ int32_t mz_zip_get_stream(void *handle, void **stream) { return MZ_OK; } -int32_t mz_zip_set_cd_stream(void *handle, int64_t cd_start_pos, void *cd_stream) { +int32_t mz_zip_set_cd_stream(void *handle, int64_t cd_start_pos, void *cd_stream) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || cd_stream == NULL) return MZ_PARAM_ERROR; @@ -1605,7 +1717,8 @@ int32_t mz_zip_set_cd_stream(void *handle, int64_t cd_start_pos, void *cd_stream return MZ_OK; } -int32_t mz_zip_get_cd_mem_stream(void *handle, void **cd_mem_stream) { +int32_t mz_zip_get_cd_mem_stream(void *handle, void **cd_mem_stream) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || cd_mem_stream == NULL) return MZ_PARAM_ERROR; @@ -1615,7 +1728,8 @@ int32_t mz_zip_get_cd_mem_stream(void *handle, void **cd_mem_stream) { return MZ_OK; } -int32_t mz_zip_set_number_entry(void *handle, uint64_t number_entry) { +int32_t mz_zip_set_number_entry(void *handle, uint64_t number_entry) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) return MZ_PARAM_ERROR; @@ -1623,7 +1737,8 @@ int32_t mz_zip_set_number_entry(void *handle, uint64_t number_entry) { return MZ_OK; } -int32_t mz_zip_get_number_entry(void *handle, uint64_t *number_entry) { +int32_t mz_zip_get_number_entry(void *handle, uint64_t *number_entry) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || number_entry == NULL) return MZ_PARAM_ERROR; @@ -1631,7 +1746,8 @@ int32_t mz_zip_get_number_entry(void *handle, uint64_t *number_entry) { return MZ_OK; } -int32_t mz_zip_set_disk_number_with_cd(void *handle, uint32_t disk_number_with_cd) { +int32_t mz_zip_set_disk_number_with_cd(void *handle, uint32_t disk_number_with_cd) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) return MZ_PARAM_ERROR; @@ -1639,7 +1755,8 @@ int32_t mz_zip_set_disk_number_with_cd(void *handle, uint32_t disk_number_with_c return MZ_OK; } -int32_t mz_zip_get_disk_number_with_cd(void *handle, uint32_t *disk_number_with_cd) { +int32_t mz_zip_get_disk_number_with_cd(void *handle, uint32_t *disk_number_with_cd) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || disk_number_with_cd == NULL) return MZ_PARAM_ERROR; @@ -1647,7 +1764,8 @@ int32_t mz_zip_get_disk_number_with_cd(void *handle, uint32_t *disk_number_with_ return MZ_OK; } -static int32_t mz_zip_entry_close_int(void *handle) { +static int32_t mz_zip_entry_close_int(void *handle) +{ mz_zip *zip = (mz_zip *)handle; if (zip->crypt_stream != NULL) @@ -1662,7 +1780,8 @@ static int32_t mz_zip_entry_close_int(void *handle) { return MZ_OK; } -static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress_level, const char *password) { +static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress_level, const char *password) +{ mz_zip *zip = (mz_zip *)handle; int64_t max_total_in = 0; int64_t header_size = 0; @@ -1673,7 +1792,8 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress if (zip == NULL) return MZ_PARAM_ERROR; - switch (zip->file_info.compression_method) { + switch (zip->file_info.compression_method) + { case MZ_COMPRESS_METHOD_STORE: case MZ_COMPRESS_METHOD_DEFLATE: #ifdef HAVE_BZIP2 @@ -1681,12 +1801,6 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress #endif #ifdef HAVE_LZMA case MZ_COMPRESS_METHOD_LZMA: -#endif -#if defined(HAVE_LZMA) || defined(HAVE_LIBCOMP) - case MZ_COMPRESS_METHOD_XZ: -#endif -#ifdef HAVE_ZSTD - case MZ_COMPRESS_METHOD_ZSTD: #endif err = MZ_OK; break; @@ -1701,30 +1815,55 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress zip->entry_raw = raw; - if ((zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) && (password != NULL)) { - if (zip->open_mode & MZ_OPEN_MODE_WRITE) { + if ((zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) && (password != NULL)) + { + if (zip->open_mode & MZ_OPEN_MODE_WRITE) + { /* Encrypt only when we are not trying to write raw and password is supplied. */ if (!zip->entry_raw) use_crypt = 1; - } else if (zip->open_mode & MZ_OPEN_MODE_READ) { + } + else if (zip->open_mode & MZ_OPEN_MODE_READ) + { /* Decrypt only when password is supplied. Don't error when password */ /* is not supplied as we may want to read the raw encrypted data. */ use_crypt = 1; } } - if ((err == MZ_OK) && (use_crypt)) { + if ((err == MZ_OK) && (use_crypt)) + { #ifdef HAVE_WZAES - if (zip->file_info.aes_version) { + if (zip->file_info.aes_version) + { mz_stream_wzaes_create(&zip->crypt_stream); mz_stream_wzaes_set_password(zip->crypt_stream, password); mz_stream_wzaes_set_encryption_mode(zip->crypt_stream, zip->file_info.aes_encryption_mode); - } else + } + else #endif { #ifdef HAVE_PKCRYPT - uint8_t verify1 = (uint8_t)((zip->file_info.pk_verify >> 8) & 0xff); - uint8_t verify2 = (uint8_t)((zip->file_info.pk_verify) & 0xff); + uint8_t verify1 = 0; + uint8_t verify2 = 0; + + /* Info-ZIP modification to ZipCrypto format: */ + /* If bit 3 of the general purpose bit flag is set, it uses high byte of 16-bit File Time. */ + + if (zip->file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR) + { + uint32_t dos_date = 0; + + dos_date = mz_zip_time_t_to_dos_date(zip->file_info.modified_date); + + verify1 = (uint8_t)((dos_date >> 16) & 0xff); + verify2 = (uint8_t)((dos_date >> 8) & 0xff); + } + else + { + verify1 = (uint8_t)((zip->file_info.crc >> 16) & 0xff); + verify2 = (uint8_t)((zip->file_info.crc >> 24) & 0xff); + } mz_stream_pkcrypt_create(&zip->crypt_stream); mz_stream_pkcrypt_set_password(zip->crypt_stream, password); @@ -1733,7 +1872,8 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress } } - if (err == MZ_OK) { + if (err == MZ_OK) + { if (zip->crypt_stream == NULL) mz_stream_raw_create(&zip->crypt_stream); @@ -1742,10 +1882,11 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress err = mz_stream_open(zip->crypt_stream, NULL, zip->open_mode); } - if (err == MZ_OK) { + if (err == MZ_OK) + { if (zip->entry_raw || zip->file_info.compression_method == MZ_COMPRESS_METHOD_STORE) mz_stream_raw_create(&zip->compress_stream); -#ifdef HAVE_ZLIB +#if defined(HAVE_ZLIB) || defined(HAVE_LIBCOMP) else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE) mz_stream_zlib_create(&zip->compress_stream); #endif @@ -1753,40 +1894,24 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_BZIP2) mz_stream_bzip_create(&zip->compress_stream); #endif -#ifdef HAVE_LIBCOMP - else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE || - zip->file_info.compression_method == MZ_COMPRESS_METHOD_XZ) { - mz_stream_libcomp_create(&zip->compress_stream); - mz_stream_set_prop_int64(zip->compress_stream, MZ_STREAM_PROP_COMPRESS_METHOD, - zip->file_info.compression_method); - } -#endif #ifdef HAVE_LZMA - else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_LZMA || - zip->file_info.compression_method == MZ_COMPRESS_METHOD_XZ) { + else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_LZMA) mz_stream_lzma_create(&zip->compress_stream); - mz_stream_set_prop_int64(zip->compress_stream, MZ_STREAM_PROP_COMPRESS_METHOD, - zip->file_info.compression_method); - } -#endif -#ifdef HAVE_ZSTD - else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_ZSTD) - mz_stream_zstd_create(&zip->compress_stream); #endif else err = MZ_PARAM_ERROR; } - if (err == MZ_OK) { - if (zip->open_mode & MZ_OPEN_MODE_WRITE) { + if (err == MZ_OK) + { + if (zip->open_mode & MZ_OPEN_MODE_WRITE) + { mz_stream_set_prop_int64(zip->compress_stream, MZ_STREAM_PROP_COMPRESS_LEVEL, compress_level); - } else { - int32_t set_end_of_stream = 0; - + } + else + { #ifndef HAVE_LIBCOMP - if (zip->entry_raw || - zip->file_info.compression_method == MZ_COMPRESS_METHOD_STORE || - zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) + if (zip->entry_raw || zip->file_info.compression_method == MZ_COMPRESS_METHOD_STORE || zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) #endif { max_total_in = zip->file_info.compressed_size; @@ -1799,18 +1924,8 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress mz_stream_set_prop_int64(zip->compress_stream, MZ_STREAM_PROP_TOTAL_IN_MAX, max_total_in); } - - switch (zip->file_info.compression_method) { - case MZ_COMPRESS_METHOD_LZMA: - case MZ_COMPRESS_METHOD_XZ: - set_end_of_stream = (zip->file_info.flag & MZ_ZIP_FLAG_LZMA_EOS_MARKER); - break; - case MZ_COMPRESS_METHOD_ZSTD: - set_end_of_stream = 1; - break; - } - - if (set_end_of_stream) { + if ((zip->file_info.compression_method == MZ_COMPRESS_METHOD_LZMA) && (zip->file_info.flag & MZ_ZIP_FLAG_LZMA_EOS_MARKER) == 0) + { mz_stream_set_prop_int64(zip->compress_stream, MZ_STREAM_PROP_TOTAL_IN_MAX, zip->file_info.compressed_size); mz_stream_set_prop_int64(zip->compress_stream, MZ_STREAM_PROP_TOTAL_OUT_MAX, zip->file_info.uncompressed_size); } @@ -1821,17 +1936,21 @@ static int32_t mz_zip_entry_open_int(void *handle, uint8_t raw, int16_t compress err = mz_stream_open(zip->compress_stream, NULL, zip->open_mode); } - if (err == MZ_OK) { + if (err == MZ_OK) + { zip->entry_opened = 1; zip->entry_crc32 = 0; - } else { + } + else + { mz_zip_entry_close_int(handle); } return err; } -int32_t mz_zip_entry_is_open(void *handle) { +int32_t mz_zip_entry_is_open(void *handle) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) return MZ_PARAM_ERROR; @@ -1840,7 +1959,34 @@ int32_t mz_zip_entry_is_open(void *handle) { return MZ_OK; } -int32_t mz_zip_entry_read_open(void *handle, uint8_t raw, const char *password) { +static int32_t mz_zip_seek_to_local_header(void *handle) +{ + mz_zip *zip = (mz_zip *)handle; + int64_t disk_size = 0; + uint32_t disk_number = zip->file_info.disk_number; + + if (disk_number == zip->disk_number_with_cd) + { + mz_stream_get_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_SIZE, &disk_size); + if ((disk_size == 0) || ((zip->open_mode & MZ_OPEN_MODE_WRITE) == 0)) + disk_number = -1; + } + + mz_stream_set_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, disk_number); + + mz_zip_print("Zip - Entry - Seek local (disk %" PRId32 " offset %" PRId64 ")\n", + disk_number, zip->file_info.disk_offset); + + /* Guard against seek overflows */ + if ((zip->disk_offset_shift > 0) && + (zip->file_info.disk_offset > (INT64_MAX - zip->disk_offset_shift))) + return MZ_FORMAT_ERROR; + + return mz_stream_seek(zip->stream, zip->file_info.disk_offset + zip->disk_offset_shift, MZ_SEEK_SET); +} + +int32_t mz_zip_entry_read_open(void *handle, uint8_t raw, const char *password) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; int32_t err_shift = MZ_OK; @@ -1858,16 +2004,18 @@ int32_t mz_zip_entry_read_open(void *handle, uint8_t raw, const char *password) mz_zip_print("Zip - Entry - Read open (raw %" PRId32 ")\n", raw); - err = mz_zip_entry_seek_local_header(handle); + err = mz_zip_seek_to_local_header(handle); if (err == MZ_OK) err = mz_zip_entry_read_header(zip->stream, 1, &zip->local_file_info, zip->local_file_info_stream); - if (err == MZ_FORMAT_ERROR && zip->disk_offset_shift > 0) { + if (err == MZ_FORMAT_ERROR && zip->disk_offset_shift > 0) + { /* Perhaps we didn't compensated correctly for incorrect cd offset */ err_shift = mz_stream_seek(zip->stream, zip->file_info.disk_offset, MZ_SEEK_SET); if (err_shift == MZ_OK) err_shift = mz_zip_entry_read_header(zip->stream, 1, &zip->local_file_info, zip->local_file_info_stream); - if (err_shift == MZ_OK) { + if (err_shift == MZ_OK) + { zip->disk_offset_shift = 0; err = err_shift; } @@ -1883,7 +2031,8 @@ int32_t mz_zip_entry_read_open(void *handle, uint8_t raw, const char *password) return err; } -int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int16_t compress_level, uint8_t raw, const char *password) { +int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int16_t compress_level, uint8_t raw, const char *password) +{ mz_zip *zip = (mz_zip *)handle; int64_t filename_pos = -1; int64_t extrafield_pos = 0; @@ -1900,7 +2049,8 @@ int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int1 if (zip == NULL || file_info == NULL || file_info->filename == NULL) return MZ_PARAM_ERROR; - if (mz_zip_entry_is_open(handle) == MZ_OK) { + if (mz_zip_entry_is_open(handle) == MZ_OK) + { err = mz_zip_entry_close(handle); if (err != MZ_OK) return err; @@ -1940,7 +2090,8 @@ int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int1 mz_stream_mem_get_buffer_at(zip->file_info_stream, comment_pos, (const void **)&zip->file_info.comment); mz_stream_mem_get_buffer_at(zip->file_info_stream, linkname_pos, (const void **)&zip->file_info.linkname); - if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE) { + if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE) + { if ((compress_level == 8) || (compress_level == 9)) zip->file_info.flag |= MZ_ZIP_FLAG_DEFLATE_MAX; if (compress_level == 2) @@ -1948,16 +2099,16 @@ int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int1 if (compress_level == 1) zip->file_info.flag |= MZ_ZIP_FLAG_DEFLATE_SUPER_FAST; } -#if defined(HAVE_LZMA) || defined(HAVE_LIBCOMP) - else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_LZMA || - zip->file_info.compression_method == MZ_COMPRESS_METHOD_XZ) +#ifdef HAVE_LZMA + else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_LZMA) zip->file_info.flag |= MZ_ZIP_FLAG_LZMA_EOS_MARKER; #endif if (mz_zip_attrib_is_dir(zip->file_info.external_fa, zip->file_info.version_madeby) == MZ_OK) is_dir = 1; - if (!is_dir) { + if (!is_dir) + { if (zip->data_descriptor) zip->file_info.flag |= MZ_ZIP_FLAG_DATA_DESCRIPTOR; if (password != NULL) @@ -1966,22 +2117,15 @@ int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int1 mz_stream_get_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, &disk_number); zip->file_info.disk_number = (uint32_t)disk_number; + zip->file_info.disk_offset = mz_stream_tell(zip->stream); + zip->file_info.crc = 0; + zip->file_info.compressed_size = 0; - if (zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) { -#ifdef HAVE_PKCRYPT - /* Pre-calculated CRC value is required for PKWARE traditional encryption */ - uint32_t dos_date = mz_zip_time_t_to_dos_date(zip->file_info.modified_date); - zip->file_info.pk_verify = mz_zip_get_pk_verify(dos_date, zip->file_info.crc, zip->file_info.flag); -#endif #ifdef HAVE_WZAES - if (zip->file_info.aes_version && zip->file_info.aes_encryption_mode == 0) - zip->file_info.aes_encryption_mode = MZ_AES_ENCRYPTION_MODE_256; + if (zip->file_info.aes_version && zip->file_info.aes_encryption_mode == 0) + zip->file_info.aes_encryption_mode = MZ_AES_ENCRYPTION_MODE_256; #endif - } - - zip->file_info.crc = 0; - zip->file_info.compressed_size = 0; if ((compress_level == 0) || (is_dir)) zip->file_info.compression_method = MZ_COMPRESS_METHOD_STORE; @@ -1998,7 +2142,8 @@ int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int1 return err; } -int32_t mz_zip_entry_read(void *handle, void *buf, int32_t len) { +int32_t mz_zip_entry_read(void *handle, void *buf, int32_t len) +{ mz_zip *zip = (mz_zip *)handle; int32_t read = 0; @@ -2023,7 +2168,8 @@ int32_t mz_zip_entry_read(void *handle, void *buf, int32_t len) { return read; } -int32_t mz_zip_entry_write(void *handle, const void *buf, int32_t len) { +int32_t mz_zip_entry_write(void *handle, const void *buf, int32_t len) +{ mz_zip *zip = (mz_zip *)handle; int32_t written = 0; @@ -2039,7 +2185,8 @@ int32_t mz_zip_entry_write(void *handle, const void *buf, int32_t len) { } int32_t mz_zip_entry_read_close(void *handle, uint32_t *crc32, int64_t *compressed_size, - int64_t *uncompressed_size) { + int64_t *uncompressed_size) +{ mz_zip *zip = (mz_zip *)handle; int64_t total_in = 0; int32_t err = MZ_OK; @@ -2063,13 +2210,14 @@ int32_t mz_zip_entry_read_close(void *handle, uint32_t *crc32, int64_t *compress if ((zip->file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR) && ((zip->file_info.flag & MZ_ZIP_FLAG_MASK_LOCAL_INFO) == 0) && - (crc32 != NULL || compressed_size != NULL || uncompressed_size != NULL)) { + (crc32 != NULL || compressed_size != NULL || uncompressed_size != NULL)) + { /* Check to see if data descriptor is zip64 bit format or not */ if (mz_zip_extrafield_contains(zip->local_file_info.extrafield, zip->local_file_info.extrafield_size, MZ_ZIP_EXTENSION_ZIP64, NULL) == MZ_OK) zip64 = 1; - err = mz_zip_entry_seek_local_header(handle); + err = mz_zip_seek_to_local_header(handle); /* Seek to end of compressed stream since we might have over-read during compression */ if (err == MZ_OK) @@ -2085,13 +2233,15 @@ int32_t mz_zip_entry_read_close(void *handle, uint32_t *crc32, int64_t *compress } /* If entire entry was not read verification will fail */ - if ((err == MZ_OK) && (total_in > 0) && (!zip->entry_raw)) { + if ((err == MZ_OK) && (total_in > 0) && (!zip->entry_raw)) + { #ifdef HAVE_WZAES /* AES zip version AE-1 will expect a valid crc as well */ if (zip->file_info.aes_version <= 0x0001) #endif { - if (zip->entry_crc32 != zip->file_info.crc) { + if (zip->entry_crc32 != zip->file_info.crc) + { mz_zip_print("Zip - Entry - Crc failed (actual 0x%08" PRIx32 " expected 0x%08" PRIx32 ")\n", zip->entry_crc32, zip->file_info.crc); @@ -2106,7 +2256,8 @@ int32_t mz_zip_entry_read_close(void *handle, uint32_t *crc32, int64_t *compress } int32_t mz_zip_entry_write_close(void *handle, uint32_t crc32, int64_t compressed_size, - int64_t uncompressed_size) { + int64_t uncompressed_size) +{ mz_zip *zip = (mz_zip *)handle; int64_t end_disk_number = 0; int32_t err = MZ_OK; @@ -2129,18 +2280,33 @@ int32_t mz_zip_entry_write_close(void *handle, uint32_t crc32, int64_t compresse if (uncompressed_size < 0) mz_stream_get_prop_int64(zip->compress_stream, MZ_STREAM_PROP_TOTAL_IN, &uncompressed_size); - if (zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) { + if (zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) + { mz_stream_set_base(zip->crypt_stream, zip->stream); err = mz_stream_close(zip->crypt_stream); mz_stream_get_prop_int64(zip->crypt_stream, MZ_STREAM_PROP_TOTAL_OUT, &compressed_size); } - mz_zip_entry_needs_zip64(&zip->file_info, 1, &zip64); - - if ((err == MZ_OK) && (zip->file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR)) { + if ((err == MZ_OK) && (zip->file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR)) + { /* Determine if we need to write data descriptor in zip64 format, if local extrafield was saved with zip64 extrafield */ + if (zip->file_info.zip64 == MZ_ZIP64_AUTO) + { + if (zip->file_info.uncompressed_size >= UINT32_MAX) + zip64 = 1; + if (zip->file_info.compressed_size >= UINT32_MAX) + zip64 = 1; + if (zip->file_info.disk_offset >= UINT32_MAX) + zip64 = 1; + else if (zip->file_info.uncompressed_size == 0) + zip64 = 1; + } + else if (zip->file_info.zip64 == MZ_ZIP64_FORCE) + { + zip64 = 1; + } if (zip->file_info.flag & MZ_ZIP_FLAG_MASK_LOCAL_INFO) err = mz_zip_entry_write_descriptor(zip->stream, @@ -2164,36 +2330,22 @@ int32_t mz_zip_entry_write_close(void *handle, uint32_t crc32, int64_t compresse /* Update local header with crc32 and sizes */ if ((err == MZ_OK) && ((zip->file_info.flag & MZ_ZIP_FLAG_DATA_DESCRIPTOR) == 0) && - ((zip->file_info.flag & MZ_ZIP_FLAG_MASK_LOCAL_INFO) == 0)) { + ((zip->file_info.flag & MZ_ZIP_FLAG_MASK_LOCAL_INFO) == 0)) + { /* Save the disk number and position we are to seek back after updating local header */ int64_t end_pos = mz_stream_tell(zip->stream); mz_stream_get_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, &end_disk_number); - err = mz_zip_entry_seek_local_header(handle); + err = mz_zip_seek_to_local_header(handle); - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Seek to crc32 and sizes offset in local header */ err = mz_stream_seek(zip->stream, MZ_ZIP_OFFSET_CRC_SIZES, MZ_SEEK_CUR); } if (err == MZ_OK) - err = mz_zip_entry_write_crc_sizes(zip->stream, zip64, 0, &zip->file_info); - - /* Seek to and update zip64 extension sizes */ - if ((err == MZ_OK) && (zip64)) { - int64_t filename_size = zip->file_info.filename_size; - - if (filename_size == 0) - filename_size = strlen(zip->file_info.filename); - - /* Since we write zip64 extension first we know its offset */ - err = mz_stream_seek(zip->stream, 2 + 2 + filename_size + 4, MZ_SEEK_CUR); - - if (err == MZ_OK) - err = mz_stream_write_uint64(zip->stream, zip->file_info.uncompressed_size); - if (err == MZ_OK) - err = mz_stream_write_uint64(zip->stream, zip->file_info.compressed_size); - } + err = mz_zip_entry_write_crc_sizes(zip->stream, 0, &zip->file_info); mz_stream_set_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, end_disk_number); mz_stream_seek(zip->stream, end_pos, MZ_SEEK_SET); @@ -2206,35 +2358,13 @@ int32_t mz_zip_entry_write_close(void *handle, uint32_t crc32, int64_t compresse return err; } -int32_t mz_zip_entry_seek_local_header(void *handle) { - mz_zip *zip = (mz_zip *)handle; - int64_t disk_size = 0; - uint32_t disk_number = zip->file_info.disk_number; - - if (disk_number == zip->disk_number_with_cd) { - mz_stream_get_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_SIZE, &disk_size); - if ((disk_size == 0) || ((zip->open_mode & MZ_OPEN_MODE_WRITE) == 0)) - disk_number = (uint32_t)-1; - } - - mz_stream_set_prop_int64(zip->stream, MZ_STREAM_PROP_DISK_NUMBER, disk_number); - - mz_zip_print("Zip - Entry - Seek local (disk %" PRId32 " offset %" PRId64 ")\n", - disk_number, zip->file_info.disk_offset); - - /* Guard against seek overflows */ - if ((zip->disk_offset_shift > 0) && - (zip->file_info.disk_offset > (INT64_MAX - zip->disk_offset_shift))) - return MZ_FORMAT_ERROR; - - return mz_stream_seek(zip->stream, zip->file_info.disk_offset + zip->disk_offset_shift, MZ_SEEK_SET); -} - -int32_t mz_zip_entry_close(void *handle) { +int32_t mz_zip_entry_close(void *handle) +{ return mz_zip_entry_close_raw(handle, UINT64_MAX, 0); } -int32_t mz_zip_entry_close_raw(void *handle, int64_t uncompressed_size, uint32_t crc32) { +int32_t mz_zip_entry_close_raw(void *handle, int64_t uncompressed_size, uint32_t crc32) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; @@ -2249,7 +2379,8 @@ int32_t mz_zip_entry_close_raw(void *handle, int64_t uncompressed_size, uint32_t return err; } -int32_t mz_zip_entry_is_dir(void *handle) { +int32_t mz_zip_entry_is_dir(void *handle) +{ mz_zip *zip = (mz_zip *)handle; int32_t filename_length = 0; @@ -2261,7 +2392,8 @@ int32_t mz_zip_entry_is_dir(void *handle) { return MZ_OK; filename_length = (int32_t)strlen(zip->file_info.filename); - if (filename_length > 0) { + if (filename_length > 0) + { if ((zip->file_info.filename[filename_length - 1] == '/') || (zip->file_info.filename[filename_length - 1] == '\\')) return MZ_OK; @@ -2269,7 +2401,8 @@ int32_t mz_zip_entry_is_dir(void *handle) { return MZ_EXIST_ERROR; } -int32_t mz_zip_entry_is_symlink(void *handle) { +int32_t mz_zip_entry_is_symlink(void *handle) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) @@ -2284,13 +2417,15 @@ int32_t mz_zip_entry_is_symlink(void *handle) { return MZ_OK; } -int32_t mz_zip_entry_get_info(void *handle, mz_zip_file **file_info) { +int32_t mz_zip_entry_get_info(void *handle, mz_zip_file **file_info) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) return MZ_PARAM_ERROR; - if ((zip->open_mode & MZ_OPEN_MODE_WRITE) == 0) { + if ((zip->open_mode & MZ_OPEN_MODE_WRITE) == 0) + { if (!zip->entry_scanned) return MZ_PARAM_ERROR; } @@ -2299,7 +2434,8 @@ int32_t mz_zip_entry_get_info(void *handle, mz_zip_file **file_info) { return MZ_OK; } -int32_t mz_zip_entry_get_local_info(void *handle, mz_zip_file **local_file_info) { +int32_t mz_zip_entry_get_local_info(void *handle, mz_zip_file **local_file_info) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || mz_zip_entry_is_open(handle) != MZ_OK) return MZ_PARAM_ERROR; @@ -2307,7 +2443,8 @@ int32_t mz_zip_entry_get_local_info(void *handle, mz_zip_file **local_file_info) return MZ_OK; } -int32_t mz_zip_entry_set_extrafield(void *handle, const uint8_t *extrafield, uint16_t extrafield_size) { +int32_t mz_zip_entry_set_extrafield(void *handle, const uint8_t *extrafield, uint16_t extrafield_size) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL || mz_zip_entry_is_open(handle) != MZ_OK) @@ -2318,7 +2455,8 @@ int32_t mz_zip_entry_set_extrafield(void *handle, const uint8_t *extrafield, uin return MZ_OK; } -static int32_t mz_zip_goto_next_entry_int(void *handle) { +static int32_t mz_zip_goto_next_entry_int(void *handle) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; @@ -2337,7 +2475,8 @@ static int32_t mz_zip_goto_next_entry_int(void *handle) { return err; } -int64_t mz_zip_get_entry(void *handle) { +int64_t mz_zip_get_entry(void *handle) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) @@ -2346,7 +2485,8 @@ int64_t mz_zip_get_entry(void *handle) { return zip->cd_current_pos; } -int32_t mz_zip_goto_entry(void *handle, int64_t cd_pos) { +int32_t mz_zip_goto_entry(void *handle, int64_t cd_pos) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) @@ -2360,7 +2500,8 @@ int32_t mz_zip_goto_entry(void *handle, int64_t cd_pos) { return mz_zip_goto_next_entry_int(handle); } -int32_t mz_zip_goto_first_entry(void *handle) { +int32_t mz_zip_goto_first_entry(void *handle) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) @@ -2371,7 +2512,8 @@ int32_t mz_zip_goto_first_entry(void *handle) { return mz_zip_goto_next_entry_int(handle); } -int32_t mz_zip_goto_next_entry(void *handle) { +int32_t mz_zip_goto_next_entry(void *handle) +{ mz_zip *zip = (mz_zip *)handle; if (zip == NULL) @@ -2383,7 +2525,8 @@ int32_t mz_zip_goto_next_entry(void *handle) { return mz_zip_goto_next_entry_int(handle); } -int32_t mz_zip_locate_entry(void *handle, const char *filename, uint8_t ignore_case) { +int32_t mz_zip_locate_entry(void *handle, const char *filename, uint8_t ignore_case) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; int32_t result = 0; @@ -2392,7 +2535,8 @@ int32_t mz_zip_locate_entry(void *handle, const char *filename, uint8_t ignore_c return MZ_PARAM_ERROR; /* If we are already on the current entry, no need to search */ - if ((zip->entry_scanned) && (zip->file_info.filename != NULL)) { + if ((zip->entry_scanned) && (zip->file_info.filename != NULL)) + { result = mz_zip_path_compare(zip->file_info.filename, filename, ignore_case); if (result == 0) return MZ_OK; @@ -2400,7 +2544,8 @@ int32_t mz_zip_locate_entry(void *handle, const char *filename, uint8_t ignore_c /* Search all entries starting at the first */ err = mz_zip_goto_first_entry(handle); - while (err == MZ_OK) { + while (err == MZ_OK) + { result = mz_zip_path_compare(zip->file_info.filename, filename, ignore_case); if (result == 0) return MZ_OK; @@ -2411,7 +2556,8 @@ int32_t mz_zip_locate_entry(void *handle, const char *filename, uint8_t ignore_c return err; } -int32_t mz_zip_locate_first_entry(void *handle, void *userdata, mz_zip_locate_entry_cb cb) { +int32_t mz_zip_locate_first_entry(void *handle, void *userdata, mz_zip_locate_entry_cb cb) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; int32_t result = 0; @@ -2428,14 +2574,16 @@ int32_t mz_zip_locate_first_entry(void *handle, void *userdata, mz_zip_locate_en return mz_zip_locate_next_entry(handle, userdata, cb); } -int32_t mz_zip_locate_next_entry(void *handle, void *userdata, mz_zip_locate_entry_cb cb) { +int32_t mz_zip_locate_next_entry(void *handle, void *userdata, mz_zip_locate_entry_cb cb) +{ mz_zip *zip = (mz_zip *)handle; int32_t err = MZ_OK; int32_t result = 0; /* Search next entries looking for match */ err = mz_zip_goto_next_entry(handle); - while (err == MZ_OK) { + while (err == MZ_OK) + { result = cb(handle, userdata, &zip->file_info); if (result == 0) return MZ_OK; @@ -2448,13 +2596,15 @@ int32_t mz_zip_locate_next_entry(void *handle, void *userdata, mz_zip_locate_ent /***************************************************************************/ -int32_t mz_zip_attrib_is_dir(uint32_t attrib, int32_t version_madeby) { +int32_t mz_zip_attrib_is_dir(uint32_t attrib, int32_t version_madeby) +{ uint32_t posix_attrib = 0; uint8_t system = MZ_HOST_SYSTEM(version_madeby); int32_t err = MZ_OK; err = mz_zip_attrib_convert(system, attrib, MZ_HOST_SYSTEM_UNIX, &posix_attrib); - if (err == MZ_OK) { + if (err == MZ_OK) + { if ((posix_attrib & 0170000) == 0040000) /* S_ISDIR */ return MZ_OK; } @@ -2462,13 +2612,15 @@ int32_t mz_zip_attrib_is_dir(uint32_t attrib, int32_t version_madeby) { return MZ_EXIST_ERROR; } -int32_t mz_zip_attrib_is_symlink(uint32_t attrib, int32_t version_madeby) { +int32_t mz_zip_attrib_is_symlink(uint32_t attrib, int32_t version_madeby) +{ uint32_t posix_attrib = 0; uint8_t system = MZ_HOST_SYSTEM(version_madeby); int32_t err = MZ_OK; err = mz_zip_attrib_convert(system, attrib, MZ_HOST_SYSTEM_UNIX, &posix_attrib); - if (err == MZ_OK) { + if (err == MZ_OK) + { if ((posix_attrib & 0170000) == 0120000) /* S_ISLNK */ return MZ_OK; } @@ -2476,21 +2628,27 @@ int32_t mz_zip_attrib_is_symlink(uint32_t attrib, int32_t version_madeby) { return MZ_EXIST_ERROR; } -int32_t mz_zip_attrib_convert(uint8_t src_sys, uint32_t src_attrib, uint8_t target_sys, uint32_t *target_attrib) { +int32_t mz_zip_attrib_convert(uint8_t src_sys, uint32_t src_attrib, uint8_t target_sys, uint32_t *target_attrib) +{ if (target_attrib == NULL) return MZ_PARAM_ERROR; *target_attrib = 0; - if ((src_sys == MZ_HOST_SYSTEM_MSDOS) || (src_sys == MZ_HOST_SYSTEM_WINDOWS_NTFS)) { - if ((target_sys == MZ_HOST_SYSTEM_MSDOS) || (target_sys == MZ_HOST_SYSTEM_WINDOWS_NTFS)) { + if ((src_sys == MZ_HOST_SYSTEM_MSDOS) || (src_sys == MZ_HOST_SYSTEM_WINDOWS_NTFS)) + { + if ((target_sys == MZ_HOST_SYSTEM_MSDOS) || (target_sys == MZ_HOST_SYSTEM_WINDOWS_NTFS)) + { *target_attrib = src_attrib; return MZ_OK; } if ((target_sys == MZ_HOST_SYSTEM_UNIX) || (target_sys == MZ_HOST_SYSTEM_OSX_DARWIN) || (target_sys == MZ_HOST_SYSTEM_RISCOS)) return mz_zip_attrib_win32_to_posix(src_attrib, target_attrib); - } else if ((src_sys == MZ_HOST_SYSTEM_UNIX) || (src_sys == MZ_HOST_SYSTEM_OSX_DARWIN) || (src_sys == MZ_HOST_SYSTEM_RISCOS)) { - if ((target_sys == MZ_HOST_SYSTEM_UNIX) || (target_sys == MZ_HOST_SYSTEM_OSX_DARWIN) || (target_sys == MZ_HOST_SYSTEM_RISCOS)) { + } + else if ((src_sys == MZ_HOST_SYSTEM_UNIX) || (src_sys == MZ_HOST_SYSTEM_OSX_DARWIN) || (src_sys == MZ_HOST_SYSTEM_RISCOS)) + { + if ((target_sys == MZ_HOST_SYSTEM_UNIX) || (target_sys == MZ_HOST_SYSTEM_OSX_DARWIN) || (target_sys == MZ_HOST_SYSTEM_RISCOS)) + { /* If high bytes are set, it contains unix specific attributes */ if ((src_attrib >> 16) != 0) src_attrib >>= 16; @@ -2505,7 +2663,8 @@ int32_t mz_zip_attrib_convert(uint8_t src_sys, uint32_t src_attrib, uint8_t targ return MZ_SUPPORT_ERROR; } -int32_t mz_zip_attrib_posix_to_win32(uint32_t posix_attrib, uint32_t *win32_attrib) { +int32_t mz_zip_attrib_posix_to_win32(uint32_t posix_attrib, uint32_t *win32_attrib) +{ if (win32_attrib == NULL) return MZ_PARAM_ERROR; @@ -2527,7 +2686,8 @@ int32_t mz_zip_attrib_posix_to_win32(uint32_t posix_attrib, uint32_t *win32_attr return MZ_OK; } -int32_t mz_zip_attrib_win32_to_posix(uint32_t win32_attrib, uint32_t *posix_attrib) { +int32_t mz_zip_attrib_win32_to_posix(uint32_t win32_attrib, uint32_t *posix_attrib) +{ if (posix_attrib == NULL) return MZ_PARAM_ERROR; @@ -2549,40 +2709,37 @@ int32_t mz_zip_attrib_win32_to_posix(uint32_t win32_attrib, uint32_t *posix_attr /***************************************************************************/ -int32_t mz_zip_extrafield_find(void *stream, uint16_t type, int32_t max_seek, uint16_t *length) { +int32_t mz_zip_extrafield_find(void *stream, uint16_t type, uint16_t *length) +{ int32_t err = MZ_OK; uint16_t field_type = 0; uint16_t field_length = 0; - - if (max_seek < 4) - return MZ_EXIST_ERROR; - - do { + do + { err = mz_stream_read_uint16(stream, &field_type); if (err == MZ_OK) err = mz_stream_read_uint16(stream, &field_length); if (err != MZ_OK) break; - if (type == field_type) { + if (type == field_type) + { if (length != NULL) *length = field_length; return MZ_OK; } - max_seek -= field_length - 4; - if (max_seek < 0) - return MZ_EXIST_ERROR; - err = mz_stream_seek(stream, field_length, MZ_SEEK_CUR); - } while (err == MZ_OK); + } + while (err == MZ_OK); return MZ_EXIST_ERROR; } int32_t mz_zip_extrafield_contains(const uint8_t *extrafield, int32_t extrafield_size, - uint16_t type, uint16_t *length) { + uint16_t type, uint16_t *length) +{ void *file_extra_stream = NULL; int32_t err = MZ_OK; @@ -2592,14 +2749,15 @@ int32_t mz_zip_extrafield_contains(const uint8_t *extrafield, int32_t extrafield mz_stream_mem_create(&file_extra_stream); mz_stream_mem_set_buffer(file_extra_stream, (void *)extrafield, extrafield_size); - err = mz_zip_extrafield_find(file_extra_stream, type, extrafield_size, length); + err = mz_zip_extrafield_find(file_extra_stream, type, length); mz_stream_mem_delete(&file_extra_stream); return err; } -int32_t mz_zip_extrafield_read(void *stream, uint16_t *type, uint16_t *length) { +int32_t mz_zip_extrafield_read(void *stream, uint16_t *type, uint16_t *length) +{ int32_t err = MZ_OK; if (type == NULL || length == NULL) return MZ_PARAM_ERROR; @@ -2609,7 +2767,8 @@ int32_t mz_zip_extrafield_read(void *stream, uint16_t *type, uint16_t *length) { return err; } -int32_t mz_zip_extrafield_write(void *stream, uint16_t type, uint16_t length) { +int32_t mz_zip_extrafield_write(void *stream, uint16_t type, uint16_t length) +{ int32_t err = MZ_OK; err = mz_stream_write_uint16(stream, type); if (err == MZ_OK) @@ -2619,7 +2778,8 @@ int32_t mz_zip_extrafield_write(void *stream, uint16_t type, uint16_t length) { /***************************************************************************/ -static int32_t mz_zip_invalid_date(const struct tm *ptm) { +static int32_t mz_zip_invalid_date(const struct tm *ptm) +{ #define datevalue_in_range(min, max, value) ((min) <= (value) && (value) <= (max)) return (!datevalue_in_range(0, 127 + 80, ptm->tm_year) || /* 1980-based year, allow 80 extra */ !datevalue_in_range(0, 11, ptm->tm_mon) || @@ -2630,7 +2790,8 @@ static int32_t mz_zip_invalid_date(const struct tm *ptm) { #undef datevalue_in_range } -static void mz_zip_dosdate_to_raw_tm(uint64_t dos_date, struct tm *ptm) { +static void mz_zip_dosdate_to_raw_tm(uint64_t dos_date, struct tm *ptm) +{ uint64_t date = (uint64_t)(dos_date >> 16); ptm->tm_mday = (uint16_t)(date & 0x1f); @@ -2642,13 +2803,15 @@ static void mz_zip_dosdate_to_raw_tm(uint64_t dos_date, struct tm *ptm) { ptm->tm_isdst = -1; } -int32_t mz_zip_dosdate_to_tm(uint64_t dos_date, struct tm *ptm) { +int32_t mz_zip_dosdate_to_tm(uint64_t dos_date, struct tm *ptm) +{ if (ptm == NULL) return MZ_PARAM_ERROR; mz_zip_dosdate_to_raw_tm(dos_date, ptm); - if (mz_zip_invalid_date(ptm)) { + if (mz_zip_invalid_date(ptm)) + { /* Invalid date stored, so don't return it */ memset(ptm, 0, sizeof(struct tm)); return MZ_FORMAT_ERROR; @@ -2656,17 +2819,20 @@ int32_t mz_zip_dosdate_to_tm(uint64_t dos_date, struct tm *ptm) { return MZ_OK; } -time_t mz_zip_dosdate_to_time_t(uint64_t dos_date) { +time_t mz_zip_dosdate_to_time_t(uint64_t dos_date) +{ struct tm ptm; mz_zip_dosdate_to_raw_tm(dos_date, &ptm); return mktime(&ptm); } -int32_t mz_zip_time_t_to_tm(time_t unix_time, struct tm *ptm) { +int32_t mz_zip_time_t_to_tm(time_t unix_time, struct tm *ptm) +{ struct tm ltm; if (ptm == NULL) return MZ_PARAM_ERROR; - if (localtime_r(&unix_time, <m) == NULL) { /* Returns a 1900-based year */ + if (localtime_r(&unix_time, <m) == NULL) /* Returns a 1900-based year */ + { /* Invalid date stored, so don't return it */ memset(ptm, 0, sizeof(struct tm)); return MZ_INTERNAL_ERROR; @@ -2675,13 +2841,15 @@ int32_t mz_zip_time_t_to_tm(time_t unix_time, struct tm *ptm) { return MZ_OK; } -uint32_t mz_zip_time_t_to_dos_date(time_t unix_time) { +uint32_t mz_zip_time_t_to_dos_date(time_t unix_time) +{ struct tm ptm; mz_zip_time_t_to_tm(unix_time, &ptm); return mz_zip_tm_to_dosdate((const struct tm *)&ptm); } -uint32_t mz_zip_tm_to_dosdate(const struct tm *ptm) { +uint32_t mz_zip_tm_to_dosdate(const struct tm *ptm) +{ struct tm fixed_tm; /* Years supported: */ @@ -2706,33 +2874,43 @@ uint32_t mz_zip_tm_to_dosdate(const struct tm *ptm) { (((uint32_t)fixed_tm.tm_sec / 2) + (32 * (uint32_t)fixed_tm.tm_min) + (2048 * (uint32_t)fixed_tm.tm_hour)); } -int32_t mz_zip_ntfs_to_unix_time(uint64_t ntfs_time, time_t *unix_time) { +int32_t mz_zip_ntfs_to_unix_time(uint64_t ntfs_time, time_t *unix_time) +{ *unix_time = (time_t)((ntfs_time - 116444736000000000LL) / 10000000); return MZ_OK; } -int32_t mz_zip_unix_to_ntfs_time(time_t unix_time, uint64_t *ntfs_time) { +int32_t mz_zip_unix_to_ntfs_time(time_t unix_time, uint64_t *ntfs_time) +{ *ntfs_time = ((uint64_t)unix_time * 10000000) + 116444736000000000LL; return MZ_OK; } /***************************************************************************/ -int32_t mz_zip_path_compare(const char *path1, const char *path2, uint8_t ignore_case) { - do { +int32_t mz_zip_path_compare(const char *path1, const char *path2, uint8_t ignore_case) +{ + do + { if ((*path1 == '\\' && *path2 == '/') || - (*path2 == '\\' && *path1 == '/')) { + (*path2 == '\\' && *path1 == '/')) + { /* Ignore comparison of path slashes */ - } else if (ignore_case) { + } + else if (ignore_case) + { if (tolower(*path1) != tolower(*path2)) break; - } else if (*path1 != *path2) { + } + else if (*path1 != *path2) + { break; } path1 += 1; path2 += 1; - } while (*path1 != 0 && *path2 != 0); + } + while (*path1 != 0 && *path2 != 0); if (ignore_case) return (int32_t)(tolower(*path1) - tolower(*path2)); @@ -2741,31 +2919,3 @@ int32_t mz_zip_path_compare(const char *path1, const char *path2, uint8_t ignore } /***************************************************************************/ - -const char* mz_zip_get_compression_method_string(int32_t compression_method) -{ - const char *method = "?"; - switch (compression_method) { - case MZ_COMPRESS_METHOD_STORE: - method = "stored"; - break; - case MZ_COMPRESS_METHOD_DEFLATE: - method = "deflate"; - break; - case MZ_COMPRESS_METHOD_BZIP2: - method = "bzip2"; - break; - case MZ_COMPRESS_METHOD_LZMA: - method = "lzma"; - break; - case MZ_COMPRESS_METHOD_XZ: - method = "xz"; - break; - case MZ_COMPRESS_METHOD_ZSTD: - method = "zstd"; - break; - } - return method; -} - -/***************************************************************************/ diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip.h b/Sources/XlsxReaderWriter/minizip/mz_zip.h similarity index 91% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip.h rename to Sources/XlsxReaderWriter/minizip/mz_zip.h index e3d1fbd..c47025e 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip.h +++ b/Sources/XlsxReaderWriter/minizip/mz_zip.h @@ -1,8 +1,9 @@ /* mz_zip.h -- Zip manipulation - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip Copyright (C) 2009-2010 Mathias Svensson Modifications for Zip64 support http://result42.com @@ -22,7 +23,8 @@ extern "C" { /***************************************************************************/ -typedef struct mz_zip_file_s { +typedef struct mz_zip_file_s +{ uint16_t version_madeby; /* version made by */ uint16_t version_needed; /* version needed to extract */ uint16_t flag; /* general purpose bit flag */ @@ -49,7 +51,6 @@ typedef struct mz_zip_file_s { uint16_t zip64; /* zip64 extension mode */ uint16_t aes_version; /* winzip aes extension if not 0 */ uint8_t aes_encryption_mode; /* winzip aes encryption mode */ - uint16_t pk_verify; /* pkware encryption verifier */ } mz_zip_file, mz_zip_entry; @@ -75,19 +76,19 @@ int32_t mz_zip_get_comment(void *handle, const char **comment); /* Get a pointer to the global comment */ int32_t mz_zip_set_comment(void *handle, const char *comment); -/* Sets the global comment used for writing zip file */ +/* Set the global comment used for writing zip file */ int32_t mz_zip_get_version_madeby(void *handle, uint16_t *version_madeby); /* Get the version made by */ int32_t mz_zip_set_version_madeby(void *handle, uint16_t version_madeby); -/* Sets the version made by used for writing zip file */ +/* Set the version made by used for writing zip file */ int32_t mz_zip_set_recover(void *handle, uint8_t recover); -/* Sets the ability to recover the central dir by reading local file headers */ +/* Set the ability to recover the central dir by reading local file headers */ int32_t mz_zip_set_data_descriptor(void *handle, uint8_t data_descriptor); -/* Sets the use of data descriptor flag when writing zip entries */ +/* Set the use of data descriptor flag when writing zip entries */ int32_t mz_zip_get_stream(void *handle, void **stream); /* Get a pointer to the stream used to open */ @@ -136,9 +137,6 @@ int32_t mz_zip_entry_write_close(void *handle, uint32_t crc32, int64_t compresse int64_t uncompressed_size); /* Close the current file for writing and set data descriptor values */ -int32_t mz_zip_entry_seek_local_header(void *handle); -/* Seeks to the local header for the entry */ - int32_t mz_zip_entry_close_raw(void *handle, int64_t uncompressed_size, uint32_t crc32); /* Close the current file in the zip file where raw is compressed data */ @@ -203,7 +201,7 @@ int32_t mz_zip_attrib_win32_to_posix(uint32_t win32_attrib, uint32_t *posix_attr /***************************************************************************/ -int32_t mz_zip_extrafield_find(void *stream, uint16_t type, int32_t max_seek, uint16_t *length); +int32_t mz_zip_extrafield_find(void *stream, uint16_t type, uint16_t *length); /* Seeks to extra field by its type and returns its length */ int32_t mz_zip_extrafield_contains(const uint8_t *extrafield, int32_t extrafield_size, @@ -246,12 +244,6 @@ int32_t mz_zip_path_compare(const char *path1, const char *path2, uint8_t ignor /***************************************************************************/ -const -char* mz_zip_get_compression_method_string(int32_t compression_method); -/* Gets a string representing the compression method */ - -/***************************************************************************/ - #ifdef __cplusplus } #endif diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip_rw.c b/Sources/XlsxReaderWriter/minizip/mz_zip_rw.c similarity index 89% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip_rw.c rename to Sources/XlsxReaderWriter/minizip/mz_zip_rw.c index 5dde882..688e2ba 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip_rw.c +++ b/Sources/XlsxReaderWriter/minizip/mz_zip_rw.c @@ -1,12 +1,14 @@ /* mz_zip_rw.c -- Zip reader/writer - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. */ +#define HAVE_ZLIB #include "mz.h" #include "mz_crypt.h" @@ -62,12 +64,12 @@ typedef struct mz_zip_reader_s { uint8_t cd_verified; uint8_t cd_zipped; uint8_t entry_verified; - uint8_t recover; } mz_zip_reader; /***************************************************************************/ -int32_t mz_zip_reader_is_open(void *handle) { +int32_t mz_zip_reader_is_open(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (reader == NULL) return MZ_PARAM_ERROR; @@ -76,7 +78,8 @@ int32_t mz_zip_reader_is_open(void *handle) { return MZ_OK; } -int32_t mz_zip_reader_open(void *handle, void *stream) { +int32_t mz_zip_reader_open(void *handle, void *stream) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; @@ -84,11 +87,12 @@ int32_t mz_zip_reader_open(void *handle, void *stream) { reader->cd_zipped = 0; mz_zip_create(&reader->zip_handle); - mz_zip_set_recover(reader->zip_handle, reader->recover); + mz_zip_set_recover(reader->zip_handle, 1); err = mz_zip_open(reader->zip_handle, stream, MZ_OPEN_MODE_READ); - if (err != MZ_OK) { + if (err != MZ_OK) + { mz_zip_reader_close(handle); return err; } @@ -97,7 +101,8 @@ int32_t mz_zip_reader_open(void *handle, void *stream) { return MZ_OK; } -int32_t mz_zip_reader_open_file(void *handle, const char *path) { +int32_t mz_zip_reader_open_file(void *handle, const char *path) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; @@ -117,7 +122,8 @@ int32_t mz_zip_reader_open_file(void *handle, const char *path) { return err; } -int32_t mz_zip_reader_open_file_in_memory(void *handle, const char *path) { +int32_t mz_zip_reader_open_file_in_memory(void *handle, const char *path) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; void *file_stream = NULL; int64_t file_size = 0; @@ -130,7 +136,8 @@ int32_t mz_zip_reader_open_file_in_memory(void *handle, const char *path) { err = mz_stream_os_open(file_stream, path, MZ_OPEN_MODE_READ); - if (err != MZ_OK) { + if (err != MZ_OK) + { mz_stream_os_delete(&file_stream); mz_zip_reader_close(handle); return err; @@ -140,7 +147,8 @@ int32_t mz_zip_reader_open_file_in_memory(void *handle, const char *path) { file_size = mz_stream_os_tell(file_stream); mz_stream_os_seek(file_stream, 0, MZ_SEEK_SET); - if ((file_size <= 0) || (file_size > UINT32_MAX)) { + if ((file_size <= 0) || (file_size > UINT32_MAX)) + { /* Memory size is too large or too small */ mz_stream_os_close(file_stream); @@ -166,7 +174,8 @@ int32_t mz_zip_reader_open_file_in_memory(void *handle, const char *path) { return err; } -int32_t mz_zip_reader_open_buffer(void *handle, uint8_t *buf, int32_t len, uint8_t copy) { +int32_t mz_zip_reader_open_buffer(void *handle, uint8_t *buf, int32_t len, uint8_t copy) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; @@ -174,12 +183,15 @@ int32_t mz_zip_reader_open_buffer(void *handle, uint8_t *buf, int32_t len, uint8 mz_stream_mem_create(&reader->mem_stream); - if (copy) { + if (copy) + { mz_stream_mem_set_grow_size(reader->mem_stream, len); mz_stream_mem_open(reader->mem_stream, NULL, MZ_OPEN_MODE_CREATE); mz_stream_mem_write(reader->mem_stream, buf, len); mz_stream_mem_seek(reader->mem_stream, 0, MZ_SEEK_SET); - } else { + } + else + { mz_stream_mem_open(reader->mem_stream, NULL, MZ_OPEN_MODE_READ); mz_stream_mem_set_buffer(reader->mem_stream, buf, len); } @@ -190,16 +202,19 @@ int32_t mz_zip_reader_open_buffer(void *handle, uint8_t *buf, int32_t len, uint8 return err; } -int32_t mz_zip_reader_close(void *handle) { +int32_t mz_zip_reader_close(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; - if (reader->zip_handle != NULL) { + if (reader->zip_handle != NULL) + { err = mz_zip_close(reader->zip_handle); mz_zip_delete(&reader->zip_handle); } - if (reader->split_stream != NULL) { + if (reader->split_stream != NULL) + { mz_stream_split_close(reader->split_stream); mz_stream_split_delete(&reader->split_stream); } @@ -210,7 +225,8 @@ int32_t mz_zip_reader_close(void *handle) { if (reader->file_stream != NULL) mz_stream_os_delete(&reader->file_stream); - if (reader->mem_stream != NULL) { + if (reader->mem_stream != NULL) + { mz_stream_mem_close(reader->mem_stream); mz_stream_mem_delete(&reader->mem_stream); } @@ -220,7 +236,8 @@ int32_t mz_zip_reader_close(void *handle) { /***************************************************************************/ -int32_t mz_zip_reader_unzip_cd(void *handle) { +int32_t mz_zip_reader_unzip_cd(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; mz_zip_file *cd_info = NULL; void *cd_mem_stream = NULL; @@ -247,7 +264,7 @@ int32_t mz_zip_reader_unzip_cd(void *handle) { mz_stream_mem_create(&file_extra_stream); mz_stream_mem_set_buffer(file_extra_stream, (void *)cd_info->extrafield, cd_info->extrafield_size); - err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_CDCD, INT32_MAX, NULL); + err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_CDCD, NULL); if (err == MZ_OK) err = mz_stream_read_uint64(file_extra_stream, &number_entry); @@ -265,7 +282,8 @@ int32_t mz_zip_reader_unzip_cd(void *handle) { err = mz_stream_copy_stream(cd_mem_stream, NULL, handle, mz_zip_reader_entry_read, (int32_t)cd_info->uncompressed_size); - if (err == MZ_OK) { + if (err == MZ_OK) + { reader->cd_zipped = 1; mz_zip_set_cd_stream(reader->zip_handle, 0, cd_mem_stream); @@ -282,7 +300,8 @@ int32_t mz_zip_reader_unzip_cd(void *handle) { /***************************************************************************/ -static int32_t mz_zip_reader_locate_entry_cb(void *handle, void *userdata, mz_zip_file *file_info) { +static int32_t mz_zip_reader_locate_entry_cb(void *handle, void *userdata, mz_zip_file *file_info) +{ mz_zip_reader *reader = (mz_zip_reader *)userdata; int32_t result = 0; MZ_UNUSED(handle); @@ -290,7 +309,8 @@ static int32_t mz_zip_reader_locate_entry_cb(void *handle, void *userdata, mz_zi return result; } -int32_t mz_zip_reader_goto_first_entry(void *handle) { +int32_t mz_zip_reader_goto_first_entry(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; @@ -312,7 +332,8 @@ int32_t mz_zip_reader_goto_first_entry(void *handle) { return err; } -int32_t mz_zip_reader_goto_next_entry(void *handle) { +int32_t mz_zip_reader_goto_next_entry(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; @@ -334,7 +355,8 @@ int32_t mz_zip_reader_goto_next_entry(void *handle) { return err; } -int32_t mz_zip_reader_locate_entry(void *handle, const char *filename, uint8_t ignore_case) { +int32_t mz_zip_reader_locate_entry(void *handle, const char *filename, uint8_t ignore_case) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; @@ -352,7 +374,8 @@ int32_t mz_zip_reader_locate_entry(void *handle, const char *filename, uint8_t i /***************************************************************************/ -int32_t mz_zip_reader_entry_open(void *handle) { +int32_t mz_zip_reader_entry_open(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; const char *password = NULL; @@ -374,7 +397,8 @@ int32_t mz_zip_reader_entry_open(void *handle) { /* Check if we need a password and ask for it if we need to */ if ((reader->file_info->flag & MZ_ZIP_FLAG_ENCRYPTED) && (password == NULL) && - (reader->password_cb != NULL)) { + (reader->password_cb != NULL)) + { reader->password_cb(handle, reader->password_userdata, reader->file_info, password_buf, sizeof(password_buf)); @@ -382,11 +406,12 @@ int32_t mz_zip_reader_entry_open(void *handle) { } err = mz_zip_entry_read_open(reader->zip_handle, reader->raw, password); -#ifndef MZ_ZIP_NO_CRYPTO +#ifndef MZ_ZIP_NO_ENCRYPTION if (err != MZ_OK) return err; - if (mz_zip_reader_entry_get_first_hash(handle, &reader->hash_algorithm, &reader->hash_digest_size) == MZ_OK) { + if (mz_zip_reader_entry_get_first_hash(handle, &reader->hash_algorithm, &reader->hash_digest_size) == MZ_OK) + { mz_crypt_sha_create(&reader->hash); if (reader->hash_algorithm == MZ_HASH_SHA1) mz_crypt_sha_set_algorithm(reader->hash, MZ_HASH_SHA1); @@ -398,39 +423,46 @@ int32_t mz_zip_reader_entry_open(void *handle) { if (err == MZ_OK) mz_crypt_sha_begin(reader->hash); #ifdef MZ_ZIP_SIGNING - if (err == MZ_OK) { - if (mz_zip_reader_entry_has_sign(handle) == MZ_OK) { + if (err == MZ_OK) + { + if (mz_zip_reader_entry_has_sign(handle) == MZ_OK) + { err = mz_zip_reader_entry_sign_verify(handle); if (err == MZ_OK) reader->entry_verified = 1; - } else if (reader->sign_required && !reader->cd_verified) + } + else if (reader->sign_required && !reader->cd_verified) err = MZ_SIGN_ERROR; } #endif - } else if (reader->sign_required && !reader->cd_verified) + } + else if (reader->sign_required && !reader->cd_verified) err = MZ_SIGN_ERROR; #endif return err; } -int32_t mz_zip_reader_entry_close(void *handle) { +int32_t mz_zip_reader_entry_close(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; int32_t err_close = MZ_OK; -#ifndef MZ_ZIP_NO_CRYPTO +#ifndef MZ_ZIP_NO_ENCRYPTION int32_t err_hash = MZ_OK; uint8_t computed_hash[MZ_HASH_MAX_SIZE]; uint8_t expected_hash[MZ_HASH_MAX_SIZE]; - if (reader->hash != NULL) { + if (reader->hash != NULL) + { mz_crypt_sha_end(reader->hash, computed_hash, sizeof(computed_hash)); mz_crypt_sha_delete(&reader->hash); err_hash = mz_zip_reader_entry_get_hash(handle, reader->hash_algorithm, expected_hash, reader->hash_digest_size); - if (err_hash == MZ_OK) { + if (err_hash == MZ_OK) + { /* Verify expected hash against computed hash */ if (memcmp(computed_hash, expected_hash, reader->hash_digest_size) != 0) err = MZ_CRC_ERROR; @@ -444,18 +476,20 @@ int32_t mz_zip_reader_entry_close(void *handle) { return err; } -int32_t mz_zip_reader_entry_read(void *handle, void *buf, int32_t len) { +int32_t mz_zip_reader_entry_read(void *handle, void *buf, int32_t len) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t read = 0; read = mz_zip_entry_read(reader->zip_handle, buf, len); -#ifndef MZ_ZIP_NO_CRYPTO +#ifndef MZ_ZIP_NO_ENCRYPTION if ((read > 0) && (reader->hash != NULL)) mz_crypt_sha_update(reader->hash, buf, read); #endif return read; } -int32_t mz_zip_reader_entry_has_sign(void *handle) { +int32_t mz_zip_reader_entry_has_sign(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (reader == NULL || mz_zip_entry_is_open(reader->zip_handle) != MZ_OK) @@ -465,8 +499,9 @@ int32_t mz_zip_reader_entry_has_sign(void *handle) { reader->file_info->extrafield_size, MZ_ZIP_EXTENSION_SIGN, NULL); } -#if !defined(MZ_ZIP_NO_CRYPTO) && defined(MZ_ZIP_SIGNING) -int32_t mz_zip_reader_entry_sign_verify(void *handle) { +#if !defined(MZ_ZIP_NO_ENCRYPTION) && defined(MZ_ZIP_SIGNING) +int32_t mz_zip_reader_entry_sign_verify(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; void *file_extra_stream = NULL; int32_t err = MZ_OK; @@ -481,8 +516,9 @@ int32_t mz_zip_reader_entry_sign_verify(void *handle) { mz_stream_mem_set_buffer(file_extra_stream, (void *)reader->file_info->extrafield, reader->file_info->extrafield_size); - err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_SIGN, INT32_MAX, &signature_size); - if ((err == MZ_OK) && (signature_size > 0)) { + err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_SIGN, &signature_size); + if ((err == MZ_OK) && (signature_size > 0)) + { signature = (uint8_t *)MZ_ALLOC(signature_size); if (mz_stream_read(file_extra_stream, signature, signature_size) != signature_size) err = MZ_READ_ERROR; @@ -490,12 +526,14 @@ int32_t mz_zip_reader_entry_sign_verify(void *handle) { mz_stream_mem_delete(&file_extra_stream); - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Get most secure hash to verify signature against */ err = mz_zip_reader_entry_get_hash(handle, reader->hash_algorithm, hash, reader->hash_digest_size); } - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Verify the pkcs signature */ err = mz_crypt_sign_verify(hash, reader->hash_digest_size, signature, signature_size); } @@ -507,7 +545,8 @@ int32_t mz_zip_reader_entry_sign_verify(void *handle) { } #endif -int32_t mz_zip_reader_entry_get_hash(void *handle, uint16_t algorithm, uint8_t *digest, int32_t digest_size) { +int32_t mz_zip_reader_entry_get_hash(void *handle, uint16_t algorithm, uint8_t *digest, int32_t digest_size) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; void *file_extra_stream = NULL; int32_t err = MZ_OK; @@ -519,8 +558,9 @@ int32_t mz_zip_reader_entry_get_hash(void *handle, uint16_t algorithm, uint8_t * mz_stream_mem_set_buffer(file_extra_stream, (void *)reader->file_info->extrafield, reader->file_info->extrafield_size); - do { - err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_HASH, INT32_MAX, NULL); + do + { + err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_HASH, NULL); if (err != MZ_OK) break; @@ -528,22 +568,27 @@ int32_t mz_zip_reader_entry_get_hash(void *handle, uint16_t algorithm, uint8_t * if (err == MZ_OK) err = mz_stream_read_uint16(file_extra_stream, &cur_digest_size); if ((err == MZ_OK) && (cur_algorithm == algorithm) && (cur_digest_size <= digest_size) && - (cur_digest_size <= MZ_HASH_MAX_SIZE)) { + (cur_digest_size <= MZ_HASH_MAX_SIZE)) + { /* Read hash digest */ if (mz_stream_read(file_extra_stream, digest, digest_size) == cur_digest_size) return_err = MZ_OK; break; - } else { + } + else + { err = mz_stream_seek(file_extra_stream, cur_digest_size, MZ_SEEK_CUR); } - } while (err == MZ_OK); + } + while (err == MZ_OK); mz_stream_mem_delete(&file_extra_stream); return return_err; } -int32_t mz_zip_reader_entry_get_first_hash(void *handle, uint16_t *algorithm, uint16_t *digest_size) { +int32_t mz_zip_reader_entry_get_first_hash(void *handle, uint16_t *algorithm, uint16_t *digest_size) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; void *file_extra_stream = NULL; int32_t err = MZ_OK; @@ -557,7 +602,7 @@ int32_t mz_zip_reader_entry_get_first_hash(void *handle, uint16_t *algorithm, ui mz_stream_mem_set_buffer(file_extra_stream, (void *)reader->file_info->extrafield, reader->file_info->extrafield_size); - err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_HASH, INT32_MAX, NULL); + err = mz_zip_extrafield_find(file_extra_stream, MZ_ZIP_EXTENSION_HASH, NULL); if (err == MZ_OK) err = mz_stream_read_uint16(file_extra_stream, &cur_algorithm); if (err == MZ_OK) @@ -573,7 +618,8 @@ int32_t mz_zip_reader_entry_get_first_hash(void *handle, uint16_t *algorithm, ui return err; } -int32_t mz_zip_reader_entry_get_info(void *handle, mz_zip_file **file_info) { +int32_t mz_zip_reader_entry_get_info(void *handle, mz_zip_file **file_info) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; if (file_info == NULL || mz_zip_reader_is_open(handle) != MZ_OK) @@ -584,14 +630,16 @@ int32_t mz_zip_reader_entry_get_info(void *handle, mz_zip_file **file_info) { return err; } -int32_t mz_zip_reader_entry_is_dir(void *handle) { +int32_t mz_zip_reader_entry_is_dir(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (mz_zip_reader_is_open(handle) != MZ_OK) return MZ_PARAM_ERROR; return mz_zip_entry_is_dir(reader->zip_handle); } -int32_t mz_zip_reader_entry_save_process(void *handle, void *stream, mz_stream_write_cb write_cb) { +int32_t mz_zip_reader_entry_save_process(void *handle, void *stream, mz_stream_write_cb write_cb) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; int32_t read = 0; @@ -615,7 +663,8 @@ int32_t mz_zip_reader_entry_save_process(void *handle, void *stream, mz_stream_w /* Unzip entry in zip file */ read = mz_zip_reader_entry_read(handle, reader->buffer, sizeof(reader->buffer)); - if (read == 0) { + if (read == 0) + { /* If we are done close the entry */ err = mz_zip_reader_entry_close(handle); if (err != MZ_OK) @@ -624,7 +673,8 @@ int32_t mz_zip_reader_entry_save_process(void *handle, void *stream, mz_stream_w return MZ_END_OF_STREAM; } - if (read > 0) { + if (read > 0) + { /* Write the data to the specified stream */ written = write_cb(stream, reader->buffer, read); if (written != read) @@ -634,7 +684,8 @@ int32_t mz_zip_reader_entry_save_process(void *handle, void *stream, mz_stream_w return read; } -int32_t mz_zip_reader_entry_save(void *handle, void *stream, mz_stream_write_cb write_cb) { +int32_t mz_zip_reader_entry_save(void *handle, void *stream, mz_stream_write_cb write_cb) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; uint64_t current_time = 0; uint64_t update_time = 0; @@ -653,7 +704,8 @@ int32_t mz_zip_reader_entry_save(void *handle, void *stream, mz_stream_write_cb reader->progress_cb(handle, reader->progress_userdata, reader->file_info, current_pos); /* Write data to stream until done */ - while (err == MZ_OK) { + while (err == MZ_OK) + { written = mz_zip_reader_entry_save_process(handle, stream, write_cb); if (written == MZ_END_OF_STREAM) break; @@ -664,7 +716,8 @@ int32_t mz_zip_reader_entry_save(void *handle, void *stream, mz_stream_write_cb /* Update progress if enough time have passed */ current_time = mz_os_ms_time(); - if ((current_time - update_time) > reader->progress_cb_interval_ms) { + if ((current_time - update_time) > reader->progress_cb_interval_ms) + { if (reader->progress_cb != NULL) reader->progress_cb(handle, reader->progress_userdata, reader->file_info, current_pos); @@ -680,7 +733,8 @@ int32_t mz_zip_reader_entry_save(void *handle, void *stream, mz_stream_write_cb return err; } -int32_t mz_zip_reader_entry_save_file(void *handle, const char *path) { +int32_t mz_zip_reader_entry_save_file(void *handle, const char *path) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; void *stream = NULL; uint32_t target_attrib = 0; @@ -709,13 +763,15 @@ int32_t mz_zip_reader_entry_save_file(void *handle, const char *path) { /* If it is a directory entry then create a directory instead of writing file */ if ((mz_zip_entry_is_dir(reader->zip_handle) == MZ_OK) && - (mz_zip_entry_is_symlink(reader->zip_handle) != MZ_OK)) { + (mz_zip_entry_is_symlink(reader->zip_handle) != MZ_OK)) + { err = mz_dir_make(directory); return err; } /* Check if file exists and ask if we want to overwrite */ - if ((mz_os_file_exists(pathwfs) == MZ_OK) && (reader->overwrite_cb != NULL)) { + if ((mz_os_file_exists(pathwfs) == MZ_OK) && (reader->overwrite_cb != NULL)) + { err_cb = reader->overwrite_cb(handle, reader->overwrite_userdata, reader->file_info, pathwfs); if (err_cb != MZ_OK) return err; @@ -724,20 +780,23 @@ int32_t mz_zip_reader_entry_save_file(void *handle, const char *path) { } /* If symbolic link then properly construct destination path and link path */ - if (mz_zip_entry_is_symlink(reader->zip_handle) == MZ_OK) { + if (mz_zip_entry_is_symlink(reader->zip_handle) == MZ_OK) + { mz_path_remove_slash(pathwfs); mz_path_remove_filename(directory); } /* Create the output directory if it doesn't already exist */ - if (mz_os_is_dir(directory) != MZ_OK) { + if (mz_os_is_dir(directory) != MZ_OK) + { err = mz_dir_make(directory); if (err != MZ_OK) return err; } /* If it is a symbolic link then create symbolic link instead of writing file */ - if (mz_zip_entry_is_symlink(reader->zip_handle) == MZ_OK) { + if (mz_zip_entry_is_symlink(reader->zip_handle) == MZ_OK) + { mz_os_make_symlink(pathwfs, reader->file_info->linkname); /* Don't check return value because we aren't validating symbolic link target */ return err; @@ -753,13 +812,15 @@ int32_t mz_zip_reader_entry_save_file(void *handle, const char *path) { mz_stream_close(stream); mz_stream_delete(&stream); - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Set the time of the file that has been created */ mz_os_set_file_date(pathwfs, reader->file_info->modified_date, reader->file_info->accessed_date, reader->file_info->creation_date); } - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Set file attributes for the correct system */ err_attrib = mz_zip_attrib_convert(MZ_HOST_SYSTEM(reader->file_info->version_madeby), reader->file_info->external_fa, MZ_VERSION_MADEBY_HOST_SYSTEM, &target_attrib); @@ -771,7 +832,8 @@ int32_t mz_zip_reader_entry_save_file(void *handle, const char *path) { return err; } -int32_t mz_zip_reader_entry_save_buffer(void *handle, void *buf, int32_t len) { +int32_t mz_zip_reader_entry_save_buffer(void *handle, void *buf, int32_t len) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; void *mem_stream = NULL; int32_t err = MZ_OK; @@ -797,7 +859,8 @@ int32_t mz_zip_reader_entry_save_buffer(void *handle, void *buf, int32_t len) { return err; } -int32_t mz_zip_reader_entry_save_buffer_length(void *handle) { +int32_t mz_zip_reader_entry_save_buffer_length(void *handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (mz_zip_reader_is_open(reader) != MZ_OK) @@ -813,7 +876,8 @@ int32_t mz_zip_reader_entry_save_buffer_length(void *handle) { /***************************************************************************/ -int32_t mz_zip_reader_save_all(void *handle, const char *destination_dir) { +int32_t mz_zip_reader_save_all(void *handle, const char *destination_dir) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; int32_t err = MZ_OK; uint8_t *utf8_string = NULL; @@ -826,16 +890,19 @@ int32_t mz_zip_reader_save_all(void *handle, const char *destination_dir) { if (err == MZ_END_OF_LIST) return err; - while (err == MZ_OK) { + while (err == MZ_OK) + { /* Construct output path */ path[0] = 0; strncpy(utf8_name, reader->file_info->filename, sizeof(utf8_name) - 1); utf8_name[sizeof(utf8_name) - 1] = 0; - if ((reader->encoding > 0) && (reader->file_info->flag & MZ_ZIP_FLAG_UTF8) == 0) { + if ((reader->encoding > 0) && (reader->file_info->flag & MZ_ZIP_FLAG_UTF8) == 0) + { utf8_string = mz_os_utf8_string_create(reader->file_info->filename, reader->encoding); - if (utf8_string) { + if (utf8_string) + { strncpy(utf8_name, (char *)utf8_string, sizeof(utf8_name) - 1); utf8_name[sizeof(utf8_name) - 1] = 0; mz_os_utf8_string_delete(&utf8_string); @@ -866,23 +933,27 @@ int32_t mz_zip_reader_save_all(void *handle, const char *destination_dir) { /***************************************************************************/ -void mz_zip_reader_set_pattern(void *handle, const char *pattern, uint8_t ignore_case) { +void mz_zip_reader_set_pattern(void *handle, const char *pattern, uint8_t ignore_case) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->pattern = pattern; reader->pattern_ignore_case = ignore_case; } -void mz_zip_reader_set_password(void *handle, const char *password) { +void mz_zip_reader_set_password(void *handle, const char *password) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->password = password; } -void mz_zip_reader_set_raw(void *handle, uint8_t raw) { +void mz_zip_reader_set_raw(void *handle, uint8_t raw) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->raw = raw; } -int32_t mz_zip_reader_get_raw(void *handle, uint8_t *raw) { +int32_t mz_zip_reader_get_raw(void *handle, uint8_t *raw) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (raw == NULL) return MZ_PARAM_ERROR; @@ -890,7 +961,8 @@ int32_t mz_zip_reader_get_raw(void *handle, uint8_t *raw) { return MZ_OK; } -int32_t mz_zip_reader_get_zip_cd(void *handle, uint8_t *zip_cd) { +int32_t mz_zip_reader_get_zip_cd(void *handle, uint8_t *zip_cd) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (zip_cd == NULL) return MZ_PARAM_ERROR; @@ -898,7 +970,8 @@ int32_t mz_zip_reader_get_zip_cd(void *handle, uint8_t *zip_cd) { return MZ_OK; } -int32_t mz_zip_reader_get_comment(void *handle, const char **comment) { +int32_t mz_zip_reader_get_comment(void *handle, const char **comment) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (mz_zip_reader_is_open(reader) != MZ_OK) return MZ_PARAM_ERROR; @@ -907,54 +980,54 @@ int32_t mz_zip_reader_get_comment(void *handle, const char **comment) { return mz_zip_get_comment(reader->zip_handle, comment); } -int32_t mz_zip_reader_set_recover(void *handle, uint8_t recover) { - mz_zip_reader *reader = (mz_zip_reader *)handle; - if (reader == NULL) - return MZ_PARAM_ERROR; - reader->recover = recover; - return MZ_OK; -} - -void mz_zip_reader_set_encoding(void *handle, int32_t encoding) { +void mz_zip_reader_set_encoding(void *handle, int32_t encoding) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->encoding = encoding; } -void mz_zip_reader_set_sign_required(void *handle, uint8_t sign_required) { +void mz_zip_reader_set_sign_required(void *handle, uint8_t sign_required) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->sign_required = sign_required; } -void mz_zip_reader_set_overwrite_cb(void *handle, void *userdata, mz_zip_reader_overwrite_cb cb) { +void mz_zip_reader_set_overwrite_cb(void *handle, void *userdata, mz_zip_reader_overwrite_cb cb) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->overwrite_cb = cb; reader->overwrite_userdata = userdata; } -void mz_zip_reader_set_password_cb(void *handle, void *userdata, mz_zip_reader_password_cb cb) { +void mz_zip_reader_set_password_cb(void *handle, void *userdata, mz_zip_reader_password_cb cb) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->password_cb = cb; reader->password_userdata = userdata; } -void mz_zip_reader_set_progress_cb(void *handle, void *userdata, mz_zip_reader_progress_cb cb) { +void mz_zip_reader_set_progress_cb(void *handle, void *userdata, mz_zip_reader_progress_cb cb) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->progress_cb = cb; reader->progress_userdata = userdata; } -void mz_zip_reader_set_progress_interval(void *handle, uint32_t milliseconds) { +void mz_zip_reader_set_progress_interval(void *handle, uint32_t milliseconds) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->progress_cb_interval_ms = milliseconds; } -void mz_zip_reader_set_entry_cb(void *handle, void *userdata, mz_zip_reader_entry_cb cb) { +void mz_zip_reader_set_entry_cb(void *handle, void *userdata, mz_zip_reader_entry_cb cb) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; reader->entry_cb = cb; reader->entry_userdata = userdata; } -int32_t mz_zip_reader_get_zip_handle(void *handle, void **zip_handle) { +int32_t mz_zip_reader_get_zip_handle(void *handle, void **zip_handle) +{ mz_zip_reader *reader = (mz_zip_reader *)handle; if (zip_handle == NULL) return MZ_PARAM_ERROR; @@ -966,27 +1039,29 @@ int32_t mz_zip_reader_get_zip_handle(void *handle, void **zip_handle) { /***************************************************************************/ -void *mz_zip_reader_create(void **handle) { +void *mz_zip_reader_create(void **handle) +{ mz_zip_reader *reader = NULL; reader = (mz_zip_reader *)MZ_ALLOC(sizeof(mz_zip_reader)); - if (reader != NULL) { + if (reader != NULL) + { memset(reader, 0, sizeof(mz_zip_reader)); - reader->recover = 1; reader->progress_cb_interval_ms = MZ_DEFAULT_PROGRESS_INTERVAL; - } - if (handle != NULL) *handle = reader; + } return reader; } -void mz_zip_reader_delete(void **handle) { +void mz_zip_reader_delete(void **handle) +{ mz_zip_reader *reader = NULL; if (handle == NULL) return; reader = (mz_zip_reader *)*handle; - if (reader != NULL) { + if (reader != NULL) + { mz_zip_reader_close(reader); MZ_FREE(reader); } @@ -1034,7 +1109,8 @@ typedef struct mz_zip_writer_s { /***************************************************************************/ -int32_t mz_zip_writer_zip_cd(void *handle) { +int32_t mz_zip_writer_zip_cd(void *handle) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; mz_zip_file cd_file; uint64_t number_entry = 0; @@ -1075,7 +1151,8 @@ int32_t mz_zip_writer_zip_cd(void *handle) { cd_file.extrafield_size = (uint16_t)extrafield_size; err = mz_zip_writer_entry_open(handle, &cd_file); - if (err == MZ_OK) { + if (err == MZ_OK) + { mz_stream_copy_stream(handle, mz_zip_writer_entry_write, cd_mem_stream, NULL, (int32_t)cd_mem_length); @@ -1092,7 +1169,8 @@ int32_t mz_zip_writer_zip_cd(void *handle) { /***************************************************************************/ -int32_t mz_zip_writer_is_open(void *handle) { +int32_t mz_zip_writer_is_open(void *handle) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; if (writer == NULL) return MZ_PARAM_ERROR; @@ -1101,14 +1179,16 @@ int32_t mz_zip_writer_is_open(void *handle) { return MZ_OK; } -static int32_t mz_zip_writer_open_int(void *handle, void *stream, int32_t mode) { +static int32_t mz_zip_writer_open_int(void *handle, void *stream, int32_t mode) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t err = MZ_OK; mz_zip_create(&writer->zip_handle); err = mz_zip_open(writer->zip_handle, stream, mode); - if (err != MZ_OK) { + if (err != MZ_OK) + { mz_zip_writer_close(handle); return err; } @@ -1116,19 +1196,13 @@ static int32_t mz_zip_writer_open_int(void *handle, void *stream, int32_t mode) return MZ_OK; } -int32_t mz_zip_writer_open(void *handle, void *stream, uint8_t append) { - int32_t mode = MZ_OPEN_MODE_WRITE; - - if (append) { - mode |= MZ_OPEN_MODE_APPEND; - } else { - mode |= MZ_OPEN_MODE_CREATE; - } - - return mz_zip_writer_open_int(handle, stream, mode); +int32_t mz_zip_writer_open(void *handle, void *stream) +{ + return mz_zip_writer_open_int(handle, stream, MZ_OPEN_MODE_WRITE); } -int32_t mz_zip_writer_open_file(void *handle, const char *path, int64_t disk_size, uint8_t append) { +int32_t mz_zip_writer_open_file(void *handle, const char *path, int64_t disk_size, uint8_t append) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t mode = MZ_OPEN_MODE_READWRITE; int32_t err = MZ_OK; @@ -1137,20 +1211,26 @@ int32_t mz_zip_writer_open_file(void *handle, const char *path, int64_t disk_siz mz_zip_writer_close(handle); - if (mz_os_file_exists(path) != MZ_OK) { + if (mz_os_file_exists(path) != MZ_OK) + { /* If the file doesn't exist, we don't append file */ mode |= MZ_OPEN_MODE_CREATE; /* Create destination directory if it doesn't already exist */ - if (strchr(path, '/') != NULL || strrchr(path, '\\') != NULL) { + if (strchr(path, '/') != NULL || strrchr(path, '\\') != NULL) + { strncpy(directory, path, sizeof(directory)); mz_path_remove_filename(directory); if (mz_os_file_exists(directory) != MZ_OK) mz_dir_make(directory); } - } else if (append) { + } + else if (append) + { mode |= MZ_OPEN_MODE_APPEND; - } else { + } + else + { if (writer->overwrite_cb != NULL) err_cb = writer->overwrite_cb(handle, writer->overwrite_userdata, path); @@ -1179,7 +1259,8 @@ int32_t mz_zip_writer_open_file(void *handle, const char *path, int64_t disk_siz return err; } -int32_t mz_zip_writer_open_file_in_memory(void *handle, const char *path) { +int32_t mz_zip_writer_open_file_in_memory(void *handle, const char *path) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; void *file_stream = NULL; int64_t file_size = 0; @@ -1192,7 +1273,8 @@ int32_t mz_zip_writer_open_file_in_memory(void *handle, const char *path) { err = mz_stream_os_open(file_stream, path, MZ_OPEN_MODE_READ); - if (err != MZ_OK) { + if (err != MZ_OK) + { mz_stream_os_delete(&file_stream); mz_zip_writer_close(handle); return err; @@ -1202,7 +1284,8 @@ int32_t mz_zip_writer_open_file_in_memory(void *handle, const char *path) { file_size = mz_stream_os_tell(file_stream); mz_stream_os_seek(file_stream, 0, MZ_SEEK_SET); - if ((file_size <= 0) || (file_size > UINT32_MAX)) { + if ((file_size <= 0) || (file_size > UINT32_MAX)) + { /* Memory size is too large or too small */ mz_stream_os_close(file_stream); @@ -1221,19 +1304,21 @@ int32_t mz_zip_writer_open_file_in_memory(void *handle, const char *path) { mz_stream_os_delete(&file_stream); if (err == MZ_OK) - err = mz_zip_writer_open(handle, writer->mem_stream, 1); + err = mz_zip_writer_open(handle, writer->mem_stream); if (err != MZ_OK) mz_zip_writer_close(handle); return err; } -int32_t mz_zip_writer_close(void *handle) { +int32_t mz_zip_writer_close(void *handle) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t err = MZ_OK; - if (writer->zip_handle != NULL) { + if (writer->zip_handle != NULL) + { mz_zip_set_version_madeby(writer->zip_handle, MZ_VERSION_MADEBY); if (writer->comment) mz_zip_set_comment(writer->zip_handle, writer->comment); @@ -1244,7 +1329,8 @@ int32_t mz_zip_writer_close(void *handle) { mz_zip_delete(&writer->zip_handle); } - if (writer->split_stream != NULL) { + if (writer->split_stream != NULL) + { mz_stream_split_close(writer->split_stream); mz_stream_split_delete(&writer->split_stream); } @@ -1255,7 +1341,8 @@ int32_t mz_zip_writer_close(void *handle) { if (writer->file_stream != NULL) mz_stream_os_delete(&writer->file_stream); - if (writer->mem_stream != NULL) { + if (writer->mem_stream != NULL) + { mz_stream_mem_close(writer->mem_stream); mz_stream_mem_delete(&writer->mem_stream); } @@ -1265,7 +1352,8 @@ int32_t mz_zip_writer_close(void *handle) { /***************************************************************************/ -int32_t mz_zip_writer_entry_open(void *handle, mz_zip_file *file_info) { +int32_t mz_zip_writer_entry_open(void *handle, mz_zip_file *file_info) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t err = MZ_OK; const char *password = NULL; @@ -1281,14 +1369,16 @@ int32_t mz_zip_writer_entry_open(void *handle, mz_zip_file *file_info) { /* Check if we need a password and ask for it if we need to */ if ((writer->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED) && (password == NULL) && - (writer->password_cb != NULL)) { + (writer->password_cb != NULL)) + { writer->password_cb(handle, writer->password_userdata, &writer->file_info, password_buf, sizeof(password_buf)); password = password_buf; } -#ifndef MZ_ZIP_NO_CRYPTO - if (mz_zip_attrib_is_dir(writer->file_info.external_fa, writer->file_info.version_madeby) != MZ_OK) { +#ifndef MZ_ZIP_NO_ENCRYPTION + if (mz_zip_attrib_is_dir(writer->file_info.external_fa, writer->file_info.version_madeby) != MZ_OK) + { /* Start calculating sha256 */ mz_crypt_sha_create(&writer->sha256); mz_crypt_sha_set_algorithm(writer->sha256, MZ_HASH_SHA256); @@ -1303,9 +1393,11 @@ int32_t mz_zip_writer_entry_open(void *handle, mz_zip_file *file_info) { return err; } -#if !defined(MZ_ZIP_NO_CRYPTO) && defined(MZ_ZIP_SIGNING) + +#if !defined(MZ_ZIP_NO_ENCRYPTION) && defined(MZ_ZIP_SIGNING) int32_t mz_zip_writer_entry_sign(void *handle, uint8_t *message, int32_t message_size, - uint8_t *cert_data, int32_t cert_data_size, const char *cert_pwd) { + uint8_t *cert_data, int32_t cert_data_size, const char *cert_pwd) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t err = MZ_OK; int32_t signature_size = 0; @@ -1321,12 +1413,14 @@ int32_t mz_zip_writer_entry_sign(void *handle, uint8_t *message, int32_t message err = mz_crypt_sign(message, message_size, cert_data, cert_data_size, cert_pwd, &signature, &signature_size); - if ((err == MZ_OK) && (signature != NULL)) { + if ((err == MZ_OK) && (signature != NULL)) + { /* Write signature zip extra field */ err = mz_zip_extrafield_write(writer->file_extra_stream, MZ_ZIP_EXTENSION_SIGN, (uint16_t)signature_size); - if (err == MZ_OK) { + if (err == MZ_OK) + { if (mz_stream_write(writer->file_extra_stream, signature, signature_size) != signature_size) err = MZ_WRITE_ERROR; } @@ -1338,17 +1432,19 @@ int32_t mz_zip_writer_entry_sign(void *handle, uint8_t *message, int32_t message } #endif -int32_t mz_zip_writer_entry_close(void *handle) { +int32_t mz_zip_writer_entry_close(void *handle) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t err = MZ_OK; -#ifndef MZ_ZIP_NO_CRYPTO +#ifndef MZ_ZIP_NO_ENCRYPTION const uint8_t *extrafield = NULL; int32_t extrafield_size = 0; int16_t field_length_hash = 0; uint8_t sha256[MZ_HASH_SHA256_SIZE]; - if (writer->sha256 != NULL) { + if (writer->sha256 != NULL) + { mz_crypt_sha_end(writer->sha256, sha256, sizeof(sha256)); mz_crypt_sha_delete(&writer->sha256); @@ -1363,15 +1459,18 @@ int32_t mz_zip_writer_entry_close(void *handle) { err = mz_stream_write_uint16(writer->file_extra_stream, MZ_HASH_SHA256); if (err == MZ_OK) err = mz_stream_write_uint16(writer->file_extra_stream, MZ_HASH_SHA256_SIZE); - if (err == MZ_OK) { + if (err == MZ_OK) + { if (mz_stream_write(writer->file_extra_stream, sha256, sizeof(sha256)) != MZ_HASH_SHA256_SIZE) err = MZ_WRITE_ERROR; } #ifdef MZ_ZIP_SIGNING - if ((err == MZ_OK) && (writer->cert_data != NULL) && (writer->cert_data_size > 0)) { + if ((err == MZ_OK) && (writer->cert_data != NULL) && (writer->cert_data_size > 0)) + { /* Sign entry if not zipping cd or if it is cd being zipped */ - if (!writer->zip_cd || strcmp(writer->file_info.filename, MZ_ZIP_CD_FILENAME) == 0) { + if (!writer->zip_cd || strcmp(writer->file_info.filename, MZ_ZIP_CD_FILENAME) == 0) + { err = mz_zip_writer_entry_sign(handle, sha256, sizeof(sha256), writer->cert_data, writer->cert_data_size, writer->cert_pwd); } @@ -1390,7 +1489,8 @@ int32_t mz_zip_writer_entry_close(void *handle) { } #endif - if (err == MZ_OK) { + if (err == MZ_OK) + { if (writer->raw) err = mz_zip_entry_close_raw(writer->zip_handle, writer->file_info.uncompressed_size, writer->file_info.crc); @@ -1404,11 +1504,12 @@ int32_t mz_zip_writer_entry_close(void *handle) { return err; } -int32_t mz_zip_writer_entry_write(void *handle, const void *buf, int32_t len) { +int32_t mz_zip_writer_entry_write(void *handle, const void *buf, int32_t len) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t written = 0; written = mz_zip_entry_write(writer->zip_handle, buf, len); -#ifndef MZ_ZIP_NO_CRYPTO +#ifndef MZ_ZIP_NO_ENCRYPTION if ((written > 0) && (writer->sha256 != NULL)) mz_crypt_sha_update(writer->sha256, buf, written); #endif @@ -1416,7 +1517,8 @@ int32_t mz_zip_writer_entry_write(void *handle, const void *buf, int32_t len) { } /***************************************************************************/ -int32_t mz_zip_writer_add_process(void *handle, void *stream, mz_stream_read_cb read_cb) { +int32_t mz_zip_writer_add_process(void *handle, void *stream, mz_stream_read_cb read_cb) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t read = 0; int32_t written = 0; @@ -1433,7 +1535,8 @@ int32_t mz_zip_writer_add_process(void *handle, void *stream, mz_stream_read_cb read = read_cb(stream, writer->buffer, sizeof(writer->buffer)); if (read == 0) return MZ_END_OF_STREAM; - if (read < 0) { + if (read < 0) + { err = read; return err; } @@ -1445,7 +1548,8 @@ int32_t mz_zip_writer_add_process(void *handle, void *stream, mz_stream_read_cb return written; } -int32_t mz_zip_writer_add(void *handle, void *stream, mz_stream_read_cb read_cb) { +int32_t mz_zip_writer_add(void *handle, void *stream, mz_stream_read_cb read_cb) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; uint64_t current_time = 0; uint64_t update_time = 0; @@ -1459,7 +1563,8 @@ int32_t mz_zip_writer_add(void *handle, void *stream, mz_stream_read_cb read_cb) writer->progress_cb(handle, writer->progress_userdata, &writer->file_info, current_pos); /* Write data to stream until done */ - while (err == MZ_OK) { + while (err == MZ_OK) + { written = mz_zip_writer_add_process(handle, stream, read_cb); if (written == MZ_END_OF_STREAM) break; @@ -1470,7 +1575,8 @@ int32_t mz_zip_writer_add(void *handle, void *stream, mz_stream_read_cb read_cb) /* Update progress if enough time have passed */ current_time = mz_os_ms_time(); - if ((current_time - update_time) > writer->progress_cb_interval_ms) { + if ((current_time - update_time) > writer->progress_cb_interval_ms) + { if (writer->progress_cb != NULL) writer->progress_cb(handle, writer->progress_userdata, &writer->file_info, current_pos); @@ -1486,7 +1592,8 @@ int32_t mz_zip_writer_add(void *handle, void *stream, mz_stream_read_cb read_cb) return err; } -int32_t mz_zip_writer_add_info(void *handle, void *stream, mz_stream_read_cb read_cb, mz_zip_file *file_info) { +int32_t mz_zip_writer_add_info(void *handle, void *stream, mz_stream_read_cb read_cb, mz_zip_file *file_info) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; int32_t err = MZ_OK; @@ -1501,8 +1608,10 @@ int32_t mz_zip_writer_add_info(void *handle, void *stream, mz_stream_read_cb rea if (err != MZ_OK) return err; - if (stream != NULL) { - if (mz_zip_attrib_is_dir(writer->file_info.external_fa, writer->file_info.version_madeby) != MZ_OK) { + if (stream != NULL) + { + if (mz_zip_attrib_is_dir(writer->file_info.external_fa, writer->file_info.version_madeby) != MZ_OK) + { err = mz_zip_writer_add(handle, stream, read_cb); if (err != MZ_OK) return err; @@ -1514,7 +1623,8 @@ int32_t mz_zip_writer_add_info(void *handle, void *stream, mz_stream_read_cb rea return err; } -int32_t mz_zip_writer_add_buffer(void *handle, void *buf, int32_t len, mz_zip_file *file_info) { +int32_t mz_zip_writer_add_buffer(void *handle, void *buf, int32_t len, mz_zip_file *file_info) +{ void *mem_stream = NULL; int32_t err = MZ_OK; @@ -1535,7 +1645,8 @@ int32_t mz_zip_writer_add_buffer(void *handle, void *buf, int32_t len, mz_zip_fi return err; } -int32_t mz_zip_writer_add_file(void *handle, const char *path, const char *filename_in_zip) { +int32_t mz_zip_writer_add_file(void *handle, const char *path, const char *filename_in_zip) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; mz_zip_file file_info; uint32_t target_attrib = 0; @@ -1552,7 +1663,8 @@ int32_t mz_zip_writer_add_file(void *handle, const char *path, const char *filen if (path == NULL) return MZ_PARAM_ERROR; - if (filename == NULL) { + if (filename == NULL) + { err = mz_path_get_filename(path, &filename); if (err != MZ_OK) return err; @@ -1585,20 +1697,27 @@ int32_t mz_zip_writer_add_file(void *handle, const char *path, const char *filen src_sys = MZ_HOST_SYSTEM(file_info.version_madeby); - if ((src_sys != MZ_HOST_SYSTEM_MSDOS) && (src_sys != MZ_HOST_SYSTEM_WINDOWS_NTFS)) { + if ((src_sys != MZ_HOST_SYSTEM_MSDOS) && (src_sys != MZ_HOST_SYSTEM_WINDOWS_NTFS)) + { /* High bytes are OS specific attributes, low byte is always DOS attributes */ if (mz_zip_attrib_convert(src_sys, src_attrib, MZ_HOST_SYSTEM_MSDOS, &target_attrib) == MZ_OK) file_info.external_fa = target_attrib; file_info.external_fa |= (src_attrib << 16); - } else { + } + else + { file_info.external_fa = src_attrib; } - if (writer->store_links && mz_os_is_symlink(path) == MZ_OK) { + if (writer->store_links && mz_os_is_symlink(path) == MZ_OK) + { err = mz_os_read_symlink(path, link_path, sizeof(link_path)); if (err == MZ_OK) file_info.linkname = link_path; - } else if (mz_os_is_dir(path) != MZ_OK) { + } + + if (mz_os_is_dir(path) != MZ_OK) + { mz_stream_os_create(&stream); err = mz_stream_os_open(stream, path, MZ_OPEN_MODE_READ); } @@ -1606,7 +1725,8 @@ int32_t mz_zip_writer_add_file(void *handle, const char *path, const char *filen if (err == MZ_OK) err = mz_zip_writer_add_info(handle, stream, mz_stream_read, &file_info); - if (stream != NULL) { + if (stream != NULL) + { mz_stream_close(stream); mz_stream_delete(&stream); } @@ -1615,7 +1735,8 @@ int32_t mz_zip_writer_add_file(void *handle, const char *path, const char *filen } int32_t mz_zip_writer_add_path(void *handle, const char *path, const char *root_path, - uint8_t include_path, uint8_t recursive) { + uint8_t include_path, uint8_t recursive) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; DIR *dir = NULL; struct dirent *entry = NULL; @@ -1628,13 +1749,16 @@ int32_t mz_zip_writer_add_path(void *handle, const char *path, const char *root_ char path_dir[1024]; - if (strrchr(path, '*') != NULL) { + if (strrchr(path, '*') != NULL) + { strncpy(path_dir, path, sizeof(path_dir) - 1); path_dir[sizeof(path_dir) - 1] = 0; mz_path_remove_filename(path_dir); wildcard_ptr = path_dir + strlen(path_dir) + 1; root_path = path = path_dir; - } else { + } + else + { if (mz_os_is_dir(path) == MZ_OK) is_dir = 1; @@ -1643,16 +1767,21 @@ int32_t mz_zip_writer_add_path(void *handle, const char *path, const char *root_ root_path = path; /* Should the file be stored with any path info at all? */ - if (!include_path) { - if (!is_dir && root_path == path) { + if (!include_path) + { + if (!is_dir && root_path == path) + { if (mz_path_get_filename(filenameinzip, &filename) == MZ_OK) filenameinzip = filename; - } else { + } + else + { filenameinzip += strlen(root_path); } } - if (!writer->store_links && !writer->follow_links) { + if (!writer->store_links && !writer->follow_links) + { if (mz_os_is_symlink(path) == MZ_OK) return err; } @@ -1663,7 +1792,8 @@ int32_t mz_zip_writer_add_path(void *handle, const char *path, const char *root_ if (!is_dir) return err; - if (writer->store_links) { + if (writer->store_links) + { if (mz_os_is_symlink(path) == MZ_OK) return err; } @@ -1674,7 +1804,8 @@ int32_t mz_zip_writer_add_path(void *handle, const char *path, const char *root_ if (dir == NULL) return MZ_EXIST_ERROR; - while ((entry = mz_os_read_dir(dir)) != NULL) { + while ((entry = mz_os_read_dir(dir)) != NULL) + { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) continue; @@ -1697,7 +1828,8 @@ int32_t mz_zip_writer_add_path(void *handle, const char *path, const char *root_ return MZ_OK; } -int32_t mz_zip_writer_copy_from_reader(void *handle, void *reader) { +int32_t mz_zip_writer_copy_from_reader(void *handle, void *reader) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; mz_zip_file *file_info = NULL; int64_t compressed_size = 0; @@ -1725,7 +1857,8 @@ int32_t mz_zip_writer_copy_from_reader(void *handle, void *reader) { /* Open entry for raw reading */ err = mz_zip_entry_read_open(reader_zip_handle, 1, NULL); - if (err == MZ_OK) { + if (err == MZ_OK) + { /* Write entry raw, save original raw value */ original_raw = writer->raw; writer->raw = 1; @@ -1733,11 +1866,13 @@ int32_t mz_zip_writer_copy_from_reader(void *handle, void *reader) { err = mz_zip_writer_entry_open(writer, file_info); if ((err == MZ_OK) && - (mz_zip_attrib_is_dir(writer->file_info.external_fa, writer->file_info.version_madeby) != MZ_OK)) { + (mz_zip_attrib_is_dir(writer->file_info.external_fa, writer->file_info.version_madeby) != MZ_OK)) + { err = mz_zip_writer_add(writer, reader_zip_handle, mz_zip_entry_read); } - if (err == MZ_OK) { + if (err == MZ_OK) + { err = mz_zip_entry_read_close(reader_zip_handle, &crc32, &compressed_size, &uncompressed_size); if (err == MZ_OK) err = mz_zip_entry_write_close(writer_zip_handle, crc32, compressed_size, uncompressed_size); @@ -1757,22 +1892,26 @@ int32_t mz_zip_writer_copy_from_reader(void *handle, void *reader) { /***************************************************************************/ -void mz_zip_writer_set_password(void *handle, const char *password) { +void mz_zip_writer_set_password(void *handle, const char *password) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->password = password; } -void mz_zip_writer_set_comment(void *handle, const char *comment) { +void mz_zip_writer_set_comment(void *handle, const char *comment) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->comment = comment; } -void mz_zip_writer_set_raw(void *handle, uint8_t raw) { +void mz_zip_writer_set_raw(void *handle, uint8_t raw) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->raw = raw; } -int32_t mz_zip_writer_get_raw(void *handle, uint8_t *raw) { +int32_t mz_zip_writer_get_raw(void *handle, uint8_t *raw) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; if (raw == NULL) return MZ_PARAM_ERROR; @@ -1780,37 +1919,44 @@ int32_t mz_zip_writer_get_raw(void *handle, uint8_t *raw) { return MZ_OK; } -void mz_zip_writer_set_aes(void *handle, uint8_t aes) { +void mz_zip_writer_set_aes(void *handle, uint8_t aes) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->aes = aes; } -void mz_zip_writer_set_compress_method(void *handle, uint16_t compress_method) { +void mz_zip_writer_set_compress_method(void *handle, uint16_t compress_method) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->compress_method = compress_method; } -void mz_zip_writer_set_compress_level(void *handle, int16_t compress_level) { +void mz_zip_writer_set_compress_level(void *handle, int16_t compress_level) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->compress_level = compress_level; } -void mz_zip_writer_set_follow_links(void *handle, uint8_t follow_links) { +void mz_zip_writer_set_follow_links(void *handle, uint8_t follow_links) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->follow_links = follow_links; } -void mz_zip_writer_set_store_links(void *handle, uint8_t store_links) { +void mz_zip_writer_set_store_links(void *handle, uint8_t store_links) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->store_links = store_links; } -void mz_zip_writer_set_zip_cd(void *handle, uint8_t zip_cd) { +void mz_zip_writer_set_zip_cd(void *handle, uint8_t zip_cd) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->zip_cd = zip_cd; } -int32_t mz_zip_writer_set_certificate(void *handle, const char *cert_path, const char *cert_pwd) { +int32_t mz_zip_writer_set_certificate(void *handle, const char *cert_path, const char *cert_pwd) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; void *cert_stream = NULL; uint8_t *cert_data = NULL; @@ -1825,7 +1971,8 @@ int32_t mz_zip_writer_set_certificate(void *handle, const char *cert_path, const if (cert_data_size == 0) return MZ_PARAM_ERROR; - if (writer->cert_data != NULL) { + if (writer->cert_data != NULL) + { MZ_FREE(writer->cert_data); writer->cert_data = NULL; } @@ -1835,54 +1982,64 @@ int32_t mz_zip_writer_set_certificate(void *handle, const char *cert_path, const /* Read pkcs12 certificate from disk */ mz_stream_os_create(&cert_stream); err = mz_stream_os_open(cert_stream, cert_path, MZ_OPEN_MODE_READ); - if (err == MZ_OK) { + if (err == MZ_OK) + { if (mz_stream_os_read(cert_stream, cert_data, cert_data_size) != cert_data_size) err = MZ_READ_ERROR; mz_stream_os_close(cert_stream); } mz_stream_os_delete(&cert_stream); - if (err == MZ_OK) { + if (err == MZ_OK) + { writer->cert_data = cert_data; writer->cert_data_size = cert_data_size; writer->cert_pwd = cert_pwd; - } else { + } + else + { MZ_FREE(cert_data); } return err; } -void mz_zip_writer_set_overwrite_cb(void *handle, void *userdata, mz_zip_writer_overwrite_cb cb) { +void mz_zip_writer_set_overwrite_cb(void *handle, void *userdata, mz_zip_writer_overwrite_cb cb) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->overwrite_cb = cb; writer->overwrite_userdata = userdata; } -void mz_zip_writer_set_password_cb(void *handle, void *userdata, mz_zip_writer_password_cb cb) { +void mz_zip_writer_set_password_cb(void *handle, void *userdata, mz_zip_writer_password_cb cb) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->password_cb = cb; writer->password_userdata = userdata; } -void mz_zip_writer_set_progress_cb(void *handle, void *userdata, mz_zip_writer_progress_cb cb) { +void mz_zip_writer_set_progress_cb(void *handle, void *userdata, mz_zip_writer_progress_cb cb) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->progress_cb = cb; writer->progress_userdata = userdata; } -void mz_zip_writer_set_progress_interval(void *handle, uint32_t milliseconds) { +void mz_zip_writer_set_progress_interval(void *handle, uint32_t milliseconds) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->progress_cb_interval_ms = milliseconds; } -void mz_zip_writer_set_entry_cb(void *handle, void *userdata, mz_zip_writer_entry_cb cb) { +void mz_zip_writer_set_entry_cb(void *handle, void *userdata, mz_zip_writer_entry_cb cb) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; writer->entry_cb = cb; writer->entry_userdata = userdata; } -int32_t mz_zip_writer_get_zip_handle(void *handle, void **zip_handle) { +int32_t mz_zip_writer_get_zip_handle(void *handle, void **zip_handle) +{ mz_zip_writer *writer = (mz_zip_writer *)handle; if (zip_handle == NULL) return MZ_PARAM_ERROR; @@ -1894,11 +2051,13 @@ int32_t mz_zip_writer_get_zip_handle(void *handle, void **zip_handle) { /***************************************************************************/ -void *mz_zip_writer_create(void **handle) { +void *mz_zip_writer_create(void **handle) +{ mz_zip_writer *writer = NULL; writer = (mz_zip_writer *)MZ_ALLOC(sizeof(mz_zip_writer)); - if (writer != NULL) { + if (writer != NULL) + { memset(writer, 0, sizeof(mz_zip_writer)); #if defined(HAVE_WZAES) writer->aes = 1; @@ -1914,19 +2073,21 @@ void *mz_zip_writer_create(void **handle) { #endif writer->compress_level = MZ_COMPRESS_LEVEL_BEST; writer->progress_cb_interval_ms = MZ_DEFAULT_PROGRESS_INTERVAL; - } - if (handle != NULL) + *handle = writer; + } return writer; } -void mz_zip_writer_delete(void **handle) { +void mz_zip_writer_delete(void **handle) +{ mz_zip_writer *writer = NULL; if (handle == NULL) return; writer = (mz_zip_writer *)*handle; - if (writer != NULL) { + if (writer != NULL) + { mz_zip_writer_close(writer); if (writer->cert_data != NULL) diff --git a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip_rw.h b/Sources/XlsxReaderWriter/minizip/mz_zip_rw.h similarity index 97% rename from Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip_rw.h rename to Sources/XlsxReaderWriter/minizip/mz_zip_rw.h index 0957d0e..1998b17 100644 --- a/Carthage/Checkouts/ZipArchive/SSZipArchive/minizip/mz_zip_rw.h +++ b/Sources/XlsxReaderWriter/minizip/mz_zip_rw.h @@ -1,8 +1,9 @@ /* mz_zip_rw.h -- Zip reader/writer - part of the minizip-ng project + Version 2.9.2, February 12, 2020 + part of the MiniZip project - Copyright (C) 2010-2021 Nathan Moinvaziri - https://github.com/zlib-ng/minizip-ng + Copyright (C) 2010-2020 Nathan Moinvaziri + https://github.com/nmoinvaz/minizip This program is distributed under the terms of the same license as zlib. See the accompanying LICENSE file for the full text of the license. @@ -125,9 +126,6 @@ int32_t mz_zip_reader_get_zip_cd(void *handle, uint8_t *zip_cd); int32_t mz_zip_reader_get_comment(void *handle, const char **comment); /* Gets the comment for the central directory */ -int32_t mz_zip_reader_set_recover(void *handle, uint8_t recover); -/* Sets the ability to recover the central dir by reading local file headers */ - void mz_zip_reader_set_encoding(void *handle, int32_t encoding); /* Sets whether or not it should support a special character encoding in zip file names. */ @@ -170,7 +168,7 @@ typedef int32_t (*mz_zip_writer_entry_cb)(void *handle, void *userdata, mz_zip_f int32_t mz_zip_writer_is_open(void *handle); /* Checks to see if the zip file is open */ -int32_t mz_zip_writer_open(void *handle, void *stream, uint8_t append); +int32_t mz_zip_writer_open(void *handle, void *stream); /* Opens zip file from stream */ int32_t mz_zip_writer_open_file(void *handle, const char *path, int64_t disk_size, uint8_t append); diff --git a/Tests/XlsxReaderWriterSwiftTests/XlsxReaderWriterTests.swift b/Tests/XlsxReaderWriterSwiftTests/XlsxReaderWriterTests.swift index 395934c..1f48ac7 100644 --- a/Tests/XlsxReaderWriterSwiftTests/XlsxReaderWriterTests.swift +++ b/Tests/XlsxReaderWriterSwiftTests/XlsxReaderWriterTests.swift @@ -6,12 +6,12 @@ // Copyright (c) 2015 BRAE. All rights reserved. // -import UIKit import XCTest +import XlsxReaderWriter class SwiftTestCase: XCTestCase { - let odp: BRAOfficeDocumentPackage = BRAOfficeDocumentPackage.open(Bundle(for: SwiftTestCase.self).path(forResource: "testWorkbook", ofType: "xlsx")) + let odp: BRAOfficeDocumentPackage = BRAOfficeDocumentPackage.open(Bundle.module.path(forResource: "testWorkbook", ofType: "xlsx")) func getDocumentsDirectory() -> URL { // find all possible documents directories for this user @@ -52,10 +52,14 @@ class SwiftTestCase: XCTestCase { let worksheet: BRAWorksheet = odp.workbook.worksheets[0] as! BRAWorksheet; XCTAssertNotNil(worksheet, "Worksheet should not be nil") - let filePath = Bundle(for: self.classForCoder).path(forResource: "photo-1415226481302-c40f24f4d45e", ofType: "jpeg")! + let filePath = Bundle.module.path(forResource: "photo-1415226481302-c40f24f4d45e", ofType: "jpeg")! let fileURL = URL(fileURLWithPath: filePath) let data = try? Data(contentsOf: fileURL) + #if os(macOS) + let image = NSImage(data: data!) + #else let image = UIImage(data: data!) + #endif let size = CGSize(width: image!.size.width * 6350, height: image!.size.height * 6350) let drawing = worksheet.add(image, inCellReferenced: "H2", diff --git a/Tests/XlsxReaderWriterTests/BRAXlsxReaderWriterTests.m b/Tests/XlsxReaderWriterTests/BRAXlsxReaderWriterTests.m index 549c859..03acefb 100644 --- a/Tests/XlsxReaderWriterTests/BRAXlsxReaderWriterTests.m +++ b/Tests/XlsxReaderWriterTests/BRAXlsxReaderWriterTests.m @@ -6,23 +6,8 @@ // Copyright (c) 2013 René Bigot. All rights reserved. // -#import -#import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +@import XCTest; +@import XlsxReaderWriter; #define NUMBER_FORMAT(X) [[BRANumberFormat alloc] initWithOpenXmlAttributes:@{@"_formatCode": X} inStyles:self.spreadsheet.workbook.styles] @@ -30,6 +15,11 @@ @interface BRAXlsxReaderWriterTests : XCTestCase @property (strong, readwrite) BRAOfficeDocumentPackage *spreadsheet; @property (strong, readwrite) BRAOfficeDocumentPackage *spreadsheet2; +#if TARGET_OS_IPHONE +@property (strong, readwrite) UIImage *image; +#else +@property (strong, readwrite) NSImage *image; +#endif @end @@ -42,12 +32,17 @@ + (void)setUp { - (void)setUp { [super setUp]; - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook" ofType:@"xlsx"]; self.spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; - NSString *documentPath2 = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook2" ofType:@"xlsx"]; + NSString *documentPath2 = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook2" ofType:@"xlsx"]; self.spreadsheet2 = [BRAOfficeDocumentPackage open:documentPath2]; +#if TARGET_OS_IPHONE + self.image = [UIImage imageWithContentsOfFile:[SWIFTPM_MODULE_BUNDLE pathForResource:@"photo-1415226481302-c40f24f4d45e" ofType:@"jpeg"]]; +#else + self.image = [SWIFTPM_MODULE_BUNDLE imageForResource:@"photo-1415226481302-c40f24f4d45e.jpeg"]; +#endif } + (void)tearDown { @@ -57,7 +52,7 @@ + (void)tearDown { } - (void)testHyperlink { - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"google" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"google" ofType:@"xlsx"]; BRAOfficeDocumentPackage *spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; XCTAssertNotNil(spreadsheet, @"Spreadsheet document can't be read"); BRAWorksheet *worksheet = spreadsheet.workbook.worksheets[0]; @@ -91,7 +86,7 @@ - (void)testCellContentBoolean { paragraphStyle.alignment = NSTextAlignmentLeft; NSDictionary *defaultAttributes = @{ - NSForegroundColorAttributeName: [UIColor colorWithRed:0 green:0 blue:0 alpha:1], + NSForegroundColorAttributeName: [BRANativeColor colorWithRed:0 green:0 blue:0 alpha:1], NSParagraphStyleAttributeName: paragraphStyle }; @@ -118,7 +113,7 @@ - (void)testCellContentNumber { paragraphStyle.alignment = NSTextAlignmentLeft; NSDictionary *defaultAttributes = @{ - NSForegroundColorAttributeName: [UIColor colorWithRed:0 green:0 blue:0 alpha:1], + NSForegroundColorAttributeName: [BRANativeColor colorWithRed:0 green:0 blue:0 alpha:1], NSParagraphStyleAttributeName: paragraphStyle }; @@ -154,7 +149,7 @@ - (void)testCellContentAttributedString { paragraphStyle.alignment = NSTextAlignmentLeft; NSDictionary *defaultAttributes = @{ - NSForegroundColorAttributeName: [UIColor colorWithRed:0 green:0 blue:0 alpha:1], + NSForegroundColorAttributeName: [BRANativeColor colorWithRed:0 green:0 blue:0 alpha:1], NSParagraphStyleAttributeName: paragraphStyle }; @@ -165,7 +160,7 @@ - (void)testCellContentAttributedString { resultAttributedString = [[NSAttributedString alloc] initWithString:@"shared string with " attributes:defaultAttributes].mutableCopy; [resultAttributedString appendAttributedString:[[NSAttributedString alloc] initWithString:@"color" attributes:@{ - NSForegroundColorAttributeName: [UIColor colorWithHexString:@"FC0507"], + NSForegroundColorAttributeName: [BRANativeColor colorWithHexString:@"FC0507"], NSParagraphStyleAttributeName: paragraphStyle }]]; @@ -193,7 +188,7 @@ - (void)testCellContentFormula { - (void)testThemeColor { BRAWorksheet *worksheet = self.spreadsheet.workbook.worksheets[0]; - XCTAssertEqualObjects([[worksheet cellForCellReference:@"F3"] cellFillColor], [UIColor colorWithRed:247./255. green:150./255. blue:70./255. alpha:1]); + XCTAssertEqualObjects([[worksheet cellForCellReference:@"F3"] cellFillColor], [BRANativeColor colorWithRed:247./255. green:150./255. blue:70./255. alpha:1]); } - (void)testNumberFormats { @@ -268,7 +263,7 @@ - (void)testNumberFormats { effectiveRange:NULL], nil); XCTAssertEqualObjects([[numberFormat formatNumber:-1241.999] attribute:NSForegroundColorAttributeName atIndex:0 - effectiveRange:NULL], [UIColor redColor]); + effectiveRange:NULL], [BRANativeColor redColor]); numberFormat = NUMBER_FORMAT(@"0%"); XCTAssertEqualObjects([[numberFormat formatNumber:.5] string], @"50%"); @@ -346,7 +341,7 @@ - (void)testSaveAs { } - (void)testAdd1Row { - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook" ofType:@"xlsx"]; [self measureBlock:^{ self.spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; @@ -365,7 +360,7 @@ - (void)testAdd1Row { } - (void)testAdd1000Rows { - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook" ofType:@"xlsx"]; [self measureBlock:^{ self.spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; @@ -384,7 +379,7 @@ - (void)testAdd1000Rows { } - (void)testRemove1Row { - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook" ofType:@"xlsx"]; [self measureBlock:^{ self.spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; @@ -403,7 +398,7 @@ - (void)testRemove1Row { } - (void)testRemove1RowAndKeepMergeCellContent { - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook" ofType:@"xlsx"]; [self measureBlock:^{ self.spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; @@ -422,7 +417,7 @@ - (void)testRemove1RowAndKeepMergeCellContent { } - (void)testRemove1RowAboveAMergedCellAndKeepMergeCellContent { - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook" ofType:@"xlsx"]; [self measureBlock:^{ self.spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; @@ -440,7 +435,7 @@ - (void)testRemove1RowAboveAMergedCellAndKeepMergeCellContent { } - (void)testRemove4Rows { - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook" ofType:@"xlsx"]; [self measureBlock:^{ self.spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; @@ -463,7 +458,7 @@ - (void)testWriteCellContent { paragraphStyle.alignment = NSTextAlignmentLeft; NSDictionary *stringAttributes = @{ NSParagraphStyleAttributeName: paragraphStyle, - NSForegroundColorAttributeName: [UIColor greenColor] + NSForegroundColorAttributeName: [BRANativeColor greenColor] }; BRAWorksheet *worksheet = self.spreadsheet.workbook.worksheets[0]; @@ -481,7 +476,7 @@ - (void)testWriteCellContent { [[worksheet cellForCellReference:@"Y24" shouldCreate:YES] setStringValue:@"FOO / BAR"]; [[worksheet cellForCellReference:@"Z24" shouldCreate:YES] - setAttributedStringValue:[[NSAttributedString alloc] initWithString:@"GREEN" attributes:@{NSForegroundColorAttributeName: [UIColor greenColor]}]]; + setAttributedStringValue:[[NSAttributedString alloc] initWithString:@"GREEN" attributes:@{NSForegroundColorAttributeName: [BRANativeColor greenColor]}]]; NSDateFormatter *df = [[NSDateFormatter alloc] init]; df.dateFormat = @"MM/dd/yyyy"; @@ -637,9 +632,7 @@ - (void)testAddOneCellAnchoredImage { //Need to test more things. Only used to generate an XLSX file BRAWorksheet *worksheet = self.spreadsheet.workbook.worksheets[0]; - UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"photo-1415226481302-c40f24f4d45e" ofType:@"jpeg"]]; - - BRAWorksheetDrawing *drawing = [worksheet addImage:image + BRAWorksheetDrawing *drawing = [worksheet addImage:self.image inCellReferenced:@"G2" withOffset:CGPointZero size:CGSizeMake(400. * 12700, 300 * 12700) @@ -654,11 +647,10 @@ - (void)testAddTwoCellAnchoredImage { //Need to test more things. Only used to generate an XLSX file BRAWorksheet *worksheet = self.spreadsheet.workbook.worksheets[0]; - UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"photo-1415226481302-c40f24f4d45e" ofType:@"jpeg"]]; - BRAWorksheetDrawing *drawing = [worksheet addImage:image betweenCellsReferenced:@"G2" and:@"I10" - withInsets:UIEdgeInsetsZero preserveTransparency:NO]; + BRAWorksheetDrawing *drawing = [worksheet addImage:self.image betweenCellsReferenced:@"G2" and:@"I10" + withInsets:BRANativeEdgeInsetsZero preserveTransparency:NO]; - drawing.insets = UIEdgeInsetsMake(0., 0., .5, .5); + drawing.insets = BRANativeEdgeInsetsMake(0., 0., .5, .5); XCTAssertNotNil(drawing, @"No drawing created"); @@ -670,8 +662,7 @@ - (void)testAddAbsoluteAnchoredImage { //Need to test more things. Only used to generate an XLSX file BRAWorksheet *worksheet = self.spreadsheet.workbook.worksheets[0]; - UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"photo-1415226481302-c40f24f4d45e" ofType:@"jpeg"]]; - BRAWorksheetDrawing *drawing = [worksheet addImage:image inFrame:CGRectMake(10. * 12700., 10. * 12700., 1024. * 12700., 768. * 12700.) + BRAWorksheetDrawing *drawing = [worksheet addImage:self.image inFrame:CGRectMake(10. * 12700., 10. * 12700., 1024. * 12700., 768. * 12700.) preserveTransparency:NO]; XCTAssertNotNil(drawing, @"No drawing created"); @@ -682,9 +673,9 @@ - (void)testAddAbsoluteAnchoredImage { - (void)testFillColor { BRAWorksheet *worksheet = self.spreadsheet.workbook.worksheets[0]; - XCTAssertEqualObjects([[worksheet cellForCellReference:@"A35"] cellFillColor], [UIColor redColor], @"A35 fill should be plain red"); + XCTAssertEqualObjects([[worksheet cellForCellReference:@"A35"] cellFillColor], [BRANativeColor redColor], @"A35 fill should be plain red"); - [[worksheet cellForCellReference:@"A36" shouldCreate:YES] setCellFillWithForegroundColor:[UIColor yellowColor] backgroundColor:[UIColor blackColor] andPatternType:kBRACellFillPatternTypeDarkTrellis]; + [[worksheet cellForCellReference:@"A36" shouldCreate:YES] setCellFillWithForegroundColor:[BRANativeColor yellowColor] backgroundColor:[BRANativeColor blackColor] andPatternType:kBRACellFillPatternTypeDarkTrellis]; [self.spreadsheet saveAs:[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"testFillColor.xlsx"]]; } @@ -726,7 +717,7 @@ - (void)testCellContentStringFor2Documents { - (void)testConcurencySpreadsheetOpenDocument { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSString *documentPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"testWorkbook2" ofType:@"xlsx"]; + NSString *documentPath = [SWIFTPM_MODULE_BUNDLE pathForResource:@"testWorkbook2" ofType:@"xlsx"]; BRAOfficeDocumentPackage *doc1 = [BRAOfficeDocumentPackage open:documentPath]; BRAWorksheet *worksheet = doc1.workbook.worksheets[0]; [worksheet removeRow:18]; diff --git a/XlsxReaderWriter.podspec b/XlsxReaderWriter.podspec index 9b16c06..4b1724e 100644 --- a/XlsxReaderWriter.podspec +++ b/XlsxReaderWriter.podspec @@ -10,15 +10,14 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.source = { :git => "https://github.com/charlymr/XlsxReaderWriter.git", :tag => s.version.to_s } - s.source_files = "Sources/XlsxReaderWriter/**/*.{h,m}" + s.source_files = "Sources/XlsxReaderWriter/**/*.{h,m,c}" s.frameworks = "Foundation" s.ios.frameworks = "UIKit" s.osx.frameworks = "Cocoa" - - s.requires_arc = true + s.libraries = 'z', 'iconv' - s.dependency "SSZipArchive", "2.3.0" + s.requires_arc = true end diff --git a/XlsxReaderWriter.xcodeproj/project.pbxproj b/XlsxReaderWriter.xcodeproj/project.pbxproj index 600f5e2..895268e 100644 --- a/XlsxReaderWriter.xcodeproj/project.pbxproj +++ b/XlsxReaderWriter.xcodeproj/project.pbxproj @@ -3,12 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 22156D611C46B5DB00BB5779 /* NSDictionary+DeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CE1A15171B00790ED5 /* NSDictionary+DeepCopy.m */; }; - 22156D621C46B5DB00BB5779 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D01A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m */; }; 22156D631C46B5DB00BB5779 /* NSDictionary+OpenXmlString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D21A15171B00790ED5 /* NSDictionary+OpenXmlString.m */; }; 22156D641C46B5DB00BB5779 /* NativeColor+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6C51A15170900790ED5 /* NativeColor+HTML.m */; }; 22156D651C46B5DB00BB5779 /* NativeColor+OpenXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6C71A15170900790ED5 /* NativeColor+OpenXML.m */; }; @@ -45,7 +44,6 @@ 22156D841C46B5DC00BB5779 /* BRARelationship.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6741A15157100790ED5 /* BRARelationship.m */; }; 22156D851C46B5DC00BB5779 /* BRARelationships.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6761A15157100790ED5 /* BRARelationships.m */; }; 22156D881C46B62900BB5779 /* NSDictionary+DeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CD1A15171B00790ED5 /* NSDictionary+DeepCopy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 22156D891C46B62900BB5779 /* NSDictionary+OpenXMLDictionaryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CF1A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22156D8A1C46B62900BB5779 /* NSDictionary+OpenXmlString.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6D11A15171B00790ED5 /* NSDictionary+OpenXmlString.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22156D8B1C46B62900BB5779 /* NativeFont+BoldItalic.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CA1A15171100790ED5 /* NativeFont+BoldItalic.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22156D8C1C46B62900BB5779 /* NativeColor+HTML.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6C41A15170900790ED5 /* NativeColor+HTML.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -119,22 +117,12 @@ 4580C6C91A15170900790ED5 /* NativeColor+OpenXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6C71A15170900790ED5 /* NativeColor+OpenXML.m */; }; 4580C6CC1A15171100790ED5 /* NativeFont+BoldItalic.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CB1A15171100790ED5 /* NativeFont+BoldItalic.m */; }; 4580C6D31A15171B00790ED5 /* NSDictionary+DeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CE1A15171B00790ED5 /* NSDictionary+DeepCopy.m */; }; - 4580C6D41A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D01A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m */; }; 4580C6D51A15171B00790ED5 /* NSDictionary+OpenXmlString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D21A15171B00790ED5 /* NSDictionary+OpenXmlString.m */; }; 4580C6D81A15176A00790ED5 /* BRAOfficeDocumentPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D71A15176A00790ED5 /* BRAOfficeDocumentPackage.m */; }; - 45B6E2461A148F7500288A78 /* libXlsxReaderWriter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45B6E23A1A148F7500288A78 /* libXlsxReaderWriter.a */; }; - 45B6E30A1A1512DD00288A78 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45B6E3091A1512DD00288A78 /* Foundation.framework */; }; - 45B6E30C1A1512E700288A78 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45B6E30B1A1512E700288A78 /* CoreGraphics.framework */; }; 45D6FBCF1BB27747002ACC9C /* BRAComments.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D6FBCA1BB212A2002ACC9C /* BRAComments.m */; }; 45D6FBD41BB27833002ACC9C /* BRACalcChainCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D6FBD31BB27833002ACC9C /* BRACalcChainCell.m */; }; 45D6FBD81BB279A5002ACC9C /* BRAComment.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D6FBD71BB279A5002ACC9C /* BRAComment.m */; }; - 6119EB6026F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */; }; - 6119EB6126F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */; }; - 6119EB6226F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */; }; - 6119EB6326F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */; }; - 6119EB6426F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */; }; 6119EB6D26F4F5C7002A9B4A /* XlsxReaderWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6119EB6C26F4F5C7002A9B4A /* XlsxReaderWriter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6119EB7126F4F608002A9B4A /* ZipArchive.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */; }; 6119EB9F26F4F662002A9B4A /* BRARelationships.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6761A15157100790ED5 /* BRARelationships.m */; }; 6119EBA026F4F662002A9B4A /* BRARelationship.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6741A15157100790ED5 /* BRARelationship.m */; }; 6119EBA126F4F662002A9B4A /* BRAElementWithRelationships.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C67A1A1515AB00790ED5 /* BRAElementWithRelationships.m */; }; @@ -170,7 +158,6 @@ 6119EBBF26F4F662002A9B4A /* BRACellRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6921A15162D00790ED5 /* BRACellRange.m */; }; 6119EBC026F4F662002A9B4A /* XlsxReaderXMLDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 8265BC302041C4BE004A2A7D /* XlsxReaderXMLDictionary.m */; }; 6119EBC126F4F662002A9B4A /* NSDictionary+DeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CE1A15171B00790ED5 /* NSDictionary+DeepCopy.m */; }; - 6119EBC226F4F662002A9B4A /* NSDictionary+OpenXMLDictionaryParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D01A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m */; }; 6119EBC326F4F662002A9B4A /* NSDictionary+OpenXmlString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D21A15171B00790ED5 /* NSDictionary+OpenXmlString.m */; }; 6119EBC426F4F662002A9B4A /* NativeFont+BoldItalic.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CB1A15171100790ED5 /* NativeFont+BoldItalic.m */; }; 6119EBC526F4F662002A9B4A /* NativeColor+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6C51A15170900790ED5 /* NativeColor+HTML.m */; }; @@ -185,7 +172,6 @@ 6119EBCE26F4F68A002A9B4A /* BRAOpenXmlSubElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C67E1A1515CB00790ED5 /* BRAOpenXmlSubElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6119EBCF26F4F68A002A9B4A /* XlsxReaderXMLDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 8265BC2F2041C4BE004A2A7D /* XlsxReaderXMLDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6119EBD026F4F68A002A9B4A /* NSDictionary+DeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CD1A15171B00790ED5 /* NSDictionary+DeepCopy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6119EBD126F4F68A002A9B4A /* NSDictionary+OpenXMLDictionaryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CF1A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6119EBD226F4F68B002A9B4A /* NSDictionary+OpenXmlString.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6D11A15171B00790ED5 /* NSDictionary+OpenXmlString.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6119EBD326F4F68B002A9B4A /* NativeColor+HTML.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6C41A15170900790ED5 /* NativeColor+HTML.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6119EBD426F4F68B002A9B4A /* NativeColor+OpenXML.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6C61A15170900790ED5 /* NativeColor+OpenXML.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -218,7 +204,164 @@ 6119EBEF26F4F68C002A9B4A /* BRACellRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6911A15162D00790ED5 /* BRACellRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6119EBF026F4F68C002A9B4A /* BRAHyperlink.h in Headers */ = {isa = PBXBuildFile; fileRef = 827A14E326B7BC1F008EB8C2 /* BRAHyperlink.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6119EBF126F4F68C002A9B4A /* XlsxReaderWriter-swift-bridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 450E98F71B9783D500177B4A /* XlsxReaderWriter-swift-bridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8201DE4A26B5336B00ABA5EF /* testWorkbook2.xlsx in Resources */ = {isa = PBXBuildFile; fileRef = 8201DE4926B5335C00ABA5EF /* testWorkbook2.xlsx */; }; + 61AF3AA4274F59C60099176F /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3A9F274F59C60099176F /* SSZipArchive.m */; }; + 61AF3AA5274F59C60099176F /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3A9F274F59C60099176F /* SSZipArchive.m */; }; + 61AF3AA6274F59C60099176F /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3A9F274F59C60099176F /* SSZipArchive.m */; }; + 61AF3AA7274F59C60099176F /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3A9F274F59C60099176F /* SSZipArchive.m */; }; + 61AF3AA8274F59C60099176F /* SSZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3A9F274F59C60099176F /* SSZipArchive.m */; }; + 61AF3AAD274F59C60099176F /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA2274F59C60099176F /* SSZipArchive.h */; }; + 61AF3AAE274F59C60099176F /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA2274F59C60099176F /* SSZipArchive.h */; }; + 61AF3AAF274F59C60099176F /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA2274F59C60099176F /* SSZipArchive.h */; }; + 61AF3AB0274F59C60099176F /* SSZipArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA2274F59C60099176F /* SSZipArchive.h */; }; + 61AF3AB1274F59C60099176F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA3274F59C60099176F /* SSZipCommon.h */; }; + 61AF3AB2274F59C60099176F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA3274F59C60099176F /* SSZipCommon.h */; }; + 61AF3AB3274F59C60099176F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA3274F59C60099176F /* SSZipCommon.h */; }; + 61AF3AB4274F59C60099176F /* SSZipCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3AA3274F59C60099176F /* SSZipCommon.h */; }; + 61AF3B43274F7BDE0099176F /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B25274F7BDE0099176F /* mz_strm_os_posix.c */; }; + 61AF3B44274F7BDE0099176F /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B25274F7BDE0099176F /* mz_strm_os_posix.c */; }; + 61AF3B45274F7BDE0099176F /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B25274F7BDE0099176F /* mz_strm_os_posix.c */; }; + 61AF3B46274F7BDE0099176F /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B25274F7BDE0099176F /* mz_strm_os_posix.c */; }; + 61AF3B47274F7BDE0099176F /* mz_strm_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B25274F7BDE0099176F /* mz_strm_os_posix.c */; }; + 61AF3B48274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B26274F7BDE0099176F /* mz_strm_pkcrypt.c */; }; + 61AF3B49274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B26274F7BDE0099176F /* mz_strm_pkcrypt.c */; }; + 61AF3B4A274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B26274F7BDE0099176F /* mz_strm_pkcrypt.c */; }; + 61AF3B4B274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B26274F7BDE0099176F /* mz_strm_pkcrypt.c */; }; + 61AF3B4C274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B26274F7BDE0099176F /* mz_strm_pkcrypt.c */; }; + 61AF3B4D274F7BDE0099176F /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B27274F7BDE0099176F /* mz_strm_wzaes.h */; }; + 61AF3B4E274F7BDE0099176F /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B27274F7BDE0099176F /* mz_strm_wzaes.h */; }; + 61AF3B4F274F7BDE0099176F /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B27274F7BDE0099176F /* mz_strm_wzaes.h */; }; + 61AF3B50274F7BDE0099176F /* mz_strm_wzaes.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B27274F7BDE0099176F /* mz_strm_wzaes.h */; }; + 61AF3B51274F7BDE0099176F /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B28274F7BDE0099176F /* mz_compat.h */; }; + 61AF3B52274F7BDE0099176F /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B28274F7BDE0099176F /* mz_compat.h */; }; + 61AF3B53274F7BDE0099176F /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B28274F7BDE0099176F /* mz_compat.h */; }; + 61AF3B54274F7BDE0099176F /* mz_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B28274F7BDE0099176F /* mz_compat.h */; }; + 61AF3B55274F7BDE0099176F /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B29274F7BDE0099176F /* mz_strm_zlib.c */; }; + 61AF3B56274F7BDE0099176F /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B29274F7BDE0099176F /* mz_strm_zlib.c */; }; + 61AF3B57274F7BDE0099176F /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B29274F7BDE0099176F /* mz_strm_zlib.c */; }; + 61AF3B58274F7BDE0099176F /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B29274F7BDE0099176F /* mz_strm_zlib.c */; }; + 61AF3B59274F7BDE0099176F /* mz_strm_zlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B29274F7BDE0099176F /* mz_strm_zlib.c */; }; + 61AF3B5A274F7BDE0099176F /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2A274F7BDE0099176F /* mz_zip.c */; }; + 61AF3B5B274F7BDE0099176F /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2A274F7BDE0099176F /* mz_zip.c */; }; + 61AF3B5C274F7BDE0099176F /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2A274F7BDE0099176F /* mz_zip.c */; }; + 61AF3B5D274F7BDE0099176F /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2A274F7BDE0099176F /* mz_zip.c */; }; + 61AF3B5E274F7BDE0099176F /* mz_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2A274F7BDE0099176F /* mz_zip.c */; }; + 61AF3B5F274F7BDE0099176F /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2B274F7BDE0099176F /* mz_os.h */; }; + 61AF3B60274F7BDE0099176F /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2B274F7BDE0099176F /* mz_os.h */; }; + 61AF3B61274F7BDE0099176F /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2B274F7BDE0099176F /* mz_os.h */; }; + 61AF3B62274F7BDE0099176F /* mz_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2B274F7BDE0099176F /* mz_os.h */; }; + 61AF3B63274F7BDE0099176F /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 61AF3B2C274F7BDE0099176F /* LICENSE */; }; + 61AF3B64274F7BDE0099176F /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 61AF3B2C274F7BDE0099176F /* LICENSE */; }; + 61AF3B65274F7BDE0099176F /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 61AF3B2C274F7BDE0099176F /* LICENSE */; }; + 61AF3B66274F7BDE0099176F /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 61AF3B2C274F7BDE0099176F /* LICENSE */; }; + 61AF3B67274F7BDE0099176F /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2D274F7BDE0099176F /* mz_zip_rw.c */; }; + 61AF3B68274F7BDE0099176F /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2D274F7BDE0099176F /* mz_zip_rw.c */; }; + 61AF3B69274F7BDE0099176F /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2D274F7BDE0099176F /* mz_zip_rw.c */; }; + 61AF3B6A274F7BDE0099176F /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2D274F7BDE0099176F /* mz_zip_rw.c */; }; + 61AF3B6B274F7BDE0099176F /* mz_zip_rw.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B2D274F7BDE0099176F /* mz_zip_rw.c */; }; + 61AF3B6C274F7BDE0099176F /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2E274F7BDE0099176F /* mz_strm_split.h */; }; + 61AF3B6D274F7BDE0099176F /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2E274F7BDE0099176F /* mz_strm_split.h */; }; + 61AF3B6E274F7BDE0099176F /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2E274F7BDE0099176F /* mz_strm_split.h */; }; + 61AF3B6F274F7BDE0099176F /* mz_strm_split.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2E274F7BDE0099176F /* mz_strm_split.h */; }; + 61AF3B70274F7BDE0099176F /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2F274F7BDE0099176F /* mz_strm_buf.h */; }; + 61AF3B71274F7BDE0099176F /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2F274F7BDE0099176F /* mz_strm_buf.h */; }; + 61AF3B72274F7BDE0099176F /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2F274F7BDE0099176F /* mz_strm_buf.h */; }; + 61AF3B73274F7BDE0099176F /* mz_strm_buf.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B2F274F7BDE0099176F /* mz_strm_buf.h */; }; + 61AF3B74274F7BDE0099176F /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B30274F7BDE0099176F /* mz_crypt_apple.c */; }; + 61AF3B75274F7BDE0099176F /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B30274F7BDE0099176F /* mz_crypt_apple.c */; }; + 61AF3B76274F7BDE0099176F /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B30274F7BDE0099176F /* mz_crypt_apple.c */; }; + 61AF3B77274F7BDE0099176F /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B30274F7BDE0099176F /* mz_crypt_apple.c */; }; + 61AF3B78274F7BDE0099176F /* mz_crypt_apple.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B30274F7BDE0099176F /* mz_crypt_apple.c */; }; + 61AF3B79274F7BDE0099176F /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B31274F7BDE0099176F /* mz_strm.h */; }; + 61AF3B7A274F7BDE0099176F /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B31274F7BDE0099176F /* mz_strm.h */; }; + 61AF3B7B274F7BDE0099176F /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B31274F7BDE0099176F /* mz_strm.h */; }; + 61AF3B7C274F7BDE0099176F /* mz_strm.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B31274F7BDE0099176F /* mz_strm.h */; }; + 61AF3B7D274F7BDE0099176F /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B32274F7BDE0099176F /* mz_strm_mem.c */; }; + 61AF3B7E274F7BDE0099176F /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B32274F7BDE0099176F /* mz_strm_mem.c */; }; + 61AF3B7F274F7BDE0099176F /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B32274F7BDE0099176F /* mz_strm_mem.c */; }; + 61AF3B80274F7BDE0099176F /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B32274F7BDE0099176F /* mz_strm_mem.c */; }; + 61AF3B81274F7BDE0099176F /* mz_strm_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B32274F7BDE0099176F /* mz_strm_mem.c */; }; + 61AF3B82274F7BDE0099176F /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B33274F7BDE0099176F /* mz_crypt.c */; }; + 61AF3B83274F7BDE0099176F /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B33274F7BDE0099176F /* mz_crypt.c */; }; + 61AF3B84274F7BDE0099176F /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B33274F7BDE0099176F /* mz_crypt.c */; }; + 61AF3B85274F7BDE0099176F /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B33274F7BDE0099176F /* mz_crypt.c */; }; + 61AF3B86274F7BDE0099176F /* mz_crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B33274F7BDE0099176F /* mz_crypt.c */; }; + 61AF3B87274F7BDE0099176F /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B34274F7BDE0099176F /* mz_strm_wzaes.c */; }; + 61AF3B88274F7BDE0099176F /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B34274F7BDE0099176F /* mz_strm_wzaes.c */; }; + 61AF3B89274F7BDE0099176F /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B34274F7BDE0099176F /* mz_strm_wzaes.c */; }; + 61AF3B8A274F7BDE0099176F /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B34274F7BDE0099176F /* mz_strm_wzaes.c */; }; + 61AF3B8B274F7BDE0099176F /* mz_strm_wzaes.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B34274F7BDE0099176F /* mz_strm_wzaes.c */; }; + 61AF3B8C274F7BDE0099176F /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B35274F7BDE0099176F /* mz_strm_zlib.h */; }; + 61AF3B8D274F7BDE0099176F /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B35274F7BDE0099176F /* mz_strm_zlib.h */; }; + 61AF3B8E274F7BDE0099176F /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B35274F7BDE0099176F /* mz_strm_zlib.h */; }; + 61AF3B8F274F7BDE0099176F /* mz_strm_zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B35274F7BDE0099176F /* mz_strm_zlib.h */; }; + 61AF3B90274F7BDE0099176F /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B36274F7BDE0099176F /* mz_compat.c */; }; + 61AF3B91274F7BDE0099176F /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B36274F7BDE0099176F /* mz_compat.c */; }; + 61AF3B92274F7BDE0099176F /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B36274F7BDE0099176F /* mz_compat.c */; }; + 61AF3B93274F7BDE0099176F /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B36274F7BDE0099176F /* mz_compat.c */; }; + 61AF3B94274F7BDE0099176F /* mz_compat.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B36274F7BDE0099176F /* mz_compat.c */; }; + 61AF3B95274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B37274F7BDE0099176F /* mz_strm_pkcrypt.h */; }; + 61AF3B96274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B37274F7BDE0099176F /* mz_strm_pkcrypt.h */; }; + 61AF3B97274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B37274F7BDE0099176F /* mz_strm_pkcrypt.h */; }; + 61AF3B98274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B37274F7BDE0099176F /* mz_strm_pkcrypt.h */; }; + 61AF3B99274F7BDE0099176F /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B38274F7BDE0099176F /* mz_zip_rw.h */; }; + 61AF3B9A274F7BDE0099176F /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B38274F7BDE0099176F /* mz_zip_rw.h */; }; + 61AF3B9B274F7BDE0099176F /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B38274F7BDE0099176F /* mz_zip_rw.h */; }; + 61AF3B9C274F7BDE0099176F /* mz_zip_rw.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B38274F7BDE0099176F /* mz_zip_rw.h */; }; + 61AF3B9D274F7BDE0099176F /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B39274F7BDE0099176F /* mz_os.c */; }; + 61AF3B9E274F7BDE0099176F /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B39274F7BDE0099176F /* mz_os.c */; }; + 61AF3B9F274F7BDE0099176F /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B39274F7BDE0099176F /* mz_os.c */; }; + 61AF3BA0274F7BDE0099176F /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B39274F7BDE0099176F /* mz_os.c */; }; + 61AF3BA1274F7BDE0099176F /* mz_os.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B39274F7BDE0099176F /* mz_os.c */; }; + 61AF3BA2274F7BDE0099176F /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3A274F7BDE0099176F /* mz_zip.h */; }; + 61AF3BA3274F7BDE0099176F /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3A274F7BDE0099176F /* mz_zip.h */; }; + 61AF3BA4274F7BDE0099176F /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3A274F7BDE0099176F /* mz_zip.h */; }; + 61AF3BA5274F7BDE0099176F /* mz_zip.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3A274F7BDE0099176F /* mz_zip.h */; }; + 61AF3BA6274F7BDE0099176F /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3B274F7BDE0099176F /* mz_os_posix.c */; }; + 61AF3BA7274F7BDE0099176F /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3B274F7BDE0099176F /* mz_os_posix.c */; }; + 61AF3BA8274F7BDE0099176F /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3B274F7BDE0099176F /* mz_os_posix.c */; }; + 61AF3BA9274F7BDE0099176F /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3B274F7BDE0099176F /* mz_os_posix.c */; }; + 61AF3BAA274F7BDE0099176F /* mz_os_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3B274F7BDE0099176F /* mz_os_posix.c */; }; + 61AF3BAB274F7BDE0099176F /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3C274F7BDE0099176F /* mz.h */; }; + 61AF3BAC274F7BDE0099176F /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3C274F7BDE0099176F /* mz.h */; }; + 61AF3BAD274F7BDE0099176F /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3C274F7BDE0099176F /* mz.h */; }; + 61AF3BAE274F7BDE0099176F /* mz.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3C274F7BDE0099176F /* mz.h */; }; + 61AF3BAF274F7BDE0099176F /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3D274F7BDE0099176F /* mz_strm_buf.c */; }; + 61AF3BB0274F7BDE0099176F /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3D274F7BDE0099176F /* mz_strm_buf.c */; }; + 61AF3BB1274F7BDE0099176F /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3D274F7BDE0099176F /* mz_strm_buf.c */; }; + 61AF3BB2274F7BDE0099176F /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3D274F7BDE0099176F /* mz_strm_buf.c */; }; + 61AF3BB3274F7BDE0099176F /* mz_strm_buf.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3D274F7BDE0099176F /* mz_strm_buf.c */; }; + 61AF3BB4274F7BDE0099176F /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3E274F7BDE0099176F /* mz_strm_split.c */; }; + 61AF3BB5274F7BDE0099176F /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3E274F7BDE0099176F /* mz_strm_split.c */; }; + 61AF3BB6274F7BDE0099176F /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3E274F7BDE0099176F /* mz_strm_split.c */; }; + 61AF3BB7274F7BDE0099176F /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3E274F7BDE0099176F /* mz_strm_split.c */; }; + 61AF3BB8274F7BDE0099176F /* mz_strm_split.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B3E274F7BDE0099176F /* mz_strm_split.c */; }; + 61AF3BB9274F7BDE0099176F /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3F274F7BDE0099176F /* mz_crypt.h */; }; + 61AF3BBA274F7BDE0099176F /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3F274F7BDE0099176F /* mz_crypt.h */; }; + 61AF3BBB274F7BDE0099176F /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3F274F7BDE0099176F /* mz_crypt.h */; }; + 61AF3BBC274F7BDE0099176F /* mz_crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B3F274F7BDE0099176F /* mz_crypt.h */; }; + 61AF3BBD274F7BDE0099176F /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B40274F7BDE0099176F /* mz_strm_mem.h */; }; + 61AF3BBE274F7BDE0099176F /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B40274F7BDE0099176F /* mz_strm_mem.h */; }; + 61AF3BBF274F7BDE0099176F /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B40274F7BDE0099176F /* mz_strm_mem.h */; }; + 61AF3BC0274F7BDE0099176F /* mz_strm_mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B40274F7BDE0099176F /* mz_strm_mem.h */; }; + 61AF3BC1274F7BDE0099176F /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B41274F7BDE0099176F /* mz_strm.c */; }; + 61AF3BC2274F7BDE0099176F /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B41274F7BDE0099176F /* mz_strm.c */; }; + 61AF3BC3274F7BDE0099176F /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B41274F7BDE0099176F /* mz_strm.c */; }; + 61AF3BC4274F7BDE0099176F /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B41274F7BDE0099176F /* mz_strm.c */; }; + 61AF3BC5274F7BDE0099176F /* mz_strm.c in Sources */ = {isa = PBXBuildFile; fileRef = 61AF3B41274F7BDE0099176F /* mz_strm.c */; }; + 61AF3BC6274F7BDE0099176F /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B42274F7BDE0099176F /* mz_strm_os.h */; }; + 61AF3BC7274F7BDE0099176F /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B42274F7BDE0099176F /* mz_strm_os.h */; }; + 61AF3BC8274F7BDE0099176F /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B42274F7BDE0099176F /* mz_strm_os.h */; }; + 61AF3BC9274F7BDE0099176F /* mz_strm_os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61AF3B42274F7BDE0099176F /* mz_strm_os.h */; }; + 61AF3BD2274F97D90099176F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BD0274F97C20099176F /* libz.tbd */; }; + 61AF3BD5274F980E0099176F /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BD1274F97CD0099176F /* libiconv.tbd */; }; + 61AF3BD6274F98E40099176F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BD0274F97C20099176F /* libz.tbd */; }; + 61AF3BD7274F98EB0099176F /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BD1274F97CD0099176F /* libiconv.tbd */; }; + 61AF3BD8274F98F30099176F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BD0274F97C20099176F /* libz.tbd */; }; + 61AF3BD9274F98F90099176F /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BD1274F97CD0099176F /* libiconv.tbd */; }; + 61AF3BDB274F99040099176F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BDA274F99040099176F /* libz.tbd */; }; + 61AF3BDD274F990B0099176F /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BDC274F990B0099176F /* libiconv.tbd */; }; + 61AF3BDF274F99120099176F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BDE274F99120099176F /* libz.tbd */; }; + 61AF3BE1274F99180099176F /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61AF3BE0274F99180099176F /* libiconv.tbd */; }; 82168549255025160041F2FD /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82168548255025160041F2FD /* UIKit.framework */; }; 8265BC312041C4BE004A2A7D /* XlsxReaderXMLDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 8265BC2F2041C4BE004A2A7D /* XlsxReaderXMLDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8265BC322041C4BE004A2A7D /* XlsxReaderXMLDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 8265BC302041C4BE004A2A7D /* XlsxReaderXMLDictionary.m */; }; @@ -230,10 +373,8 @@ 827A14E426B7BC1F008EB8C2 /* BRAHyperlink.h in Headers */ = {isa = PBXBuildFile; fileRef = 827A14E326B7BC1F008EB8C2 /* BRAHyperlink.h */; settings = {ATTRIBUTES = (Public, ); }; }; 827A14E526B7BC1F008EB8C2 /* BRAHyperlink.h in Headers */ = {isa = PBXBuildFile; fileRef = 827A14E326B7BC1F008EB8C2 /* BRAHyperlink.h */; settings = {ATTRIBUTES = (Public, ); }; }; 827A14E626B7BC1F008EB8C2 /* BRAHyperlink.h in Headers */ = {isa = PBXBuildFile; fileRef = 827A14E326B7BC1F008EB8C2 /* BRAHyperlink.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 827A14E826B7BCB6008EB8C2 /* google.xlsx in Resources */ = {isa = PBXBuildFile; fileRef = 827A14E726B7BCB6008EB8C2 /* google.xlsx */; }; 8289AA6B2041DA4800E00603 /* XlsxReaderXMLDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 8265BC302041C4BE004A2A7D /* XlsxReaderXMLDictionary.m */; }; 8289AA6C2041DA4800E00603 /* NSDictionary+DeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CE1A15171B00790ED5 /* NSDictionary+DeepCopy.m */; }; - 8289AA6D2041DA4800E00603 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D01A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m */; }; 8289AA6E2041DA4800E00603 /* NSDictionary+OpenXmlString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D21A15171B00790ED5 /* NSDictionary+OpenXmlString.m */; }; 8289AA6F2041DA4800E00603 /* NativeFont+BoldItalic.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CB1A15171100790ED5 /* NativeFont+BoldItalic.m */; }; 8289AA702041DA4800E00603 /* NativeColor+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6C51A15170900790ED5 /* NativeColor+HTML.m */; }; @@ -273,7 +414,6 @@ 8289AA922041DA8D00E00603 /* BRAPlatformSpecificDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 455542A61C492C6A00EAB8FE /* BRAPlatformSpecificDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AA932041DA8D00E00603 /* XlsxReaderXMLDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 8265BC2F2041C4BE004A2A7D /* XlsxReaderXMLDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AA942041DA8D00E00603 /* NSDictionary+DeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CD1A15171B00790ED5 /* NSDictionary+DeepCopy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8289AA952041DA8D00E00603 /* NSDictionary+OpenXMLDictionaryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CF1A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AA962041DA8D00E00603 /* NSDictionary+OpenXmlString.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6D11A15171B00790ED5 /* NSDictionary+OpenXmlString.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AA972041DA8D00E00603 /* NativeFont+BoldItalic.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CA1A15171100790ED5 /* NativeFont+BoldItalic.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AA982041DA8D00E00603 /* NativeColor+HTML.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6C41A15170900790ED5 /* NativeColor+HTML.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -316,7 +456,6 @@ 8289AADE2042117B00E00603 /* BRAPlatformSpecificDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 455542A61C492C6A00EAB8FE /* BRAPlatformSpecificDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AADF2042117B00E00603 /* XlsxReaderXMLDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 8265BC2F2041C4BE004A2A7D /* XlsxReaderXMLDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AAE02042117B00E00603 /* NSDictionary+DeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CD1A15171B00790ED5 /* NSDictionary+DeepCopy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8289AAE12042117B00E00603 /* NSDictionary+OpenXMLDictionaryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CF1A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AAE22042117B00E00603 /* NSDictionary+OpenXmlString.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6D11A15171B00790ED5 /* NSDictionary+OpenXmlString.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AAE32042117B00E00603 /* NativeFont+BoldItalic.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6CA1A15171100790ED5 /* NativeFont+BoldItalic.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AAE42042117B00E00603 /* NativeColor+HTML.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6C41A15170900790ED5 /* NativeColor+HTML.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -357,7 +496,6 @@ 8289AB072042117B00E00603 /* BRARelationships.h in Headers */ = {isa = PBXBuildFile; fileRef = 4580C6751A15157100790ED5 /* BRARelationships.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8289AB082042118900E00603 /* XlsxReaderXMLDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 8265BC302041C4BE004A2A7D /* XlsxReaderXMLDictionary.m */; }; 8289AB092042118900E00603 /* NSDictionary+DeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CE1A15171B00790ED5 /* NSDictionary+DeepCopy.m */; }; - 8289AB0A2042118900E00603 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D01A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m */; }; 8289AB0B2042118900E00603 /* NSDictionary+OpenXmlString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6D21A15171B00790ED5 /* NSDictionary+OpenXmlString.m */; }; 8289AB0C2042118900E00603 /* NativeFont+BoldItalic.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6CB1A15171100790ED5 /* NativeFont+BoldItalic.m */; }; 8289AB0D2042118900E00603 /* NativeColor+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6C51A15170900790ED5 /* NativeColor+HTML.m */; }; @@ -394,23 +532,9 @@ 8289AB2C2042118900E00603 /* BRAElementWithRelationships.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C67A1A1515AB00790ED5 /* BRAElementWithRelationships.m */; }; 8289AB2D2042118900E00603 /* BRARelationship.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6741A15157100790ED5 /* BRARelationship.m */; }; 8289AB2E2042118900E00603 /* BRARelationships.m in Sources */ = {isa = PBXBuildFile; fileRef = 4580C6761A15157100790ED5 /* BRARelationships.m */; }; - 82C08A9526B5278700CD4AA1 /* BRAXlsxReaderWriterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 82C08A9026B5278700CD4AA1 /* BRAXlsxReaderWriterTests.m */; }; - 82C08A9626B5278700CD4AA1 /* XlsxReaderWriterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82C08A9126B5278700CD4AA1 /* XlsxReaderWriterTests.swift */; }; - 82C08AA826B52D7500CD4AA1 /* photo-1415226481302-c40f24f4d45e.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 82C08AA626B52D7500CD4AA1 /* photo-1415226481302-c40f24f4d45e.jpeg */; }; - 82C08AA926B52D7500CD4AA1 /* testWorkbook.xlsx in Resources */ = {isa = PBXBuildFile; fileRef = 82C08AA726B52D7500CD4AA1 /* testWorkbook.xlsx */; }; 82EBD89026B7D75F00CFAA90 /* XlsxReaderWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 82EBD88E26B7D75F00CFAA90 /* XlsxReaderWriter.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 45B6E2471A148F7500288A78 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 45B6E2321A148F7500288A78 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 45B6E2391A148F7500288A78; - remoteInfo = XlsxReaderWriter; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ 45B6E2381A148F7500288A78 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -495,16 +619,11 @@ 4580C6CB1A15171100790ED5 /* NativeFont+BoldItalic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NativeFont+BoldItalic.m"; sourceTree = ""; }; 4580C6CD1A15171B00790ED5 /* NSDictionary+DeepCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+DeepCopy.h"; sourceTree = ""; }; 4580C6CE1A15171B00790ED5 /* NSDictionary+DeepCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+DeepCopy.m"; sourceTree = ""; }; - 4580C6CF1A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+OpenXMLDictionaryParser.h"; sourceTree = ""; }; - 4580C6D01A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+OpenXMLDictionaryParser.m"; sourceTree = ""; }; 4580C6D11A15171B00790ED5 /* NSDictionary+OpenXmlString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+OpenXmlString.h"; sourceTree = ""; }; 4580C6D21A15171B00790ED5 /* NSDictionary+OpenXmlString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+OpenXmlString.m"; sourceTree = ""; }; 4580C6D61A15176A00790ED5 /* BRAOfficeDocumentPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BRAOfficeDocumentPackage.h; sourceTree = ""; }; 4580C6D71A15176A00790ED5 /* BRAOfficeDocumentPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BRAOfficeDocumentPackage.m; sourceTree = ""; }; 45B6E23A1A148F7500288A78 /* libXlsxReaderWriter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libXlsxReaderWriter.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 45B6E2451A148F7500288A78 /* XlsxReaderWriterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XlsxReaderWriterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 45B6E3091A1512DD00288A78 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 45B6E30B1A1512E700288A78 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 45D6FBCA1BB212A2002ACC9C /* BRAComments.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BRAComments.m; sourceTree = ""; }; 45D6FBCE1BB275F3002ACC9C /* BRARelatedToColumnAndRowProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRARelatedToColumnAndRowProtocol.h; sourceTree = ""; }; 45D6FBD01BB2777C002ACC9C /* BRAComments.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRAComments.h; sourceTree = ""; }; @@ -512,28 +631,59 @@ 45D6FBD31BB27833002ACC9C /* BRACalcChainCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BRACalcChainCell.m; sourceTree = ""; }; 45D6FBD61BB27970002ACC9C /* BRAComment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRAComment.h; sourceTree = ""; }; 45D6FBD71BB279A5002ACC9C /* BRAComment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BRAComment.m; sourceTree = ""; }; - 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ZipArchive.xcframework; path = Carthage/Build/ZipArchive.xcframework; sourceTree = ""; }; 6119EB6A26F4F5C7002A9B4A /* XlsxReaderWriter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XlsxReaderWriter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6119EB6C26F4F5C7002A9B4A /* XlsxReaderWriter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XlsxReaderWriter.h; sourceTree = ""; }; - 8201DE4926B5335C00ABA5EF /* testWorkbook2.xlsx */ = {isa = PBXFileReference; lastKnownFileType = file; path = testWorkbook2.xlsx; sourceTree = ""; }; + 61AF3A9F274F59C60099176F /* SSZipArchive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSZipArchive.m; sourceTree = ""; }; + 61AF3AA2274F59C60099176F /* SSZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipArchive.h; sourceTree = ""; }; + 61AF3AA3274F59C60099176F /* SSZipCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipCommon.h; sourceTree = ""; }; + 61AF3B25274F7BDE0099176F /* mz_strm_os_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_os_posix.c; sourceTree = ""; }; + 61AF3B26274F7BDE0099176F /* mz_strm_pkcrypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_pkcrypt.c; sourceTree = ""; }; + 61AF3B27274F7BDE0099176F /* mz_strm_wzaes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_wzaes.h; sourceTree = ""; }; + 61AF3B28274F7BDE0099176F /* mz_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_compat.h; sourceTree = ""; }; + 61AF3B29274F7BDE0099176F /* mz_strm_zlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_zlib.c; sourceTree = ""; }; + 61AF3B2A274F7BDE0099176F /* mz_zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_zip.c; sourceTree = ""; }; + 61AF3B2B274F7BDE0099176F /* mz_os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_os.h; sourceTree = ""; }; + 61AF3B2C274F7BDE0099176F /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + 61AF3B2D274F7BDE0099176F /* mz_zip_rw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_zip_rw.c; sourceTree = ""; }; + 61AF3B2E274F7BDE0099176F /* mz_strm_split.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_split.h; sourceTree = ""; }; + 61AF3B2F274F7BDE0099176F /* mz_strm_buf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_buf.h; sourceTree = ""; }; + 61AF3B30274F7BDE0099176F /* mz_crypt_apple.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_crypt_apple.c; sourceTree = ""; }; + 61AF3B31274F7BDE0099176F /* mz_strm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm.h; sourceTree = ""; }; + 61AF3B32274F7BDE0099176F /* mz_strm_mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_mem.c; sourceTree = ""; }; + 61AF3B33274F7BDE0099176F /* mz_crypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_crypt.c; sourceTree = ""; }; + 61AF3B34274F7BDE0099176F /* mz_strm_wzaes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_wzaes.c; sourceTree = ""; }; + 61AF3B35274F7BDE0099176F /* mz_strm_zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_zlib.h; sourceTree = ""; }; + 61AF3B36274F7BDE0099176F /* mz_compat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_compat.c; sourceTree = ""; }; + 61AF3B37274F7BDE0099176F /* mz_strm_pkcrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_pkcrypt.h; sourceTree = ""; }; + 61AF3B38274F7BDE0099176F /* mz_zip_rw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_zip_rw.h; sourceTree = ""; }; + 61AF3B39274F7BDE0099176F /* mz_os.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_os.c; sourceTree = ""; }; + 61AF3B3A274F7BDE0099176F /* mz_zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_zip.h; sourceTree = ""; }; + 61AF3B3B274F7BDE0099176F /* mz_os_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_os_posix.c; sourceTree = ""; }; + 61AF3B3C274F7BDE0099176F /* mz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz.h; sourceTree = ""; }; + 61AF3B3D274F7BDE0099176F /* mz_strm_buf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_buf.c; sourceTree = ""; }; + 61AF3B3E274F7BDE0099176F /* mz_strm_split.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm_split.c; sourceTree = ""; }; + 61AF3B3F274F7BDE0099176F /* mz_crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_crypt.h; sourceTree = ""; }; + 61AF3B40274F7BDE0099176F /* mz_strm_mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_mem.h; sourceTree = ""; }; + 61AF3B41274F7BDE0099176F /* mz_strm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mz_strm.c; sourceTree = ""; }; + 61AF3B42274F7BDE0099176F /* mz_strm_os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mz_strm_os.h; sourceTree = ""; }; + 61AF3BD0274F97C20099176F /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; + 61AF3BD1274F97CD0099176F /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; + 61AF3BD3274F98010099176F /* libcompression.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcompression.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/lib/libcompression.tbd; sourceTree = DEVELOPER_DIR; }; + 61AF3BDA274F99040099176F /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS8.0.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; + 61AF3BDC274F990B0099176F /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS8.0.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; + 61AF3BDE274F99120099176F /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS15.0.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; + 61AF3BE0274F99180099176F /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS15.0.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; 82168548255025160041F2FD /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 8265BC2F2041C4BE004A2A7D /* XlsxReaderXMLDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XlsxReaderXMLDictionary.h; sourceTree = ""; }; 8265BC302041C4BE004A2A7D /* XlsxReaderXMLDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XlsxReaderXMLDictionary.m; sourceTree = ""; }; 827A14DE26B7BC03008EB8C2 /* BRAHyperlink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BRAHyperlink.m; sourceTree = ""; }; 827A14E326B7BC1F008EB8C2 /* BRAHyperlink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BRAHyperlink.h; sourceTree = ""; }; - 827A14E726B7BCB6008EB8C2 /* google.xlsx */ = {isa = PBXFileReference; lastKnownFileType = file; path = google.xlsx; sourceTree = ""; }; 8289AA5C2041CD4A00E00603 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = SOURCE_ROOT; }; 8289AA5D2041D98C00E00603 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; 8289AA632041D9F900E00603 /* XlsxReaderWriter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XlsxReaderWriter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8289AAD620420FFC00E00603 /* XlsxReaderWriter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XlsxReaderWriter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8289AAD820420FFC00E00603 /* XlsxReaderWriter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XlsxReaderWriter.h; sourceTree = ""; }; 8289AAD920420FFC00E00603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 82C08A9026B5278700CD4AA1 /* BRAXlsxReaderWriterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BRAXlsxReaderWriterTests.m; path = Tests/XlsxReaderWriterTests/BRAXlsxReaderWriterTests.m; sourceTree = SOURCE_ROOT; }; - 82C08A9126B5278700CD4AA1 /* XlsxReaderWriterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = XlsxReaderWriterTests.swift; path = Tests/XlsxReaderWriterSwiftTests/XlsxReaderWriterTests.swift; sourceTree = SOURCE_ROOT; }; - 82C08A9226B5278700CD4AA1 /* XlsxReaderWriterTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "XlsxReaderWriterTests-Bridging-Header.h"; path = "Tests/XlsxReaderWriterTests/XlsxReaderWriterTests-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; - 82C08A9726B527C600CD4AA1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 82C08AA626B52D7500CD4AA1 /* photo-1415226481302-c40f24f4d45e.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "photo-1415226481302-c40f24f4d45e.jpeg"; sourceTree = ""; }; - 82C08AA726B52D7500CD4AA1 /* testWorkbook.xlsx */ = {isa = PBXFileReference; lastKnownFileType = file; path = testWorkbook.xlsx; sourceTree = ""; }; 82EBD88E26B7D75F00CFAA90 /* XlsxReaderWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XlsxReaderWriter.h; sourceTree = ""; }; 82EBD88F26B7D75F00CFAA90 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -543,18 +693,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6119EB6226F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 45B6E2421A148F7500288A78 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 45B6E30C1A1512E700288A78 /* CoreGraphics.framework in Frameworks */, - 45B6E30A1A1512DD00288A78 /* Foundation.framework in Frameworks */, - 6119EB6126F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */, - 45B6E2461A148F7500288A78 /* libXlsxReaderWriter.a in Frameworks */, + 61AF3BD9274F98F90099176F /* libiconv.tbd in Frameworks */, + 61AF3BD8274F98F30099176F /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -562,7 +702,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6119EB6026F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */, + 61AF3BD7274F98EB0099176F /* libiconv.tbd in Frameworks */, + 61AF3BD6274F98E40099176F /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -570,7 +711,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6119EB7126F4F608002A9B4A /* ZipArchive.xcframework in Frameworks */, + 61AF3BE1274F99180099176F /* libiconv.tbd in Frameworks */, + 61AF3BDF274F99120099176F /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -578,8 +720,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 61AF3BD5274F980E0099176F /* libiconv.tbd in Frameworks */, + 61AF3BD2274F97D90099176F /* libz.tbd in Frameworks */, 82168549255025160041F2FD /* UIKit.framework in Frameworks */, - 6119EB6326F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -587,7 +730,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6119EB6426F4F362002A9B4A /* ZipArchive.xcframework in Frameworks */, + 61AF3BDD274F990B0099176F /* libiconv.tbd in Frameworks */, + 61AF3BDB274F99040099176F /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -611,11 +755,9 @@ 455542A21C48DE4D00EAB8FE /* README.md */, 8289AA5D2041D98C00E00603 /* CHANGELOG.md */, 8287359926B5214B00C4DC60 /* Sources */, - 82C08A8D26B5273200CD4AA1 /* Tests */, 22156D591C46B42500BB5779 /* XlsxReaderWriter-Mac */, 8289AAD720420FFC00E00603 /* XlsxReaderWriter-WatchOS */, 82EBD88D26B7D75F00CFAA90 /* XlsxReaderWriter-iOS */, - 45B6E3081A15125300288A78 /* External Frameworks */, 6119EB6B26F4F5C7002A9B4A /* XlsxReaderWriter-tvos */, 45B6E23B1A148F7500288A78 /* Products */, 8289AAC12041E85800E00603 /* Frameworks */, @@ -626,7 +768,6 @@ isa = PBXGroup; children = ( 45B6E23A1A148F7500288A78 /* libXlsxReaderWriter.a */, - 45B6E2451A148F7500288A78 /* XlsxReaderWriterTests.xctest */, 22156D581C46B42500BB5779 /* XlsxReaderWriter.framework */, 8289AA632041D9F900E00603 /* XlsxReaderWriter.framework */, 8289AAD620420FFC00E00603 /* XlsxReaderWriter.framework */, @@ -638,22 +779,13 @@ 45B6E23C1A148F7500288A78 /* XlsxReaderWriter */ = { isa = PBXGroup; children = ( + 61AF3B24274F7BDE0099176F /* minizip */, 82C08A6726B524AD00CD4AA1 /* XlsxReaderWriter */, 82C08A9F26B52A7400CD4AA1 /* Implementation */, ); path = XlsxReaderWriter; sourceTree = ""; }; - 45B6E3081A15125300288A78 /* External Frameworks */ = { - isa = PBXGroup; - children = ( - 6119EB5F26F4F362002A9B4A /* ZipArchive.xcframework */, - 45B6E30B1A1512E700288A78 /* CoreGraphics.framework */, - 45B6E3091A1512DD00288A78 /* Foundation.framework */, - ); - name = "External Frameworks"; - sourceTree = ""; - }; 6119EB6B26F4F5C7002A9B4A /* XlsxReaderWriter-tvos */ = { isa = PBXGroup; children = ( @@ -662,14 +794,44 @@ path = "XlsxReaderWriter-tvos"; sourceTree = ""; }; - 8201DE4326B5317700ABA5EF /* XlsxReaderWriterTests */ = { + 61AF3B24274F7BDE0099176F /* minizip */ = { isa = PBXGroup; children = ( - 82C08AA526B52D7500CD4AA1 /* Resources */, - 82C08A9026B5278700CD4AA1 /* BRAXlsxReaderWriterTests.m */, - 82C08A9226B5278700CD4AA1 /* XlsxReaderWriterTests-Bridging-Header.h */, - ); - path = XlsxReaderWriterTests; + 61AF3AA2274F59C60099176F /* SSZipArchive.h */, + 61AF3AA3274F59C60099176F /* SSZipCommon.h */, + 61AF3A9F274F59C60099176F /* SSZipArchive.m */, + 61AF3B25274F7BDE0099176F /* mz_strm_os_posix.c */, + 61AF3B26274F7BDE0099176F /* mz_strm_pkcrypt.c */, + 61AF3B27274F7BDE0099176F /* mz_strm_wzaes.h */, + 61AF3B28274F7BDE0099176F /* mz_compat.h */, + 61AF3B29274F7BDE0099176F /* mz_strm_zlib.c */, + 61AF3B2A274F7BDE0099176F /* mz_zip.c */, + 61AF3B2B274F7BDE0099176F /* mz_os.h */, + 61AF3B2C274F7BDE0099176F /* LICENSE */, + 61AF3B2D274F7BDE0099176F /* mz_zip_rw.c */, + 61AF3B2E274F7BDE0099176F /* mz_strm_split.h */, + 61AF3B2F274F7BDE0099176F /* mz_strm_buf.h */, + 61AF3B30274F7BDE0099176F /* mz_crypt_apple.c */, + 61AF3B31274F7BDE0099176F /* mz_strm.h */, + 61AF3B32274F7BDE0099176F /* mz_strm_mem.c */, + 61AF3B33274F7BDE0099176F /* mz_crypt.c */, + 61AF3B34274F7BDE0099176F /* mz_strm_wzaes.c */, + 61AF3B35274F7BDE0099176F /* mz_strm_zlib.h */, + 61AF3B36274F7BDE0099176F /* mz_compat.c */, + 61AF3B37274F7BDE0099176F /* mz_strm_pkcrypt.h */, + 61AF3B38274F7BDE0099176F /* mz_zip_rw.h */, + 61AF3B39274F7BDE0099176F /* mz_os.c */, + 61AF3B3A274F7BDE0099176F /* mz_zip.h */, + 61AF3B3B274F7BDE0099176F /* mz_os_posix.c */, + 61AF3B3C274F7BDE0099176F /* mz.h */, + 61AF3B3D274F7BDE0099176F /* mz_strm_buf.c */, + 61AF3B3E274F7BDE0099176F /* mz_strm_split.c */, + 61AF3B3F274F7BDE0099176F /* mz_crypt.h */, + 61AF3B40274F7BDE0099176F /* mz_strm_mem.h */, + 61AF3B41274F7BDE0099176F /* mz_strm.c */, + 61AF3B42274F7BDE0099176F /* mz_strm_os.h */, + ); + path = minizip; sourceTree = ""; }; 827A14DD26B7BC03008EB8C2 /* Hyperlink */ = { @@ -691,6 +853,13 @@ 8289AAC12041E85800E00603 /* Frameworks */ = { isa = PBXGroup; children = ( + 61AF3BE0274F99180099176F /* libiconv.tbd */, + 61AF3BDE274F99120099176F /* libz.tbd */, + 61AF3BDC274F990B0099176F /* libiconv.tbd */, + 61AF3BDA274F99040099176F /* libz.tbd */, + 61AF3BD3274F98010099176F /* libcompression.tbd */, + 61AF3BD1274F97CD0099176F /* libiconv.tbd */, + 61AF3BD0274F97C20099176F /* libz.tbd */, 82168548255025160041F2FD /* UIKit.framework */, ); name = Frameworks; @@ -718,7 +887,6 @@ 4580C67E1A1515CB00790ED5 /* BRAOpenXmlSubElement.h */, 8265BC2F2041C4BE004A2A7D /* XlsxReaderXMLDictionary.h */, 4580C6CD1A15171B00790ED5 /* NSDictionary+DeepCopy.h */, - 4580C6CF1A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.h */, 4580C6D11A15171B00790ED5 /* NSDictionary+OpenXmlString.h */, 4580C6C41A15170900790ED5 /* NativeColor+HTML.h */, 4580C6C61A15170900790ED5 /* NativeColor+OpenXML.h */, @@ -770,7 +938,6 @@ children = ( 8265BC302041C4BE004A2A7D /* XlsxReaderXMLDictionary.m */, 4580C6CE1A15171B00790ED5 /* NSDictionary+DeepCopy.m */, - 4580C6D01A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m */, 4580C6D21A15171B00790ED5 /* NSDictionary+OpenXmlString.m */, ); path = NSDictionary; @@ -1058,16 +1225,6 @@ path = "Sub Elements"; sourceTree = ""; }; - 82C08A8D26B5273200CD4AA1 /* Tests */ = { - isa = PBXGroup; - children = ( - 82C08AA026B52C9800CD4AA1 /* XlsxReaderWriterSwiftTests */, - 82C08A9726B527C600CD4AA1 /* Info.plist */, - 8201DE4326B5317700ABA5EF /* XlsxReaderWriterTests */, - ); - path = Tests; - sourceTree = ""; - }; 82C08A9F26B52A7400CD4AA1 /* Implementation */ = { isa = PBXGroup; children = ( @@ -1077,26 +1234,6 @@ path = Implementation; sourceTree = ""; }; - 82C08AA026B52C9800CD4AA1 /* XlsxReaderWriterSwiftTests */ = { - isa = PBXGroup; - children = ( - 82C08A9126B5278700CD4AA1 /* XlsxReaderWriterTests.swift */, - ); - path = XlsxReaderWriterSwiftTests; - sourceTree = ""; - }; - 82C08AA526B52D7500CD4AA1 /* Resources */ = { - isa = PBXGroup; - children = ( - 827A14E726B7BCB6008EB8C2 /* google.xlsx */, - 8201DE4926B5335C00ABA5EF /* testWorkbook2.xlsx */, - 82C08AA626B52D7500CD4AA1 /* photo-1415226481302-c40f24f4d45e.jpeg */, - 82C08AA726B52D7500CD4AA1 /* testWorkbook.xlsx */, - ); - name = Resources; - path = Tests/XlsxReaderWriterTests/Resources; - sourceTree = SOURCE_ROOT; - }; 82EBD88D26B7D75F00CFAA90 /* XlsxReaderWriter-iOS */ = { isa = PBXGroup; children = ( @@ -1114,35 +1251,49 @@ buildActionMask = 2147483647; files = ( 22156D881C46B62900BB5779 /* NSDictionary+DeepCopy.h in Headers */, - 22156D891C46B62900BB5779 /* NSDictionary+OpenXMLDictionaryParser.h in Headers */, + 61AF3BAB274F7BDE0099176F /* mz.h in Headers */, 22156D8A1C46B62900BB5779 /* NSDictionary+OpenXmlString.h in Headers */, + 61AF3AB1274F59C60099176F /* SSZipCommon.h in Headers */, 22156D8B1C46B62900BB5779 /* NativeFont+BoldItalic.h in Headers */, 22156D8C1C46B62900BB5779 /* NativeColor+HTML.h in Headers */, 22156D8D1C46B62900BB5779 /* NativeColor+OpenXML.h in Headers */, 22156D8E1C46B62900BB5779 /* XlsxReaderWriter-swift-bridge.h in Headers */, 22156D8F1C46B62900BB5779 /* BRAOfficeDocumentPackage.h in Headers */, + 61AF3B79274F7BDE0099176F /* mz_strm.h in Headers */, 22156D901C46B62900BB5779 /* BRACalcChainCell.h in Headers */, 22156D911C46B62900BB5779 /* BRACalcChain.h in Headers */, 22156D921C46B62900BB5779 /* BRAComment.h in Headers */, 22156D931C46B62900BB5779 /* BRAComments.h in Headers */, + 61AF3BB9274F7BDE0099176F /* mz_crypt.h in Headers */, 22156D941C46B62900BB5779 /* BRAContentTypesOverride.h in Headers */, + 61AF3BC6274F7BDE0099176F /* mz_strm_os.h in Headers */, 22156D951C46B62900BB5779 /* BRAContentTypesDefaultExtension.h in Headers */, 22156D961C46B62900BB5779 /* BRAContentTypes.h in Headers */, 22156D971C46B62A00BB5779 /* BRAWorksheetDrawing.h in Headers */, 22156D981C46B62A00BB5779 /* BRADrawing.h in Headers */, 22156D991C46B62A00BB5779 /* BRAImage.h in Headers */, + 61AF3B4D274F7BDE0099176F /* mz_strm_wzaes.h in Headers */, + 61AF3B8C274F7BDE0099176F /* mz_strm_zlib.h in Headers */, + 61AF3BA2274F7BDE0099176F /* mz_zip.h in Headers */, 22156D9A1C46B62A00BB5779 /* BRASharedString.h in Headers */, 22156D9B1C46B62A00BB5779 /* BRASharedStrings.h in Headers */, + 61AF3B5F274F7BDE0099176F /* mz_os.h in Headers */, 22156D9C1C46B62A00BB5779 /* BRACellFormat.h in Headers */, 22156D9D1C46B62A00BB5779 /* BRANumberFormat.h in Headers */, + 61AF3B95274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */, 22156D9E1C46B62A00BB5779 /* BRACellFill.h in Headers */, + 61AF3B70274F7BDE0099176F /* mz_strm_buf.h in Headers */, + 61AF3B51274F7BDE0099176F /* mz_compat.h in Headers */, + 61AF3BBD274F7BDE0099176F /* mz_strm_mem.h in Headers */, 22156D9F1C46B62A00BB5779 /* BRAStyles.h in Headers */, 22156DA01C46B62A00BB5779 /* BRATheme.h in Headers */, 22156DA11C46B62A00BB5779 /* BRAVmlDrawing.h in Headers */, + 61AF3AAD274F59C60099176F /* SSZipArchive.h in Headers */, 22156DA21C46B62A00BB5779 /* BRASheet.h in Headers */, 22156DA31C46B62A00BB5779 /* BRAOfficeDocument.h in Headers */, 22156DA41C46B62B00BB5779 /* BRACell.h in Headers */, 22156DA51C46B62B00BB5779 /* BRARow.h in Headers */, + 61AF3B6C274F7BDE0099176F /* mz_strm_split.h in Headers */, 22156DA61C46B62B00BB5779 /* BRAColumn.h in Headers */, 22156DA71C46B62B00BB5779 /* BRAMergeCell.h in Headers */, 22156DA81C46B62B00BB5779 /* BRACellRange.h in Headers */, @@ -1156,6 +1307,7 @@ 455542A71C492C6A00EAB8FE /* BRAPlatformSpecificDefines.h in Headers */, 22156DAE1C46B62C00BB5779 /* BRARelationship.h in Headers */, 22156DAF1C46B62C00BB5779 /* BRARelationships.h in Headers */, + 61AF3B99274F7BDE0099176F /* mz_zip_rw.h in Headers */, 8265BC312041C4BE004A2A7D /* XlsxReaderXMLDictionary.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1165,35 +1317,49 @@ buildActionMask = 2147483647; files = ( 6119EB6D26F4F5C7002A9B4A /* XlsxReaderWriter.h in Headers */, + 61AF3BAE274F7BDE0099176F /* mz.h in Headers */, 6119EBC726F4F68A002A9B4A /* NativeFont+BoldItalic.h in Headers */, 6119EBC826F4F68A002A9B4A /* BRARelationship.h in Headers */, + 61AF3AB4274F59C60099176F /* SSZipCommon.h in Headers */, 6119EBC926F4F68A002A9B4A /* BRAPlatformSpecificDefines.h in Headers */, 6119EBCA26F4F68A002A9B4A /* BRARelationships.h in Headers */, 6119EBCB26F4F68A002A9B4A /* BRAElementWithRelationships.h in Headers */, 6119EBCC26F4F68A002A9B4A /* BRAOpenXmlElement.h in Headers */, + 61AF3B7C274F7BDE0099176F /* mz_strm.h in Headers */, 6119EBCD26F4F68A002A9B4A /* BRARelatedToColumnAndRowProtocol.h in Headers */, 6119EBCE26F4F68A002A9B4A /* BRAOpenXmlSubElement.h in Headers */, 6119EBCF26F4F68A002A9B4A /* XlsxReaderXMLDictionary.h in Headers */, 6119EBD026F4F68A002A9B4A /* NSDictionary+DeepCopy.h in Headers */, - 6119EBD126F4F68A002A9B4A /* NSDictionary+OpenXMLDictionaryParser.h in Headers */, + 61AF3BBC274F7BDE0099176F /* mz_crypt.h in Headers */, 6119EBD226F4F68B002A9B4A /* NSDictionary+OpenXmlString.h in Headers */, + 61AF3BC9274F7BDE0099176F /* mz_strm_os.h in Headers */, 6119EBD326F4F68B002A9B4A /* NativeColor+HTML.h in Headers */, 6119EBD426F4F68B002A9B4A /* NativeColor+OpenXML.h in Headers */, 6119EBD526F4F68B002A9B4A /* BRAOfficeDocumentPackage.h in Headers */, 6119EBD626F4F68B002A9B4A /* BRACalcChain.h in Headers */, 6119EBD726F4F68B002A9B4A /* BRACalcChainCell.h in Headers */, + 61AF3B50274F7BDE0099176F /* mz_strm_wzaes.h in Headers */, + 61AF3B8F274F7BDE0099176F /* mz_strm_zlib.h in Headers */, + 61AF3BA5274F7BDE0099176F /* mz_zip.h in Headers */, 6119EBD826F4F68B002A9B4A /* BRAComments.h in Headers */, 6119EBD926F4F68B002A9B4A /* BRAComment.h in Headers */, + 61AF3B62274F7BDE0099176F /* mz_os.h in Headers */, 6119EBDA26F4F68B002A9B4A /* BRAContentTypes.h in Headers */, 6119EBDB26F4F68B002A9B4A /* BRAContentTypesOverride.h in Headers */, + 61AF3B98274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */, 6119EBDC26F4F68B002A9B4A /* BRAContentTypesDefaultExtension.h in Headers */, + 61AF3B73274F7BDE0099176F /* mz_strm_buf.h in Headers */, + 61AF3B54274F7BDE0099176F /* mz_compat.h in Headers */, + 61AF3BC0274F7BDE0099176F /* mz_strm_mem.h in Headers */, 6119EBDD26F4F68B002A9B4A /* BRADrawing.h in Headers */, 6119EBDE26F4F68B002A9B4A /* BRAWorksheetDrawing.h in Headers */, 6119EBDF26F4F68B002A9B4A /* BRAImage.h in Headers */, + 61AF3AB0274F59C60099176F /* SSZipArchive.h in Headers */, 6119EBE026F4F68B002A9B4A /* BRASharedStrings.h in Headers */, 6119EBE126F4F68B002A9B4A /* BRASharedString.h in Headers */, 6119EBE226F4F68B002A9B4A /* BRAStyles.h in Headers */, 6119EBE326F4F68B002A9B4A /* BRACellFormat.h in Headers */, + 61AF3B6F274F7BDE0099176F /* mz_strm_split.h in Headers */, 6119EBE426F4F68B002A9B4A /* BRANumberFormat.h in Headers */, 6119EBE526F4F68B002A9B4A /* BRACellFill.h in Headers */, 6119EBE626F4F68B002A9B4A /* BRATheme.h in Headers */, @@ -1207,6 +1373,7 @@ 6119EBEE26F4F68C002A9B4A /* BRAMergeCell.h in Headers */, 6119EBEF26F4F68C002A9B4A /* BRACellRange.h in Headers */, 6119EBF026F4F68C002A9B4A /* BRAHyperlink.h in Headers */, + 61AF3B9C274F7BDE0099176F /* mz_zip_rw.h in Headers */, 6119EBF126F4F68C002A9B4A /* XlsxReaderWriter-swift-bridge.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1216,35 +1383,49 @@ buildActionMask = 2147483647; files = ( 8289AA942041DA8D00E00603 /* NSDictionary+DeepCopy.h in Headers */, - 8289AA952041DA8D00E00603 /* NSDictionary+OpenXMLDictionaryParser.h in Headers */, + 61AF3BAC274F7BDE0099176F /* mz.h in Headers */, 8289AA962041DA8D00E00603 /* NSDictionary+OpenXmlString.h in Headers */, + 61AF3AB2274F59C60099176F /* SSZipCommon.h in Headers */, 8289AA972041DA8D00E00603 /* NativeFont+BoldItalic.h in Headers */, 8289AA982041DA8D00E00603 /* NativeColor+HTML.h in Headers */, 8289AA992041DA8D00E00603 /* NativeColor+OpenXML.h in Headers */, 8289AA9A2041DA8D00E00603 /* XlsxReaderWriter-swift-bridge.h in Headers */, 8289AA9B2041DA8D00E00603 /* BRAOfficeDocumentPackage.h in Headers */, + 61AF3B7A274F7BDE0099176F /* mz_strm.h in Headers */, 8289AA9C2041DA8D00E00603 /* BRACalcChainCell.h in Headers */, 8289AA9D2041DA8D00E00603 /* BRACalcChain.h in Headers */, 8289AA9E2041DA8D00E00603 /* BRAComment.h in Headers */, 8289AA9F2041DA8D00E00603 /* BRAComments.h in Headers */, + 61AF3BBA274F7BDE0099176F /* mz_crypt.h in Headers */, 8289AAA02041DA8D00E00603 /* BRAContentTypesOverride.h in Headers */, + 61AF3BC7274F7BDE0099176F /* mz_strm_os.h in Headers */, 8289AAA12041DA8D00E00603 /* BRAContentTypesDefaultExtension.h in Headers */, 8289AAA22041DA8D00E00603 /* BRAContentTypes.h in Headers */, 8289AAA32041DA8D00E00603 /* BRAWorksheetDrawing.h in Headers */, 8289AAA42041DA8D00E00603 /* BRADrawing.h in Headers */, 8289AAA52041DA8D00E00603 /* BRAImage.h in Headers */, + 61AF3B4E274F7BDE0099176F /* mz_strm_wzaes.h in Headers */, + 61AF3B8D274F7BDE0099176F /* mz_strm_zlib.h in Headers */, + 61AF3BA3274F7BDE0099176F /* mz_zip.h in Headers */, 8289AAA62041DA8D00E00603 /* BRASharedString.h in Headers */, 8289AAA72041DA8D00E00603 /* BRASharedStrings.h in Headers */, + 61AF3B60274F7BDE0099176F /* mz_os.h in Headers */, 8289AAA82041DA8D00E00603 /* BRACellFormat.h in Headers */, 8289AAA92041DA8D00E00603 /* BRANumberFormat.h in Headers */, + 61AF3B96274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */, 8289AAAA2041DA8D00E00603 /* BRACellFill.h in Headers */, + 61AF3B71274F7BDE0099176F /* mz_strm_buf.h in Headers */, + 61AF3B52274F7BDE0099176F /* mz_compat.h in Headers */, + 61AF3BBE274F7BDE0099176F /* mz_strm_mem.h in Headers */, 8289AAAB2041DA8D00E00603 /* BRAStyles.h in Headers */, 8289AAAC2041DA8D00E00603 /* BRATheme.h in Headers */, 8289AAAD2041DA8D00E00603 /* BRAVmlDrawing.h in Headers */, + 61AF3AAE274F59C60099176F /* SSZipArchive.h in Headers */, 8289AAAE2041DA8D00E00603 /* BRASheet.h in Headers */, 8289AAAF2041DA8D00E00603 /* BRAOfficeDocument.h in Headers */, 8289AAB02041DA8D00E00603 /* BRACell.h in Headers */, 8289AAB12041DA8D00E00603 /* BRARow.h in Headers */, + 61AF3B6D274F7BDE0099176F /* mz_strm_split.h in Headers */, 8289AAB22041DA8D00E00603 /* BRAColumn.h in Headers */, 82EBD89026B7D75F00CFAA90 /* XlsxReaderWriter.h in Headers */, 8289AAB32041DA8D00E00603 /* BRAMergeCell.h in Headers */, @@ -1258,6 +1439,7 @@ 8289AABA2041DA8E00E00603 /* BRARelationship.h in Headers */, 8289AABB2041DA8E00E00603 /* BRARelationships.h in Headers */, 8289AA922041DA8D00E00603 /* BRAPlatformSpecificDefines.h in Headers */, + 61AF3B9A274F7BDE0099176F /* mz_zip_rw.h in Headers */, 8289AA932041DA8D00E00603 /* XlsxReaderXMLDictionary.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1267,35 +1449,49 @@ buildActionMask = 2147483647; files = ( 8289AADA20420FFC00E00603 /* XlsxReaderWriter.h in Headers */, + 61AF3BAD274F7BDE0099176F /* mz.h in Headers */, 8289AADE2042117B00E00603 /* BRAPlatformSpecificDefines.h in Headers */, 8289AAE02042117B00E00603 /* NSDictionary+DeepCopy.h in Headers */, - 8289AAE12042117B00E00603 /* NSDictionary+OpenXMLDictionaryParser.h in Headers */, + 61AF3AB3274F59C60099176F /* SSZipCommon.h in Headers */, 8289AAE22042117B00E00603 /* NSDictionary+OpenXmlString.h in Headers */, 8289AAE32042117B00E00603 /* NativeFont+BoldItalic.h in Headers */, 8289AAE42042117B00E00603 /* NativeColor+HTML.h in Headers */, 8289AAE52042117B00E00603 /* NativeColor+OpenXML.h in Headers */, + 61AF3B7B274F7BDE0099176F /* mz_strm.h in Headers */, 8289AAE62042117B00E00603 /* XlsxReaderWriter-swift-bridge.h in Headers */, 8289AAE72042117B00E00603 /* BRAOfficeDocumentPackage.h in Headers */, 8289AAE82042117B00E00603 /* BRACalcChainCell.h in Headers */, 8289AAE92042117B00E00603 /* BRACalcChain.h in Headers */, + 61AF3BBB274F7BDE0099176F /* mz_crypt.h in Headers */, 8289AAEA2042117B00E00603 /* BRAComment.h in Headers */, + 61AF3BC8274F7BDE0099176F /* mz_strm_os.h in Headers */, 8289AAEB2042117B00E00603 /* BRAComments.h in Headers */, 8289AAEC2042117B00E00603 /* BRAContentTypesOverride.h in Headers */, 8289AAED2042117B00E00603 /* BRAContentTypesDefaultExtension.h in Headers */, 827A14E626B7BC1F008EB8C2 /* BRAHyperlink.h in Headers */, 8289AAEE2042117B00E00603 /* BRAContentTypes.h in Headers */, + 61AF3B4F274F7BDE0099176F /* mz_strm_wzaes.h in Headers */, + 61AF3B8E274F7BDE0099176F /* mz_strm_zlib.h in Headers */, + 61AF3BA4274F7BDE0099176F /* mz_zip.h in Headers */, 8289AAEF2042117B00E00603 /* BRAWorksheetDrawing.h in Headers */, 8289AAF02042117B00E00603 /* BRADrawing.h in Headers */, + 61AF3B61274F7BDE0099176F /* mz_os.h in Headers */, 8289AAF12042117B00E00603 /* BRAImage.h in Headers */, 8289AAF22042117B00E00603 /* BRASharedString.h in Headers */, + 61AF3B97274F7BDE0099176F /* mz_strm_pkcrypt.h in Headers */, 8289AAF32042117B00E00603 /* BRASharedStrings.h in Headers */, + 61AF3B72274F7BDE0099176F /* mz_strm_buf.h in Headers */, + 61AF3B53274F7BDE0099176F /* mz_compat.h in Headers */, + 61AF3BBF274F7BDE0099176F /* mz_strm_mem.h in Headers */, 8289AAF42042117B00E00603 /* BRACellFormat.h in Headers */, 8289AAF52042117B00E00603 /* BRANumberFormat.h in Headers */, 8289AAF62042117B00E00603 /* BRACellFill.h in Headers */, + 61AF3AAF274F59C60099176F /* SSZipArchive.h in Headers */, 8289AAF72042117B00E00603 /* BRAStyles.h in Headers */, 8289AAF82042117B00E00603 /* BRATheme.h in Headers */, 8289AAF92042117B00E00603 /* BRAVmlDrawing.h in Headers */, 8289AAFA2042117B00E00603 /* BRASheet.h in Headers */, + 61AF3B6E274F7BDE0099176F /* mz_strm_split.h in Headers */, 8289AAFB2042117B00E00603 /* BRAOfficeDocument.h in Headers */, 8289AAFC2042117B00E00603 /* BRACell.h in Headers */, 8289AAFD2042117B00E00603 /* BRARow.h in Headers */, @@ -1309,6 +1505,7 @@ 8289AB052042117B00E00603 /* BRAElementWithRelationships.h in Headers */, 8289AB062042117B00E00603 /* BRARelationship.h in Headers */, 8289AB072042117B00E00603 /* BRARelationships.h in Headers */, + 61AF3B9B274F7BDE0099176F /* mz_zip_rw.h in Headers */, 8289AADF2042117B00E00603 /* XlsxReaderXMLDictionary.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1351,24 +1548,6 @@ productReference = 45B6E23A1A148F7500288A78 /* libXlsxReaderWriter.a */; productType = "com.apple.product-type.library.static"; }; - 45B6E2441A148F7500288A78 /* XlsxReaderWriterTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 45B6E2511A148F7500288A78 /* Build configuration list for PBXNativeTarget "XlsxReaderWriterTests" */; - buildPhases = ( - 45B6E2411A148F7500288A78 /* Sources */, - 45B6E2421A148F7500288A78 /* Frameworks */, - 45B6E2431A148F7500288A78 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 45B6E2481A148F7500288A78 /* PBXTargetDependency */, - ); - name = XlsxReaderWriterTests; - productName = XlsxReaderWriterTests; - productReference = 45B6E2451A148F7500288A78 /* XlsxReaderWriterTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 6119EB6926F4F5C7002A9B4A /* XlsxReaderWriter-tvos */ = { isa = PBXNativeTarget; buildConfigurationList = 6119EB6E26F4F5C7002A9B4A /* Build configuration list for PBXNativeTarget "XlsxReaderWriter-tvos" */; @@ -1430,7 +1609,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1200; + LastUpgradeCheck = 1310; ORGANIZATIONNAME = BRAE; TargetAttributes = { 22156D571C46B42500BB5779 = { @@ -1439,12 +1618,9 @@ 45B6E2391A148F7500288A78 = { CreatedOnToolsVersion = 6.1; }; - 45B6E2441A148F7500288A78 = { - CreatedOnToolsVersion = 6.1; - LastSwiftMigration = 1120; - }; 6119EB6926F4F5C7002A9B4A = { CreatedOnToolsVersion = 13.0; + ProvisioningStyle = Automatic; }; 8289AA622041D9F900E00603 = { CreatedOnToolsVersion = 9.2; @@ -1470,7 +1646,6 @@ projectRoot = ""; targets = ( 45B6E2391A148F7500288A78 /* XlsxReaderWriter */, - 45B6E2441A148F7500288A78 /* XlsxReaderWriterTests */, 22156D571C46B42500BB5779 /* XlsxReaderWriter-Mac */, 8289AA622041D9F900E00603 /* XlsxReaderWriter-iOS */, 8289AAD520420FFC00E00603 /* XlsxReaderWriter-WatchOS */, @@ -1484,17 +1659,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 45B6E2431A148F7500288A78 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8201DE4A26B5336B00ABA5EF /* testWorkbook2.xlsx in Resources */, - 827A14E826B7BCB6008EB8C2 /* google.xlsx in Resources */, - 82C08AA926B52D7500CD4AA1 /* testWorkbook.xlsx in Resources */, - 82C08AA826B52D7500CD4AA1 /* photo-1415226481302-c40f24f4d45e.jpeg in Resources */, + 61AF3B63274F7BDE0099176F /* LICENSE in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1502,6 +1667,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 61AF3B66274F7BDE0099176F /* LICENSE in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1509,6 +1675,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 61AF3B64274F7BDE0099176F /* LICENSE in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1516,6 +1683,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 61AF3B65274F7BDE0099176F /* LICENSE in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1527,20 +1695,31 @@ buildActionMask = 2147483647; files = ( 22156D611C46B5DB00BB5779 /* NSDictionary+DeepCopy.m in Sources */, - 22156D621C46B5DB00BB5779 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */, 22156D631C46B5DB00BB5779 /* NSDictionary+OpenXmlString.m in Sources */, + 61AF3B88274F7BDE0099176F /* mz_strm_wzaes.c in Sources */, 22156D641C46B5DB00BB5779 /* NativeColor+HTML.m in Sources */, + 61AF3B91274F7BDE0099176F /* mz_compat.c in Sources */, 22156D651C46B5DB00BB5779 /* NativeColor+OpenXML.m in Sources */, 22156D661C46B5DB00BB5779 /* BRAOfficeDocumentPackage.m in Sources */, + 61AF3B44274F7BDE0099176F /* mz_strm_os_posix.c in Sources */, + 61AF3AA5274F59C60099176F /* SSZipArchive.m in Sources */, + 61AF3BB5274F7BDE0099176F /* mz_strm_split.c in Sources */, + 61AF3B9E274F7BDE0099176F /* mz_os.c in Sources */, + 61AF3B56274F7BDE0099176F /* mz_strm_zlib.c in Sources */, 22156D671C46B5DB00BB5779 /* BRACalcChainCell.m in Sources */, 22156D681C46B5DC00BB5779 /* BRACalcChain.m in Sources */, 22156D691C46B5DC00BB5779 /* BRAComment.m in Sources */, + 61AF3B49274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */, 22156D6A1C46B5DC00BB5779 /* BRAComments.m in Sources */, + 61AF3BB0274F7BDE0099176F /* mz_strm_buf.c in Sources */, + 61AF3B68274F7BDE0099176F /* mz_zip_rw.c in Sources */, 22156D6B1C46B5DC00BB5779 /* BRAContentTypesOverride.m in Sources */, 22156D6C1C46B5DC00BB5779 /* BRAContentTypesDefaultExtension.m in Sources */, + 61AF3BC2274F7BDE0099176F /* mz_strm.c in Sources */, 22156D6D1C46B5DC00BB5779 /* BRAContentTypes.m in Sources */, 22156D6E1C46B5DC00BB5779 /* BRAWorksheetDrawing.m in Sources */, 22156D6F1C46B5DC00BB5779 /* BRADrawing.m in Sources */, + 61AF3B83274F7BDE0099176F /* mz_crypt.c in Sources */, 22156D701C46B5DC00BB5779 /* BRAImage.m in Sources */, 22156D711C46B5DC00BB5779 /* BRASharedString.m in Sources */, 22156D721C46B5DC00BB5779 /* BRASharedStrings.m in Sources */, @@ -1550,6 +1729,7 @@ 827A14E026B7BC03008EB8C2 /* BRAHyperlink.m in Sources */, 22156D761C46B5DC00BB5779 /* BRAStyles.m in Sources */, 22156D771C46B5DC00BB5779 /* BRATheme.m in Sources */, + 61AF3B75274F7BDE0099176F /* mz_crypt_apple.c in Sources */, 22156D781C46B5DC00BB5779 /* BRAVmlDrawing.m in Sources */, 22156D791C46B5DC00BB5779 /* BRASheet.m in Sources */, 22156D7A1C46B5DC00BB5779 /* BRAOfficeDocument.m in Sources */, @@ -1557,7 +1737,10 @@ 22156D7B1C46B5DC00BB5779 /* BRACell.m in Sources */, 22156D7C1C46B5DC00BB5779 /* BRARow.m in Sources */, 22156D7D1C46B5DC00BB5779 /* BRAColumn.m in Sources */, + 61AF3BA7274F7BDE0099176F /* mz_os_posix.c in Sources */, + 61AF3B5B274F7BDE0099176F /* mz_zip.c in Sources */, 22156D7E1C46B5DC00BB5779 /* BRAMergeCell.m in Sources */, + 61AF3B7E274F7BDE0099176F /* mz_strm_mem.c in Sources */, 22156D7F1C46B5DC00BB5779 /* BRACellRange.m in Sources */, 22156D801C46B5DC00BB5779 /* BRAWorksheet.m in Sources */, 22156D811C46B5DC00BB5779 /* BRAOpenXmlSubElement.m in Sources */, @@ -1575,18 +1758,30 @@ files = ( 4580C6801A1515CB00790ED5 /* BRAOpenXmlElement.m in Sources */, 4580C6D31A15171B00790ED5 /* NSDictionary+DeepCopy.m in Sources */, + 61AF3B87274F7BDE0099176F /* mz_strm_wzaes.c in Sources */, 4580C6BD1A1516E200790ED5 /* BRAContentTypesDefaultExtension.m in Sources */, + 61AF3B90274F7BDE0099176F /* mz_compat.c in Sources */, 4580C6D51A15171B00790ED5 /* NSDictionary+OpenXmlString.m in Sources */, 4580C6C91A15170900790ED5 /* NativeColor+OpenXML.m in Sources */, + 61AF3B43274F7BDE0099176F /* mz_strm_os_posix.c in Sources */, 4580C6CC1A15171100790ED5 /* NativeFont+BoldItalic.m in Sources */, + 61AF3BB4274F7BDE0099176F /* mz_strm_split.c in Sources */, + 61AF3B9D274F7BDE0099176F /* mz_os.c in Sources */, + 61AF3B55274F7BDE0099176F /* mz_strm_zlib.c in Sources */, + 61AF3AA4274F59C60099176F /* SSZipArchive.m in Sources */, 4580C68D1A15160C00790ED5 /* BRACalcChain.m in Sources */, 4580C6A81A15168A00790ED5 /* BRANumberFormat.m in Sources */, + 61AF3B48274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */, 4580C6931A15162D00790ED5 /* BRACellRange.m in Sources */, + 61AF3BAF274F7BDE0099176F /* mz_strm_buf.c in Sources */, + 61AF3B67274F7BDE0099176F /* mz_zip_rw.c in Sources */, 4580C6BA1A1516D000790ED5 /* BRAContentTypes.m in Sources */, 4580C6781A15157100790ED5 /* BRARelationships.m in Sources */, + 61AF3BC1274F7BDE0099176F /* mz_strm.c in Sources */, 4580C69F1A15165D00790ED5 /* BRACell.m in Sources */, 4580C6B41A1516B900790ED5 /* BRASheet.m in Sources */, 4580C6841A1515E100790ED5 /* BRAImage.m in Sources */, + 61AF3B82274F7BDE0099176F /* mz_crypt.c in Sources */, 4580C6991A15164600790ED5 /* BRAColumn.m in Sources */, 4580C6B11A1516A500790ED5 /* BRASharedStrings.m in Sources */, 4580C6A51A15167D00790ED5 /* BRACellFormat.m in Sources */, @@ -1596,6 +1791,7 @@ 4580C6B71A1516BF00790ED5 /* BRAOfficeDocument.m in Sources */, 827A14DF26B7BC03008EB8C2 /* BRAHyperlink.m in Sources */, 454D49FD1B4B27E40053CD86 /* BRATheme.m in Sources */, + 61AF3B74274F7BDE0099176F /* mz_crypt_apple.c in Sources */, 4580C69C1A15165100790ED5 /* BRARow.m in Sources */, 455C23B61BB908D300CEE3A2 /* BRAVmlDrawing.m in Sources */, 45D6FBD81BB279A5002ACC9C /* BRAComment.m in Sources */, @@ -1603,8 +1799,10 @@ 8265BC322041C4BE004A2A7D /* XlsxReaderXMLDictionary.m in Sources */, 4580C6811A1515CB00790ED5 /* BRAOpenXmlSubElement.m in Sources */, 45D6FBCF1BB27747002ACC9C /* BRAComments.m in Sources */, - 4580C6D41A15171B00790ED5 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */, + 61AF3BA6274F7BDE0099176F /* mz_os_posix.c in Sources */, + 61AF3B5A274F7BDE0099176F /* mz_zip.c in Sources */, 4580C68A1A1515F700790ED5 /* BRAWorksheetDrawing.m in Sources */, + 61AF3B7D274F7BDE0099176F /* mz_strm_mem.c in Sources */, 4580C6B01A1516A500790ED5 /* BRASharedString.m in Sources */, 4580C6D81A15176A00790ED5 /* BRAOfficeDocumentPackage.m in Sources */, 4580C6C01A1516EA00790ED5 /* BRAContentTypesOverride.m in Sources */, @@ -1616,33 +1814,36 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 45B6E2411A148F7500288A78 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 82C08A9626B5278700CD4AA1 /* XlsxReaderWriterTests.swift in Sources */, - 82C08A9526B5278700CD4AA1 /* BRAXlsxReaderWriterTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 6119EB6626F4F5C7002A9B4A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 6119EB9F26F4F662002A9B4A /* BRARelationships.m in Sources */, 6119EBA026F4F662002A9B4A /* BRARelationship.m in Sources */, + 61AF3B8B274F7BDE0099176F /* mz_strm_wzaes.c in Sources */, 6119EBA126F4F662002A9B4A /* BRAElementWithRelationships.m in Sources */, + 61AF3B94274F7BDE0099176F /* mz_compat.c in Sources */, 6119EBA226F4F662002A9B4A /* BRAOpenXmlElement.m in Sources */, 6119EBA326F4F662002A9B4A /* BRAOpenXmlSubElement.m in Sources */, + 61AF3B47274F7BDE0099176F /* mz_strm_os_posix.c in Sources */, 6119EBA426F4F662002A9B4A /* BRAOfficeDocumentPackage.m in Sources */, + 61AF3BB8274F7BDE0099176F /* mz_strm_split.c in Sources */, + 61AF3BA1274F7BDE0099176F /* mz_os.c in Sources */, + 61AF3B59274F7BDE0099176F /* mz_strm_zlib.c in Sources */, + 61AF3AA8274F59C60099176F /* SSZipArchive.m in Sources */, 6119EBA526F4F662002A9B4A /* BRACalcChain.m in Sources */, 6119EBA626F4F662002A9B4A /* BRACalcChainCell.m in Sources */, + 61AF3B4C274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */, 6119EBA726F4F662002A9B4A /* BRAComments.m in Sources */, + 61AF3BB3274F7BDE0099176F /* mz_strm_buf.c in Sources */, + 61AF3B6B274F7BDE0099176F /* mz_zip_rw.c in Sources */, 6119EBA826F4F662002A9B4A /* BRAComment.m in Sources */, 6119EBA926F4F662002A9B4A /* BRAContentTypes.m in Sources */, + 61AF3BC5274F7BDE0099176F /* mz_strm.c in Sources */, 6119EBAA26F4F662002A9B4A /* BRAContentTypesOverride.m in Sources */, 6119EBAB26F4F662002A9B4A /* BRAContentTypesDefaultExtension.m in Sources */, 6119EBAC26F4F662002A9B4A /* BRADrawing.m in Sources */, + 61AF3B86274F7BDE0099176F /* mz_crypt.c in Sources */, 6119EBAD26F4F662002A9B4A /* BRAWorksheetDrawing.m in Sources */, 6119EBAE26F4F662002A9B4A /* BRAHyperlink.m in Sources */, 6119EBAF26F4F662002A9B4A /* BRAImage.m in Sources */, @@ -1652,6 +1853,7 @@ 6119EBB326F4F662002A9B4A /* BRACellFormat.m in Sources */, 6119EBB426F4F662002A9B4A /* BRANumberFormat.m in Sources */, 6119EBB526F4F662002A9B4A /* BRACellFill.m in Sources */, + 61AF3B78274F7BDE0099176F /* mz_crypt_apple.c in Sources */, 6119EBB626F4F662002A9B4A /* BRATheme.m in Sources */, 6119EBB726F4F662002A9B4A /* BRAVmlDrawing.m in Sources */, 6119EBB826F4F662002A9B4A /* BRAOfficeDocument.m in Sources */, @@ -1659,12 +1861,14 @@ 6119EBBA26F4F662002A9B4A /* BRAWorksheet.m in Sources */, 6119EBBB26F4F662002A9B4A /* BRACell.m in Sources */, 6119EBBC26F4F662002A9B4A /* BRARow.m in Sources */, + 61AF3BAA274F7BDE0099176F /* mz_os_posix.c in Sources */, + 61AF3B5E274F7BDE0099176F /* mz_zip.c in Sources */, 6119EBBD26F4F662002A9B4A /* BRAColumn.m in Sources */, + 61AF3B81274F7BDE0099176F /* mz_strm_mem.c in Sources */, 6119EBBE26F4F662002A9B4A /* BRAMergeCell.m in Sources */, 6119EBBF26F4F662002A9B4A /* BRACellRange.m in Sources */, 6119EBC026F4F662002A9B4A /* XlsxReaderXMLDictionary.m in Sources */, 6119EBC126F4F662002A9B4A /* NSDictionary+DeepCopy.m in Sources */, - 6119EBC226F4F662002A9B4A /* NSDictionary+OpenXMLDictionaryParser.m in Sources */, 6119EBC326F4F662002A9B4A /* NSDictionary+OpenXmlString.m in Sources */, 6119EBC426F4F662002A9B4A /* NativeFont+BoldItalic.m in Sources */, 6119EBC526F4F662002A9B4A /* NativeColor+HTML.m in Sources */, @@ -1678,19 +1882,30 @@ files = ( 8289AA6B2041DA4800E00603 /* XlsxReaderXMLDictionary.m in Sources */, 8289AA6C2041DA4800E00603 /* NSDictionary+DeepCopy.m in Sources */, - 8289AA6D2041DA4800E00603 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */, + 61AF3B89274F7BDE0099176F /* mz_strm_wzaes.c in Sources */, 8289AA6E2041DA4800E00603 /* NSDictionary+OpenXmlString.m in Sources */, + 61AF3B92274F7BDE0099176F /* mz_compat.c in Sources */, 8289AA6F2041DA4800E00603 /* NativeFont+BoldItalic.m in Sources */, 8289AA702041DA4800E00603 /* NativeColor+HTML.m in Sources */, + 61AF3B45274F7BDE0099176F /* mz_strm_os_posix.c in Sources */, + 61AF3AA6274F59C60099176F /* SSZipArchive.m in Sources */, + 61AF3BB6274F7BDE0099176F /* mz_strm_split.c in Sources */, + 61AF3B9F274F7BDE0099176F /* mz_os.c in Sources */, + 61AF3B57274F7BDE0099176F /* mz_strm_zlib.c in Sources */, 8289AA712041DA4800E00603 /* NativeColor+OpenXML.m in Sources */, 8289AA722041DA4800E00603 /* BRAOfficeDocumentPackage.m in Sources */, 8289AA732041DA4800E00603 /* BRACalcChainCell.m in Sources */, + 61AF3B4A274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */, 8289AA742041DA4800E00603 /* BRACalcChain.m in Sources */, + 61AF3BB1274F7BDE0099176F /* mz_strm_buf.c in Sources */, + 61AF3B69274F7BDE0099176F /* mz_zip_rw.c in Sources */, 8289AA752041DA4800E00603 /* BRAComment.m in Sources */, 8289AA762041DA4800E00603 /* BRAComments.m in Sources */, + 61AF3BC3274F7BDE0099176F /* mz_strm.c in Sources */, 8289AA772041DA4800E00603 /* BRAContentTypesOverride.m in Sources */, 8289AA782041DA4800E00603 /* BRAContentTypesDefaultExtension.m in Sources */, 8289AA792041DA4800E00603 /* BRAContentTypes.m in Sources */, + 61AF3B84274F7BDE0099176F /* mz_crypt.c in Sources */, 8289AA7A2041DA4800E00603 /* BRAWorksheetDrawing.m in Sources */, 8289AA7B2041DA4800E00603 /* BRADrawing.m in Sources */, 8289AA7C2041DA4800E00603 /* BRAImage.m in Sources */, @@ -1700,6 +1915,7 @@ 827A14E126B7BC03008EB8C2 /* BRAHyperlink.m in Sources */, 8289AA802041DA4800E00603 /* BRANumberFormat.m in Sources */, 8289AA812041DA4800E00603 /* BRACellFill.m in Sources */, + 61AF3B76274F7BDE0099176F /* mz_crypt_apple.c in Sources */, 8289AA822041DA4800E00603 /* BRAStyles.m in Sources */, 8289AA832041DA4800E00603 /* BRATheme.m in Sources */, 8289AA842041DA4800E00603 /* BRAVmlDrawing.m in Sources */, @@ -1707,7 +1923,10 @@ 8289AA862041DA4800E00603 /* BRAOfficeDocument.m in Sources */, 8289AA872041DA4800E00603 /* BRACell.m in Sources */, 8289AA882041DA4800E00603 /* BRARow.m in Sources */, + 61AF3BA8274F7BDE0099176F /* mz_os_posix.c in Sources */, + 61AF3B5C274F7BDE0099176F /* mz_zip.c in Sources */, 8289AA892041DA4800E00603 /* BRAColumn.m in Sources */, + 61AF3B7F274F7BDE0099176F /* mz_strm_mem.c in Sources */, 8289AA8A2041DA4800E00603 /* BRAMergeCell.m in Sources */, 8289AA8B2041DA4800E00603 /* BRACellRange.m in Sources */, 8289AA8C2041DA4800E00603 /* BRAWorksheet.m in Sources */, @@ -1725,19 +1944,30 @@ files = ( 8289AB082042118900E00603 /* XlsxReaderXMLDictionary.m in Sources */, 8289AB092042118900E00603 /* NSDictionary+DeepCopy.m in Sources */, - 8289AB0A2042118900E00603 /* NSDictionary+OpenXMLDictionaryParser.m in Sources */, + 61AF3B8A274F7BDE0099176F /* mz_strm_wzaes.c in Sources */, 8289AB0B2042118900E00603 /* NSDictionary+OpenXmlString.m in Sources */, + 61AF3B93274F7BDE0099176F /* mz_compat.c in Sources */, 8289AB0C2042118900E00603 /* NativeFont+BoldItalic.m in Sources */, 8289AB0D2042118900E00603 /* NativeColor+HTML.m in Sources */, + 61AF3B46274F7BDE0099176F /* mz_strm_os_posix.c in Sources */, + 61AF3AA7274F59C60099176F /* SSZipArchive.m in Sources */, + 61AF3BB7274F7BDE0099176F /* mz_strm_split.c in Sources */, + 61AF3BA0274F7BDE0099176F /* mz_os.c in Sources */, + 61AF3B58274F7BDE0099176F /* mz_strm_zlib.c in Sources */, 8289AB0E2042118900E00603 /* NativeColor+OpenXML.m in Sources */, 8289AB0F2042118900E00603 /* BRAOfficeDocumentPackage.m in Sources */, 8289AB102042118900E00603 /* BRACalcChainCell.m in Sources */, + 61AF3B4B274F7BDE0099176F /* mz_strm_pkcrypt.c in Sources */, 8289AB112042118900E00603 /* BRACalcChain.m in Sources */, + 61AF3BB2274F7BDE0099176F /* mz_strm_buf.c in Sources */, + 61AF3B6A274F7BDE0099176F /* mz_zip_rw.c in Sources */, 8289AB122042118900E00603 /* BRAComment.m in Sources */, 8289AB132042118900E00603 /* BRAComments.m in Sources */, + 61AF3BC4274F7BDE0099176F /* mz_strm.c in Sources */, 8289AB142042118900E00603 /* BRAContentTypesOverride.m in Sources */, 8289AB152042118900E00603 /* BRAContentTypesDefaultExtension.m in Sources */, 8289AB162042118900E00603 /* BRAContentTypes.m in Sources */, + 61AF3B85274F7BDE0099176F /* mz_crypt.c in Sources */, 8289AB172042118900E00603 /* BRAWorksheetDrawing.m in Sources */, 8289AB182042118900E00603 /* BRADrawing.m in Sources */, 8289AB192042118900E00603 /* BRAImage.m in Sources */, @@ -1747,6 +1977,7 @@ 827A14E226B7BC03008EB8C2 /* BRAHyperlink.m in Sources */, 8289AB1D2042118900E00603 /* BRANumberFormat.m in Sources */, 8289AB1E2042118900E00603 /* BRACellFill.m in Sources */, + 61AF3B77274F7BDE0099176F /* mz_crypt_apple.c in Sources */, 8289AB1F2042118900E00603 /* BRAStyles.m in Sources */, 8289AB202042118900E00603 /* BRATheme.m in Sources */, 8289AB212042118900E00603 /* BRAVmlDrawing.m in Sources */, @@ -1754,7 +1985,10 @@ 8289AB232042118900E00603 /* BRAOfficeDocument.m in Sources */, 8289AB242042118900E00603 /* BRACell.m in Sources */, 8289AB252042118900E00603 /* BRARow.m in Sources */, + 61AF3BA9274F7BDE0099176F /* mz_os_posix.c in Sources */, + 61AF3B5D274F7BDE0099176F /* mz_zip.c in Sources */, 8289AB262042118900E00603 /* BRAColumn.m in Sources */, + 61AF3B80274F7BDE0099176F /* mz_strm_mem.c in Sources */, 8289AB272042118900E00603 /* BRAMergeCell.m in Sources */, 8289AB282042118900E00603 /* BRACellRange.m in Sources */, 8289AB292042118900E00603 /* BRAWorksheet.m in Sources */, @@ -1768,14 +2002,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 45B6E2481A148F7500288A78 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 45B6E2391A148F7500288A78 /* XlsxReaderWriter */; - targetProxy = 45B6E2471A148F7500288A78 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 22156D5E1C46B42500BB5779 /* Debug */ = { isa = XCBuildConfiguration; @@ -1793,7 +2019,6 @@ EXCLUDED_ARCHS = ""; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", "$(PROJECT_DIR)", ); FRAMEWORK_VERSION = A; @@ -1802,13 +2027,9 @@ HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "XlsxReaderWriter-Mac/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 2.4.2; + MARKETING_VERSION = 2.5.0; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-Mac"; PRODUCT_NAME = XlsxReaderWriter; @@ -1836,7 +2057,6 @@ EXCLUDED_ARCHS = ""; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/Mac", "$(PROJECT_DIR)", ); FRAMEWORK_VERSION = A; @@ -1845,13 +2065,9 @@ HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "XlsxReaderWriter-Mac/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 2.4.2; + MARKETING_VERSION = 2.5.0; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-Mac"; PRODUCT_NAME = XlsxReaderWriter; @@ -1914,7 +2130,7 @@ "$(inherited)", "$(SRCROOT)/Sources/XlsxReaderWriter/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1958,6 +2174,7 @@ EXCLUDED_ARCHS = ""; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1968,14 +2185,13 @@ "$(inherited)", "$(SRCROOT)/Sources/XlsxReaderWriter/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "$(inherited)"; SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = NO; }; name = Release; @@ -1985,10 +2201,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; HEADER_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2002,10 +2215,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; HEADER_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2014,49 +2224,6 @@ }; name = Release; }; - 45B6E2521A148F7500288A78 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = "$(inherited)"; - PRODUCT_BUNDLE_IDENTIFIER = "fr.brae.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Tests/XlsxReaderWriterTests/XlsxReaderWriterTests-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 45B6E2531A148F7500288A78 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = "$(inherited)"; - PRODUCT_BUNDLE_IDENTIFIER = "fr.brae.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Tests/XlsxReaderWriterTests/XlsxReaderWriterTests-Bridging-Header.h"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; 6119EB6F26F4F5C7002A9B4A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2079,12 +2246,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 BRAE. All rights reserved."; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 2.4.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.5.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-tvos"; @@ -2124,12 +2287,8 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 BRAE. All rights reserved."; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 2.4.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.5.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-tvos"; PRODUCT_NAME = XlsxReaderWriter; @@ -2174,22 +2333,15 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; EXCLUDED_ARCHS = ""; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "XlsxReaderWriter-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 2.4.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.5.0; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-iOS"; PRODUCT_NAME = XlsxReaderWriter; @@ -2233,22 +2385,15 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; EXCLUDED_ARCHS = ""; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "XlsxReaderWriter-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 2.4.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.5.0; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-iOS"; PRODUCT_NAME = XlsxReaderWriter; @@ -2289,20 +2434,13 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/watchOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "XlsxReaderWriter-WatchOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 2.4.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.5.0; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-WatchOS"; PRODUCT_NAME = XlsxReaderWriter; SDKROOT = watchos; @@ -2340,20 +2478,13 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/watchOS", - ); + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "XlsxReaderWriter-WatchOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 2.4.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.5.0; PRODUCT_BUNDLE_IDENTIFIER = "com.charlymr.XlsxReaderWriter-WatchOS"; PRODUCT_NAME = XlsxReaderWriter; SDKROOT = watchos; @@ -2395,15 +2526,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 45B6E2511A148F7500288A78 /* Build configuration list for PBXNativeTarget "XlsxReaderWriterTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 45B6E2521A148F7500288A78 /* Debug */, - 45B6E2531A148F7500288A78 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 6119EB6E26F4F5C7002A9B4A /* Build configuration list for PBXNativeTarget "XlsxReaderWriter-tvos" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/XlsxReaderWriter.xcodeproj/xcshareddata/xcschemes/XlsxReaderWriter-Mac.xcscheme b/XlsxReaderWriter.xcodeproj/xcshareddata/xcschemes/XlsxReaderWriter-Mac.xcscheme index 4fcadb9..47ccf84 100644 --- a/XlsxReaderWriter.xcodeproj/xcshareddata/xcschemes/XlsxReaderWriter-Mac.xcscheme +++ b/XlsxReaderWriter.xcodeproj/xcshareddata/xcschemes/XlsxReaderWriter-Mac.xcscheme @@ -1,6 +1,6 @@ + + + + - - - - - - - - diff --git a/XlsxReaderWriter.xcworkspace/contents.xcworkspacedata b/XlsxReaderWriter.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index fa605d6..0000000 --- a/XlsxReaderWriter.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/XlsxReaderWriter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/XlsxReaderWriter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/XlsxReaderWriter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - -