![]()
Some checks failed
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_BZIP=OFF, ubuntu_clang_no_bzip2, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang No Bzip2, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_COMPRESS_ONLY=ON, ubuntu_clang_compress_only, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang Compress Only, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_DECOMPRESS_ONLY=ON, ubuntu_clang_decompress_only, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang Decompress Only, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_FORCE_FETCH_LIBS=ON -G Ninja, windows_gcc, gcc, g++, Windows GCC Code Coverage, windows-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_LIBCOMP=ON, macos_xcode_libcompression, macOS Xcode LibCompression, macOS-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_LZMA=OFF, ubuntu_clang_no_lzma, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang No LZMA, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_OPENSSL=ON, macos_xcode_openssl, macOS Xcode OpenSSL, macos-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_OPENSSL=ON, ubuntu_clang_openssl, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang OpenSSL, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_PKCRYPT=OFF -D MZ_WZAES=OFF, ubuntu_clang_no_encryption, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang No Encryption, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_PKCRYPT=OFF, ubuntu_clang_no_pkcrypt, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang No Pkcrypt, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_WZAES=OFF, ubuntu_clang_no_winzip_aes, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang No Winzip AES, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_ZLIB=OFF, ubuntu_clang_no_zlib, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang No Zlib, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON -D MZ_ZSTD=OFF, ubuntu_clang_no_zstd, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang No Zstd, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON, macos_xcode, macOS Xcode Code Coverage, macOS-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON, ubuntu_clang, clang-14, clang++-14, llvm-cov-14 gcov, Ubuntu Clang, ubuntu-latest, clang-14 llvm-14) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_CODE_COVERAGE=ON, ubuntu_gcc, gcc, g++, Ubuntu GCC, ubuntu-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_FORCE_FETCH_LIBS=ON, cl, true, windows, Windows MSVC, windows-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_SANITIZER=Address, ubuntu_gcc_asan, gcc, g++, Ubuntu GCC ASAN, ubuntu-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_SANITIZER=Memory, ubuntu_gcc_msan, gcc, g++, Ubuntu GCC MSAN, ubuntu-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (-D MZ_SANITIZER=Undefined, ubuntu_gcc_undefined, gcc, g++, Ubuntu GCC UBSAN, ubuntu-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (../build, ../minizip-ng, gcc, g++, Ubuntu GCC OSB, ubuntu-latest) (push) Has been cancelled
Build / ${{ matrix.name }} (clang, clang++, true, linux, Ubuntu 22 Clang, ubuntu-22.04) (push) Has been cancelled
Build / ${{ matrix.name }} (clang-11, clang++-11, Ubuntu 22 Clang 11, ubuntu-22.04, llvm-11 clang-11, 11) (push) Has been cancelled
Build / ${{ matrix.name }} (true, macos, macOS Xcode, macos-latest) (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
|
||
---|---|---|
.github | ||
cmake | ||
compat | ||
doc | ||
test | ||
.clang-format | ||
.codecov.yaml | ||
.gitignore | ||
CMakeLists.txt | ||
INDEX.md | ||
LICENSE | ||
minigzip.c | ||
minizip.c | ||
minizip.pc.cmakein | ||
mz_crypt_apple.c | ||
mz_crypt_openssl.c | ||
mz_crypt_winvista.c | ||
mz_crypt_winxp.c | ||
mz_crypt.c | ||
mz_crypt.h | ||
mz_os_posix.c | ||
mz_os_win32.c | ||
mz_os.c | ||
mz_os.h | ||
mz_strm_buf.c | ||
mz_strm_buf.h | ||
mz_strm_bzip.c | ||
mz_strm_bzip.h | ||
mz_strm_libcomp.c | ||
mz_strm_libcomp.h | ||
mz_strm_lzma.c | ||
mz_strm_lzma.h | ||
mz_strm_mem.c | ||
mz_strm_mem.h | ||
mz_strm_os_posix.c | ||
mz_strm_os_win32.c | ||
mz_strm_os.h | ||
mz_strm_pkcrypt.c | ||
mz_strm_pkcrypt.h | ||
mz_strm_split.c | ||
mz_strm_split.h | ||
mz_strm_wzaes.c | ||
mz_strm_wzaes.h | ||
mz_strm_zlib.c | ||
mz_strm_zlib.h | ||
mz_strm_zstd.c | ||
mz_strm_zstd.h | ||
mz_strm.c | ||
mz_strm.h | ||
mz_zip_rw.c | ||
mz_zip_rw.h | ||
mz_zip.c | ||
mz_zip.h | ||
mz.h | ||
README.md |
minizip-ng
minizip-ng is a zip manipulation library written in C that is supported on Windows, macOS, and Linux.
Developed and maintained by Nathan Moinvaziri.
Branches
Name | Description |
---|---|
develop | Latest development code. |
master | Most recent stable release. |
1.2 | Old changes to original minizip that includes WinZip AES encryption, disk splitting, I/O buffering and some additional fixes. Not ABI compatible with original minizip. |
1.1 | Original minizip as of zlib 1.2.11. |
History
Minizip was originally developed by Gilles Vollant in 1998. It was first included in the zlib distribution as an additional code contribution starting in zlib 1.1.2. Since that time, it has been continually improved upon and contributed to by many people. The original project can still be found in the zlib distribution that is maintained by Mark Adler.
The motivation behind this repository has been the need for new features and bug fixes to the original library which had not been maintained for a long period of time. The code has been largely refactored and rewritten in order to help improve maintainability and readability. A compatibility layer has been provided for consumers of the original minizip library.
Features
- Creating and extracting zip archives.
- Adding and removing entries from zip archives.
- Read and write raw zip entry data.
- Reading and writing zip archives from memory.
- Support for large files with ZIP64 extension.
- Zlib, BZIP2, LZMA, XZ, and ZSTD compression methods.
- Password protection through Traditional PKWARE and WinZIP AES encryption.
- Buffered streaming for improved I/O performance.
- NTFS timestamp support for UTC last modified, last accessed, and creation dates.
- Disk split support for splitting zip archives into multiple files.
- Preservation of file attributes across file systems.
- Follow and store symbolic links.
- Unicode filename support through UTF-8 encoding.
- Legacy character encoding support CP437, CP932, CP936, CP950.
- Turn off compilation of compression, decompression, or encryption.
- Windows (Win32 & WinRT), macOS and Linux platform support.
- Streaming interface for easy implementation of additional platforms.
- Support for Apple's compression library ZLIB and XZ implementations.
- Zero out local file header information.
- Zip/unzip of central directory to reduce size.
- Recover the central directory if it is corrupt or missing.
- Example minizip and minigzip command line tools.
Build
To generate project files for your platform:
- Download and install cmake (version 3.11 or later recommended).
- Run cmake in the minizip directory.
cmake -S . -B build -D MZ_BUILD_TESTS=ON
cmake --build build
Build Options
Name | Description | Default Value |
---|---|---|
MZ_COMPAT | Enables compatibility layer | ON |
MZ_ZLIB | Enables ZLIB compression | ON |
MZ_BZIP2 | Enables BZIP2 compression | ON |
MZ_LZMA | Enables LZMA & XZ compression | ON |
MZ_ZSTD | Enables ZSTD compression | ON |
MZ_LIBCOMP | Enables Apple compression | APPLE |
MZ_FETCH_LIBS | Enables fetching third-party libraries if not found | WIN32 |
MZ_FORCE_FETCH_LIBS | Enables fetching third-party libraries always | OFF |
MZ_PKCRYPT | Enables PKWARE traditional encryption | ON |
MZ_WZAES | Enables WinZIP AES encryption | ON |
MZ_OPENSSL | Enables OpenSSL encryption | UNIX |
MZ_LIBBSD | Builds with libbsd crypto random | UNIX |
MZ_ICONV | Enables iconv encoding conversion | ON |
MZ_COMPRESS_ONLY | Only support compression | OFF |
MZ_DECOMPRESS_ONLY | Only support decompression | OFF |
MZ_FILE32_API | Builds using posix 32-bit file api | OFF |
MZ_BUILD_TESTS | Builds minizip test executable | OFF |
MZ_BUILD_UNIT_TESTS | Builds minizip unit test project | OFF |
MZ_BUILD_FUZZ_TESTS | Builds minizip fuzz executables | OFF |
MZ_CODE_COVERAGE | Build with code coverage flags | OFF |
MZ_SANITIZER | Build with code sanitizer (Memory, Thread, Address, Undefined) | |
MZ_LIB_SUFFIX | Library name suffix for packaging |
Third-Party Libraries
Third-party libraries may be required based on the CMake options selected. If the system already has the library
installed then it will be used, otherwise CMake will retrieve the source code for the library from its official git repository and compile it in when the MZ_FETCH_LIBS
option is enabled.
Project | License | CMake Option | Comments |
---|---|---|---|
bzip2 | license | MZ_BZIP2 |
Written by Julian Seward. |
liblzma | Public domain | MZ_LZMA |
Written by Igor Pavlov and Lasse Collin. |
zlib | zlib | MZ_ZLIB |
Written by Mark Adler and Jean-loup Gailly. Or alternatively, zlib-ng by Hans Kristian Rosbach. |
zstd | BSD | MZ_ZSTD |
Written by Facebook. |
This project uses the zlib license.
Acknowledgments
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 on which this work is originally based on.
The ZIP format was defined by Phil Katz of PKWARE.