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