9 ZLIB_VERSION = '1.1.3';
18 alloc_func = function(opaque: voidpf; items, size: uInt): voidpf;
20 free_func = procedure(opaque, address: voidpf);
23 internal_state = Pointer;
25 z_streamp = ^z_stream;
26 z_stream = packed record
27 next_in: pBytef; // next input byte
28 avail_in: uInt; // number of bytes available at next_in
29 total_in: uLong; // total nb of input bytes read so far
31 next_out: pBytef; // next output byte should be put there
32 avail_out: uInt; // remaining free space at next_out
33 total_out: uLong; // total nb of bytes output so far
35 msg: PChar; // last error message, NULL if no error
36 state: internal_state; // not visible by applications
38 zalloc: alloc_func; // used to allocate the internal state
39 zfree: free_func; // used to free the internal state
40 opaque: voidpf; // private data object passed to zalloc and zfree
42 data_type: int; // best guess about the data type: ascii or binary
43 adler: uLong; // adler32 value of the uncompressed data
44 reserved: uLong; // reserved for future use
58 Z_BEST_COMPRESSION = 9;
59 Z_DEFAULT_COMPRESSION = -1;
63 Z_DEFAULT_STRATEGY = 0;
73 function adler32(adler: uLong; const buf: pBytef; len: uInt): uLong;
75 function crc32(crc: uLong; const buf: pBytef; len: uInt): uLong;
77 function deflate(strm: z_streamp; flush: int): int;
79 function deflateCopy(dest, source: z_streamp): int;
81 function deflateEnd(strm: z_streamp): int;
83 function deflateInit2_(strm: z_streamp; level, method,
84 windowBits, memLevel, strategy: int;
85 const version: PChar; stream_size: int): int;
87 function deflateInit_(strm: z_streamp; level: int;
88 const version: PChar; stream_size: int): int;
90 function deflateParams(strm: z_streamp; level, strategy: int): int;
92 function deflateReset(strm: z_streamp): int;
94 function deflateSetDictionary(strm: z_streamp;
95 const dictionary: pBytef;
96 dictLength: uInt): int;
98 function inflate(strm: z_streamp; flush: int): int;
100 function inflateEnd(strm: z_streamp): int;
102 function inflateInit2_(strm: z_streamp; windowBits: int;
103 const version: PChar; stream_size: int): int;
105 function inflateInit_(strm: z_streamp; const version: PChar;
106 stream_size: int): int;
108 function inflateReset(strm: z_streamp): int;
110 function inflateSetDictionary(strm: z_streamp;
111 const dictionary: pBytef;
112 dictLength: uInt): int;
114 function inflateSync(strm: z_streamp): int;
117 function deflateInit(strm: z_streamp; level: int): int;
118 function deflateInit2(strm: z_streamp; level, method, windowBits,
119 memLevel, strategy: int): int;
120 function inflateInit(strm: z_streamp): int;
121 function inflateInit2(strm: z_streamp; windowBits: int): int;
125 function deflateInit(strm: z_streamp; level: int): int;
127 Result := deflateInit_(strm, level, ZLIB_VERSION, sizeof(z_stream));
130 function deflateInit2(strm: z_streamp; level, method, windowBits,
131 memLevel, strategy: int): int;
133 Result := deflateInit2_(strm, level, method, windowBits, memLevel,
134 strategy, ZLIB_VERSION, sizeof(z_stream));
137 function inflateInit(strm: z_streamp): int;
139 Result := inflateInit_(strm, ZLIB_VERSION, sizeof(z_stream));
142 function inflateInit2(strm: z_streamp; windowBits: int): int;
144 Result := inflateInit2_(strm, windowBits, ZLIB_VERSION,
149 zlibDLL = 'png32bd.dll';
151 function adler32; external zlibDLL;
152 function crc32; external zlibDLL;
153 function deflate; external zlibDLL;
154 function deflateCopy; external zlibDLL;
155 function deflateEnd; external zlibDLL;
156 function deflateInit2_; external zlibDLL;
157 function deflateInit_; external zlibDLL;
158 function deflateParams; external zlibDLL;
159 function deflateReset; external zlibDLL;
160 function deflateSetDictionary; external zlibDLL;
161 function inflate; external zlibDLL;
162 function inflateEnd; external zlibDLL;
163 function inflateInit2_; external zlibDLL;
164 function inflateInit_; external zlibDLL;
165 function inflateReset; external zlibDLL;
166 function inflateSetDictionary; external zlibDLL;
167 function inflateSync; external zlibDLL;