Recent

Author Topic: "unzip" the invisible unit  (Read 6332 times)

minovitiello

  • New Member
  • *
  • Posts: 14
"unzip" the invisible unit
« on: April 02, 2011, 02:34:29 pm »
My code:

Uses unzip;

...

Procedure Tform1.Button1click(Sender: Tobject);
      VAR pippo : unz_file_info;
    Begin

    End; 

The compiler doesn't find the variable record "unz_file_info", why?
If I try to use a function inside "unzip" like "unzOpen" I get the same result.
I don't understand because. Where I am wrong?


Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: "unzip" the invisible unit
« Reply #1 on: April 02, 2011, 03:22:57 pm »
It seems work here.
Can compiler find unit unzip.pas itself?

Here it shows me that it is in: ../fpc/packages/paszlib/src/unzip.pas
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

minovitiello

  • New Member
  • *
  • Posts: 14
Re: "unzip" the invisible unit
« Reply #2 on: April 02, 2011, 04:09:03 pm »
The message says that it doesn't find "unz_file_info", but not from error for the use of "unzip"   
Oddly if I do "Find Declaration", it opens the unit and show the declaration of the record.

Boh!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12905
  • FPC developer.
Re: "unzip" the invisible unit
« Reply #3 on: April 02, 2011, 04:12:01 pm »
Very old examples might use unzip51g, that used to be "unzip" in old releases.

But better use the current unzip, it was renamed for a reason.

(Added later), hmm, that symbol is in paszlib/src/unzip.pp, maybe you have some other unzip unit (or old .ppu) in the path? Increase FPC verbosity

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: "unzip" the invisible unit
« Reply #4 on: April 02, 2011, 04:22:11 pm »
In my case it is file: ../fpc/packages/paszlib/src/unzip.pas - 45.5kB
Header:
Code: [Select]
unit Unzip;

{ ----------------------------------------------------------------- }
{ unzip.c -- IO on .zip files using zlib
   Version 0.15 beta, Mar 19th, 1998,
  unzip.h -- IO for uncompress .zip files using zlib
  Version 0.15 beta, Mar 19th, 1998,

  Copyright (C) 1998 Gilles Vollant <info@winimage.com>
  http://www.winimage.com/zLibDll/zip.htm

   This unzip package allow extract file from .ZIP file, compatible
   with PKZip 2.04g, WinZip, InfoZip tools and compatible.
   Encryption and multi volume ZipFile (span) are not supported.
   Old compressions used by old PKZip 1.x are not supported

  Pascal tranlastion
  Copyright (C) 2000 by Jacques Nomssi Nzali
  For conditions of distribution and use, see copyright notice in readme.txt }

and declaration on line 67
Code: [Select]
{ unz_file_info contain information about a file in the zipfile }
type
  unz_file_info = record
    version: longint;                  { version made by                 2 bytes }
    version_needed: longint;           { version needed to extract       2 bytes }
    flag:    longint;                  { general purpose bit flag        2 bytes }
    compression_method: longint;       { compression method              2 bytes }
    dosDate: longint;                  { last mod file date in Dos fmt   4 bytes }
    crc:     longint;                  { crc-32                          4 bytes }
    compressed_size: longint;          { compressed size                 4 bytes }
    uncompressed_size: longint;        { uncompressed size               4 bytes }
    size_filename: longint;            { filename length                 2 bytes }
    size_file_extra: longint;          { extra field length              2 bytes }
    size_file_comment: longint;        { file comment length             2 bytes }

    disk_num_start: longint;          { disk number start               2 bytes }
    internal_fa:    longint;          { internal file attributes        2 bytes }
    external_fa:    longint;          { external file attributes        4 bytes }

    tmu_date: tm_unz;
  end;
  unz_file_info_ptr = ^unz_file_info;

If it will help you.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

minovitiello

  • New Member
  • *
  • Posts: 14
Re: "unzip" the invisible unit
« Reply #5 on: April 02, 2011, 04:35:36 pm »
Thanks Blaazen, is really that.   
 
marcov, seems that there are different units with the same name, I will see to modify the name of that that serves and I hopes work well.   
   
Thanks 
 
excuse my bad English!

 

TinyPortal © 2005-2018