kusano fc6ab3
kusano fc6ab3
Overview
kusano fc6ab3
========
kusano fc6ab3
kusano fc6ab3
This directory contains an update to the ZLib interface unit,
kusano fc6ab3
distributed by Borland as a Delphi supplemental component.
kusano fc6ab3
kusano fc6ab3
The original ZLib unit is Copyright (c) 1997,99 Borland Corp.,
kusano fc6ab3
and is based on zlib version 1.0.4.  There are a series of bugs
kusano fc6ab3
and security problems associated with that old zlib version, and
kusano fc6ab3
we recommend the users to update their ZLib unit.
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
Summary of modifications
kusano fc6ab3
========================
kusano fc6ab3
kusano fc6ab3
- Improved makefile, adapted to zlib version 1.2.1.
kusano fc6ab3
kusano fc6ab3
- Some field types from TZStreamRec are changed from Integer to
kusano fc6ab3
  Longint, for consistency with the zlib.h header, and for 64-bit
kusano fc6ab3
  readiness.
kusano fc6ab3
kusano fc6ab3
- The zlib_version constant is updated.
kusano fc6ab3
kusano fc6ab3
- The new Z_RLE strategy has its corresponding symbolic constant.
kusano fc6ab3
kusano fc6ab3
- The allocation and deallocation functions and function types
kusano fc6ab3
  (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl,
kusano fc6ab3
  and _malloc and _free are added as C RTL stubs.  As a result,
kusano fc6ab3
  the original C sources of zlib can be compiled out of the box,
kusano fc6ab3
  and linked to the ZLib unit.
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
Suggestions for improvements
kusano fc6ab3
============================
kusano fc6ab3
kusano fc6ab3
Currently, the ZLib unit provides only a limited wrapper around
kusano fc6ab3
the zlib library, and much of the original zlib functionality is
kusano fc6ab3
missing.  Handling compressed file formats like ZIP/GZIP or PNG
kusano fc6ab3
cannot be implemented without having this functionality.
kusano fc6ab3
Applications that handle these formats are either using their own,
kusano fc6ab3
duplicated code, or not using the ZLib unit at all.
kusano fc6ab3
kusano fc6ab3
Here are a few suggestions:
kusano fc6ab3
kusano fc6ab3
- Checksum class wrappers around adler32() and crc32(), similar
kusano fc6ab3
  to the Java classes that implement the java.util.zip.Checksum
kusano fc6ab3
  interface.
kusano fc6ab3
kusano fc6ab3
- The ability to read and write raw deflate streams, without the
kusano fc6ab3
  zlib stream header and trailer.  Raw deflate streams are used
kusano fc6ab3
  in the ZIP file format.
kusano fc6ab3
kusano fc6ab3
- The ability to read and write gzip streams, used in the GZIP
kusano fc6ab3
  file format, and normally produced by the gzip program.
kusano fc6ab3
kusano fc6ab3
- The ability to select a different compression strategy, useful
kusano fc6ab3
  to PNG and MNG image compression, and to multimedia compression
kusano fc6ab3
  in general.  Besides the compression level
kusano fc6ab3
kusano fc6ab3
    TCompressionLevel = (clNone, clFastest, clDefault, clMax);
kusano fc6ab3
kusano fc6ab3
  which, in fact, could have used the 'z' prefix and avoided
kusano fc6ab3
  TColor-like symbols
kusano fc6ab3
kusano fc6ab3
    TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax);
kusano fc6ab3
kusano fc6ab3
  there could be a compression strategy
kusano fc6ab3
kusano fc6ab3
    TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle);
kusano fc6ab3
kusano fc6ab3
- ZIP and GZIP stream handling via TStreams.
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
--
kusano fc6ab3
Cosmin Truta <cosmint@cs.ubbcluj.ro></cosmint@cs.ubbcluj.ro>