1275793eaSopenharmony_ci 2275793eaSopenharmony_ciOverview 3275793eaSopenharmony_ci======== 4275793eaSopenharmony_ci 5275793eaSopenharmony_ciThis directory contains an update to the ZLib interface unit, 6275793eaSopenharmony_cidistributed by Borland as a Delphi supplemental component. 7275793eaSopenharmony_ci 8275793eaSopenharmony_ciThe original ZLib unit is Copyright (c) 1997,99 Borland Corp., 9275793eaSopenharmony_ciand is based on zlib version 1.0.4. There are a series of bugs 10275793eaSopenharmony_ciand security problems associated with that old zlib version, and 11275793eaSopenharmony_ciwe recommend the users to update their ZLib unit. 12275793eaSopenharmony_ci 13275793eaSopenharmony_ci 14275793eaSopenharmony_ciSummary of modifications 15275793eaSopenharmony_ci======================== 16275793eaSopenharmony_ci 17275793eaSopenharmony_ci- Improved makefile, adapted to zlib version 1.2.1. 18275793eaSopenharmony_ci 19275793eaSopenharmony_ci- Some field types from TZStreamRec are changed from Integer to 20275793eaSopenharmony_ci Longint, for consistency with the zlib.h header, and for 64-bit 21275793eaSopenharmony_ci readiness. 22275793eaSopenharmony_ci 23275793eaSopenharmony_ci- The zlib_version constant is updated. 24275793eaSopenharmony_ci 25275793eaSopenharmony_ci- The new Z_RLE strategy has its corresponding symbolic constant. 26275793eaSopenharmony_ci 27275793eaSopenharmony_ci- The allocation and deallocation functions and function types 28275793eaSopenharmony_ci (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl, 29275793eaSopenharmony_ci and _malloc and _free are added as C RTL stubs. As a result, 30275793eaSopenharmony_ci the original C sources of zlib can be compiled out of the box, 31275793eaSopenharmony_ci and linked to the ZLib unit. 32275793eaSopenharmony_ci 33275793eaSopenharmony_ci 34275793eaSopenharmony_ciSuggestions for improvements 35275793eaSopenharmony_ci============================ 36275793eaSopenharmony_ci 37275793eaSopenharmony_ciCurrently, the ZLib unit provides only a limited wrapper around 38275793eaSopenharmony_cithe zlib library, and much of the original zlib functionality is 39275793eaSopenharmony_cimissing. Handling compressed file formats like ZIP/GZIP or PNG 40275793eaSopenharmony_cicannot be implemented without having this functionality. 41275793eaSopenharmony_ciApplications that handle these formats are either using their own, 42275793eaSopenharmony_ciduplicated code, or not using the ZLib unit at all. 43275793eaSopenharmony_ci 44275793eaSopenharmony_ciHere are a few suggestions: 45275793eaSopenharmony_ci 46275793eaSopenharmony_ci- Checksum class wrappers around adler32() and crc32(), similar 47275793eaSopenharmony_ci to the Java classes that implement the java.util.zip.Checksum 48275793eaSopenharmony_ci interface. 49275793eaSopenharmony_ci 50275793eaSopenharmony_ci- The ability to read and write raw deflate streams, without the 51275793eaSopenharmony_ci zlib stream header and trailer. Raw deflate streams are used 52275793eaSopenharmony_ci in the ZIP file format. 53275793eaSopenharmony_ci 54275793eaSopenharmony_ci- The ability to read and write gzip streams, used in the GZIP 55275793eaSopenharmony_ci file format, and normally produced by the gzip program. 56275793eaSopenharmony_ci 57275793eaSopenharmony_ci- The ability to select a different compression strategy, useful 58275793eaSopenharmony_ci to PNG and MNG image compression, and to multimedia compression 59275793eaSopenharmony_ci in general. Besides the compression level 60275793eaSopenharmony_ci 61275793eaSopenharmony_ci TCompressionLevel = (clNone, clFastest, clDefault, clMax); 62275793eaSopenharmony_ci 63275793eaSopenharmony_ci which, in fact, could have used the 'z' prefix and avoided 64275793eaSopenharmony_ci TColor-like symbols 65275793eaSopenharmony_ci 66275793eaSopenharmony_ci TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax); 67275793eaSopenharmony_ci 68275793eaSopenharmony_ci there could be a compression strategy 69275793eaSopenharmony_ci 70275793eaSopenharmony_ci TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle); 71275793eaSopenharmony_ci 72275793eaSopenharmony_ci- ZIP and GZIP stream handling via TStreams. 73275793eaSopenharmony_ci 74275793eaSopenharmony_ci 75275793eaSopenharmony_ci-- 76275793eaSopenharmony_ciCosmin Truta <cosmint@cs.ubbcluj.ro> 77