1*aaf4ece6Schristos 2*aaf4ece6SchristosOverview 3*aaf4ece6Schristos======== 4*aaf4ece6Schristos 5*aaf4ece6SchristosThis directory contains an update to the ZLib interface unit, 6*aaf4ece6Schristosdistributed by Borland as a Delphi supplemental component. 7*aaf4ece6Schristos 8*aaf4ece6SchristosThe original ZLib unit is Copyright (c) 1997,99 Borland Corp., 9*aaf4ece6Schristosand is based on zlib version 1.0.4. There are a series of bugs 10*aaf4ece6Schristosand security problems associated with that old zlib version, and 11*aaf4ece6Schristoswe recommend the users to update their ZLib unit. 12*aaf4ece6Schristos 13*aaf4ece6Schristos 14*aaf4ece6SchristosSummary of modifications 15*aaf4ece6Schristos======================== 16*aaf4ece6Schristos 17*aaf4ece6Schristos- Improved makefile, adapted to zlib version 1.2.1. 18*aaf4ece6Schristos 19*aaf4ece6Schristos- Some field types from TZStreamRec are changed from Integer to 20*aaf4ece6Schristos Longint, for consistency with the zlib.h header, and for 64-bit 21*aaf4ece6Schristos readiness. 22*aaf4ece6Schristos 23*aaf4ece6Schristos- The zlib_version constant is updated. 24*aaf4ece6Schristos 25*aaf4ece6Schristos- The new Z_RLE strategy has its corresponding symbolic constant. 26*aaf4ece6Schristos 27*aaf4ece6Schristos- The allocation and deallocation functions and function types 28*aaf4ece6Schristos (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl, 29*aaf4ece6Schristos and _malloc and _free are added as C RTL stubs. As a result, 30*aaf4ece6Schristos the original C sources of zlib can be compiled out of the box, 31*aaf4ece6Schristos and linked to the ZLib unit. 32*aaf4ece6Schristos 33*aaf4ece6Schristos 34*aaf4ece6SchristosSuggestions for improvements 35*aaf4ece6Schristos============================ 36*aaf4ece6Schristos 37*aaf4ece6SchristosCurrently, the ZLib unit provides only a limited wrapper around 38*aaf4ece6Schristosthe zlib library, and much of the original zlib functionality is 39*aaf4ece6Schristosmissing. Handling compressed file formats like ZIP/GZIP or PNG 40*aaf4ece6Schristoscannot be implemented without having this functionality. 41*aaf4ece6SchristosApplications that handle these formats are either using their own, 42*aaf4ece6Schristosduplicated code, or not using the ZLib unit at all. 43*aaf4ece6Schristos 44*aaf4ece6SchristosHere are a few suggestions: 45*aaf4ece6Schristos 46*aaf4ece6Schristos- Checksum class wrappers around adler32() and crc32(), similar 47*aaf4ece6Schristos to the Java classes that implement the java.util.zip.Checksum 48*aaf4ece6Schristos interface. 49*aaf4ece6Schristos 50*aaf4ece6Schristos- The ability to read and write raw deflate streams, without the 51*aaf4ece6Schristos zlib stream header and trailer. Raw deflate streams are used 52*aaf4ece6Schristos in the ZIP file format. 53*aaf4ece6Schristos 54*aaf4ece6Schristos- The ability to read and write gzip streams, used in the GZIP 55*aaf4ece6Schristos file format, and normally produced by the gzip program. 56*aaf4ece6Schristos 57*aaf4ece6Schristos- The ability to select a different compression strategy, useful 58*aaf4ece6Schristos to PNG and MNG image compression, and to multimedia compression 59*aaf4ece6Schristos in general. Besides the compression level 60*aaf4ece6Schristos 61*aaf4ece6Schristos TCompressionLevel = (clNone, clFastest, clDefault, clMax); 62*aaf4ece6Schristos 63*aaf4ece6Schristos which, in fact, could have used the 'z' prefix and avoided 64*aaf4ece6Schristos TColor-like symbols 65*aaf4ece6Schristos 66*aaf4ece6Schristos TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax); 67*aaf4ece6Schristos 68*aaf4ece6Schristos there could be a compression strategy 69*aaf4ece6Schristos 70*aaf4ece6Schristos TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle); 71*aaf4ece6Schristos 72*aaf4ece6Schristos- ZIP and GZIP stream handling via TStreams. 73*aaf4ece6Schristos 74*aaf4ece6Schristos 75*aaf4ece6Schristos-- 76*aaf4ece6SchristosCosmin Truta <cosmint@cs.ubbcluj.ro> 77