mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 13:09:43 +02:00
* paszlib compatibility
This commit is contained in:
parent
8cc5bdb728
commit
762742960e
@ -12,13 +12,13 @@ const
|
||||
libz='z';
|
||||
|
||||
type
|
||||
|
||||
{ Compatibility types }
|
||||
Uint = cardinal;
|
||||
Ulong = Cardinal;
|
||||
Ulongf = Cardinal;
|
||||
{ Compatible with paszlib }
|
||||
Uint = Longint;
|
||||
Ulong = Longint;
|
||||
Ulongf = Longint;
|
||||
Pulongf = ^Ulongf;
|
||||
z_off_t = longint;
|
||||
pbytef = ^byte;
|
||||
|
||||
TAllocfunc = function (opaque:pointer; items:uInt; size:uInt):pointer;cdecl;
|
||||
TFreeFunc = procedure (opaque:pointer; address:pointer);cdecl;
|
||||
@ -28,13 +28,13 @@ type
|
||||
PInternalState = ^TInternalstate;
|
||||
|
||||
TZStream = record
|
||||
next_in : pchar;
|
||||
next_in : pbytef;
|
||||
avail_in : uInt;
|
||||
total_in : uLong;
|
||||
next_out : pchar;
|
||||
next_out : pbytef;
|
||||
avail_out : uInt;
|
||||
total_out : uLong;
|
||||
msg : pchar;
|
||||
msg : pbytef;
|
||||
state : PInternalState;
|
||||
zalloc : TAllocFunc;
|
||||
zfree : TFreeFunc;
|
||||
@ -82,30 +82,30 @@ const
|
||||
|
||||
Z_NULL = 0;
|
||||
|
||||
function zlibVersionPchar:pchar;cdecl;external libz name 'zlibVersion';
|
||||
function zlibVersionpchar:pchar;cdecl;external libz name 'zlibVersion';
|
||||
function zlibVersion:string;
|
||||
function deflate(var strm:TZStream; flush:longint):longint;cdecl;external libz name 'deflate';
|
||||
function deflateEnd(var strm:TZStream):longint;cdecl;external libz name 'deflateEnd';
|
||||
function inflate(var strm:TZStream; flush:longint):longint;cdecl;external libz name 'inflate';
|
||||
function inflateEnd(var strm:TZStream):longint;cdecl;external libz name 'inflateEnd';
|
||||
function deflateSetDictionary(var strm:TZStream;dictionary : pchar; dictLength:uInt):longint;cdecl;external libz name 'deflateSetDictionary';
|
||||
function deflateSetDictionary(var strm:TZStream;dictionary : pbytef; dictLength:uInt):longint;cdecl;external libz name 'deflateSetDictionary';
|
||||
function deflateCopy(var dest,source:TZstream):longint;cdecl;external libz name 'deflateCopy';
|
||||
function deflateReset(var strm:TZStream):longint;cdecl;external libz name 'deflateReset';
|
||||
function deflateParams(var strm:TZStream; level:longint; strategy:longint):longint;cdecl;external libz name 'deflateParams';
|
||||
function inflateSetDictionary(var strm:TZStream;dictionary : pchar; dictLength:uInt):longint;cdecl;external libz name 'inflateSetDictionary';
|
||||
function inflateSetDictionary(var strm:TZStream;dictionary : pbytef; dictLength:uInt):longint;cdecl;external libz name 'inflateSetDictionary';
|
||||
function inflateSync(var strm:TZStream):longint;cdecl;external libz name 'inflateSync';
|
||||
function inflateReset(var strm:TZStream):longint;cdecl;external libz name 'inflateReset';
|
||||
function compress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;external libz name 'compress';
|
||||
function compress2(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong; level:longint):longint;cdecl;external libz name 'compress2';
|
||||
function uncompress(dest:pchar;destLen:uLongf; source : pchar; sourceLen:uLong):longint;cdecl;external libz name 'uncompress';
|
||||
function gzopen(path:pchar; mode:pchar):gzFile;cdecl;external libz name 'gzopen';
|
||||
function gzdopen(fd:longint; mode:pchar):gzFile;cdecl;external libz name 'gzdopen';
|
||||
function compress(dest:pbytef;destLen:uLongf; source : pbytef; sourceLen:uLong):longint;cdecl;external libz name 'compress';
|
||||
function compress2(dest:pbytef;destLen:uLongf; source : pbytef; sourceLen:uLong; level:longint):longint;cdecl;external libz name 'compress2';
|
||||
function uncompress(dest:pbytef;destLen:uLongf; source : pbytef; sourceLen:uLong):longint;cdecl;external libz name 'uncompress';
|
||||
function gzopen(path:pbytef; mode:pbytef):gzFile;cdecl;external libz name 'gzopen';
|
||||
function gzdopen(fd:longint; mode:pbytef):gzFile;cdecl;external libz name 'gzdopen';
|
||||
function gzsetparams(thefile:gzFile; level:longint; strategy:longint):longint;cdecl;external libz name 'gzsetparams';
|
||||
function gzread(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external libz name 'gzread';
|
||||
function gzwrite(thefile:gzFile; buf:pointer; len:cardinal):longint;cdecl;external libz name 'gzwrite';
|
||||
function gzprintf(thefile:gzFile; format:pchar; args:array of const):longint;cdecl;external libz name 'gzprintf';
|
||||
function gzputs(thefile:gzFile; s:pchar):longint;cdecl;external libz name 'gzputs';
|
||||
function gzgets(thefile:gzFile; buf:pchar; len:longint):pchar;cdecl;external libz name 'gzgets';
|
||||
function gzprintf(thefile:gzFile; format:pbytef; args:array of const):longint;cdecl;external libz name 'gzprintf';
|
||||
function gzputs(thefile:gzFile; s:pbytef):longint;cdecl;external libz name 'gzputs';
|
||||
function gzgets(thefile:gzFile; buf:pbytef; len:longint):pbytef;cdecl;external libz name 'gzgets';
|
||||
function gzputc(thefile:gzFile; c:char):char;cdecl;external libz name 'gzputc';
|
||||
function gzgetc(thefile:gzFile):char;cdecl;external libz name 'gzgetc';
|
||||
function gzflush(thefile:gzFile; flush:longint):longint;cdecl;external libz name 'gzflush';
|
||||
@ -114,9 +114,9 @@ function gzrewind(thefile:gzFile):longint;cdecl;external libz name 'gzrewind';
|
||||
function gztell(thefile:gzFile):z_off_t;cdecl;external libz name 'gztell';
|
||||
function gzeof(thefile:gzFile):longbool;cdecl;external libz name 'gzeof';
|
||||
function gzclose(thefile:gzFile):longint;cdecl;external libz name 'gzclose';
|
||||
function gzerror(thefile:gzFile; var errnum:longint):pchar;cdecl;external libz name 'gzerror';
|
||||
function adler32(adler:uLong;buf : pchar; len:uInt):uLong;cdecl;external libz name 'adler32';
|
||||
function crc32(crc:uLong;buf : pchar; len:uInt):uLong;cdecl;external libz name 'crc32';
|
||||
function gzerror(thefile:gzFile; var errnum:longint):pbytef;cdecl;external libz name 'gzerror';
|
||||
function adler32(adler:uLong;buf : pbytef; len:uInt):uLong;cdecl;external libz name 'adler32';
|
||||
function crc32(crc:uLong;buf : pbytef; len:uInt):uLong;cdecl;external libz name 'crc32';
|
||||
function deflateInit_(var strm:TZStream; level:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'deflateInit_';
|
||||
function inflateInit_(var strm:TZStream; version:pchar; stream_size:longint):longint;cdecl;external libz name 'inflateInit_';
|
||||
function deflateInit(var strm:TZStream;level : longint) : longint;
|
||||
@ -125,7 +125,7 @@ function deflateInit2_(var strm:TZStream; level:longint; method:longint; windowB
|
||||
function inflateInit2_(var strm:TZStream; windowBits:longint; version:pchar; stream_size:longint):longint;cdecl;external libz name 'inflateInit2_';
|
||||
function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;
|
||||
function inflateInit2(var strm:TZStream;windowBits : longint) : longint;
|
||||
function zErrorPchar(err:longint):pchar;cdecl;external libz name 'zError';
|
||||
function zErrorpchar(err:longint):pchar;cdecl;external libz name 'zError';
|
||||
function zError(err:longint):string;
|
||||
function inflateSyncPoint(z:PZstream):longint;cdecl;external libz name 'inflateSyncPoint';
|
||||
function get_crc_table:pointer;cdecl;external libz name 'get_crc_table';
|
||||
@ -138,7 +138,7 @@ uses
|
||||
|
||||
function zlibversion : string;
|
||||
begin
|
||||
zlibversion:=strpas(zlibversionPchar);
|
||||
zlibversion:=strpas(zlibversionpchar);
|
||||
end;
|
||||
|
||||
function deflateInit(var strm:TZStream;level : longint) : longint;
|
||||
@ -163,7 +163,7 @@ function inflateInit2(var strm:TZStream;windowBits : longint) : longint;
|
||||
|
||||
function zError(err:longint):string;
|
||||
begin
|
||||
zerror:=Strpas(zErrorPchar(err));
|
||||
zerror:=Strpas(zErrorpchar(err));
|
||||
end;
|
||||
|
||||
end.
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user