* compilable with TP again

This commit is contained in:
Tomas Hajny 1999-06-10 07:28:27 +00:00
parent 3dcaa3bf59
commit 6a236a0f58
4 changed files with 90 additions and 9 deletions

View File

@ -4,7 +4,7 @@
Copyright (c) 1993-98 by Florian Klaempfl Copyright (c) 1993-98 by Florian Klaempfl
member of the Free Pascal development team member of the Free Pascal development team
This is the install program for the DOS version of Free Pascal This is the install program for the DOS and OS/2 versions of Free Pascal
See the file COPYING.FPC, included in this distribution, See the file COPYING.FPC, included in this distribution,
for details about the copyright. for details about the copyright.
@ -17,7 +17,7 @@
program install; program install;
{$DEFINE FV} (* TH - added to make use of the original Turbo Vision possible. *) {$DEFINE FV} (* TH - added to make use of the original Turbo Vision possible. *)
{ $DEFINE DLL} (* TH - if defined, UNZIP32.DLL library is used to unpack. *) {$DEFINE DLL} (* TH - if defined, UNZIP32.DLL library is used to unpack. *)
{ $DEFINE DOSSTUB} (* TH - should _not_ be defined unless creating a bound DOS and OS/2 installer!!! *) { $DEFINE DOSSTUB} (* TH - should _not_ be defined unless creating a bound DOS and OS/2 installer!!! *)
(* Defining DOSSTUB causes adding a small piece of code *) (* Defining DOSSTUB causes adding a small piece of code *)
(* for starting the OS/2 part from the DOS part of a bound *) (* for starting the OS/2 part from the DOS part of a bound *)
@ -930,7 +930,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.1 1999-02-19 16:45:26 peter Revision 1.2 1999-06-10 07:28:27 hajny
* compilable with TP again
Revision 1.1 1999/02/19 16:45:26 peter
* moved to fpinst/ directory * moved to fpinst/ directory
+ makefile + makefile
@ -981,4 +984,3 @@ end.
+ version/release/patch numbers as string added + version/release/patch numbers as string added
} }


View File

