diff --git a/Objective-Zip/FileInZipInfo.h b/Objective-Zip/FileInZipInfo.h index b2bb787..0be2202 100644 --- a/Objective-Zip/FileInZipInfo.h +++ b/Objective-Zip/FileInZipInfo.h @@ -1,6 +1,6 @@ // // FileInZipInfo.h -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 27/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. diff --git a/Objective-Zip/FileInZipInfo.m b/Objective-Zip/FileInZipInfo.m index 9e7ed8f..2962f99 100644 --- a/Objective-Zip/FileInZipInfo.m +++ b/Objective-Zip/FileInZipInfo.m @@ -1,6 +1,6 @@ // // FileInZipInfo.m -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 27/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. diff --git a/Objective-Zip/ZipException.h b/Objective-Zip/ZipException.h index 61b855b..77a0e2b 100644 --- a/Objective-Zip/ZipException.h +++ b/Objective-Zip/ZipException.h @@ -1,6 +1,6 @@ // // ZipException.h -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 25/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. diff --git a/Objective-Zip/ZipException.m b/Objective-Zip/ZipException.m index 607af24..12bc890 100644 --- a/Objective-Zip/ZipException.m +++ b/Objective-Zip/ZipException.m @@ -1,6 +1,6 @@ // // ZipException.m -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 25/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. diff --git a/Objective-Zip/ZipFile.h b/Objective-Zip/ZipFile.h index 1e7c167..d5582f3 100644 --- a/Objective-Zip/ZipFile.h +++ b/Objective-Zip/ZipFile.h @@ -1,6 +1,6 @@ // // ZipFile.h -// Objective-Zip v.0.8.2 +// Objective-Zip v.0.8.3 // // Created by Gianluca Bertani on 25/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. diff --git a/Objective-Zip/ZipFile.m b/Objective-Zip/ZipFile.m index 4c0445a..00b09a5 100644 --- a/Objective-Zip/ZipFile.m +++ b/Objective-Zip/ZipFile.m @@ -1,6 +1,6 @@ // // ZipFile.m -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 25/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. @@ -50,7 +50,7 @@ switch (mode) { case ZipFileModeUnzip: - _unzFile= unzOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding]); + _unzFile= unzOpen64([_fileName cStringUsingEncoding:NSUTF8StringEncoding]); if (_unzFile == NULL) { NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName]; @throw [[[ZipException alloc] initWithReason:reason] autorelease]; @@ -58,7 +58,7 @@ break; case ZipFileModeCreate: - _zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_CREATE); + _zipFile= zipOpen64([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_CREATE); if (_zipFile == NULL) { NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName]; @throw [[[ZipException alloc] initWithReason:reason] autorelease]; @@ -66,7 +66,7 @@ break; case ZipFileModeAppend: - _zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_ADDINZIP); + _zipFile= zipOpen64([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_ADDINZIP); if (_zipFile == NULL) { NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName]; @throw [[[ZipException alloc] initWithReason:reason] autorelease]; @@ -109,17 +109,17 @@ zi.external_fa= 0; zi.dosDate= 0; - int err= zipOpenNewFileInZip3( - _zipFile, - [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], - &zi, - NULL, 0, NULL, 0, NULL, - (compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0, - compressionLevel, 0, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0); + int err= zipOpenNewFileInZip3_64( + _zipFile, + [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], + &zi, + NULL, 0, NULL, 0, NULL, + (compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0, + compressionLevel, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, 1); if (err != ZIP_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in opening '%@' in zipfile", fileNameInZip]; + NSString *reason= [NSString stringWithFormat:@"Error opening '%@' in zipfile", fileNameInZip]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -145,17 +145,17 @@ zi.external_fa= 0; zi.dosDate= 0; - int err= zipOpenNewFileInZip3( - _zipFile, - [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], - &zi, - NULL, 0, NULL, 0, NULL, - (compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0, - compressionLevel, 0, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0); + int err= zipOpenNewFileInZip3_64( + _zipFile, + [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], + &zi, + NULL, 0, NULL, 0, NULL, + (compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0, + compressionLevel, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, 1); if (err != ZIP_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in opening '%@' in zipfile", fileNameInZip]; + NSString *reason= [NSString stringWithFormat:@"Error opening '%@' in zipfile", fileNameInZip]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -181,17 +181,17 @@ zi.external_fa= 0; zi.dosDate= 0; - int err= zipOpenNewFileInZip3( - _zipFile, - [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], - &zi, - NULL, 0, NULL, 0, NULL, - (compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0, - compressionLevel, 0, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - [password cStringUsingEncoding:NSUTF8StringEncoding], crc32); + int err= zipOpenNewFileInZip3_64( + _zipFile, + [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], + &zi, + NULL, 0, NULL, 0, NULL, + (compressionLevel != ZipCompressionLevelNone) ? Z_DEFLATED : 0, + compressionLevel, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + [password cStringUsingEncoding:NSUTF8StringEncoding], crc32, 1); if (err != ZIP_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in opening '%@' in zipfile", fileNameInZip]; + NSString *reason= [NSString stringWithFormat:@"Error opening '%@' in zipfile", fileNameInZip]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -208,10 +208,10 @@ @throw [[[ZipException alloc] initWithReason:reason] autorelease]; } - unz_global_info gi; - int err= unzGetGlobalInfo(_unzFile, &gi); + unz_global_info64 gi; + int err= unzGetGlobalInfo64(_unzFile, &gi); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in getting global info in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error getting global info in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -245,7 +245,7 @@ int err= unzGoToFirstFile(_unzFile); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in going to first file in zip in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error going to first file in zip in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } } @@ -261,7 +261,7 @@ return NO; if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in going to next file in zip in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error going to next file in zip in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -279,7 +279,7 @@ return NO; if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in going to next file in zip in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error localting file in zip in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -293,11 +293,11 @@ } char filename_inzip[FILE_IN_ZIP_MAX_NAME_LENGTH]; - unz_file_info file_info; + unz_file_info64 file_info; - int err= unzGetCurrentFileInfo(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); + int err= unzGetCurrentFileInfo64(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in getting current file info in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error getting current file info in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -343,11 +343,11 @@ } char filename_inzip[FILE_IN_ZIP_MAX_NAME_LENGTH]; - unz_file_info file_info; + unz_file_info64 file_info; - int err= unzGetCurrentFileInfo(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); + int err= unzGetCurrentFileInfo64(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in getting current file info in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error getting current file info in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -355,7 +355,7 @@ err= unzOpenCurrentFilePassword(_unzFile, NULL); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in opening current file in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error opening current file in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -369,11 +369,11 @@ } char filename_inzip[FILE_IN_ZIP_MAX_NAME_LENGTH]; - unz_file_info file_info; + unz_file_info64 file_info; - int err= unzGetCurrentFileInfo(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); + int err= unzGetCurrentFileInfo64(_unzFile, &file_info, filename_inzip, sizeof(filename_inzip), NULL, 0, NULL, 0); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in getting current file info in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error getting current file info in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -381,7 +381,7 @@ err= unzOpenCurrentFilePassword(_unzFile, [password cStringUsingEncoding:NSUTF8StringEncoding]); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in opening current file in '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error opening current file in '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -393,7 +393,7 @@ case ZipFileModeUnzip: { int err= unzClose(_unzFile); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in closing '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error closing '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } break; @@ -402,7 +402,7 @@ case ZipFileModeCreate: { int err= zipClose(_zipFile, NULL); if (err != ZIP_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in closing '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error closing '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } break; @@ -411,7 +411,7 @@ case ZipFileModeAppend: { int err= zipClose(_zipFile, NULL); if (err != ZIP_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in closing '%@'", _fileName]; + NSString *reason= [NSString stringWithFormat:@"Error closing '%@'", _fileName]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } break; diff --git a/Objective-Zip/ZipReadStream.h b/Objective-Zip/ZipReadStream.h index dac84c9..cc429e3 100644 --- a/Objective-Zip/ZipReadStream.h +++ b/Objective-Zip/ZipReadStream.h @@ -1,6 +1,6 @@ // // ZipReadStream.h -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 28/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. diff --git a/Objective-Zip/ZipReadStream.m b/Objective-Zip/ZipReadStream.m index c9f031b..2ebea6c 100644 --- a/Objective-Zip/ZipReadStream.m +++ b/Objective-Zip/ZipReadStream.m @@ -1,6 +1,6 @@ // // ZipReadStream.m -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 28/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. @@ -52,7 +52,7 @@ - (NSUInteger) readDataWithBuffer:(NSMutableData *)buffer { int err= unzReadCurrentFile(_unzFile, [buffer mutableBytes], [buffer length]); if (err < 0) { - NSString *reason= [NSString stringWithFormat:@"Error in reading '%@' in the zipfile", _fileNameInZip]; + NSString *reason= [NSString stringWithFormat:@"Error reading '%@' in the zipfile", _fileNameInZip]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } @@ -62,7 +62,7 @@ - (void) finishedReading { int err= unzCloseCurrentFile(_unzFile); if (err != UNZ_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in closing '%@' in the zipfile", _fileNameInZip]; + NSString *reason= [NSString stringWithFormat:@"Error closing '%@' in the zipfile", _fileNameInZip]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } } diff --git a/Objective-Zip/ZipWriteStream.h b/Objective-Zip/ZipWriteStream.h index 30130ff..90ca29b 100644 --- a/Objective-Zip/ZipWriteStream.h +++ b/Objective-Zip/ZipWriteStream.h @@ -1,6 +1,6 @@ // // ZipWriteStream.h -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 25/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. diff --git a/Objective-Zip/ZipWriteStream.m b/Objective-Zip/ZipWriteStream.m index 20e15e2..4ca9156 100644 --- a/Objective-Zip/ZipWriteStream.m +++ b/Objective-Zip/ZipWriteStream.m @@ -1,6 +1,6 @@ // // ZipWriteStream.m -// Objective-Zip v. 0.8.2 +// Objective-Zip v. 0.8.3 // // Created by Gianluca Bertani on 25/12/09. // Copyright 2009-10 Flying Dolphin Studio. All rights reserved. @@ -52,7 +52,7 @@ - (void) writeData:(NSData *)data { int err= zipWriteInFileInZip(_zipFile, [data bytes], [data length]); if (err < 0) { - NSString *reason= [NSString stringWithFormat:@"Error in writing '%@' in the zipfile", _fileNameInZip]; + NSString *reason= [NSString stringWithFormat:@"Error writing '%@' in the zipfile", _fileNameInZip]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } } @@ -60,7 +60,7 @@ - (void) finishedWriting { int err= zipCloseFileInZip(_zipFile); if (err != ZIP_OK) { - NSString *reason= [NSString stringWithFormat:@"Error in closing '%@' in the zipfile", _fileNameInZip]; + NSString *reason= [NSString stringWithFormat:@"Error closing '%@' in the zipfile", _fileNameInZip]; @throw [[[ZipException alloc] initWithError:err reason:reason] autorelease]; } }