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