Unit WizUnZip

Classes

Functions

DLLProcessZipFiles - wrapper function to handle switching to choosen unzip to directory *) (* dll functions -----------------------------------------------------

wz_unzip*) (
GetDLLVersion - function to run the unzip routine
WZDestroyDCL - procedure used to alloc and init a dcl struct with zeros

wzinitadcl*) (
WZDummyPrint - procedure used to free a dcl allocated by prior call to initadcl

wzdestroydcl*) (
WZDummySound - CEDCL;} (* procedure that can be used as a dummy print routine for dll *) (* - C call back, parameters ignored in dummy

wzdummyprint*) (
WZInitADCL - ***********************************************************************)

***********************************************************************)
WZRetErrorString - CEDCL;} (* procedure that can be used as a dummy sound routine for the dll

wzdummysound*) (
WZ_UnZip - function used to return error as a string

wzreterrorstring*) (

Types

PACHAR
PDCL
PUMB
TACHAR
TDCL
TDLLPRNT
TDLLSND
TUMB

Constants

LibName
wze_BadErr
wze_Disk
wze_EOF
wze_Err
wze_Find
wze_Mem
wze_Mem2
wze_Mem3
wze_Mem4
wze_Mem5
wze_NoZip
wze_OK
wze_Param
wze_Warning
wzl_Long
wzl_None
wzl_Options_Buffer_Len
wzl_Short
wzl_WizUnzip_Max_Path

Variables


Functions


FUNCTION DLLProcessZipFiles(_DCL : PDCL) : INTEGER;

wrapper function to handle switching to choosen unzip to directory *) (* dll functions -----------------------------------------------------

wz_unzip*) (


PROCEDURE GetDLLVersion(VAR Ver : LONGINT);

function to run the unzip routine

PROCEDURE WZDestroyDCL(VAR _DCL : PDCL);

procedure used to alloc and init a dcl struct with zeros

wzinitadcl*) (


FUNCTION WZDummyPrint{(VAR FH : INTEGER; Len : WORD; S : PCHAR)} : WORD;

procedure used to free a dcl allocated by prior call to initadcl

wzdestroydcl*) (


PROCEDURE WZDummySound;

CEDCL;} (* procedure that can be used as a dummy print routine for dll *) (* - C call back, parameters ignored in dummy

wzdummyprint*) (


PROCEDURE WZInitADCL(VAR _DCL : PDCL; PInst : THANDLE; MainW, ListW : HWND);

***********************************************************************)

***********************************************************************)


FUNCTION WZRetErrorString(ErrC : INTEGER) : STRING;

