Browse Source

* PChar -> PAnsichar

Michaël Van Canneyt 2 years ago
parent
commit
afaea85c9f
3 changed files with 70 additions and 70 deletions
  1. 53 53
      packages/unzip/src/unzip51g.pp
  2. 13 13
      packages/unzip/src/unzipdll.pp
  3. 4 4
      packages/unzip/src/ziptypes.pp

+ 53 - 53
packages/unzip/src/unzip51g.pp

@@ -75,7 +75,7 @@ USES
 {**********************************************************************}
 {**********************************************************************}
 {**********************************************************************}
 {**********************************************************************}
 FUNCTION FileUnzip
 FUNCTION FileUnzip
-( SourceZipFile, TargetDirectory, FileSpecs : pChar;
+( SourceZipFile, TargetDirectory, FileSpecs : PAnsiChar;
  Report : UnzipReportProc;Question : UnzipQuestionProc ) : integer;
  Report : UnzipReportProc;Question : UnzipQuestionProc ) : integer;
 
 
 {
 {
@@ -95,7 +95,7 @@ e.g.,
 
 
 }
 }
 
 
-FUNCTION FileUnzipEx ( SourceZipFile, TargetDirectory, FileSpecs : pChar ) : integer;
+FUNCTION FileUnzipEx ( SourceZipFile, TargetDirectory, FileSpecs : PAnsiChar ) : integer;
 {
 {
 high level unzip with no callback parameters;
 high level unzip with no callback parameters;
 passes ZipReport & ZipQuestion internally, so you
 passes ZipReport & ZipQuestion internally, so you
@@ -105,7 +105,7 @@ e.g.,
    Count := FileUnzipEx('test.zip', 'c:\temp', '*.*');
    Count := FileUnzipEx('test.zip', 'c:\temp', '*.*');
 }
 }
 
 
-FUNCTION ViewZip ( SourceZipFile, FileSpecs : pChar; Report : UnzipReportProc ) : integer;
+FUNCTION ViewZip ( SourceZipFile, FileSpecs : PAnsiChar; Report : UnzipReportProc ) : integer;
 {
 {
 view contents of zip file
 view contents of zip file
 usage:
 usage:
@@ -139,7 +139,7 @@ e.g.,
 SetUnZipQuestionProc(QueryFileExistProc);
 SetUnZipQuestionProc(QueryFileExistProc);
 }
 }
 
 
