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