ZZIPlib Library


0.10.27  

The Library

The zziplib library offers users the ability to easily extract data from files archived in a single zip file. This way, programs that use many "read-only" files from a program specific source directory can have a single zip archive

This library offers only a (free) subset of compression methods provided in a full implementation but that is well enough. The idea here is that zip/unzip utilities can be used to create archives that will later be read by using this library. Yet those programmes (or a library with their functionality) is not needed in that final operation.

Magic Wrappers

A ZZIP_FILE can serve as a replacement for a normal file descriptor. As long as it is only used for reading a file, the zzlib-user can actually replace the posix functions open/read/close by their counterparts from the zziplib library: zzip_open/zzip_read/zzip_close.

As long as the filename path given to zzip_open refers to a real file in the filesystem, it will almost directly forward the call to the respective posix open call. Any subsequent calls to zzip_read will then be forwarded to the posix read call on the memorized file descriptor.

The real benefit of the zziplib library comes about when the filename argument does actually refer to a file that is zipped in a zip-archive. It happens that even both a real file and a zipped file can live under the same pathname given to the zzip_open call, whereas the real file is used in preference.

When opening a file called 'test/README' it may refer to a real file (if one exists) or it can refer to a file 'README' that is compressed in an archive named test.zip. There are also wrappers for posix 'dirent.h'-like functions that can read a zip-archive as if it were a normal directory. See the examples programs that come with the library: zzcat.c and zzdir.c .

A Bit Of History

You'll find gzip using the same compression that was written by Jean-loup Gailly for the Info-Zip Group whose Zip program is compatible with msdos PKZIP program from PK Ware. Then, in collaboration with Mark Adler he wrote the zlib compression library which was later standardized in the zlib RFCs, namely RFC 1950 zlib 3.3, RFC 1951 deflate 1.3 and RFC 1952 gzip 4.3. The free algorithm can be found in lots of places today including PPP packet compression and PNG picture compression.

 

Documentation

Download

Tarballs, RPM-archive and windll-ZIPs can be downloaded from the sourceforge file list
(accessible from its sourceforge project index and reachable from the sourceforge zziplib.sf.net webpage.

Installation

The installation is from the source .tar.gz tarball does follow the simple gnu style: type ''configure && make install'' in the unpacked directory. This will actually perform the usual sequence of ''configure && make && make install''. The use of ''make rpm'' will make rpms based on your system setup, and using a decent mingw32 compiler (e.g. the crossgcc from libsdl.org/Xmingw32) will allow you to create windows dlls using a gnu development environment. MSVC and Borland support (Make-)files should be easy to be derived from the Makefile.am

Contact

The library was developed by Guido Draheim based on the library zip08x by Tomi Ollila (many thanks for his support of the zziplib project). He has provided a good deal of testing rounds and very helpful comments. It may be assumed that this library supersedes zip08x. Anyone who wants to contribute in accessing zip-archives with the zlib-library is hereby kindly invited to send us comments and sourcecode.

Links

The zziplib library must be linked with the free zlib package from the Info-Zip Group. As the original seems to be mostly defunct, look at the new zlibHome maintained by Greg Roelofs. There are other zzip like projects, e.g. zipios++ that mangles zip access into C++ iostream facilities.


guidod@gmx.de 1.Jun.2000 (generated 2002-07-18)