comp.lang.ada
 help / color / mirror / Atom feed
* Ann: Unzip-Ada, v.03
@ 1999-06-28  0:00 Gautier
  1999-06-28  0:00 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 6+ messages in thread
From: Gautier @ 1999-06-28  0:00 UTC (permalink / raw)


The URL: http://members.xoom.com/gdemont/unzipada.htm

Some news:

* New standalone demo tool ( just to see how slow it is ;-) ).
  If you build with cross-package inlining, suppress_all and some
  optimization, it will be a bit faster... In fact the I/O part
  is the main source of slowdown.

* The latest bugs in unzipping _seem_ to be gone...

* The library code is still pure, plain, vanilla, Ada95 (in fact
  99% Ada83 - note for the Ada83 fanatics), so it _should_
  compile on/for every platform (mainframe, embedded coffee-machine etc.).

* Known ( successful 8-) ) test reports: GNAT/DOS, GNAT/NT.

* Absolutely no progress from the "Stream" side.

* Other things on the web page!


Have fun.

-- 
Gautier

PS: the specification:

--  ___  ____  ____  ____  ________  ___   ______       ______     ___
--  |.|  |../  |...\ |../ /___..._/  |.|   |.___.\     /. __ .\  __|.|   ____
--  |.|  |.|   |.|\.\|.|     /../    |.|   |.____/     |.|__|.| /....|  __\..\
--  |.|__|.|   |.| \...|   _/../___  |.|   |.|    ===  |..__..||. = .| | = ..|
--  |______|  /__|  \__|  /_______/  |_|  /__|        /__|  |_| \__\_|  \__\_|

-- UnZip-Ada
------------
-- Unzips deflated, imploded, reduced, shrunk and stored files

--  Ada translation & cleanup by Gautier de Montmollin
--    http://members.xoom.com/gdemont/unzipada.htm

--  based on Pascal version 2.10 by Dr Abimbola A Olowofoyeku,
--    http://ourworld.compuserve.com/homepages/African_Chief/sources.htm,

--  itself based on Pascal version by Christian Ghisler,
--  itself based on C code by Info-Zip group (Mark Adler et al.)
--    http://www.cdrom.com/pub/infozip/

-- Technical documentation: read appnote.txt

-- Legal notice: no copyright, no warranty.

package Unzip is

  ----------------------------------
  -- Simple extraction procedures --
  ----------------------------------

  procedure Extract( from, what : String;
                     test_only  : boolean:= false ); -- a precise file
  procedure Extract( from, what, rename : String;
                     test_only  : boolean:= false ); -- id., under a new name
  procedure Extract_all_files(
                     from       : String;
                     test_only  : boolean:= false ); -- all files

  -------------------------------------------------------------------------
  -- Simple extraction procedures without re-searching central directory --
  -------------------------------------------------------------------------

  type zip_info is private; -- contains zip file name and its sorted directory

  procedure Load_zip_info( from : String; info : out zip_info );
  procedure Delete_zip_info( info : in out zip_info );

  procedure Extract( from : zip_info; what : String;
                     test_only  : boolean:= false );
  procedure Extract( from : zip_info; what, rename : String;
                     test_only  : boolean:= false );

  ----------------------------------------------
  -- Extraction procedures for user interface --
  ----------------------------------------------

  type feedback_proc is access
    procedure ( percents_done: in natural; user_abort: out boolean );

  type name_conflict_intervention is
    ( yes, no, yes_to_all, none, rename, abort_now );

  current_user_attitude : name_conflict_intervention:= yes;
  -- reset to "yes" for a new session (in case of yes_to_all / none state!)

  type resolve_conflict_proc is access
    procedure ( name            :  in String;
                action          : out name_conflict_intervention;
                new_name        : out String;
                new_name_length : out Natural );

  type tell_name_proc is access procedure ( name: String );
    -- Inform user for multiple file extracting

  -- NB: these accesses may necessitate the non-standard attribute
  -- unrestricted_access - or some changes. Read unzipada.adb for
  -- details.

  type pkzip_method is

   ( store,    -- ok
     shrink,   -- ok (tested with small files)
     reduce_1, reduce_2, reduce_3, reduce_4, -- untested (must be rare)
     implode,  -- ok
     tokenize, -- not yet implemented by PKWARE
     deflate,  -- ok
     unknown );

  procedure Extract( from, what  : String;
                     method      : out pkzip_method;
                     feedback    : feedback_proc;
                     file_exists : resolve_conflict_proc;
                     test_only   : boolean:= false );

  procedure Extract( from, what, rename : String;
                     method     : out pkzip_method;
                     feedback   : feedback_proc;
                     test_only  : boolean:= false );

  procedure Extract_all_files(
                     from        : String;
                     method      : out pkzip_method;
                     feedback    : feedback_proc;
                     file_exists : resolve_conflict_proc;
                     tell_name   : tell_name_proc;
                     test_only   : boolean:= false );

  procedure Extract( from : zip_info; what : String;
                     method      : out pkzip_method;
                     feedback    : feedback_proc;
                     file_exists : resolve_conflict_proc;
                     test_only   : boolean:= false );

  procedure Extract( from : zip_info; what, rename : String;
                     method     : out pkzip_method;
                     feedback   : feedback_proc;
                     test_only  : boolean:= false );