CEDCL;} (* procedure that can be used as a dummy sound routine for the dll

wzdummysound*) (


FUNCTION WZ_UnZip(_DCL : PDCL) : INTEGER;

function used to return error as a string

wzreterrorstring*) (


Types


PACHAR   = ^TACHAR
CEDCL;
PDCL = ^TDCL

PUMB = ^TUMB

TACHAR   = ARRAY[0..8187] OF PCHAR;

TDCL = record
PrintFunc : TDLLPRNT;
SoundProc : TDLLSND;
StdOut : POINTER;
lpUMB : PUMB;
hWndList : HWND;
hWndMain : HWND;
hInst : THANDLE;
ExtractOnlyNewer : BOOL;
OverWrite : BOOL;
SpaceToUnderscore : BOOL;
PromptToOverwrite : BOOL;
ncFlag : BOOL;
ntFlag : BOOL;
nvFlag : INTEGER;
nuFlag : BOOL;
nzFlag : BOOL;
ndFlag : BOOL;
noFlag : BOOL;
naFlag : BOOL;
ArgC : INTEGER;
lpszZipFN : PCHAR;
FNV : PACHAR;
end;

TDLLPRNT = FUNCTION{(VAR F : FILE; Len : WORD; S : PCHAR)} : WORD

TDLLSND  = PROCEDURE
CEDCL;
TUMB = record
szFileName : ARRAY[0..wzl_WizUnzip_Max_Path] OF CHAR;
szDirName : ARRAY[0..wzl_WizUnzip_Max_Path] OF CHAR;
szUnzipToDirName : ARRAY[0..wzl_WizUnzip_Max_Path] OF CHAR;
szUnzipToDirNameTmp : ARRAY[0..wzl_WizUnzip_Max_Path] OF CHAR;
szUnzipFromDirName : ARRAY[0..wzl_WizUnzip_Max_Path] OF CHAR;
szTotalsLine : ARRAY[0..79] OF CHAR;
szBuffer : ARRAY[0..wzl_Options_Buffer_Len] OF CHAR;
szSoundName : ARRAY[0..wzl_WizUnzip_Max_Path] OF CHAR;
szPassword : ARRAY[0..80] OF CHAR;
lpPassword : PCHAR;
ofn : TOPENFILENAME;
wofn : TOPENFILENAME;
msg : TMSG;
_of : TOFSTRUCT;
wof : TOFSTRUCT;
end;

Constants

LibName = 'wizunz16'

*) (* AUTHOR: Michael G. Slack DATE WRITTEN: 05/17/1996 *) (* ENVIRONMENT: Borland Pascal V7.0+/Delphi V1.02+ *) (* *) (* Unit that defines the interface into the wizunzip dll. *) (* NOTE: File names are case-sensitive. *) (* *) (* To use: *) (* VAR _DCL : PDCL; *) (* Fils : PACHAR; {pointer to array or pchars} *) (* ZipFn : ARRAY[0..144] OF CHAR; *) (* FilNm : ARRAY[0..xx] OF CHAR; *) (* { TT : THANDLE; } *) (* ... *) (* StrCopy(FilNm,'case sensitive file name (could incl wildcards)'); *) (* GetMem(Fils,SizeOf(PCHAR)); {only allocating for single file} *) (* {or} *) (* {should use this method in Delphi - seems to prevent GPFs} *) (* { TT := GlobalAlloc(GHnd,SizeOf(PCHAR)); } *) (* { Fils := GlobalLock(TT); } *) (* Fils^[0] := @FilNm; *) (* StrCopy(ZipFn,'C:\UNZIP52.ZIP'); *) (* WZInitADCL(_DCL,HInstance,MWnd,LWnd); {create/initialize struct} *) (* WITH _DCL^ DO *) (* BEGIN {setup rest of parameters for unzip} *) (* WITH lpUMB^ DO *) (* StrCopy(szUnzipToDirName,'some dir'); {only dir that is used} *) (* {set flags wanted (all set to false from init)} *) (* OverWrite := TRUE; {example} *) (* ArgC := 1; {set equal to number of files submitting} *) (* lpszZipFN := @ZipFn; *) (* FNV := Fils; *) (* END; {with} *) (* I := WZ_UnZip(_DCL); {run unzip proc} *) (* WZDestroyDCL(_DCL); {release control block} *) (* FreeMem(Fils,SizeOf(PCHAR)); {free file list} *) (* {or} *) (* { GlobalUnlock(TT); } *) (* { GlobalFree(TT); } *) (* IF I <> wze_OK THEN {problem with unzip}; *) (* *) (* -------------------------------------------------------------------- *) (* *) (* REVISED: 07/30/1996 - Per suggestions from Brad Clarke *) (* (bclarke@cyberus.ca), added listing constants *) (* and changed nzFlag to integer. *) (*

wze_BadErr = 3

wze_Disk = 50

wze_EOF = 51

wze_Err = 2

wze_Find = 11

wze_Mem = 4

wze_Mem2 = 5

wze_Mem3 = 6

wze_Mem4 = 7

wze_Mem5 = 8

wze_NoZip = 9

wze_OK = 0

long listing

wze_Param = 10

wze_Warning = 1

wzl_Long = 2

short listing

wzl_None = 0

256

wzl_Options_Buffer_Len = 255

128

wzl_Short = 1

no listing

wzl_WizUnzip_Max_Path = 127


Variables