Zip-Ada: Ada library for zip files (.zip). Ada programming.
History
(-!- marks an improvement which is bringing an incompatibility):
- '59', 25-May-2024 [rev. 946]:
- UnZip.Streams: added Set_Index & Index subprograms for inward
streams from Zip archives.
- Zip.Create: added procedure Add_Empty_Folder.
- '58', 20-Aug-2022 [rev. 922]:
- Support for Zip_64 archives.
The Zip_64 format extension is needed when there are more than more
than 65535 entries or more than 4 GiB data for a single entry's
compressed or uncompressed size, or for a whole archive.
- '57', 02-Oct-2020 [rev. 799]:
- UnZip: fixed bad decoding case for the Shrink (LZW) format,
on some data compressed only by PKZIP up to v.1.10,
release date 1990-03-15.
- Zip.Create: added
Zip_Entry_Stream_Type for doing output
streaming into Zip archives.
- Zip.Compress: Preselection
method detects Audacity files (.aup, .au)
and compresses them better.
- '56', 17-Jan-2020 [rev. 780]:
- Zip: the Zip_info type is now controlled (no need to call Delete;
additionally, clones are done correctly).
- UnZip.Streams: added Size and Name functions for Zipped_File_Type.
- LZ77: added nice simple LZ77 compressor by Rich Geldreich, Jr.
- (Tools) Added Zip_Dir_List.
- Some refactoring was needed for -gnatwh warning switch (warnings for
hiding declarations). Subprogram Create in package Zip.Create
was renamed to Create_Archive.
- Adapted to -gnatytc style checks.
- Better names for some exceptions (the old names
can be still used); better exception messages.
- '55', 22-Nov-2018 [rev. 725]:
- Zip_Streams: ZS_Size_Type is now 64-bit signed, enabling Zip.Create
to capture archive size overflows in Zip_32 mode.
- Zip.Create raises Zip_Capacity_Exceeded when archive creation exceeds
the Zip_32 format's capacity: 4GB total size, 65,535 entries.
- Zip.Create is now using an Ada 2005+'s Containers's Hashed Maps;
creation is much faster on Zip archives with many entries.
- (Tools) ReZip has a new option for working only with its own internal
compression algorithms - those provided by Zip.Compress.
This option is useful if external tools are not available.
- New Trained_Compression package: generic streaming encoder-decoder
engine with the capability of training the engine with data known
in advance, in order to achieve better compression. Not Zip-related.
-!- Minimum required Ada version is now Ada 2005 (was Ada 95 before).
- '54', 28-Jun-2018 [rev. 637]:
- Zip.Compress.Deflate: use of L1_tweaked measure; adjusted
threshold for activating new compression block
- Source gardening: removal of needless "use" clauses; these cases
are detected by GNAT Community 2018
- '53', 14-Nov-2017 [rev. 611]:
- Decompression and loading of archive directory are more
resistant to
fuzzing attacks
.
From that version, a random data
passed as a Zip archive will be either valid (with an extremely tiny
probability), or, for loading the archive directory, issue
Zip.Archive_Corrupted. Data extraction will issue one of:
Zip.Archive_Corrupted, UnZip.CRC_Error, UnZip.Wrong_password,
UnZip.Unsupported_method, UnZip.Not_supported.
- Zip.Compress & ReZip: fix in local header generation: EOS flag for
LZMA format is properly set in any situation LZMA is actually used.
- (Tools) ZipAda tool has a more useful recursive
directory search (-r2 option).
- (Tests) Added Fuzzip, a fuzzing tool for the compression side.
- '52', 08-Oct-2016 [rev. 557]:
- UnZip.Streams: all procedures have an additional (optional)
Ignore_Directory parameter.
- Zip.Compress has the following new methods with improved compression:
LZMA_3, Preselection_1 (replaces Preselection), Preselection_2.
Preselection methods use now entry name extension and size for
improving compression, while remaining 1-pass methods.
- '51', 27-Aug-2016 [rev. 475]:
- LZMA.Encoding has been added; it is a standalone compressor,
see lzma_enc.adb for an example of use.
- Zip.Compress provides now LZMA_1, LZMA_2 methods. In other words, you
can use the LZMA compression with Zip.Create.
- Zip.Compress has also a "Preselection" method that selects
a compression method depending on hints like the uncompressed size.
- Zip.Compress.Deflate: Deflate_1 .. Deflate_3 compression is
slightly better.
- '50', 31-Mar-2016 [rev. 383]:
- Zip.Compress.Shrink is slightly faster
- Zip.Compress.Deflate has new compression features:
- Deflate_Fixed is much faster, with slightly better compression
- Deflate_1 was added: strength similar to zlib, level 6
- Deflate_2 was added: strength similar to zlib, level 9
- Deflate_3 was added: strength similar to 7-Zip, method=deflate, level 5
- '49', 21-Mar-2015:
- encryption implemented (portable Zip 2.0 encryption scheme)
- '48', 20-Jul-2014:
- LZMA
decompression significantly faster
- '47', 28-Jun-2014:
- LZMA
method added for decompression
- '46', 14-Sep-2013:
- UnZip.Streams decompresses to input and (new) to output streams
- Removed usage of signed integers for stream sizes, increasing
limits from 2 GB to 4 GB on 32-bit targets
- Added Zip.Traverse_Unicode
- UnZip: does not attempt to create empty pathes or drives
- '45', 22-Dec-2012:
- Decryption's password check also working for archives encrypted
by Info-Zip software.
- Massive speedup when checking files that are invalid Zip archives
or Zip archives with large comments.
- Added Is_Open method for File_Zipstream.
- Zip.Load closes properly the file when loading fails.
- Improved detection of invalid dates in some Zip archives
(e.g. wmpChrome.crx Chrome extension).
- UnZip.Decompress: Optimized calls of feedback: called only when
1% more done.
-!- Removed case_sensitive as a parameter in Zip.Exists, Zip.Find_Offset,
Zip.Get_Sizes, and UnZip.Streams.Open, versions with Zip_Info profiles.
The Zip_info objects now keep this information in a field after Load.
Rationale: case-sensitivity mode for search make only sense when it
matches the mode used for building the dictionary.
- Added User_code to Zip_info entries. Can be set with the Set_user_code
and User_code subprograms, or via the Action procedure for the generic
Traverse_Verbose procedure.
-!- Improved (if not completed) Unicode support (UTF-8); clearer
informations about encoding.
- '44', 3-Nov-2012:
- The libary provides now a complete toolset for managing Zip archives
(creating, updating, extracting)
-!- Zip_Streams: All methods now with pointer-free profiles
- Zip.Create:
- new Add_Compressed_Stream for copying entries from an archive
to another one
- file modification date and read-only attribute can be passed
to Add_File
- archive creation date is used when entries are added which
are from a memory buffer (Add_String)
- compression method can be changed "on the fly", before
adding new entries
- Zip.Compress: set a larger, standard output buffer size
- '43', 15-Sep-2012:
- Read-only attribute is recognized
- '42', 30-Jan-2012:
- Support for Zip archives appended to other files,
like a self-extracting archive with Zip-Ada in the executable
- Zip.Traverse (and then Extract all from Zip_Info) uses real file names
in the case-insensitive mode, instead of UPPER-cased names that are
there only for dictionary search
- Some improvements in the ReZip and ZipAda tools
- '41', 22-Jul-2011:
- Support for Unicode (UTF-8) entry names within archives; see: Zip,
Zip.Create, Zip_Streams
-!- Zip_Streams: Made names more consistent, previous names
preserved with the pragma 'Obsolescent'
- '40', 1-Mar-2011:
- New package Zip.Compress.Deflate, with a first (weak but straightforward)
compression technique for the Deflate format
- Some improvements in the ReZip and UnZipAda tools
- '39', 5-Oct-2010:
- Some fixes in the tools
- '38', 27-Feb-2010:
- ReZip: added '-fast_dec' and '-rand_stable' options
- Zip.Create: fixed major bottlenecks around Dir_entries
→ 5x faster overall for 1000 files, 356x for 100'000 files !
- '37', 1-Jan-2010:
- Minor changes which leads to a significant speedup on GNAT;
active use of Ada.Calendar can be totally avoided if this is desired
- '36', 21-Nov-2009:
- BZip2
method added for decompression
- Added Zip.Traverse_verbose
- Added an UnZip.Extract to extract all files, using a Zip_Info variable
- '35', 2-Nov-2009:
- major performance improvement
:
decompression 10x faster, compression 3x faster, thanks to
a workaround for slow 'Read, 'Write attributes in GNAT & ObjectAda
- ReZip: HTML display improved
- '34', 12-Oct-2009:
- ReZip: added '-defl' option for having a recompressed archive only
with Deflate or Store methods (most compatible)
- ReZip: added '-comp' option for comparing output against input
- ReZip: added '-touch' and '-lower' options
- '33', 18-Jun-2009:
- UnZip: added extract_as_text option (cf. UnZipAda with -a option)
- Zip: Zip_comment function added (cf. UnZipAda with -z option)
- '31', 20-Feb-2009:
- Added tiny demos: Demo_Zip, Demo_UnZip
-!- Zip.Create: Create / Finish: if Info.Stream is to a file,
the underlying archive file is also created / closed as well
- Added procedure Add_String in Zip.Create
- '30', 7-Feb-2009:
- Added support for the 64KB slide "enhanced deflate" format #9 in UnZip.Decompress
- Added Find_Zip tool
- Added Demo_csv_into_zip demo (production of numerous files into a zip archive)
- LZ77 output in "Reduce" is cached
- '29', 30-Jan-2009:
- Added Zip.LZ77 and Zip.Compress.Reduce .
The "Reduce" method compresses data with a Markov matrix
(in this implementation, the matrix is optimal)
- Added an ./extra directory with a tiny LZH encoder/decoder
- ...
- '26', 30-Aug-2008:
- zip archive can be any kind of stream (not only a file), for both
extraction (unzip) and creation (zip)
- ...
- '22', 14-Dec-2007:
- Added a new Compose_File_Name to UnZip.File_System_Routines,
see new "-d dir" option in the UnZipAda tool
- Added Zip.Compress, Zip.Compress.Shrink,
see the ZipAda tool, which has now the light "Shrink" compression
- ...
- '19', 9-Mar-2007:
- New Zip library with Zip stuff concerning not only decompression;
packages: Zip, Zip.Headers, Zip.CRC
- ...
- '11' : 29-Nov-2002:
New generic procedure for traversing a Zip directory structure.
As a demo, a tool (comp_zip) for comparing two .Zip archive files.
Useful when combining zip, pkzip, 7zip, kzip and zipmix to shrink
archives and check them after.
- ...
- '04' : 4-Jul-1999:
Reduce method debugged. Now all PKZIPs from 1989 to 1999 are supported.
File unzipping is finished and works.
User information more complete (see unzipada.adb).
1st publishing in the Public Ada Library.
- ...
- 7-Jun-1999
Begin of Pascal source translation via P2Ada