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