1
{$ifndef NO_SMART_LINK}
8
{ Needed for array of const }
10
{ for linux for linking with libc }
20
ZLIB_VERSION = '1.1.3';
22
{$ifdef netware} {zlib.nlm comes with netware6}
33
{ Compatible with paszlib }
42
TAllocfunc = function (opaque:pointer; items:uInt; size:uInt):pointer;cdecl;
43
TFreeFunc = procedure (opaque:pointer; address:pointer);cdecl;
45
TInternalState = record
47
PInternalState = ^TInternalstate;
57
state : PInternalState;
65
TZStreamRec = TZStream;
82
Z_STREAM_ERROR = -(2);
86
Z_VERSION_ERROR = -(6);
90
Z_BEST_COMPRESSION = 9;
91
Z_DEFAULT_COMPRESSION = -(1);
95
Z_DEFAULT_STRATEGY = 0;
105
function zlibVersionpchar:pchar;cdecl;external libz name 'zlibVersion';
106
function zlibVersion:string;
107
function deflate(var strm:TZStream; flush:longint):longint;cdecl;external libz name 'deflate';
108
function deflateEnd(var strm:TZStream):longint;cdecl;external libz name 'deflateEnd';
109
function inflate(var strm:TZStream; flush:longint):longint;cdecl;external libz name 'inflate';
110
function inflateEnd(var strm:TZStream):longint;cdecl;external libz name 'inflateEnd';
111
function deflateSetDictionary(var strm:TZStream;dictionary : pbytef; dictLength:uInt):longint;cdecl;external libz name 'deflateSetDictionary';
112
function deflateCopy(var dest,source:TZstream):longint;cdecl;external libz name 'deflateCopy';
113
function deflateReset(var strm:TZStream):longint;cdecl;external libz name 'deflateReset';
114
function deflateParams(var strm:TZStream; level:longint; strategy:longint):longint;cdecl;external libz name 'deflateParams';
115
function inflateSetDictionary(var strm:TZStream;dictionary : pbytef; dictLength:uInt):longint;cdecl;external libz name 'inflateSetDictionary';
116
function inflateSync(var strm:TZStream):longint;cdecl;external libz name 'inflateSync';
117
function inflateReset(var strm:TZStream):longint;cdecl;external libz name 'inflateReset';
118
function compress(dest:pbytef;destLen:puLongf; source : pbytef; sourceLen:uLong):cint;cdecl;external libz name 'compress';
119
function compress2(dest:pbytef;destLen:puLongf; source : pbytef; sourceLen:uLong; level:cint):cint;cdecl;external libz name 'compress2';
120
function uncompress(dest:pbytef;destLen:puLongf; source : pbytef; sourceLen:uLong):cint;cdecl;external libz name 'uncompress';
121
function gzopen(path:pchar; mode:pchar):gzFile;cdecl;external libz name 'gzopen';
122
function gzdopen(fd:longint; mode:pchar):gzFile;cdecl;external libz name 'gzdopen';
123
function gzsetparams(thefile:gzFile; level:longint; strategy:longint):longint;cdecl;external libz name 'gzsetparams';
124
function gzread(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external libz name 'gzread';
125
function gzwrite(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external libz name 'gzwrite';
126
function gzprintf(thefile:gzFile; format:pbytef; args:array of const):longint;cdecl;external libz name 'gzprintf';
127
function gzputs(thefile:gzFile; s:pbytef):longint;cdecl;external libz name 'gzputs';
128
function gzgets(thefile:gzFile; buf:pbytef; len:longint):pbytef;cdecl;external libz name 'gzgets';
129
function gzputc(thefile:gzFile; c:char):char;cdecl;external libz name 'gzputc';
130
function gzgetc(thefile:gzFile):char;cdecl;external libz name 'gzgetc';
131
function gzflush(thefile:gzFile; flush:longint):longint;cdecl;external libz name 'gzflush';
132
function gzseek(thefile:gzFile; offset:z_off_t; whence:longint):z_off_t;cdecl;external libz name 'gzseek';
133
function gzrewind(thefile:gzFile):longint;cdecl;external libz name 'gzrewind';
134
function gztell(thefile:gzFile):z_off_t;cdecl;external libz name 'gztell';
135
function gzeof(thefile:gzFile):longbool;cdecl;external libz name 'gzeof';
136
function gzclose(thefile:gzFile):longint;cdecl;external libz name 'gzclose';
137
function gzerror(thefile:gzFile; var errnum:longint):pbytef;cdecl;external libz name 'gzerror';
138
function adler32(adler:uLong;buf : pbytef; len:uInt):uLong;cdecl;external libz name 'adler32';
139
function crc32(crc:uLong;buf : pbytef; len:uInt):uLong;cdecl;external libz name 'crc32';
140
function deflateInit_(var strm:TZStream; level:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'deflateInit_';
141
function inflateInit_(var strm:TZStream; version:pchar; stream_size:longint):longint;cdecl;external libz name 'inflateInit_';
142
function deflateInit(var strm:TZStream;level : longint) : longint;
143
function inflateInit(var strm:TZStream) : longint;
144
function deflateInit2_(var strm:TZStream; level:longint; method:longint; windowBits:longint; memLevel:longint;strategy:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'deflateInit2_';
145
function inflateInit2_(var strm:TZStream; windowBits:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'inflateInit2_';
146
function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;
147
function inflateInit2(var strm:TZStream;windowBits : longint) : longint;
148
function zErrorpchar(err:longint):pchar;cdecl;external libz name 'zError';
149
function zError(err:longint):string;
150
function inflateSyncPoint(z:PZstream):longint;cdecl;external libz name 'inflateSyncPoint';
151
function get_crc_table:pointer;cdecl;external libz name 'get_crc_table';
153
function zlibAllocMem(AppData: Pointer; Items, Size: Integer): Pointer; cdecl;
154
procedure zlibFreeMem(AppData, Block: Pointer); cdecl;
161
function zlibversion : string;
163
zlibversion:=strpas(zlibversionpchar);
166
function deflateInit(var strm:TZStream;level : longint) : longint;
168
deflateInit:=deflateInit_(strm,level,ZLIB_VERSION,sizeof(TZStream));
171
function inflateInit(var strm:TZStream) : longint;
173
inflateInit:=inflateInit_(strm,ZLIB_VERSION,sizeof(TZStream));
176
function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;
178
deflateInit2:=deflateInit2_(strm,level,method,windowBits,memLevel,strategy,ZLIB_VERSION,sizeof(TZStream));
181
function inflateInit2(var strm:TZStream;windowBits : longint) : longint;
183
inflateInit2:=inflateInit2_(strm,windowBits,ZLIB_VERSION,sizeof(TZStream));
186
function zError(err:longint):string;
188
zerror:=Strpas(zErrorpchar(err));
191
function zlibAllocMem(AppData: Pointer; Items, Size: Integer): Pointer; cdecl;
194
Result := AllocMem(Items * Size);
197
procedure zlibFreeMem(AppData, Block: Pointer); cdecl;