Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ann: Zip-Ada v.42

24 views
Skip to first unread message

Gautier write-only

unread,
Feb 10, 2012, 7:53:50 AM2/10/12
to
Hello!

I am pleased to announce a new version of the Zip-Ada library, @
http://unzip-ada.sf.net/ .

Major changes in the last versions:

42: Support for Zip archives appended to other files, like a self-
extracting archive with Zip-Ada in the executable

41: Support for Unicode UTF-8 entry names within Zip archives

40: New package Zip.Compress.Deflate, with a first (weak but
straightforward) compression technique for the Deflate format

Some features:
- full sources are in Ada (no binding)
- decompression for all Zip sub-formats up to BZip2
- compression for all Zip sub-formats up to Deflate
- unconditionally portable
- input and output can be any stream (file, buffer,...) for archive
creation as well as data extraction.
- task safe
- endian-neutral

The zipada42.zip archive contains:

* The full library sources (inside one directory: Zip_Lib), in Ada 95,
using only Ada 95 standard's libraries

* Some command-line demo / tools:
* ZipAda, a zipping tool
* UnZipAda, an unzipping utility
* Comp_Zip, compares two Zip files
* Find_Zip, searches a text string through contents of a Zip file
* ReZip.adb, optimizes compression of Zip archives

NB: the ZipAda, UnZipAda, ReZip use a few non-Ada 95 library items.

The tools can be found pre-built for Windows in zipada42-bin-
win32.zip .

Enjoy!
_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/
NB: follow the above link for a valid e-mail address

Yannick Duchêne (Hibou57)

unread,
Feb 10, 2012, 10:59:02 AM2/10/12
to
Le Fri, 10 Feb 2012 13:53:50 +0100, Gautier write-only
<gautier...@hotmail.com> a écrit:

> Hello!
>
> I am pleased to announce a new version of the Zip-Ada library, @
> http://unzip-ada.sf.net/ .

In verif.aru, you have rules to exclude GNAT specific attributes, and you
enumerate all GNAT specific attributes. Like with any enumeration,
completness may be an issue, an there is nothing like Others here ;)

You may replace these AdaControl rules with simply a pragma:

pragma Restrictions (No_Implementation_Attributes);

With this, you are ensured to not miss a single one.

You may also add

pragma Restrictions (No_Implementation_Pragmas);
pragma Restrictions (No_Obsolescent_Features); -- But may cause
portability issues.

For GNAT, place these in a “gnat.adc” file.


Otherwise, good point, you provided some documentation about the Zip file
format. That's kind of you for readers.


--
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University

Yannick Duchêne (Hibou57)

unread,
Feb 10, 2012, 11:22:30 AM2/10/12
to
Le Fri, 10 Feb 2012 16:59:02 +0100, Yannick Duchêne (Hibou57)
<yannick...@yahoo.fr> a écrit:

> Le Fri, 10 Feb 2012 13:53:50 +0100, Gautier write-only
> <gautier...@hotmail.com> a écrit:
>
>> Hello!
>>
>> I am pleased to announce a new version of the Zip-Ada library, @
>> http://unzip-ada.sf.net/ .

The license file seems to be missing from the archive. The change log in
“zipada.txt” (which by the way, cannot be opened with Gedit, it fails for
some encoding errors) tells about MIT license, but that's just a mention
in the changes log, not a license file.

Randy Brukardt

unread,
Feb 10, 2012, 8:13:09 PM2/10/12
to
"Yannick Duchêne (Hibou57)" <yannick...@yahoo.fr> wrote in message
news:op.v9gz0okrule2fv@douda-yannick...
...
>You may replace these AdaControl rules with simply a pragma:
>
> pragma Restrictions (No_Implementation_Attributes);

Right, but that was introduced in Ada 2005, so it probably won't work on
non-GNAT compilers (or possibly GNAT in Ada 95 mode).

If you're willing to go to Ada 2012 features, use

pragma Profile (No_Implementation_Extensions);

which prevents implementation-defined pragmas, attributes, aspects, units,
and identifiers (the latter being declarations in the standard libraries
that are allowed to vary between implementations - like Short_Integer).

But I suspect that most people will find it hard to write completely pure
Ada (there are a lot of useful vendor-supplied libraries out there).

Ada 2012 also has restrictions to prevent the use of specific individual
aspects, attributes, and pragmas, which might be more appropriate for this
problem.

Randy.


Gautier write-only

unread,
Feb 11, 2012, 4:35:12 AM2/11/12
to
On 11 fév, 02:13, "Randy Brukardt" <ra...@rrsoftware.com> wrote:

> >    pragma Restrictions (No_Implementation_Attributes);
>
> Right, but that was introduced in Ada 2005, so it probably won't work on
> non-GNAT compilers (or possibly GNAT in Ada 95 mode).

Exact! And of course GNAT itself catches GNAT-isms in some items
outside the Zip-Ada library, like some Zip tool using a
'Unrestricted_Access. (cf experiments in SVN revision 108).
Actually, I found a much better way to check purity, which is building
and testing the library with another compiler (specifically, ObjectAda
7.2.2 SE).
Nothing is worth a second opinion...
Plus, I get from time to time a feedback about other compilers :-).
_________________________
Gautier's Ada programming
http://sf.net/users/gdemont

Georg Bauhaus

unread,
Feb 11, 2012, 8:01:42 AM2/11/12
to
On 11.02.12 10:35, Gautier write-only wrote:

> Actually, I found a much better way to check purity, which is building
> and testing the library with another compiler (specifically, ObjectAda
> 7.2.2 SE).
> Nothing is worth a second opinion...
> Plus, I get from time to time a feedback about other compilers :-).

It's good to have mini tools made by compiler vendors that allow
anyone to catch a glimpse of what their compiler will likely accept.
A tool like a relatively dumb syntax checker.

If the tool reuses some source text of their compiler's,and is
reasonably up to date, it might help promoting actual portability.
I'd guess, or hope, that ICC's pretty printer tool is such
a thing.

Yannick Duchêne (Hibou57)

unread,
Feb 11, 2012, 8:14:52 AM2/11/12
to
Le Sat, 11 Feb 2012 02:13:09 +0100, Randy Brukardt <ra...@rrsoftware.com>
a écrit:

> "Yannick Duchêne (Hibou57)" <yannick...@yahoo.fr> wrote in message
> news:op.v9gz0okrule2fv@douda-yannick...
> ...
>> You may replace these AdaControl rules with simply a pragma:
>>
>> pragma Restrictions (No_Implementation_Attributes);
>
> Right, but that was introduced in Ada 2005, so it probably won't work on
> non-GNAT compilers (or possibly GNAT in Ada 95 mode).

You're right, and the source says it targets Ada 95.

Gautier write-only

unread,
Feb 12, 2012, 5:26:23 AM2/12/12
to
On 10 fév, 17:22, Yannick Duchêne (Hibou57) <yannick_duch...@yahoo.fr>
wrote:

> The license file seems to be missing from the archive. The change log in
> “zipada.txt” (which by the way, cannot be opened with Gedit, it fails for
> some encoding errors) tells about MIT license, but that's just a mention
> in the changes log, not a license file.

Thanks for the feedback - any feedback is welcome!
I have made it clearer where to find the licence.
http://unzip-ada.svn.sf.net/viewvc/unzip-ada/zipada.txt?r1=107&r2=106&pathrev=107

Cheers
_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/search/label/Ada
0 new messages