private

  -- zip_info, 23.VI.1999.

  -- The PKZIP central directory is coded here as a binary tree
  -- to allow a fast retrieval of the searched offset in zip file.
  -- E.g. for a 1000-file archive, the offset will be found in less
  -- than 11 moves: 2**10=1024 - without any read in the archive.

  type dir_node;
  type p_dir_node is access dir_node;

  type dir_node(name_len: natural) is record
    left, right : p_dir_node;
    name        : string(1..name_len);
    offset      : long_long_integer;
  end record;

  type p_string is access string;

  type zip_info is record
    zip_file_name   : p_string;
    dir_binary_tree : p_dir_node;
  end record;

end Unzip;




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unzip-Ada, v.03
  1999-06-28  0:00 Ann: Unzip-Ada, v.03 Gautier
@ 1999-06-28  0:00 ` David C. Hoos, Sr.
  1999-06-29  0:00   ` Ted Dennison
  1999-06-29  0:00   ` Gautier
  0 siblings, 2 replies; 6+ messages in thread
From: David C. Hoos, Sr. @ 1999-06-28  0:00 UTC (permalink / raw)



Gautier wrote in message <3777C30C.A1B0A52D@Maths.UniNe.CH>...
>The URL: http://members.xoom.com/gdemont/unzipada.htm
>
The above URL is not working, although I can access
http://members.xoom.com


Just thought you'd like to know.







^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unzip-Ada, v.03
  1999-06-28  0:00 ` David C. Hoos, Sr.
  1999-06-29  0:00   ` Ted Dennison
@ 1999-06-29  0:00   ` Gautier
  1 sibling, 0 replies; 6+ messages in thread
From: Gautier @ 1999-06-29  0:00 UTC (permalink / raw)
  To: David C. Hoos, Sr.

> Gautier wrote in message <3777C30C.A1B0A52D@Maths.UniNe.CH>...
> >The URL: http://members.xoom.com/gdemont/unzipada.htm

> The above URL is not working, although I can access
> http://members.xoom.com

> Just thought you'd like to know.

Maybe XOOM's automatic frame causes problems.

Try http://members.xoom.com/_XOOM/gdemont/unzipada.htm
(direct access to the page!)

-- 
Gautier




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unzip-Ada, v.03
  1999-06-28  0:00 ` David C. Hoos, Sr.
@ 1999-06-29  0:00   ` Ted Dennison
  1999-06-30  0:00     ` Gautier
  1999-06-29  0:00   ` Gautier
  1 sibling, 1 reply; 6+ messages in thread
From: Ted Dennison @ 1999-06-29  0:00 UTC (permalink / raw)


In article <7l90a1$94q@hobbes.crc.com>,
  "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> wrote:
>
> Gautier wrote in message <3777C30C.A1B0A52D@Maths.UniNe.CH>...
> >The URL: http://members.xoom.com/gdemont/unzipada.htm
> >
> The above URL is not working, although I can access
> http://members.xoom.com

The "NetNanny" here at work won't let me get at either URL. After
all, there's nothing but personal web pages on that site. Surfing there
can't *possibly* be work-related, right? (sigh)

Perhaps AdaPower or one of the repositories would be a better place to
put it.

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unzip-Ada, v.03
  1999-06-29  0:00   ` Ted Dennison
@ 1999-06-30  0:00     ` Gautier
  1999-06-30  0:00       ` Ted Dennison
  0 siblings, 1 reply; 6+ messages in thread
From: Gautier @ 1999-06-30  0:00 UTC (permalink / raw)
  To: Ted Dennison

> Perhaps AdaPower or one of the repositories would be a better place to
> put it.

Surely... a long-term solution will be found - e.g. PAL.

For now, a _provisory_ location:

 ftp://ftp.unine.ch/incoming/gautier/unzipada.htm

Hoping it works this time - otherwise I always can send via e-mail!

-- 
Gautier




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Unzip-Ada, v.03
  1999-06-30  0:00     ` Gautier
@ 1999-06-30  0:00       ` Ted Dennison
  0 siblings, 0 replies; 6+ messages in thread
From: Ted Dennison @ 1999-06-30  0:00 UTC (permalink / raw)


In article <3779CC0D.B84F34E1@Maths.UniNe.CH>,
  Gautier <Gautier.deMontmollin@Maths.UniNe.CH> wrote:
> > Perhaps AdaPower or one of the repositories would be a better place
to
> > put it.
>
> For now, a _provisory_ location:
>
>  ftp://ftp.unine.ch/incoming/gautier/unzipada.htm

Works great. Thanks.

ps. ASCII art on a web page? How quaint. :-)

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-06-30  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-28  0:00 Ann: Unzip-Ada, v.03 Gautier
1999-06-28  0:00 ` David C. Hoos, Sr.
1999-06-29  0:00   ` Ted Dennison
1999-06-30  0:00     ` Gautier
1999-06-30  0:00       ` Ted Dennison
1999-06-29  0:00   ` Gautier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox