Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04d8d9d1d4 | ||
|
|
cc40af1311 | ||
|
|
1dbde8f9c9 | ||
|
|
5a90a66267 | ||
|
|
00386a3fe9 | ||
|
|
ec6056de67 | ||
|
|
2485f97586 | ||
|
|
8364f87f9a | ||
|
|
9dfa7e43da | ||
|
|
401dfa4b17 | ||
|
|
a1e5810879 | ||
|
|
64185c4750 |
@@ -342,7 +342,10 @@ local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
|
||||
return 0;
|
||||
|
||||
if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
|
||||
{
|
||||
TRYFREE(buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
file_size = ZTELL64(*pzlib_filefunc_def, filestream);
|
||||
|
||||
|
||||
@@ -575,7 +575,10 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
|
||||
return 0;
|
||||
|
||||
if (ZSEEK64(*pzlib_filefunc_def, filestream, 0, ZLIB_FILEFUNC_SEEK_END) != 0)
|
||||
{
|
||||
TRYFREE(buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
file_size = ZTELL64(*pzlib_filefunc_def, filestream);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZFileInZipInfo+Internals.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/08/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZFileInZipInfo.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZFileInZipInfo.m
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipCompressionLevel.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/08/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipException+Internals.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/08/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipException.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipException.m
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipFile+NSError.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 09/09/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
@@ -231,7 +231,7 @@ static const NSInteger OZLocateFileResultFound= 1;
|
||||
@throws OZZipException If the zip file has been opened with a mode other than
|
||||
Unzip.
|
||||
*/
|
||||
- (NSInteger) __attribute__((swift_error(zero_result))) locateFileInZip:(nonnull NSString *)fileNameInZip error:(NSError * __autoreleasing __nullable * __nullable)error;
|
||||
- (NSInteger) __attribute__((swift_error(nonnull_error))) locateFileInZip:(nonnull NSString *)fileNameInZip error:(NSError * __autoreleasing __nullable * __nullable)error;
|
||||
|
||||
/**
|
||||
@brief Returns the number of files contained in the zip file.
|
||||
@@ -242,7 +242,7 @@ static const NSInteger OZLocateFileResultFound= 1;
|
||||
@throws OZZipException If the zip file has been opened with a mode other
|
||||
than Unzip.
|
||||
*/
|
||||
- (NSUInteger) __attribute__((swift_error(zero_result))) numFilesInZipWithError:(NSError * __autoreleasing __nullable * __nullable)error;
|
||||
- (NSUInteger) __attribute__((swift_error(nonnull_error))) numFilesInZipWithError:(NSError * __autoreleasing __nullable * __nullable)error;
|
||||
|
||||
/**
|
||||
@brief Returns a list of OZFileInZipInfo with the information on all the files
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipFile+Standard.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 09/09/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipFile.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipFile.m
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipFileMode.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/08/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipReadStream+Internals.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/08/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipReadStream+NSError.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 09/09/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
@@ -58,7 +58,7 @@ static const NSInteger OZReadStreamResultEndOfFile= -1;
|
||||
<br/>NOTE: return value convention is different in the standard (non-NSError
|
||||
compliant) interface.
|
||||
*/
|
||||
- (NSInteger) __attribute__((swift_error(zero_result))) readDataWithBuffer:(nonnull NSMutableData *)buffer error:(NSError * __autoreleasing __nullable * __nullable)error;
|
||||
- (NSInteger) __attribute__((swift_error(nonnull_error))) readDataWithBuffer:(nonnull NSMutableData *)buffer error:(NSError * __autoreleasing __nullable * __nullable)error;
|
||||
|
||||
/**
|
||||
@brief Closes the read steam.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipReadStream+Standard.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 09/09/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipReadStream.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 28/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipReadStream.m
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 28/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipWriteStream+Internals.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/08/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipWriteStream+NSError.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 09/09/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipWriteStream+Standard.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 09/09/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipWriteStream.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OZZipWriteStream.m
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 25/12/09.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Objective-Zip+NSError.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 09/09/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Objective-Zip.h
|
||||
// Objective-Zip v. 1.0.2
|
||||
// Objective-Zip v. 1.0.3
|
||||
//
|
||||
// Created by Gianluca Bertani on 27/08/15.
|
||||
// Copyright 2009-2015 Gianluca Bertani. All rights reserved.
|
||||
|
||||
14
README.md
14
README.md
@@ -175,12 +175,11 @@ zip and expand it:
|
||||
|
||||
```objective-c
|
||||
OZZipFile *unzipFile= [[OZZipFile alloc] initWithFileName:@"test.zip"
|
||||
mode:ZipFileModeUnzip];
|
||||
mode:OZZipFileModeUnzip];
|
||||
|
||||
NSArray *infos= [unzipFile listFileInZipInfos];
|
||||
for (OZFileInZipInfo *info in infos) {
|
||||
NSLog(@"- %@ %@ %d (%d)", info.name, info.date, info.size,
|
||||
info.level);
|
||||
NSLog(@"- %@ %@ %llu (%d)", info.name, info.date, info.size, info.level);
|
||||
|
||||
// Locate the file in the zip
|
||||
[unzipFile locateFileInZip:info.name];
|
||||
@@ -280,6 +279,13 @@ The library is distributed under the New BSD License.
|
||||
Version history
|
||||
===============
|
||||
|
||||
Version 1.0.3:
|
||||
|
||||
- Fixed some memory leaks in MiniZip (contributed by @SheffieldKevin)
|
||||
- Silenced a warning about shifting a negative value in ZLib (contributed by Martin Winter)
|
||||
- Fixed throwing of errors so that it is compatible with Swift 3 (contributed by @andyj-at-aspin)
|
||||
- Fixed typos and errors in README (contributed by @deni2s)
|
||||
|
||||
Version 1.0.2:
|
||||
|
||||
- Fixed interface for `locateFileInZip` and `readDataWithBuffer` in NSError
|
||||
@@ -351,7 +357,7 @@ Version 0.7.0:
|
||||
Compatibility
|
||||
=============
|
||||
|
||||
Version 1.0.2 has been tested with iOS up to 9.0 and OS X up to 10.11, but
|
||||
Version 1.0.3 has been tested with iOS up to 9.3 and OS X up to 10.11, but
|
||||
should be compatible with earlier versions too, down to iOS 5.1 and OS X 10.7.
|
||||
Le me know of any issues that should arise.
|
||||
|
||||
|
||||
@@ -1504,9 +1504,10 @@ z_streamp strm;
|
||||
{
|
||||
struct inflate_state FAR *state;
|
||||
|
||||
if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
|
||||
if (strm == Z_NULL || strm->state == Z_NULL)
|
||||
return (long)(((unsigned long)0 - 1) << 16);
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
return ((long)(state->back) << 16) +
|
||||
return (long)(((unsigned long)((long)state->back)) << 16) +
|
||||
(state->mode == COPY ? state->length :
|
||||
(state->mode == MATCH ? state->was - state->length : 0));
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
|
||||
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
|
||||
s.name = "objective-zip"
|
||||
s.version = "1.0.2"
|
||||
s.version = "1.0.3"
|
||||
s.summary = "An object-oriented friendly wrapper library for ZLib and MiniZip, in Objective-C for iOS and OS X"
|
||||
|
||||
s.description = <<-DESC
|
||||
@@ -48,6 +48,16 @@ Pod::Spec.new do |s|
|
||||
s.source_files = "Objective-Zip/**/*.{h,m}", "MiniZip/**/*.{h,c}", "ZLib/**/*.{h,c}"
|
||||
|
||||
|
||||
# ――― Publich Headers ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
|
||||
s.public_header_files = ["Objective-Zip/OZZipFile.h", "Objective-Zip/OZZipFile+Standard.h", "Objective-Zip/OZZipFile+NSError.h",
|
||||
"Objective-Zip/OZZipFileMode.h", "Objective-Zip/OZZipCompressionLevel.h", "Objective-Zip/OZZipException.h",
|
||||
"Objective-Zip/OZZipWriteStream.h", "Objective-Zip/OZZipWriteStream+Standard.h",
|
||||
"Objective-Zip/OZZipWriteStream+NSError.h", "Objective-Zip/OZZipReadStream.h",
|
||||
"Objective-Zip/OZZipReadStream+Standard.h", "Objective-Zip/OZZipReadStream+NSError.h",
|
||||
"Objective-Zip/OZFileInZipInfo.h", "Objective-Zip/Objective-Zip.h", "Objective-Zip/Objective-Zip+NSError.h"]
|
||||
|
||||
|
||||
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
|
||||
s.requires_arc = true
|
||||
|
||||
Reference in New Issue
Block a user