Skip to content

Commit

Permalink
Version 2.8.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz committed Jul 4, 2019
1 parent 84498c7 commit 32fd805
Show file tree
Hide file tree
Showing 49 changed files with 265 additions and 266 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ endif()
enable_language(C)

# Minizip library version
set(VERSION "2.8.8")
set(VERSION "2.8.9")

# Minizip api version
set(SOVERSION "2.5")
Expand Down
2 changes: 1 addition & 1 deletion Minizip.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Minizip'
s.version = '2.8.8'
s.version = '2.8.9'
s.license = 'zlib'
s.summary = 'Minizip contrib in zlib with the latest bug fixes and advanced features'
s.description = <<-DESC
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# minizip 2.8.8
# minizip 2.8.9

minizip is a zip manipulation library written in C that is supported on Windows, macOS, and Linux.
minizip is a zip manipulation library written in C that is supported on Windows, macOS, and Linux.

[![License: Zlib](https://img.shields.io/badge/license-zlib-lightgrey.svg)](https://github.com/nmoinvaz/minizip/blob/master/LICENSE)
[![Code Quality: Cpp](https://img.shields.io/lgtm/grade/cpp/g/nmoinvaz/minizip.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/nmoinvaz/minizip/context:cpp)
Expand Down Expand Up @@ -119,6 +119,6 @@ cmake --build .

Thanks go out to all the people who have taken the time to contribute code reviews, testing and/or patches. This project would not have been as good without you.

Thanks to [Gilles Vollant](https://www.winimage.com/zLibDll/minizip.html) on which this work is originally based on.
Thanks to [Gilles Vollant](https://www.winimage.com/zLibDll/minizip.html) on which this work is originally based on.

The [ZIP format](https://github.com/nmoinvaz/minizip/blob/master/doc/appnote.txt) was defined by Phil Katz of PKWARE.
2 changes: 1 addition & 1 deletion minigzip.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* minigzip.c
Version 2.8.8, May 22, 2019
Version 2.8.9, July 4, 2019
part of the MiniZip project
Copyright (C) 2010-2019 Nathan Moinvaziri
Expand Down
22 changes: 11 additions & 11 deletions minizip.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* minizip.c
Version 2.8.8, May 22, 2019
Version 2.8.9, July 4, 2019
part of the MiniZip project
Copyright (C) 2010-2019 Nathan Moinvaziri
Expand Down Expand Up @@ -183,7 +183,7 @@ int32_t minizip_list(const char *path)
/* Print entry information */
printf("%12"PRId64" %12"PRId64" %3"PRIu32"%% %6s%c %8"PRIx32" %2.2"PRIu32\
"-%2.2"PRIu32"-%2.2"PRIu32" %2.2"PRIu32":%2.2"PRIu32" %8.8"PRIx32" %s\n",
file_info->compressed_size, file_info->uncompressed_size, ratio,
file_info->compressed_size, file_info->uncompressed_size, ratio,
string_method, crypt, file_info->external_fa,
(uint32_t)tmu_date.tm_mon + 1, (uint32_t)tmu_date.tm_mday,
(uint32_t)tmu_date.tm_year % 100,
Expand Down Expand Up @@ -214,7 +214,7 @@ int32_t minizip_add_entry_cb(void *handle, void *userdata, mz_zip_file *file_inf
{
MZ_UNUSED(handle);
MZ_UNUSED(userdata);

/* Print the current file we are trying to compress */
printf("Adding %s\n", file_info->filename);
return MZ_OK;
Expand All @@ -227,7 +227,7 @@ int32_t minizip_add_progress_cb(void *handle, void *userdata, mz_zip_file *file_
uint8_t raw = 0;

MZ_UNUSED(userdata);

mz_zip_writer_get_raw(handle, &raw);

if (raw && file_info->compressed_size > 0)
Expand All @@ -237,7 +237,7 @@ int32_t minizip_add_progress_cb(void *handle, void *userdata, mz_zip_file *file_

/* Print the progress of the current compress operation */
if (options->verbose)
printf("%s - %"PRId64" / %"PRId64" (%.02f%%)\n", file_info->filename, position,
printf("%s - %"PRId64" / %"PRId64" (%.02f%%)\n", file_info->filename, position,
file_info->uncompressed_size, progress);
return MZ_OK;
}
Expand All @@ -247,7 +247,7 @@ int32_t minizip_add_overwrite_cb(void *handle, void *userdata, const char *path)
minizip_opt *options = (minizip_opt *)userdata;

MZ_UNUSED(handle);

if (options->overwrite == 0)
{
/* If ask the user what to do because append and overwrite args not set */
Expand Down Expand Up @@ -340,7 +340,7 @@ int32_t minizip_extract_entry_cb(void *handle, void *userdata, mz_zip_file *file
MZ_UNUSED(handle);
MZ_UNUSED(userdata);
MZ_UNUSED(path);

/* Print the current entry extracting */
printf("Extracting %s\n", file_info->filename);
return MZ_OK;
Expand All @@ -353,7 +353,7 @@ int32_t minizip_extract_progress_cb(void *handle, void *userdata, mz_zip_file *f
uint8_t raw = 0;

MZ_UNUSED(userdata);

mz_zip_reader_get_raw(handle, &raw);

if (raw && file_info->compressed_size > 0)
Expand All @@ -363,7 +363,7 @@ int32_t minizip_extract_progress_cb(void *handle, void *userdata, mz_zip_file *f

/* Print the progress of the current extraction */
if (options->verbose)
printf("%s - %"PRId64" / %"PRId64" (%.02f%%)\n", file_info->filename, position,
printf("%s - %"PRId64" / %"PRId64" (%.02f%%)\n", file_info->filename, position,
file_info->uncompressed_size, progress);

return MZ_OK;
Expand All @@ -375,7 +375,7 @@ int32_t minizip_extract_overwrite_cb(void *handle, void *userdata, mz_zip_file *

MZ_UNUSED(handle);
MZ_UNUSED(file_info);

/* Verify if we want to overwrite current entry on disk */
if (options->overwrite == 0)
{
Expand Down Expand Up @@ -718,7 +718,7 @@ int main(int argc, const char *argv[])
path_arg = i;
}
printf("\n");

if (err == MZ_SUPPORT_ERROR)
{
printf("Feature not supported\n");
Expand Down
10 changes: 5 additions & 5 deletions mz.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* mz.h -- Errors codes, zip flags and magic
Version 2.8.8, May 22, 2019
Version 2.8.9, July 4, 2019
part of the MiniZip project
Copyright (C) 2010-2019 Nathan Moinvaziri
Expand All @@ -15,7 +15,7 @@
/***************************************************************************/

/* MZ_VERSION */
#define MZ_VERSION ("2.8.8")
#define MZ_VERSION ("2.8.9")

/* MZ_ERROR */
#define MZ_OK (0) /* zlib */
Expand Down Expand Up @@ -230,7 +230,7 @@ typedef unsigned long long uint64_t;
#ifndef INT16_MAX
# define INT16_MAX 32767
#endif
#ifndef INT32_MAX
#ifndef INT32_MAX
# define INT32_MAX 2147483647L
#endif
#ifndef INT64_MAX
Expand All @@ -239,8 +239,8 @@ typedef unsigned long long uint64_t;
#ifndef UINT16_MAX
# define UINT16_MAX 65535U
#endif
#ifndef UINT32_MAX
# define UINT32_MAX 4294967295UL
#ifndef UINT32_MAX
# define UINT32_MAX 4294967295UL
#endif
#ifndef UINT64_MAX
# define UINT64_MAX 18446744073709551615ULL
Expand Down
24 changes: 12 additions & 12 deletions mz_compat.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* mz_compat.c -- Backwards compatible interface for older versions
Version 2.8.8, May 22, 2019
Version 2.8.9, July 4, 2019
part of the MiniZip project
Copyright (C) 2010-2019 Nathan Moinvaziri
Expand Down Expand Up @@ -245,7 +245,7 @@ int zipOpenNewFileInZip3_64(zipFile file, const char *filename, const zip_filein

int zipOpenNewFileInZip2(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,
uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level,
int raw)
{
return zipOpenNewFileInZip4_64(file, filename, zipfi, extrafield_local, size_extrafield_local,
Expand All @@ -255,7 +255,7 @@ int zipOpenNewFileInZip2(zipFile file, const char *filename, const zip_fileinfo

int zipOpenNewFileInZip2_64(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,
uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level,
int raw, int zip64)
{
return zipOpenNewFileInZip4_64(file, filename, zipfi, extrafield_local, size_extrafield_local,
Expand All @@ -274,7 +274,7 @@ int zipOpenNewFileInZip(zipFile file, const char *filename, const zip_fileinfo *

int zipOpenNewFileInZip_64(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,
uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level,
int zip64)
{
return zipOpenNewFileInZip4_64(file, filename, zipfi, extrafield_local, size_extrafield_local,
Expand Down Expand Up @@ -835,14 +835,14 @@ 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;
Expand All @@ -866,14 +866,14 @@ 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;
Expand Down Expand Up @@ -928,11 +928,11 @@ int unzGetLocalExtrafield(unzFile file, void *buf, unsigned int len)

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;
Expand Down
14 changes: 7 additions & 7 deletions mz_compat.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* mz_compat.h -- Backwards compatible interface for older versions
Version 2.8.8, May 22, 2019
Version 2.8.9, July 4, 2019
part of the MiniZip project
Copyright (C) 2010-2019 Nathan Moinvaziri
Expand Down Expand Up @@ -111,15 +111,15 @@ ZEXPORT int zipOpenNewFileInZip(zipFile file, const char *filename, const zi
uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level);
ZEXPORT int zipOpenNewFileInZip_64(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,
uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level,
int zip64);
ZEXPORT int zipOpenNewFileInZip2(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,
uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level,
int raw);
ZEXPORT int zipOpenNewFileInZip2_64(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,
uint16_t size_extrafield_global, const char *comment, uint16_t compression_method, int level,
int raw, int zip64);
ZEXPORT int zipOpenNewFileInZip3(zipFile file, const char *filename, const zip_fileinfo *zipfi,
const void *extrafield_local, uint16_t size_extrafield_local, const void *extrafield_global,
Expand Down Expand Up @@ -251,7 +251,7 @@ typedef struct unz_file_info_s
typedef int (*unzFileNameComparer)(unzFile file, const char *filename1, const char *filename2);
typedef int (*unzIteratorFunction)(unzFile file);
typedef int (*unzIteratorFunction2)(unzFile file, unz_file_info64 *pfile_info, char *filename,
uint16_t filename_size, void *extrafield, uint16_t extrafield_size, char *comment,
uint16_t filename_size, void *extrafield, uint16_t extrafield_size, char *comment,
uint16_t comment_size);

/***************************************************************************/
Expand Down Expand Up @@ -279,10 +279,10 @@ ZEXPORT int unzCloseCurrentFile(unzFile file);


ZEXPORT 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 filename_size, void *extrafield, uint16_t extrafield_size, char *comment,
uint16_t comment_size);
ZEXPORT 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 filename_size, void *extrafield, uint16_t extrafield_size, char *comment,
uint16_t comment_size);

ZEXPORT int unzGoToFirstFile(unzFile file);
Expand Down
Loading

0 comments on commit 32fd805

Please sign in to comment.