-FUNCTION UnzipSize ( SourceZipFile : pChar;VAR Compressed : Longint ) : longint;
+FUNCTION UnzipSize ( SourceZipFile : PAnsiChar;VAR Compressed : Longint ) : longint;
 { uncompressed and compressed zip size
 { uncompressed and compressed zip size
  usage:
  usage:
  SourceZipFile  = the zip file
  SourceZipFile  = the zip file
@@ -176,7 +176,7 @@ FUNCTION GetSupportedMethods : longint;
 {Checks which pack methods are supported by the dll}
 {Checks which pack methods are supported by the dll}
 {bit 8=1 -> Format 8 supported, etc.}
 {bit 8=1 -> Format 8 supported, etc.}
 
 
-FUNCTION UnzipFile ( in_name : pchar;out_name : pchar;offset : longint;hFileAction : word;cm_index : integer ) : integer;
+FUNCTION UnzipFile ( in_name : PAnsiChar;out_name : PAnsiChar;offset : longint;hFileAction : word;cm_index : integer ) : integer;
 {usage:
 {usage:
  in_name:      name of zip file with full path
  in_name:      name of zip file with full path
  out_name:     desired name for out file
  out_name:     desired name for out file
@@ -211,7 +211,7 @@ FUNCTION UnzipFile ( in_name : pchar;out_name : pchar;offset : longint;hFileActi
  end;
  end;
 }
 }
 
 
-FUNCTION  GetFirstInZip ( zipfilename : pchar;VAR zprec : tZipRec ) : integer;
+FUNCTION  GetFirstInZip ( zipfilename : PAnsiChar;VAR zprec : tZipRec ) : integer;
 {
 {
  Get first entry from ZIP file
  Get first entry from ZIP file
  e.g.,
  e.g.,
@@ -226,7 +226,7 @@ FUNCTION  GetNextInZip ( VAR Zprec : tZiprec ) : integer;
    rc:=GetNextInZip(myZipRec);
    rc:=GetNextInZip(myZipRec);
 }
 }
 
 
-FUNCTION  IsZip ( filename : pchar ) : boolean;
+FUNCTION  IsZip ( filename : PAnsiChar ) : boolean;
 {
 {
   VERY simple test for zip file
   VERY simple test for zip file
 
 
@@ -252,7 +252,7 @@ NoRecurseDirs : Boolean;              {Global Recurse variable}
 
 
 {*************************************************************************}
 {*************************************************************************}
 {$ifdef Delphi}
 {$ifdef Delphi}
-PROCEDURE SetCurDir ( p : pChar );
+PROCEDURE SetCurDir ( p : PAnsiChar );
 BEGIN
 BEGIN
    Chdir ( strpas ( p ) );
    Chdir ( strpas ( p ) );
 END;
 END;
@@ -267,7 +267,7 @@ BEGIN
    {$ifdef Win32}Result := {$endif}FileSetDate ( TFileRec ( f ) .Handle, l );
    {$ifdef Win32}Result := {$endif}FileSetDate ( TFileRec ( f ) .Handle, l );
 END;
 END;
 
 
-PROCEDURE CreateDir ( p : pchar );
+PROCEDURE CreateDir ( p : PAnsiChar );
 BEGIN
 BEGIN
   mkdir ( strpas ( p ) );
   mkdir ( strpas ( p ) );
 END;
 END;
@@ -329,7 +329,7 @@ TYPE li = PACKED RECORD
 TYPE
 TYPE
   plocalheader = ^tlocalheader;
   plocalheader = ^tlocalheader;
   tlocalheader = PACKED RECORD
   tlocalheader = PACKED RECORD
-    signature : ARRAY [ 0..3 ] of char;  {'PK'#1#2}
+    signature : ARRAY [ 0..3 ] of AnsiChar;  {'PK'#1#2}
     extract_ver,
     extract_ver,
     bit_flag,
     bit_flag,
     zip_type : word;
     zip_type : word;
@@ -341,7 +341,7 @@ TYPE
     extra_field_len : word;
     extra_field_len : word;
   END;
   END;
 
 
-VAR slide : pchar;            {Sliding dictionary for unzipping}
+VAR slide : PAnsiChar;            {Sliding dictionary for unzipping}
     inbuf : iobuf;            {input buffer}
     inbuf : iobuf;            {input buffer}
     inpos, readpos : integer;  {position in input buffer, position read from file}
     inpos, readpos : integer;  {position in input buffer, position read from file}
 
 
@@ -682,10 +682,10 @@ END;
 {******************************* Break string into tokens ****************************}
 {******************************* Break string into tokens ****************************}
 
 
 VAR
 VAR
-  _Token : PChar;
+  _Token : PAnsiChar;
 
 
-FUNCTION StrTok ( Source : PChar; Token : CHAR ) : PChar;
-  VAR P : PChar;
+FUNCTION StrTok ( Source : PAnsiChar; Token : AnsiChar ) : PAnsiChar;
+  VAR P : PAnsiChar;
 BEGIN
 BEGIN
   IF Source <> NIL THEN _Token := Source;
   IF Source <> NIL THEN _Token := Source;
   IF _Token = NIL THEN BEGIN
   IF _Token = NIL THEN BEGIN
@@ -991,7 +991,7 @@ BEGIN
     UNTIL e <= 16;
     UNTIL e <= 16;
     DUMPBITS ( t^.b );
     DUMPBITS ( t^.b );
     IF e = 16 THEN BEGIN
     IF e = 16 THEN BEGIN
-      slide [ w ] := char ( t^.v_n );
+      slide [ w ] := AnsiChar ( t^.v_n );
       inc ( w );
       inc ( w );
       IF w = WSIZE THEN BEGIN
       IF w = WSIZE THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
@@ -1082,7 +1082,7 @@ BEGIN
   WHILE ( n > 0 ) AND NOT ( totalabort OR zipeof ) DO BEGIN {read and output the compressed data}
   WHILE ( n > 0 ) AND NOT ( totalabort OR zipeof ) DO BEGIN {read and output the compressed data}
     dec ( n );
     dec ( n );
     NEEDBITS ( 8 );
     NEEDBITS ( 8 );
-    slide [ w ] := char ( b );
+    slide [ w ] := AnsiChar ( b );
     inc ( w );
     inc ( w );
     IF w = WSIZE THEN BEGIN
     IF w = WSIZE THEN BEGIN
       IF NOT flush ( w ) THEN BEGIN
       IF NOT flush ( w ) THEN BEGIN
@@ -1421,7 +1421,7 @@ BEGIN
         e := t^.e;
         e := t^.e;
       UNTIL e <= 16;
       UNTIL e <= 16;
       DUMPBITS ( t^.b );
       DUMPBITS ( t^.b );
-      slide [ w ] := char ( t^.v_n );
+      slide [ w ] := AnsiChar ( t^.v_n );
       inc ( w );
       inc ( w );
       IF w = WSIZE THEN BEGIN
       IF w = WSIZE THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
@@ -1552,7 +1552,7 @@ BEGIN
         e := t^.e;
         e := t^.e;
       UNTIL e <= 16;
       UNTIL e <= 16;
       DUMPBITS ( t^.b );
       DUMPBITS ( t^.b );
-      slide [ w ] := char ( t^.v_n );
+      slide [ w ] := AnsiChar ( t^.v_n );
       inc ( w );
       inc ( w );
       IF w = WSIZE THEN BEGIN
       IF w = WSIZE THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
@@ -1665,7 +1665,7 @@ BEGIN
       DUMPBITS ( 1 );
       DUMPBITS ( 1 );
       dec ( s );
       dec ( s );
       NEEDBITS ( 8 );
       NEEDBITS ( 8 );
-      slide [ w ] := char ( b );
+      slide [ w ] := AnsiChar ( b );
       inc ( w );
       inc ( w );
       IF w = WSIZE THEN BEGIN
       IF w = WSIZE THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
@@ -1781,7 +1781,7 @@ BEGIN
       DUMPBITS ( 1 );
       DUMPBITS ( 1 );
       dec ( s );
       dec ( s );
       NEEDBITS ( 8 );
       NEEDBITS ( 8 );
-      slide [ w ] := char ( b );
+      slide [ w ] := AnsiChar ( b );
       inc ( w );
       inc ( w );
       IF w = WSIZE THEN BEGIN
       IF w = WSIZE THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
         IF NOT flush ( w ) THEN BEGIN
@@ -2005,11 +2005,11 @@ CONST max_code = 8192;
 
 
 TYPE prev = ARRAY [ 257..max_code ] of integer;
 TYPE prev = ARRAY [ 257..max_code ] of integer;
      pprev = ^prev;
      pprev = ^prev;
-     cds = ARRAY [ 257..max_code ] of char;
+     cds = ARRAY [ 257..max_code ] of AnsiChar;
      pcds = ^cds;
      pcds = ^cds;
-     stacktype = ARRAY [ 0..max_stack ] of char;
+     stacktype = ARRAY [ 0..max_stack ] of AnsiChar;
      pstacktype = ^stacktype;
      pstacktype = ^stacktype;
-     writebuftype = ARRAY [ 0..write_max ] of char;   {write buffer}
+     writebuftype = ARRAY [ 0..write_max ] of AnsiChar;   {write buffer}
      pwritebuftype = ^writebuftype;
      pwritebuftype = ^writebuftype;
 
 
 VAR previous_code : pprev;       {previous code trie}
 VAR previous_code : pprev;       {previous code trie}
@@ -2044,7 +2044,7 @@ BEGIN
   unshrink_flush := b;
   unshrink_flush := b;
 END;
 END;
 
 
-FUNCTION write_char ( c : char ) : boolean;
+FUNCTION write_char ( c : AnsiChar ) : boolean;
 BEGIN
 BEGIN
   writebuf^ [ write_ptr ] := c;
   writebuf^ [ write_ptr ] := c;
   inc ( write_ptr );
   inc ( write_ptr );
@@ -2088,7 +2088,7 @@ FUNCTION unshrink : integer;
 
 
 VAR incode : integer;            {code read in}
 VAR incode : integer;            {code read in}
     lastincode : integer;        {last code read in}
     lastincode : integer;        {last code read in}
-    lastoutcode : char;          {last code emitted}
+    lastoutcode : AnsiChar;          {last code emitted}
     code_size : byte;            {Actual code size}
     code_size : byte;            {Actual code size}
     stack_ptr,                 {Stackpointer}
     stack_ptr,                 {Stackpointer}
     new_code,                  {Save new code read}
     new_code,                  {Save new code read}
@@ -2130,7 +2130,7 @@ BEGIN
   DUMPBITS ( code_size );
   DUMPBITS ( code_size );
 
 
   lastincode := incode;
   lastincode := incode;
-  lastoutcode := char ( incode );
+  lastoutcode := AnsiChar ( incode );
   IF NOT write_char ( lastoutcode ) THEN BEGIN
   IF NOT write_char ( lastoutcode ) THEN BEGIN
     unshrink := unzip_writeErr;
     unshrink := unzip_writeErr;
     exit
     exit
@@ -2166,8 +2166,8 @@ BEGIN
       END;
       END;
     END ELSE BEGIN
     END ELSE BEGIN
       new_code := incode;
       new_code := incode;
-      IF incode < 256 THEN BEGIN          {Simple char}
-        lastoutcode := char ( incode );
+      IF incode < 256 THEN BEGIN          {Simple AnsiChar}
+        lastoutcode := AnsiChar ( incode );
         IF NOT write_char ( lastoutcode ) THEN BEGIN
         IF NOT write_char ( lastoutcode ) THEN BEGIN
           unshrink := unzip_writeErr;
           unshrink := unzip_writeErr;
           exit
           exit
@@ -2183,7 +2183,7 @@ BEGIN
           dec ( stack_ptr );
           dec ( stack_ptr );
           incode := previous_code^ [ incode ];
           incode := previous_code^ [ incode ];
         END;
         END;
-        lastoutcode := char ( incode );
+        lastoutcode := AnsiChar ( incode );
         IF NOT write_char ( lastoutcode ) THEN BEGIN
         IF NOT write_char ( lastoutcode ) THEN BEGIN
           unshrink := unzip_writeErr;
           unshrink := unzip_writeErr;
           exit
           exit
@@ -2221,19 +2221,19 @@ END;
 
 
 {******************** main low level function: unzipfile ********************}
 {******************** main low level function: unzipfile ********************}
 {written and not copyrighted by Christian Ghisler}
 {written and not copyrighted by Christian Ghisler}
-FUNCTION unzipfile ( in_name : pchar;out_name : pchar;offset : longint;
+FUNCTION unzipfile ( in_name : PAnsiChar;out_name : PAnsiChar;offset : longint;
   hFileAction : word;cm_index : integer ) : integer;
   hFileAction : word;cm_index : integer ) : integer;
 VAR err : integer;
 VAR err : integer;
     header : plocalheader;
     header : plocalheader;
-    buf : ARRAY [ 0..tfSize+1 ] of char;
+    buf : ARRAY [ 0..tfSize+1 ] of AnsiChar;
 {$ifndef unix}
 {$ifndef unix}
-    buf0 : ARRAY [ 0..3 ] of char;
+    buf0 : ARRAY [ 0..3 ] of AnsiChar;
 {$endif}
 {$endif}
     storefilemode,
     storefilemode,
     timedate : longint;
     timedate : longint;
     originalcrc : cardinal;    {crc from zip-header}
     originalcrc : cardinal;    {crc from zip-header}
     ziptype, aResult : integer;
     ziptype, aResult : integer;
-    p, p1 : pchar;
+    p, p1 : PAnsiChar;
     isadir : boolean;
     isadir : boolean;
     oldcurdir : string [ 80 ];
     oldcurdir : string [ 80 ];
 
 
@@ -2446,7 +2446,7 @@ END;
 {***************************************************************************}
 {***************************************************************************}
 {***************************************************************************}
 {***************************************************************************}
 { other functions; zipread.pas }
 { other functions; zipread.pas }
-CONST mainheader : pchar = 'PK'#5#6;
+CONST mainheader : PAnsiChar = 'PK'#5#6;
       maxbufsize = 64000;  {Can be as low as 500 Bytes; however, }
       maxbufsize = 64000;  {Can be as low as 500 Bytes; however, }
                          {this would lead to extensive disk reading!}
                          {this would lead to extensive disk reading!}
                          {If one entry (including Extra field) is bigger}
                          {If one entry (including Extra field) is bigger}
@@ -2456,7 +2456,7 @@ TYPE
   pheader = ^theader;
   pheader = ^theader;
   pmainheader = ^tmainheader;
   pmainheader = ^tmainheader;
   tmainheader = PACKED RECORD
   tmainheader = PACKED RECORD
-    signature : ARRAY [ 0..3 ] of char;  {'PK'#5#6}
+    signature : ARRAY [ 0..3 ] of AnsiChar;  {'PK'#5#6}
     thisdisk,
     thisdisk,
     centralstartdisk,
     centralstartdisk,
     entries_this_disk,
     entries_this_disk,
@@ -2467,7 +2467,7 @@ TYPE
     unknown : word;
     unknown : word;
   END;
   END;
   theader = PACKED RECORD
   theader = PACKED RECORD
-    signature : ARRAY [ 0..3 ] of char;  {'PK'#1#2}
+    signature : ARRAY [ 0..3 ] of AnsiChar;  {'PK'#1#2}
     OSversion,      {Operating system version}
     OSversion,      {Operating system version}
     OSmadeby : byte;  {MSDOS (FAT): 0}
     OSmadeby : byte;  {MSDOS (FAT): 0}
     extract_ver,
     extract_ver,
@@ -2489,11 +2489,11 @@ TYPE
 {*********** Fill out tZipRec structure with next entry *************}
 {*********** Fill out tZipRec structure with next entry *************}
 
 
 FUNCTION filloutRec ( VAR zprec : tZipRec ) : integer;
 FUNCTION filloutRec ( VAR zprec : tZipRec ) : integer;
-VAR p : pchar;
+VAR p : PAnsiChar;
     incr : longint;
     incr : longint;
     header : pheader;
     header : pheader;
     offs : word;
     offs : word;
-    old : char;
+    old : AnsiChar;
     f : file;
     f : file;
     extra, err : nword;
     extra, err : nword;
 
 
@@ -2544,7 +2544,7 @@ BEGIN
   offs := localstart + header^.filename_len + sizeof ( header^ );
   offs := localstart + header^.filename_len + sizeof ( header^ );
   old := buf^ [ offs ];
   old := buf^ [ offs ];
   buf^ [ offs ] := #0;  {Repair signature of next block!}
   buf^ [ offs ] := #0;  {Repair signature of next block!}
-  strlcopy ( filename, pchar ( @buf^ [ localstart + sizeof ( header^ ) ] ), sizeof ( filename ) -1 );
+  strlcopy ( filename, PAnsiChar ( @buf^ [ localstart + sizeof ( header^ ) ] ), sizeof ( filename ) -1 );
   buf^ [ offs ] := old;
   buf^ [ offs ] := old;
 {$ifndef unix}
 {$ifndef unix}
   REPEAT           {Convert slash to backslash!}
   REPEAT           {Convert slash to backslash!}
@@ -2569,7 +2569,7 @@ BEGIN
 END;
 END;
 
 
 {**************** Get first entry from ZIP file ********************}
 {**************** Get first entry from ZIP file ********************}
-FUNCTION GetFirstInZip ( zipfilename : pchar;VAR zprec : tZipRec ) : integer;
+FUNCTION GetFirstInZip ( zipfilename : PAnsiChar;VAR zprec : tZipRec ) : integer;
 VAR bufstart, headerstart, start : longint;
 VAR bufstart, headerstart, start : longint;
     err, i : integer;
     err, i : integer;
     mainh : pmainheader;
     mainh : pmainheader;
@@ -2731,12 +2731,12 @@ BEGIN
 END;
 END;
 
 
 {**************** VERY simple test for zip file ********************}
 {**************** VERY simple test for zip file ********************}
-FUNCTION isZip ( filename : pchar ) : boolean;
+FUNCTION isZip ( filename : PAnsiChar ) : boolean;
 VAR
 VAR
     myname : tdirtype;
     myname : tdirtype;
     l, err : integer;
     l, err : integer;
     f : file;
     f : file;
-    buf : ARRAY [ 0..4 ] of char;
+    buf : ARRAY [ 0..4 ] of AnsiChar;
     oldcurdir : string{$ifndef BIT32} [ 80 ]{$endif};
     oldcurdir : string{$ifndef BIT32} [ 80 ]{$endif};
 
 
 BEGIN
 BEGIN
@@ -2808,7 +2808,7 @@ END;
 {***************************************************************************}
 {***************************************************************************}
 {***************************************************************************}
 {***************************************************************************}
 {$ifndef Delphi}
 {$ifndef Delphi}
-FUNCTION FileExists ( CONST fname : string ) : boolean; {simple fileexist function}
+FUNCTION FileExists ( CONST fname : AnsiString ) : boolean; {simple fileexist function}
 VAR
 VAR
 f : file;
 f : file;
 i : byte;
 i : byte;
@@ -2836,11 +2836,11 @@ begin
   DummyQuestion:=true;
   DummyQuestion:=true;
 end;
 end;
 
 
-FUNCTION Matches ( s : String;CONST main : string ) : Boolean;
+FUNCTION Matches ( s : AnsiString;CONST main : AnsiString ) : Boolean;
 {rudimentary matching function;
 {rudimentary matching function;
  accepts only '', '*.*', 'XXX.*' or '*.XXX'
  accepts only '', '*.*', 'XXX.*' or '*.XXX'
 }
 }
-FUNCTION extensiononly ( CONST s : string ) : string;{return just the extension}
+FUNCTION extensiononly ( CONST s : AnsiString ) : AnsiString;{return just the extension}
 VAR i : integer;
 VAR i : integer;
 BEGIN
 BEGIN
    extensiononly := '';
    extensiononly := '';
@@ -2849,7 +2849,7 @@ BEGIN
    extensiononly := copy ( s, succ ( i ), length ( s ) );
    extensiononly := copy ( s, succ ( i ), length ( s ) );
 END;
 END;
 
 
-FUNCTION nameonly ( CONST s : string ) : string;{return just the name}
+FUNCTION nameonly ( CONST s : AnsiString ) : AnsiString;{return just the name}
 VAR i : integer;
 VAR i : integer;
 BEGIN
 BEGIN
    nameonly := s;
    nameonly := s;
@@ -2881,14 +2881,14 @@ BEGIN
    END;
    END;
 END;  { Matches }
 END;  { Matches }
 {****************************************************}
 {****************************************************}
-FUNCTION FileUnzip ( SourceZipFile, TargetDirectory, FileSpecs : pChar;
+FUNCTION FileUnzip ( SourceZipFile, TargetDirectory, FileSpecs : PAnsiChar;
  Report : UnzipReportProc;Question : UnzipQuestionProc ) : integer;
  Report : UnzipReportProc;Question : UnzipQuestionProc ) : integer;
 VAR
 VAR
     rc : integer;
     rc : integer;
     r : tziprec;
     r : tziprec;
     buf,
     buf,
     thename,
     thename,
-    target : ARRAY [ 0..tFSize ] of char;
+    target : ARRAY [ 0..tFSize ] of AnsiChar;
     Count : integer;
     Count : integer;
     rSize, cSize : longint;
     rSize, cSize : longint;
     s : string [ 255 ];
     s : string [ 255 ];
@@ -3037,17 +3037,17 @@ BEGIN
   FileUnzip := Count;
   FileUnzip := Count;
 END; { FileUnzip }
 END; { FileUnzip }
 {***************************************************************************}
 {***************************************************************************}
-FUNCTION FileUnzipEx ( SourceZipFile, TargetDirectory, FileSpecs : pChar ) : integer;
+FUNCTION FileUnzipEx ( SourceZipFile, TargetDirectory, FileSpecs : PAnsiChar ) : integer;
 BEGIN
 BEGIN
   FileUnzipEx :=
   FileUnzipEx :=
   FileUnzip ( SourceZipFile, TargetDirectory, FileSpecs, ZipReport, ZipQuestion );
   FileUnzip ( SourceZipFile, TargetDirectory, FileSpecs, ZipReport, ZipQuestion );
 END; { FileUnzipEx }
 END; { FileUnzipEx }
 {***************************************************************************}
 {***************************************************************************}
-FUNCTION Viewzip ( SourceZipFile, FileSpecs : pChar; Report : UnzipReportProc ) : integer;
+FUNCTION Viewzip ( SourceZipFile, FileSpecs : PAnsiChar; Report : UnzipReportProc ) : integer;
 VAR
 VAR
     rc : integer;
     rc : integer;
     r : tziprec;
     r : tziprec;
-    thename : ARRAY [ 0..tFSize ] of char;
+    thename : ARRAY [ 0..tFSize ] of AnsiChar;
     Count : integer;
     Count : integer;
     rSize, cSize : longint;
     rSize, cSize : longint;
 
 
@@ -3106,11 +3106,11 @@ BEGIN
   ViewZip := Count;
   ViewZip := Count;
 END; { ViewZip }
 END; { ViewZip }
 {***************************************************************************}
 {***************************************************************************}
-FUNCTION UnZipSize ( SourceZipFile : pChar;VAR Compressed : Longint ) : longint;
+FUNCTION UnZipSize ( SourceZipFile : PAnsiChar;VAR Compressed : Longint ) : longint;
 VAR
 VAR
     rc : integer;
     rc : integer;
     r : tziprec;
     r : tziprec;
-    thename : ARRAY [ 0..tFSize ] of char;
+    thename : ARRAY [ 0..tFSize ] of AnsiChar;
     Count : longint;
     Count : longint;
     f : file;
     f : file;
 
 

+ 13 - 13
packages/unzip/src/unzipdll.pp

@@ -19,15 +19,15 @@ const
  UnzipErr: longint = 0;
  UnzipErr: longint = 0;
 
 
 type
 type
- TArgV = array [0..1023] of PChar;
+ TArgV = array [0..1023] of PAnsiChar;
  PArgV = ^TArgV;
  PArgV = ^TArgV;
- TCharArray = array [1..1024*1024] of char;
+ TCharArray = array [1..1024*1024] of AnsiChar;
  PCharArray = ^TCharArray;
  PCharArray = ^TCharArray;
  TFileUnzipEx = function (SourceZipFile, TargetDirectory,
  TFileUnzipEx = function (SourceZipFile, TargetDirectory,
-                                                    FileSpecs: PChar): integer;
+                                                    FileSpecs: PAnsiChar): integer;
 
 
 function DllFileUnzipEx (SourceZipFile, TargetDirectory,
 function DllFileUnzipEx (SourceZipFile, TargetDirectory,
-                                                    FileSpecs: PChar): integer;
+                                                    FileSpecs: PAnsiChar): integer;
 
 
 const
 const
  FileUnzipEx: TFileUnzipEx = @DllFileUnzipEx;
  FileUnzipEx: TFileUnzipEx = @DllFileUnzipEx;
@@ -73,21 +73,21 @@ const
  UzpMainOrd = 4;
  UzpMainOrd = 4;
  DLLName: string [8] = 'UNZIP32'#0;
  DLLName: string [8] = 'UNZIP32'#0;
  UzpMain: UzpMainFunc = nil;
  UzpMain: UzpMainFunc = nil;
- QuietOpt: array [1..4] of char = '-qq'#0;
- OverOpt: array [1..3] of char = '-o'#0;
- CaseInsOpt: array [1..3] of char = '-C'#0;
- ExDirOpt: array [1..3] of char = '-d'#0;
+ QuietOpt: array [1..4] of AnsiChar = '-qq'#0;
+ OverOpt: array [1..3] of AnsiChar = '-o'#0;
+ CaseInsOpt: array [1..3] of AnsiChar = '-C'#0;
+ ExDirOpt: array [1..3] of AnsiChar = '-d'#0;
  OptCount = 4;
  OptCount = 4;
 
 
 var
 var
  DLLHandle: longint;
  DLLHandle: longint;
  OldExit: pointer;
  OldExit: pointer;
- C: char;
+ C: AnsiChar;
 
 
 function DLLInit: boolean;
 function DLLInit: boolean;
 var
 var
 {$IFDEF OS2}
 {$IFDEF OS2}
- ErrPath: array [0..259] of char;
+ ErrPath: array [0..259] of AnsiChar;
 {$ENDIF}
 {$ENDIF}
  DLLPath: PathStr;
  DLLPath: PathStr;
  Dir: DirStr;
  Dir: DirStr;
@@ -106,7 +106,7 @@ begin
   if ErrPath [0] <> #0 then
   if ErrPath [0] <> #0 then
   begin
   begin
    Write (#13#10'Error while loading module ');
    Write (#13#10'Error while loading module ');
-   WriteLn (PChar (@ErrPath));
+   WriteLn (PAnsiChar (@ErrPath));
   end;
   end;
  {$IFDEF FPC}
  {$IFDEF FPC}
  end else DLLInit := DosQueryProcAddr (DLLHandle, UzpMainOrd, nil, pointer (UzpMain)) = 0;
  end else DLLInit := DosQueryProcAddr (DLLHandle, UzpMainOrd, nil, pointer (UzpMain)) = 0;
@@ -141,11 +141,11 @@ begin
 end;
 end;
 
 
 function DllFileUnzipEx (SourceZipFile, TargetDirectory,
 function DllFileUnzipEx (SourceZipFile, TargetDirectory,
-                                                    FileSpecs: PChar): integer;
+                                                    FileSpecs: PAnsiChar): integer;
 var
 var
  I, FCount, ArgC: longint;
  I, FCount, ArgC: longint;
  ArgV: TArgV;
  ArgV: TArgV;
- P: PChar;
+ P: PAnsiChar;
  StrLen: array [Succ (OptCount)..1023] of longint;
  StrLen: array [Succ (OptCount)..1023] of longint;
 begin
 begin
  ArgV [0] := @DLLName;
  ArgV [0] := @DLLName;

+ 4 - 4
packages/unzip/src/ziptypes.pp

@@ -58,8 +58,8 @@ CONST
 
 
 TYPE
 TYPE
   { Record for UNZIP }
   { Record for UNZIP }
-  buftype  = ARRAY [ 0..tBufSize ] of char;
-  TDirtype = ARRAY [ 0..tFSize ] of char;
+  buftype  = ARRAY [ 0..tBufSize ] of AnsiChar;
+  TDirtype = ARRAY [ 0..tFSize ] of AnsiChar;
   TZipRec = PACKED RECORD
   TZipRec = PACKED RECORD
        buf : ^buftype;        {please}         {buffer containing central dir}
        buf : ^buftype;        {please}         {buffer containing central dir}
        bufsize,               {do not}         {size of buffer}
        bufsize,               {do not}         {size of buffer}
@@ -159,13 +159,13 @@ CONST
 
 
 { the various unzip methods }
 { the various unzip methods }
 CONST
 CONST
-Unzipmethods : ARRAY [ 0..9 ] of pchar =
+Unzipmethods : ARRAY [ 0..9 ] of PAnsiChar =
   ( 'stored', 'shrunk', 'reduced 1', 'reduced 2', 'reduced 3',
   ( 'stored', 'shrunk', 'reduced 1', 'reduced 2', 'reduced 3',
    'reduced 4', 'imploded', 'tokenized', 'deflated', 'skipped' );
    'reduced 4', 'imploded', 'tokenized', 'deflated', 'skipped' );
 
 
 { unzip actions being undertaken }
 { unzip actions being undertaken }
 CONST
 CONST
-UnzipActions : ARRAY [ 0..9 ] of pchar =
+UnzipActions : ARRAY [ 0..9 ] of PAnsiChar =
   ( 'copying', 'unshrinking', 'unreducing 1', 'unreducing 2', 'unreducing 3',
   ( 'copying', 'unshrinking', 'unreducing 1', 'unreducing 2', 'unreducing 3',
    'unreducing 4', 'exploding', 'un-tokenizing', 'inflating', 'skipping' );
    'unreducing 4', 'exploding', 'un-tokenizing', 'inflating', 'skipping' );