@ -2,6 +2,49 @@
$Id$ $Id$
} }
UNIT Unzip; UNIT Unzip;
{
Unzips deflated, imploded, shrunk and stored files
** COMPATIBLE WITH
* Turbo Pascal v7.x (DOS)
* Borland Pascal v7.x (Dos, DPMI, and Windows)
* Delphi v1.x
* Delphi v2.x
* Delphi v3.x
* Virtual Pascal v2.0 (OS/2, Win32)
* Free Pascal Compiler (DOS, OS/2, Win32, Linux)
}
{
Original version (1.x): Christian Ghisler
C code by info-zip group, translated to pascal by Christian Ghisler
based on unz51g.zip;
Special thanks go to Mark Adler,who wrote the main inflate and
explode code, and did NOT copyright it!!!
v2.00: March 1998: Dr Abimbola Olowofoyeku (The African Chief)
Homepage: http://ourworld.compuserve.com/homepages/African_Chief
* modified to compile for Delphi v2.x and Delphi v3.x
v2.01: April 1998: Dr Abimbola Olowofoyeku (The African Chief)
* source files merged into a single source (this) file
* several high level functions added - i.e.,
FileUnzip()
FileUnzipEx()
ViewZip()
UnzipSize()
SetUnzipReportProc()
SetUnzipQuestionProc()
ChfUnzip_Init()
* callbacks added
* modified to support Virtual Pascal v2.0 (Win32)
* Delphi component added (chfunzip.pas)
v2.01a: December 1998: Tomas Hajny, XHajT03@mbox.vol.cz
* extended to support other 32-bit compilers/platforms (OS/2, GO32, ...);
search for (* TH ... *)
v2.01b: December 1998: Peter Vreman
* modifications needed for Linux
}
INTERFACE INTERFACE
{$IFDEF FPC} {$IFDEF FPC}
@ -285,6 +328,7 @@ CONST {Error codes returned by huft_build}
huft_incomplete = 1; {Incomplete tree <- sufficient in some cases!} huft_incomplete = 1; {Incomplete tree <- sufficient in some cases!}
huft_error = 2; {bad tree constructed} huft_error = 2; {bad tree constructed}
huft_outofmem = 3; {not enough memory} huft_outofmem = 3; {not enough memory}
(* TH - use of the new BIT32 conditional (was WIN32 only previously) *)
MaxMax = {$ifdef BIT32}256 * 1024 {BIT32 = 256kb buffer} MaxMax = {$ifdef BIT32}256 * 1024 {BIT32 = 256kb buffer}
{$else}Maxint -1{$endif}; {16-bit = 32kb buffer} {$else}Maxint -1{$endif}; {16-bit = 32kb buffer}
@ -718,7 +762,11 @@ BEGIN
b := ( n = w ) AND ( ioresult = 0 ); {True-> alles ok} b := ( n = w ) AND ( ioresult = 0 ); {True-> alles ok}
UpdateCRC ( iobuf ( pointer ( @slide [ 0 ] ) ^ ), w ); UpdateCRC ( iobuf ( pointer ( @slide [ 0 ] ) ^ ), w );
{--} {--}
{$IFDEF FPC}
IF ( b = TRUE ) AND Assigned(ZipReport) {callback report for high level functions} IF ( b = TRUE ) AND Assigned(ZipReport) {callback report for high level functions}
{$ELSE}
IF ( b = TRUE ) AND ( @ZipReport <> NIL ) {callback report for high level functions}
{$ENDIF}
THEN BEGIN THEN BEGIN
WITH ZipRec DO BEGIN WITH ZipRec DO BEGIN
Status := file_unzipping; Status := file_unzipping;
@ -2083,7 +2131,11 @@ BEGIN
b := ( n = write_ptr ) AND ( ioresult = 0 ); {True-> alles ok} b := ( n = write_ptr ) AND ( ioresult = 0 ); {True-> alles ok}
UpdateCRC ( iobuf ( pointer ( @writebuf^ [ 0 ] ) ^ ), write_ptr ); UpdateCRC ( iobuf ( pointer ( @writebuf^ [ 0 ] ) ^ ), write_ptr );
{--} {--}
{$IFDEF FPC}
IF ( b = TRUE ) AND Assigned(ZipReport) {callback report for high level functions} IF ( b = TRUE ) AND Assigned(ZipReport) {callback report for high level functions}
{$ELSE}
IF ( b = TRUE ) AND ( @ZipReport <> NIL ) {callback report for high level functions}
{$ENDIF}
THEN BEGIN THEN BEGIN
WITH ZipRec DO BEGIN WITH ZipRec DO BEGIN
Status := file_unzipping; Status := file_unzipping;
@ -2980,10 +3032,17 @@ VAR
s : string [ 255 ]; s : string [ 255 ];
BEGIN BEGIN
{$IFDEF FPC}
IF not assigned(Report) THEN IF not assigned(Report) THEN
Report := DummyReport; Report := DummyReport;
IF not assigned(Question) THEN IF not assigned(Question) THEN
Question := DummyQuestion; Question := DummyQuestion;
{$ELSE}
IF @Report = nil THEN
Report := DummyReport;
IF @Question = nil THEN
Question := DummyQuestion;
{$ENDIF}
Count := 0; Count := 0;
rSize := 0; rSize := 0;
@ -3135,9 +3194,13 @@ BEGIN
rSize := 0; rSize := 0;
cSize := 0; cSize := 0;
Viewzip := unzip_MissingParameter; Viewzip := unzip_MissingParameter;
{$IFDEF FPC}
IF ( StrPas ( SourceZipFile ) = '' ) or IF ( StrPas ( SourceZipFile ) = '' ) or
not assigned(Report) THEN not assigned(Report) THEN
exit; exit;
{$ELSE}
IF ( StrPas ( SourceZipFile ) = '' ) OR ( @Report = NIL ) THEN Exit;
{$ENDIF}
Strcopy ( thename, SourceZipFile ); Strcopy ( thename, SourceZipFile );
ViewZip := unzip_NotZipFile; ViewZip := unzip_NotZipFile;
@ -3221,13 +3284,21 @@ END; { UnZipSize }
{***************************************************************************} {***************************************************************************}
FUNCTION SetUnZipReportProc ( aProc : UnzipReportProc ) : Pointer; FUNCTION SetUnZipReportProc ( aProc : UnzipReportProc ) : Pointer;
BEGIN BEGIN
{$IFDEF FPC}
SetUnZipReportProc := ZipReport; {save and return original} SetUnZipReportProc := ZipReport; {save and return original}
{$ELSE}
SetUnZipReportProc := @ZipReport; {save and return original}
{$ENDIF}
ZipReport := aProc; ZipReport := aProc;
END; { SetUnZipReportProc } END; { SetUnZipReportProc }
{***************************************************************************} {***************************************************************************}
FUNCTION SetUnZipQuestionProc ( aProc : UnzipQuestionProc ) : Pointer; FUNCTION SetUnZipQuestionProc ( aProc : UnzipQuestionProc ) : Pointer;
BEGIN BEGIN
{$IFDEF FPC}
SetUnZipQuestionProc := ZipQuestion; {save and return original} SetUnZipQuestionProc := ZipQuestion; {save and return original}
{$ELSE}
SetUnZipQuestionProc := @ZipQuestion; {save and return original}
{$ENDIF}
ZipQuestion := aProc; ZipQuestion := aProc;
END; { SetUnZipQuestionProc } END; { SetUnZipQuestionProc }
{***************************************************************************} {***************************************************************************}
@ -3257,7 +3328,10 @@ BEGIN
END. END.
{ {
$Log$ $Log$
Revision 1.1 1999-02-19 16:45:26 peter Revision 1.2 1999-06-10 07:28:28 hajny
* compilable with TP again
Revision 1.1 1999/02/19 16:45:26 peter
* moved to fpinst/ directory * moved to fpinst/ directory
+ makefile + makefile

View File

@ -41,7 +41,6 @@ uses
type type
UzpMainFunc = function (ArgC: longint; var ArgV: TArgV): longint; UzpMainFunc = function (ArgC: longint; var ArgV: TArgV): longint;
(* var ArgV ??? *)
const const
{$IFDEF OS2} {$IFDEF OS2}
@ -175,7 +174,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.1 1999-02-19 16:45:26 peter Revision 1.2 1999-06-10 07:28:29 hajny
* compilable with TP again
Revision 1.1 1999/02/19 16:45:26 peter
* moved to fpinst/ directory * moved to fpinst/ directory
+ makefile + makefile

View File

@ -9,7 +9,7 @@ Type definitions for UNZIP
and and
amended for Win32 by Dr Abimbola Olowofoyeku (The African Chief) amended for Win32 by Dr Abimbola Olowofoyeku (The African Chief)
Homepage: http://ourworld.compuserve.com/homepages/African_Chief Homepage: http://ourworld.compuserve.com/homepages/African_Chief
* extended to by Tomas Hajny, XHajT03@mbox.vol.cz to support other 32-bit * extended by Tomas Hajny, XHajT03@mbox.vol.cz to support other 32-bit
compilers/platforms (OS/2, GO32, ...); search for (* TH ... *) compilers/platforms (OS/2, GO32, ...); search for (* TH ... *)
} }
@ -202,7 +202,10 @@ END;
END. END.
{ {
$Log$ $Log$
Revision 1.1 1999-02-19 16:45:26 peter Revision 1.2 1999-06-10 07:28:30 hajny
* compilable with TP again
Revision 1.1 1999/02/19 16:45:26 peter
* moved to fpinst/ directory * moved to fpinst/ directory
+ makefile + makefile