* Dotted filenames for package paszlib

This commit is contained in:
Michaël Van Canneyt 2023-03-06 14:57:59 +01:00
parent f3c74295e2
commit ab8dc45ff8
39 changed files with 318 additions and 47 deletions

View File

@ -0,0 +1,3 @@
unit System.ZLib.Adler;
{$DEFINE FPC_DOTTEDUNITS}
{$i adler.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Gzio;
{$DEFINE FPC_DOTTEDUNITS}
{$i gzio.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Infblock;
{$DEFINE FPC_DOTTEDUNITS}
{$i infblock.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Infcodes;
{$DEFINE FPC_DOTTEDUNITS}
{$i infcodes.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Inffast;
{$DEFINE FPC_DOTTEDUNITS}
{$i inffast.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Inftrees;
{$DEFINE FPC_DOTTEDUNITS}
{$i inftrees.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Infutil;
{$DEFINE FPC_DOTTEDUNITS}
{$i infutil.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Paszlib;
{$DEFINE FPC_DOTTEDUNITS}
{$i paszlib.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Trees;
{$DEFINE FPC_DOTTEDUNITS}
{$i trees.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Unzip;
{$DEFINE FPC_DOTTEDUNITS}
{$i unzip.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zbase;
{$DEFINE FPC_DOTTEDUNITS}
{$i zbase.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zcompres;
{$DEFINE FPC_DOTTEDUNITS}
{$i zcompres.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zdeflate;
{$DEFINE FPC_DOTTEDUNITS}
{$i zdeflate.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zinflate;
{$DEFINE FPC_DOTTEDUNITS}
{$i zinflate.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zip;
{$DEFINE FPC_DOTTEDUNITS}
{$i zip.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zipper;
{$DEFINE FPC_DOTTEDUNITS}
{$i zipper.pp}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Ziputils;
{$DEFINE FPC_DOTTEDUNITS}
{$i ziputils.pas}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zstream;
{$DEFINE FPC_DOTTEDUNITS}
{$i zstream.pp}

View File

@ -0,0 +1,3 @@
unit System.ZLib.Zuncompr;
{$DEFINE FPC_DOTTEDUNITS}
{$i zuncompr.pas}

View File

@ -0,0 +1,21 @@
src/zstream.pp=namespaced/System.ZLib.Zstream.pp
{s*:src/}=namespaced/
{i+:src/}
src/adler.pas=namespaced/System.ZLib.Adler.pas
src/unzip.pas=namespaced/System.ZLib.Unzip.pas
src/inffast.pas=namespaced/System.ZLib.Inffast.pas
src/zbase.pas=namespaced/System.ZLib.Zbase.pas
src/infutil.pas=namespaced/System.ZLib.Infutil.pas
src/zdeflate.pas=namespaced/System.ZLib.Zdeflate.pas
src/zcompres.pas=namespaced/System.ZLib.Zcompres.pas
src/zip.pas=namespaced/System.ZLib.Zip.pas
src/zuncompr.pas=namespaced/System.ZLib.Zuncompr.pas
src/gzio.pas=namespaced/System.ZLib.Gzio.pas
src/infblock.pas=namespaced/System.ZLib.Infblock.pas
src/infcodes.pas=namespaced/System.ZLib.Infcodes.pas
src/inftrees.pas=namespaced/System.ZLib.Inftrees.pas
src/zinflate.pas=namespaced/System.ZLib.Zinflate.pas
src/trees.pas=namespaced/System.ZLib.Trees.pas
src/zipper.pp=namespaced/System.ZLib.Zipper.pp
src/ziputils.pas=namespaced/System.ZLib.Ziputils.pas
src/paszlib.pas=namespaced/System.ZLib.Paszlib.pas

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit adler;
{$ENDIF FPC_DOTTEDUNITS}
{
adler32.c -- compute the Adler-32 checksum of a data stream

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit gzio;
{$ENDIF FPC_DOTTEDUNITS}
{
Pascal unit based on gzio.c -- IO on .gz files
@ -15,6 +17,15 @@ interface
{$mode objfpc}
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
{$ifdef Unix}
UnixApi.Base,
{$else}
TP.DOS,
{$endif}
System.ZLib.Zbase, System.Hash.Crc, System.ZLib.Zdeflate, System.ZLib.Zinflate;
{$ELSE FPC_DOTTEDUNITS}
uses
{$ifdef UNIX}
baseunix,
@ -22,6 +33,7 @@ uses
dos,
{$endif}
zbase, crc, zdeflate, zinflate;
{$ENDIF FPC_DOTTEDUNITS}
type gzFile = pointer;
type z_off_t = int64;

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit infblock;
{$ENDIF FPC_DOTTEDUNITS}
{ infblock.h and
infblock.c -- interpret and process block types to last block
@ -13,8 +15,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase;
{$ENDIF FPC_DOTTEDUNITS}
function inflate_blocks_new(var z : z_stream;
c : check_func; { check function }
@ -42,8 +49,13 @@ function inflate_blocks_sync_point(var s : inflate_blocks_state) : integer;
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Infcodes, System.ZLib.Inftrees, System.ZLib.Infutil{$IFDEF ZLIB_DEBUG}, System.SysUtils{$ENDIF};
{$ELSE FPC_DOTTEDUNITS}
uses
infcodes, inftrees, infutil{$IFDEF ZLIB_DEBUG}, SysUtils{$ENDIF};
{$ENDIF FPC_DOTTEDUNITS}
{ Tables for deflate from PKZIP's appnote.txt. }
Const

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit infcodes;
{$ENDIF FPC_DOTTEDUNITS}
{ infcodes.c -- process literals and length/distance pairs
Copyright (C) 1995-1998 Mark Adler
@ -12,8 +14,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase;
{$ENDIF FPC_DOTTEDUNITS}
function inflate_codes_new (bl : cardinal;
bd : cardinal;
@ -30,8 +37,13 @@ procedure inflate_codes_free(var c : pInflate_codes_state;
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Infutil, System.ZLib.Inffast{$IFDEF ZLIB_DEBUG}, System.SysUtils{$ENDIF};
{$ELSE FPC_DOTTEDUNITS}
uses
infutil, inffast{$IFDEF ZLIB_DEBUG}, SysUtils{$ENDIF};
{$ENDIF FPC_DOTTEDUNITS}
function inflate_codes_new (bl : cardinal;
@ -585,4 +597,4 @@ begin
{$ENDIF}
end;
end.
end.

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
Unit InfFast;
{$ENDIF FPC_DOTTEDUNITS}
{
inffast.h and
@ -15,8 +17,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase;
{$ENDIF FPC_DOTTEDUNITS}
function inflate_fast( bl : cardinal;
bd : cardinal;
@ -28,8 +35,13 @@ function inflate_fast( bl : cardinal;
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Infutil{$IFDEF ZLIB_DEBUG}, System.SysUtils{$ENDIF};
{$ELSE FPC_DOTTEDUNITS}
uses
infutil{$IFDEF ZLIB_DEBUG}, SysUtils{$ENDIF};
{$ENDIF FPC_DOTTEDUNITS}
{ Called with number of bytes left to write in window at least 258
@ -312,4 +324,4 @@ begin
inflate_fast := Z_OK;
end;
end.
end.

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit inftrees;
{$ENDIF FPC_DOTTEDUNITS}
{ inftrees.h -- header to use inftrees.c
inftrees.c -- generate Huffman trees for efficient decoding
@ -17,8 +19,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase;
{$ENDIF FPC_DOTTEDUNITS}
{ Maximum size of dynamic tree. The maximum found in a long but non-

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
Unit infutil;
{$ENDIF FPC_DOTTEDUNITS}
{ types and macros common to blocks and codes
Copyright (C) 1995-1998 Mark Adler
@ -16,8 +18,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase;
{$ENDIF FPC_DOTTEDUNITS}
{ copy as much as possible from the sliding window to the output area }
function inflate_flush(var s : inflate_blocks_state;

View File

@ -1,11 +1,18 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit PasZLib;
{$ENDIF FPC_DOTTEDUNITS}
{$inline on}
interface
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase;
{$ENDIF FPC_DOTTEDUNITS}
const
ZLIB_VERSION = '1.2';
@ -105,67 +112,72 @@ function get_crc_table:pointer;inline;
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zdeflate,System.ZLib.Zinflate,System.ZLib.Zcompres,System.ZLib.Zuncompr,System.ZLib.Gzio,System.ZLib.Adler,System.Hash.Crc;
{$ELSE FPC_DOTTEDUNITS}
uses
zdeflate,zinflate,zcompres,zuncompr,gzio,adler,crc;
{$ENDIF FPC_DOTTEDUNITS}
function zlibVersion:string;inline;
begin
zlibversion:=zbase.zlibversion;
zlibversion:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zbase.zlibversion;
end;
function deflate(var strm:TZstream; flush:longint):longint;inline;
begin
deflate:=zdeflate.deflate(strm,flush);
deflate:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflate(strm,flush);
end;
function deflateEnd(var strm:TZstream):longint;inline;
begin
deflateEnd:=zdeflate.deflateEnd(strm);
deflateEnd:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateEnd(strm);
end;
function inflate(var strm:TZstream; flush:longint):longint;inline;
begin
inflate:=zinflate.inflate(strm,flush);
inflate:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflate(strm,flush);
end;
function inflateEnd(var strm:TZstream):longint;inline;
begin
inflateEnd:=zinflate.inflateEnd(strm);
inflateEnd:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateEnd(strm);
end;
function deflateSetDictionary(var strm:TZstream;dictionary : PAnsiChar; dictLength:cardinal):longint;inline;
begin
deflateSetDictionary:=zdeflate.deflateSetDictionary(strm,Pbyte(dictionary),dictlength);
deflateSetDictionary:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateSetDictionary(strm,Pbyte(dictionary),dictlength);
end;
function deflateCopy(var dest,source:TZstream):longint;inline;
begin
deflateCopy:=zdeflate.deflateCopy(@dest,@source);
deflateCopy:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateCopy(@dest,@source);
end;
function deflateReset(var strm:TZstream):longint;inline;
begin
deflateReset:=zdeflate.deflateReset(strm);
deflateReset:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateReset(strm);
end;
function deflateParams(var strm:TZstream; level:longint; strategy:longint):longint;inline;
begin
deflateParams:=zdeflate.deflateParams(strm,level,strategy);
deflateParams:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateParams(strm,level,strategy);
end;
function inflateSetDictionary(var strm:TZStream;dictionary : PAnsiChar; dictLength:cardinal):longint;inline;
begin
inflateSetDictionary:=zinflate.inflateSetDictionary(strm,Pbyte(dictionary),dictlength);
inflateSetDictionary:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateSetDictionary(strm,Pbyte(dictionary),dictlength);
end;
function inflateSync(var strm:TZStream):longint;inline;
begin
inflateSync:=zinflate.inflateSync(strm);
inflateSync:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateSync(strm);
end;
function inflateReset(var strm:TZStream):longint;inline;
begin
inflateReset:=zinflate.inflateReset(strm);
inflateReset:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateReset(strm);
end;
function compress(dest:PAnsiChar;var destLen:cardinal; source : PAnsiChar; sourceLen:cardinal):longint;
@ -174,7 +186,7 @@ type Pbytearray=^Tbytearray;
Tbytearray=array[0..0] of byte;
begin
compress:=zcompres.compress(Pbyte(dest),destlen,Pbytearray(source)^,sourcelen);
compress:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zcompres.compress(Pbyte(dest),destlen,Pbytearray(source)^,sourcelen);
end;
function compress2(dest:PAnsiChar;var destLen:cardinal; source : PAnsiChar; sourceLen:cardinal; level:longint):longint;
@ -183,7 +195,7 @@ type Pbytearray=^Tbytearray;
Tbytearray=array[0..0] of byte;
begin
compress2:=zcompres.compress2(Pbyte(dest),destlen,Pbytearray(source)^,sourcelen,level);
compress2:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zcompres.compress2(Pbyte(dest),destlen,Pbytearray(source)^,sourcelen,level);
end;
function uncompress(dest:PAnsiChar;var destLen:cardinal; source : PAnsiChar; sourceLen:cardinal):longint;
@ -192,147 +204,147 @@ type Pbytearray=^Tbytearray;
Tbytearray=array[0..0] of byte;
begin
uncompress:=zuncompr.uncompress(Pbyte(dest),destlen,Pbytearray(source)^,sourcelen);
uncompress:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zuncompr.uncompress(Pbyte(dest),destlen,Pbytearray(source)^,sourcelen);
end;
function gzopen(path:PAnsiChar; mode:PAnsiChar):gzFile;inline;
begin
gzopen:=gzio.gzopen(path,mode);
gzopen:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzopen(path,mode);
end;
function gzsetparams(Thefile:gzFile; level:longint; strategy:longint):longint;inline;
begin
gzsetparams:=gzio.gzsetparams(thefile,level,strategy);
gzsetparams:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzsetparams(thefile,level,strategy);
end;
function gzread(thefile:gzFile; buf : pointer; len:cardinal):longint;inline;
begin
gzread:=gzio.gzread(thefile,buf,len);
gzread:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzread(thefile,buf,len);
end;
function gzwrite(thefile:gzFile; buf: pointer; len:cardinal):longint;inline;
begin
gzwrite:=gzio.gzwrite(thefile,buf,len);
gzwrite:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzwrite(thefile,buf,len);
end;
function gzputs(thefile:gzFile; s:PAnsiChar):longint;inline;
begin
gzputs:=gzio.gzputs(thefile,s);
gzputs:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzputs(thefile,s);
end;
function gzgets(thefile:gzFile; buf:PAnsiChar; len:longint):PAnsiChar;inline;
begin
gzgets:=gzio.gzgets(thefile,buf,len);
gzgets:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzgets(thefile,buf,len);
end;
function gzputc(thefile:gzFile; c:AnsiChar):longint;inline;
begin
gzputc:=gzio.gzputc(thefile,c);
gzputc:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzputc(thefile,c);
end;
function gzgetc(thefile:gzFile):AnsiChar;inline;
begin
gzgetc:=chr(gzio.gzgetc(thefile));
gzgetc:=chr({$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzgetc(thefile));
end;
function gzflush(thefile:gzFile; flush:longint):longint;inline;
begin
gzflush:=gzio.gzflush(thefile,flush);
gzflush:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzflush(thefile,flush);
end;
function gzseek(thefile:gzFile; offset:z_off_t; whence:longint):z_off_t;inline;
begin
gzseek:=gzio.gzseek(thefile,offset,whence);
gzseek:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzseek(thefile,offset,whence);
end;
function gzrewind(thefile:gzFile):longint;inline;
begin
gzrewind:=gzio.gzrewind(thefile);
gzrewind:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzrewind(thefile);
end;
function gztell(thefile:gzFile):z_off_t;inline;
begin
gztell:=gzio.gztell(thefile);
gztell:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gztell(thefile);
end;
function gzeof(thefile:gzFile):longbool;inline;
begin
gzeof:=gzio.gzeof(thefile);
gzeof:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzeof(thefile);
end;
function gzclose(thefile:gzFile):longint;inline;
begin
gzclose:=gzio.gzclose(thefile);
gzclose:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzclose(thefile);
end;
function gzerror(thefile:gzFile; var errnum:smallint):string;inline;
begin
gzerror:=gzio.gzerror(thefile,errnum);
gzerror:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}gzio.gzerror(thefile,errnum);
end;
function adler32(theadler:cardinal;buf : PAnsiChar; len:cardinal):cardinal;inline;
begin
adler32:=adler.adler32(theadler,Pbyte(buf),len);
adler32:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}adler.adler32(theadler,Pbyte(buf),len);
end;
function crc32(thecrc:cardinal;buf : PAnsiChar; len:cardinal):cardinal;inline;
begin
crc32:=crc.crc32(thecrc,Pbyte(buf),len);
crc32:={$IFDEF FPC_DOTTEDUNITS}System.Hash.{$ENDIF}crc.crc32(thecrc,Pbyte(buf),len);
end;
function deflateInit_(var strm:TZStream; level:longint; version:PAnsiChar; stream_size:longint):longint;inline;
begin
deflateInit_:=zdeflate.deflateInit_(@strm,level,version,stream_size);
deflateInit_:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateInit_(@strm,level,version,stream_size);
end;
function inflateInit_(var strm:TZStream; version:PAnsiChar; stream_size:longint):longint;inline;
begin
inflateInit_:=zinflate.inflateInit_(@strm,version,stream_size);
inflateInit_:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateInit_(@strm,version,stream_size);
end;
function deflateInit2_(var strm:TZStream; level:longint; method:longint; windowBits:longint; memLevel:longint;strategy:longint; version:PAnsiChar; stream_size:longint):longint;inline;
begin
deflateInit2_:=zdeflate.deflateInit2_(strm,level,method,windowBits,memlevel,strategy,version,stream_size);
deflateInit2_:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateInit2_(strm,level,method,windowBits,memlevel,strategy,version,stream_size);
end;
function inflateInit2_(var strm:TZStream; windowBits:longint; version:PAnsiChar; stream_size:longint):longint;inline;
begin
inflateInit2_:=zinflate.inflateInit2_(strm,windowBits,version,stream_size);
inflateInit2_:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateInit2_(strm,windowBits,version,stream_size);
end;
function deflateInit(var strm:TZStream;level : longint) : longint;inline;
begin
deflateInit:=zdeflate.deflateInit(strm,level);
deflateInit:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateInit(strm,level);
end;
function inflateInit(var strm:TZStream) : longint;inline;
begin
inflateInit:=zinflate.inflateInit(strm);
inflateInit:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateInit(strm);
end;
function deflateInit2(var strm:TZStream;level,method,windowBits,memLevel,strategy : longint) : longint;inline;
begin
deflateInit2:=zdeflate.deflateInit2(strm,level,method,windowbits,memlevel,strategy);
deflateInit2:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zdeflate.deflateInit2(strm,level,method,windowbits,memlevel,strategy);
end;
function inflateInit2(var strm:TZStream; windowBits : longint) : longint;inline;
begin
inflateInit2:=zinflate.inflateInit2_(strm,windowBits,ZLIB_VERSION,sizeof(TZStream));
inflateInit2:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateInit2_(strm,windowBits,ZLIB_VERSION,sizeof(TZStream));
end;
function zError(err:longint):string;inline;
begin
zerror:=zbase.zerror(err);
zerror:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zbase.zerror(err);
end;
function inflateSyncPoint(z:PZstream):longint;inline;
begin
inflateSyncPoint:=zinflate.inflateSyncPoint(z^);
inflateSyncPoint:={$IFDEF FPC_DOTTEDUNITS}System.ZLib.{$ENDIF}zinflate.inflateSyncPoint(z^);
end;
function get_crc_table:pointer;inline;
begin
get_crc_table:=crc.get_crc_table;
get_crc_table:={$IFDEF FPC_DOTTEDUNITS}System.Hash.{$ENDIF}crc.get_crc_table;
end;
end.

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit Trees;
{$ENDIF FPC_DOTTEDUNITS}
{$T-}
{$define ORG_DEBUG}
@ -41,12 +43,21 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
{$ifdef ZLIB_DEBUG}
System.SysUtils,
{$endif}
System.ZLib.Zbase
;
{$ELSE FPC_DOTTEDUNITS}
uses
{$ifdef ZLIB_DEBUG}
sysutils,
{$endif}
zbase
;
{$ENDIF FPC_DOTTEDUNITS}
{ ===========================================================================
Internal compression state. }

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit Unzip;
{$ENDIF FPC_DOTTEDUNITS}
{$mode tp}
@ -27,11 +29,19 @@ interface
{$define Delphi}
{$endif}
{$IFDEF FPC_DOTTEDUNITS}
uses
//zutil,
System.ZLib.Zbase,
//Api.Z,
System.ZLib.Ziputils;
{$ELSE FPC_DOTTEDUNITS}
uses
//zutil,
zbase,
//zLib,
ziputils;
{$ENDIF FPC_DOTTEDUNITS}
const
UNZ_OK = (0);
@ -223,6 +233,15 @@ function unzGetLocalExtrafield(afile: unzFile; buf: pointer; len: cardinal): lon
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
{$ifdef Delphi}
SysUtils,
{$else}
System.Strings,
{$endif}
System.ZLib.Zinflate, System.Hash.Crc;
{$ELSE FPC_DOTTEDUNITS}
uses
{$ifdef Delphi}
SysUtils,
@ -230,6 +249,7 @@ uses
strings,
{$endif}
zInflate, crc;
{$ENDIF FPC_DOTTEDUNITS}
{$ifdef unix and not def (CASESENSITIVITYDEFAULT_YES) and \
!defined(CASESENSITIVITYDEFAULT_NO)}

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit ZBase;
{$ENDIF FPC_DOTTEDUNITS}
{ Original:

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
Unit ZCompres;
{$ENDIF FPC_DOTTEDUNITS}
{ compress.c -- compress a memory buffer
Copyright (C) 1995-1998 Jean-loup Gailly.
@ -12,8 +14,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase, System.ZLib.Zdeflate;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase, zdeflate;
{$ENDIF FPC_DOTTEDUNITS}
{ utility functions }
@ -115,4 +122,4 @@ begin
end;
end.
end.

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit ZDeflate;
{$ENDIF FPC_DOTTEDUNITS}
{$IFDEF CPUWASM}
{$DEFINE NOGOTO}
@ -65,8 +67,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase;
{$ENDIF FPC_DOTTEDUNITS}
function deflateInit_(strm : z_streamp;
@ -342,8 +349,13 @@ const
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Trees, System.ZLib.Adler;
{$ELSE FPC_DOTTEDUNITS}
uses
trees, adler;
{$ENDIF FPC_DOTTEDUNITS}
{ ===========================================================================
Function prototypes. }

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit ZInflate;
{$ENDIF FPC_DOTTEDUNITS}
{ inflate.c -- zlib interface to inflate modules
Copyright (C) 1995-1998 Mark Adler
@ -12,8 +14,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase, System.ZLib.Infblock, System.ZLib.Infutil;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase, infblock, infutil;
{$ENDIF FPC_DOTTEDUNITS}
function inflateInit(var z : z_stream) : integer;
@ -196,8 +203,13 @@ function inflateSyncPoint(var z : z_stream) : integer;
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Adler;
{$ELSE FPC_DOTTEDUNITS}
uses
adler;
{$ENDIF FPC_DOTTEDUNITS}
function inflateReset(var z : z_stream) : integer;
begin

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit Zip;
{$ENDIF FPC_DOTTEDUNITS}
{ zip.c -- IO on .zip files using zlib
zip.h -- IO for compress .zip files using zlib
@ -24,11 +26,19 @@ interface
{$define Delphi}
{$endif}
{$IFDEF FPC_DOTTEDUNITS}
uses
//zutil,
System.ZLib.Zbase,
//Api.Z,
System.ZLib.Ziputils;
{$ELSE FPC_DOTTEDUNITS}
uses
//zutil,
zbase,
//zLib,
ziputils;
{$ENDIF FPC_DOTTEDUNITS}
const
ZIP_OK = (0);
@ -95,6 +105,15 @@ function zipClose(afile: zipFile; const global_comment: PAnsiChar): longint; {ZE
implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
{$ifdef Delphi}
SysUtils,
{$else}
System.Strings,
{$endif}
System.ZLib.Zdeflate, System.Hash.Crc;
{$ELSE FPC_DOTTEDUNITS}
uses
{$ifdef Delphi}
SysUtils,
@ -102,6 +121,7 @@ uses
strings,
{$endif}
zDeflate, crc;
{$ENDIF FPC_DOTTEDUNITS}
const
VERSIONMADEBY = ($0); { platform depedent }

View File

@ -13,15 +13,25 @@
**********************************************************************}
{$mode objfpc}
{$h+}
{$IFNDEF FPC_DOTTEDUNITS}
unit Zipper;
{$ENDIF FPC_DOTTEDUNITS}
Interface
{$IFDEF FPC_DOTTEDUNITS}
Uses
{$IFDEF Unix}
UnixApi.Base,
{$ENDIF}
System.SysUtils,System.Classes,System.ZLib.Zstream;
{$ELSE FPC_DOTTEDUNITS}
Uses
{$IFDEF UNIX}
BaseUnix,
{$ENDIF}
SysUtils,Classes,zstream;
{$ENDIF FPC_DOTTEDUNITS}
Const
@ -619,7 +629,11 @@ Type
Implementation
{$IFDEF FPC_DOTTEDUNITS}
uses System.RtlConsts;
{$ELSE FPC_DOTTEDUNITS}
uses rtlconsts;
{$ENDIF FPC_DOTTEDUNITS}
ResourceString
SErrBufsizeChange = 'Changing buffer size is not allowed while (un)zipping.';

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit ZipUtils;
{$ENDIF}
{ ziputils.pas - IO on .zip files using zlib
- definitions, declarations and routines used by both

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit ZStream;
{$ENDIF FPC_DOTTEDUNITS}
{**********************************************************************
This file is part of the Free Pascal free component library.
@ -27,7 +29,11 @@ unit ZStream;
interface
{***************************************************************************}
{$IFDEF FPC_DOTTEDUNITS}
uses System.Classes,System.ZLib.Zbase,System.ZLib.Gzio;
{$ELSE FPC_DOTTEDUNITS}
uses classes,zbase,gzio;
{$ENDIF FPC_DOTTEDUNITS}
type
Tcompressionlevel=(
@ -147,7 +153,11 @@ type
implementation
{***************************************************************************}
{$IFDEF FPC_DOTTEDUNITS}
uses System.ZLib.Zdeflate,System.ZLib.Zinflate;
{$ELSE FPC_DOTTEDUNITS}
uses zdeflate,zinflate;
{$ENDIF FPC_DOTTEDUNITS}
const bufsize=16384; {Size of the buffer used for temporarily storing
data from the child stream.}

View File

@ -1,4 +1,6 @@
{$IFNDEF FPC_DOTTEDUNITS}
unit ZUncompr;
{$ENDIF FPC_DOTTEDUNITS}
{ uncompr.c -- decompress a memory buffer
Copyright (C) 1995-1998 Jean-loup Gailly.
@ -12,8 +14,13 @@ interface
{$I zconf.inc}
{$IFDEF FPC_DOTTEDUNITS}
uses
System.ZLib.Zbase, System.ZLib.Zinflate;
{$ELSE FPC_DOTTEDUNITS}
uses
zbase, zinflate;
{$ENDIF FPC_DOTTEDUNITS}
{ ===========================================================================
Decompresses the source buffer into the destination buffer. sourceLen is
@ -86,4 +93,4 @@ begin
uncompress := err;
end;
end.
end.