1. --  ________  ___   ______       ______     ___ 
  2. -- /___..._/  |.|   |.___.\     /. __ .\  __|.|   ____ 
  3. --    /../    |.|   |.____/     |.|__|.| /....|  __\..\ 
  4. --  _/../___  |.|   |.|    ===  |..__..||. = .| | = ..| 
  5. -- /_______/  |_|  /__|        /__|  |_| \__\_|  \__\_| 
  6.  
  7. -- Zip.Compress 
  8. --------------- 
  9. -- 
  10. -- Created 9-Dec-2007 
  11. -- 
  12. -- This package facilitates the storage or compression of data. 
  13. -- 
  14. -- Note that unlike decompression where the decoding is unique, 
  15. -- there are an undefinite number of ways of compressing data into 
  16. -- formats which include compression structures, like Deflate. 
  17. -- As a result, you may want to use your own way (e.g. interfacing 
  18. -- with zlib). 
  19. -- This package is only a portable one, and doesn't claim 
  20. -- to be the best or the fastest 
  21.  
  22. with Zip_Streams; 
  23.  
  24. package Zip.Compress is 
  25.  
  26.   -- Compression_Method is really reflecting the way of compressing 
  27.   -- data, not only the final compression format called "method" in 
  28.   -- Zip specifications. In future versions, there might be 
  29.   -- enumeration items like "Deflate_zlib_like", 
  30.   -- "Deflate_64KB_brute_force", or "PPMd_variant_x". 
  31.  
  32.   type Compression_Method is 
  33.     (Store, 
  34.      Shrink, 
  35.      Reduce_1, Reduce_2, Reduce_3, Reduce_4 
  36.     ); 
  37.  
  38.   User_abort: exception; 
  39.  
  40.   -- Compress data from an input stream to an output stream until 
  41.   -- End_Of_File(input) = True, or number of input bytes = input_size 
  42.  
  43.   procedure Compress_data( 
  44.     input, 
  45.     output          : Zip_Streams.Zipstream_Class; 
  46.     input_size_known: Boolean; 
  47.     input_size      : File_size_type; -- ignored if unknown 
  48.     method          : Compression_Method; 
  49.     feedback        : Feedback_proc; 
  50.     CRC             : out Interfaces.Unsigned_32; 
  51.     output_size     : out File_size_type; 
  52.     zip_type        : out Interfaces.Unsigned_16 
  53.     -- ^ code corresponding to the compression method actually used 
  54.   ); 
  55.  
  56. end Zip.Compress;