1. -- UnZip.Decompress 
  2. ------------------- 
  3. -- Private, internal to the UnZip package. 
  4. -- 
  5. -- Created 9-Mar-2007 
  6. -- 
  7. -- This package includes the decompression algorithms for methods 
  8. -- store, reduce, shrink (LZW), implode and inflate. 
  9. -- It contains the packages UnZ_IO, UnZ_Glob, UnZ_Infl, UnZ_Olds, UnZ_Misc 
  10. -- of previous versions of Zip-Ada. 
  11. -- They become local packages inside the Decompress_Data procedure -> 
  12. -- previously global variables are now local, one copy per concurrent call. 
  13.  
  14. with Zip.Headers; 
  15. with Ada.Strings.Unbounded;             use Ada.Strings.Unbounded; 
  16. with Zip_Streams; 
  17.  
  18. private package UnZip.Decompress is 
  19.  
  20.    procedure Decompress_data( 
  21.     zip_file            : Zip_Streams.Zipstream_Class; 
  22.     -- zip_file must be open and its index is meant 
  23.     -- to point to the beginning of compressed data 
  24.     format              : PKZip_method; 
  25.     mode                : Write_mode; 
  26.     output_file_name    : String; -- relevant only if mode = write_to_file 
  27.     output_memory_access: out p_Stream_Element_Array; --   = write_to_memory 
  28.     feedback            : Zip.Feedback_proc; 
  29.     explode_literal_tree: Boolean; -- relevant for the "explode" format 
  30.     explode_slide_8KB   : Boolean; -- relevant for the "explode" format 
  31.     end_data_descriptor : Boolean; 
  32.     encrypted           : Boolean; 
  33.     password            : in out Unbounded_String; 
  34.     get_new_password    : Get_password_proc; -- if null, initial pwd must fit 
  35.     hint                : in out Zip.Headers.Data_descriptor 
  36.     -- values are known, or smart fakes and corrected if a closing 
  37.     -- Data_descriptor is appended to the compressed data (1-pass written 
  38.     -- zip files, like JAR, OpenDocument, etc.) 
  39.                            ); 
  40.  
  41. private 
  42.  
  43.   -- Primitive tracing using Ada.Text_IO 
  44.   -- 
  45.   type Trace_type is (none, some, full); 
  46.  
  47.   trace: constant Trace_type:= none; -- <== Choice 
  48.  
  49.   no_trace  : constant Boolean:= trace=none; 
  50.   full_trace: constant Boolean:= trace=full; 
  51.   some_trace: constant Boolean:= trace>=some; 
  52.  
  53. end UnZip.Decompress;