Index

Package: UnZip

Description

package UnZip is
NB : this is the MIT License, as found 12 - Sep - 2007 on the site http://www.opensource.org/licenses/mit - license.php

Types

option

type option is (
    test_only,            -- test .zip file integrity, no write
    junk_directories,     -- ignore directory info - > extract to current one
    case_sensitive_match, -- case sensitive name matching
    extract_as_text       -- files will be written with native line endings
);

References:

unzip.ads:55:8 (declaration)
unzip.ads:62:29 (reference)

Option_set

type Option_set is array (option) of Boolean;

References:

unzip.ads:62:8 (declaration)
unzip.adb:25:53 (reference)
unzip.adb:369:47 (reference)
unzip.adb:380:47 (reference)
unzip.adb:392:47 (reference)
unzip.adb:402:47 (reference)
unzip.adb:413:47 (reference)
unzip.adb:425:47 (reference)
unzip.adb:450:47 (reference)
unzip.adb:499:47 (reference)
unzip.adb:545:47 (reference)
unzip.adb:595:47 (reference)
unzip.adb:629:47 (reference)
unzip.adb:684:47 (reference)
unzip.ads:64:24 (reference)
unzip.ads:103:46 (reference)
unzip.ads:112:46 (reference)
unzip.ads:123:46 (reference)
unzip.ads:136:46 (reference)
unzip.ads:146:46 (reference)
unzip.ads:158:46 (reference)
unzip.ads:207:46 (reference)
unzip.ads:220:46 (reference)
unzip.ads:234:37 (reference)
unzip.ads:249:46 (reference)
unzip.ads:263:46 (reference)
unzip.ads:278:46 (reference)

Create_Path_proc

type Create_Path_proc is access
    procedure (New_Directory : String;
               Form          : String := "");

References:

unzip.ads:68:8 (declaration)
unzip.ads:88:31 (reference)
Ada 2005's Ada.Directories.Create_Path. For Ada 95 compatibility we pass it as an optional procedure access.

Set_Time_Stamp_proc

type Set_Time_Stamp_proc is access
    procedure (file_name : String; stamp : Ada.Calendar.Time);

References:

unzip.ads:73:8 (declaration)
unzip.ads:89:31 (reference)
This is system - dependent (or in a future Ada)

Set_ZTime_Stamp_proc

type Set_ZTime_Stamp_proc is access
    procedure (file_name : String; stamp : Zip.Time);

References:

unzip.ads:77:8 (declaration)
unzip.ads:91:31 (reference)
Alternatively, you can use Zip.Time to set file time stamps

Compose_func

type Compose_func is access function (File_Name  : String) return String;

References:

unzip.ads:84:8 (declaration)
unzip.ads:90:31 (reference)
This is for modifying output file names (e.g. adding a work directory, modifying the archived path, etc.)

FS_routines_type

type FS_routines_type is record
    Create_Path             : Create_Path_proc;
    Set_Time_Stamp          : Set_Time_Stamp_proc;
    Compose_File_Name       : Compose_func;
    Set_ZTime_Stamp         : Set_ZTime_Stamp_proc; -- alt. to Set_Time_Stamp
  end record;

References:

unzip.ads:87:8 (declaration)
unzip.adb:27:53 (reference)
unzip.adb:371:47 (reference)
unzip.adb:382:47 (reference)
unzip.adb:394:47 (reference)
unzip.adb:404:47 (reference)
unzip.adb:415:47 (reference)
unzip.adb:427:47 (reference)
unzip.adb:452:47 (reference)
unzip.adb:501:47 (reference)
unzip.adb:547:47 (reference)
unzip.adb:597:47 (reference)
unzip.adb:631:47 (reference)
unzip.adb:686:47 (reference)
unzip.ads:94:28 (reference)
unzip.ads:105:46 (reference)
unzip.ads:114:46 (reference)
unzip.ads:125:46 (reference)
unzip.ads:138:46 (reference)
unzip.ads:148:46 (reference)
unzip.ads:160:46 (reference)
unzip.ads:209:46 (reference)
unzip.ads:222:46 (reference)
unzip.ads:236:46 (reference)
unzip.ads:251:46 (reference)
unzip.ads:265:46 (reference)
unzip.ads:280:46 (reference)
File System dependent settings

PKZip_method

subtype PKZip_method is Zip.PKZip_method;

References:

unzip.ads:163:11 (declaration)
unzip-decompress.adb:9:54 (reference)
unzip-decompress.ads:24:28 (reference)
unzip-streams.adb:36:16 (reference)
unzip.adb:33:16 (reference)
unzip.ads:198:39 (reference)

Name_conflict_intervention

type Name_conflict_intervention is
    (yes, no, yes_to_all, none, rename_it, abort_now);

References:

unzip.ads:174:8 (declaration)
unzip.ads:177:28 (reference)
unzip.ads:182:40 (reference)

Resolve_conflict_proc

type Resolve_conflict_proc is access
     procedure (name             :     String;
                action           : out Name_conflict_intervention;
                new_name         : out String;
                new_name_length  : out Natural);

References:

unzip.ads:180:9 (declaration)
unzip.adb:22:53 (reference)
unzip.adb:447:47 (reference)
unzip.adb:542:47 (reference)
unzip.adb:592:47 (reference)
unzip.adb:626:47 (reference)
unzip.ads:204:46 (reference)
unzip.ads:217:46 (reference)
unzip.ads:246:46 (reference)
unzip.ads:260:46 (reference)

Get_password_proc

type Get_password_proc is access
    procedure (password : out Ada.Strings.Unbounded.Unbounded_String);

References:

unzip.ads:186:8 (declaration)
unzip-decompress.adb:19:54 (reference)
unzip-decompress.ads:34:28 (reference)
unzip.adb:24:53 (reference)
unzip.adb:449:47 (reference)
unzip.adb:498:47 (reference)
unzip.adb:544:47 (reference)
unzip.adb:594:47 (reference)
unzip.adb:628:47 (reference)
unzip.adb:683:47 (reference)
unzip.ads:206:46 (reference)
unzip.ads:219:46 (reference)
unzip.ads:233:37 (reference)
unzip.ads:248:46 (reference)
unzip.ads:262:46 (reference)
unzip.ads:277:46 (reference)

File_size_type

subtype File_size_type is Zip.File_size_type;
Data sizes in archive

Tell_data_proc

type Tell_data_proc is access
    procedure (name                : String;
                compressed_bytes    : File_size_type;
                uncompressed_bytes  : File_size_type;
                method              : PKZip_method);

References:

unzip.ads:194:8 (declaration)
unzip.adb:23:53 (reference)
unzip.adb:448:47 (reference)
unzip.adb:497:47 (reference)
unzip.adb:543:47 (reference)
unzip.adb:593:47 (reference)
unzip.adb:627:47 (reference)
unzip.adb:682:47 (reference)
unzip.ads:205:46 (reference)
unzip.ads:218:46 (reference)
unzip.ads:232:37 (reference)
unzip.ads:247:46 (reference)
unzip.ads:261:46 (reference)
unzip.ads:276:46 (reference)

Write_mode (private)

type Write_mode is
    (write_to_binary_file,
      write_to_text_file,
      write_to_memory,
      just_test
);

References:

unzip.ads:298:8 (declaration)
unzip-decompress.adb:10:54 (reference)
unzip-decompress.ads:25:28 (reference)
unzip.adb:36:51 (reference)
unzip.adb:38:42 (reference)
unzip.adb:40:21 (reference)
unzip.ads:305:28 (reference)

Write_to_file (private)

subtype Write_to_file is Write_mode
    range write_to_binary_file .. write_to_text_file;

References:

unzip.ads:305:11 (declaration)
unzip.adb:76:27 (reference)
unzip.adb:257:31 (reference)
unzip.adb:276:31 (reference)

p_Stream_Element_Array (private)

type p_Stream_Element_Array is access all Ada.Streams.Stream_Element_Array;

References:

unzip.ads:308:8 (declaration)
unzip-decompress.adb:12:58 (reference)
unzip-decompress.ads:27:32 (reference)
unzip-streams.adb:14:34 (reference)
unzip-streams.adb:27:51 (reference)
unzip-streams.adb:128:46 (reference)
unzip-streams.ads:86:23 (reference)
unzip.adb:187:15 (reference)

Constants & Global variables

no_option (Option_set)

no_option : constant Option_set := (others => False);

References:

unzip.ads:64:3 (declaration)
unzip.adb:369:61 (reference)
unzip.adb:380:61 (reference)
unzip.adb:392:61 (reference)
unzip.adb:402:61 (reference)
unzip.adb:413:61 (reference)
unzip.adb:425:61 (reference)
unzip.adb:450:61 (reference)
unzip.adb:499:61 (reference)
unzip.adb:545:61 (reference)
unzip.adb:595:61 (reference)
unzip.adb:629:61 (reference)
unzip.adb:684:61 (reference)
unzip.ads:103:60 (reference)
unzip.ads:112:60 (reference)
unzip.ads:123:60 (reference)
unzip.ads:136:60 (reference)
unzip.ads:146:60 (reference)
unzip.ads:158:60 (reference)
unzip.ads:207:60 (reference)
unzip.ads:220:60 (reference)
unzip.ads:234:51 (reference)
unzip.ads:249:60 (reference)
unzip.ads:263:60 (reference)
unzip.ads:278:60 (reference)

null_routines (FS_routines_type)

null_routines : constant FS_routines_type := (null, null, null, null);

References:

unzip.ads:94:3 (declaration)
unzip.adb:371:67 (reference)
unzip.adb:382:67 (reference)
unzip.adb:394:67 (reference)
unzip.adb:404:67 (reference)
unzip.adb:415:67 (reference)
unzip.adb:427:67 (reference)
unzip.adb:452:67 (reference)
unzip.adb:501:67 (reference)
unzip.adb:547:67 (reference)
unzip.adb:597:67 (reference)
unzip.adb:631:67 (reference)
unzip.adb:686:67 (reference)
unzip.ads:105:66 (reference)
unzip.ads:114:66 (reference)
unzip.ads:125:66 (reference)
unzip.ads:138:66 (reference)
unzip.ads:148:66 (reference)
unzip.ads:160:66 (reference)
unzip.ads:209:66 (reference)
unzip.ads:222:66 (reference)
unzip.ads:236:66 (reference)
unzip.ads:251:66 (reference)
unzip.ads:265:66 (reference)
unzip.ads:280:66 (reference)

current_user_attitude (Name_conflict_intervention)

current_user_attitude  : Name_conflict_intervention := yes;

References:

unzip.ads:177:3 (declaration)
unzip.adb:133:21 (reference)
unzip.adb:137:41 (reference)
unzip.adb:144:31 (reference)
unzip.adb:150:18 (reference)
unzip.adb:466:10 (write reference)
unzip.adb:514:10 (write reference)
unzip.adb:558:10 (write reference)
unzip.adb:651:10 (write reference)
unzip.adb:706:10 (write reference)
reset to "yes" for a new session (in case of yes_to_all / none state!)

CRC_Error

CRC_Error,
  Uncompressed_size_Error,
  Write_Error,
  Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:285:3 (declaration)
unzip-decompress.adb:2025:16 (reference)

Uncompressed_size_Error

Uncompressed_size_Error,
  Write_Error,
  Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:286:3 (declaration)
unzip-decompress.adb:2018:22 (reference)
unzip-streams.adb:77:19 (reference)

Write_Error

Write_Error,
  Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:287:3 (declaration)
unzip-decompress.adb:380:31 (reference)
unzip-decompress.adb:609:31 (reference)
unzip-decompress.adb:1452:34 (reference)

Read_Error

Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

Wrong_password

Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:289:3 (declaration)
unzip-decompress.adb:264:31 (reference)
unzip-decompress.adb:1963:21 (reference)

User_abort

User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:290:3 (declaration)
unzip-decompress.adb:394:28 (reference)
unzip-decompress.adb:623:25 (reference)
unzip.adb:160:22 (reference)

Not_supported

Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:291:3 (declaration)
unzip-decompress.adb:708:28 (reference)

Unsupported_method

Unsupported_method,
  Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:292:3 (declaration)
unzip-decompress.adb:1998:19 (reference)
unzip-streams.adb:55:16 (reference)
unzip.adb:207:16 (reference)

Wrong_or_no_password

Wrong_or_no_password,
  Internal_Error  : exception;

References:

unzip.ads:293:3 (declaration)

Internal_Error

Internal_Error  : exception;

References:

unzip.ads:294:3 (declaration)

Subprograms & Entries

Extract

procedure Extract 
(from: String;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:102:13 (declaration)
unzip.adb:368:14 (body)
unzip.adb:376:8 (label)

Calls:

Extract defined at unzip.ads:202:13

Extract

procedure Extract 
(from: String;
what: String;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:110:13 (declaration)
unzip.adb:378:14 (body)
unzip.adb:387:8 (label)

Calls:

Extract defined at unzip.ads:214:13

Extract

procedure Extract 
(from: String;
what: String;
rename: String;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:120:13 (declaration)
unzip.adb:389:14 (body)
unzip.adb:399:8 (label)

Calls:

Extract defined at unzip.ads:228:13

Extract

procedure Extract 
(from: Zip.Zip_info;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:135:13 (declaration)
unzip.adb:401:14 (body)
unzip.adb:409:8 (label)

Calls:

Extract defined at unzip.ads:244:13

Extract

procedure Extract 
(from: Zip.Zip_info;
what: String;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:144:13 (declaration)
unzip.adb:411:14 (body)
unzip.adb:420:8 (label)

Calls:

Extract defined at unzip.ads:257:13

Extract

procedure Extract 
(from: Zip.Zip_info;
what: String;
rename: String;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:155:13 (declaration)
unzip.adb:422:14 (body)
unzip.adb:432:8 (label)

Calls:

Extract defined at unzip.ads:272:13

Extract

procedure Extract 
(from: String;
feedback: Zip.Feedback_proc;
help_the_file_exists: Resolve_conflict_proc;
tell_data: Tell_data_proc;
get_pwd: Get_password_proc;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:202:13 (declaration)
unzip.adb:374:7 (call)
unzip.adb:540:14 (body)
unzip.adb:585:8 (label)

Called by:

Extract defined at unzip.ads:102:13

Calls:

To_Unbounded_String defined at a-strunb.ads:94:13
UnZip.UnZipFile defined at unzip.adb:15:14
Zip.Find_first_offset defined at zip.ads:169:14
Zip_Streams.Close defined at zip_streams.ads:138:14
Zip_Streams.Open defined at zip_streams.ads:131:14
Zip_Streams.Set_Name defined at zip_streams.ads:56:14

Extract

procedure Extract 
(from: String;
what: String;
feedback: Zip.Feedback_proc;
help_the_file_exists: Resolve_conflict_proc;
tell_data: Tell_data_proc;
get_pwd: Get_password_proc;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:214:13 (declaration)
unzip.adb:385:7 (call)
unzip.adb:444:14 (body)
unzip.adb:488:8 (label)

Called by:

Extract defined at unzip.ads:110:13

Calls:

To_Unbounded_String defined at a-strunb.ads:94:13
UnZip.UnZipFile defined at unzip.adb:15:14
Zip.Find_offset defined at zip.ads:175:14
Zip_Streams.Close defined at zip_streams.ads:138:14
Zip_Streams.Open defined at zip_streams.ads:131:14
Zip_Streams.Set_Name defined at zip_streams.ads:56:14

Extract

procedure Extract 
(from: String;
what: String;
rename: String;
feedback: Zip.Feedback_proc;
tell_data: Tell_data_proc;
get_pwd: Get_password_proc;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:228:13 (declaration)
unzip.adb:397:7 (call)
unzip.adb:493:14 (body)
unzip.adb:536:8 (label)

Called by:

Extract defined at unzip.ads:120:13

Calls:

To_Unbounded_String defined at a-strunb.ads:94:13
UnZip.UnZipFile defined at unzip.adb:15:14
Zip.Find_offset defined at zip.ads:175:14
Zip_Streams.Close defined at zip_streams.ads:138:14
Zip_Streams.Open defined at zip_streams.ads:131:14
Zip_Streams.Set_Name defined at zip_streams.ads:56:14

Extract

procedure Extract 
(from: Zip.Zip_info;
feedback: Zip.Feedback_proc;
help_the_file_exists: Resolve_conflict_proc;
tell_data: Tell_data_proc;
get_pwd: Get_password_proc;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:244:13 (declaration)
unzip.adb:407:7 (call)
unzip.adb:590:14 (body)
unzip.adb:618:8 (label)

Called by:

Extract defined at unzip.ads:135:13

Extract

procedure Extract 
(from: Zip.Zip_info;
what: String;
feedback: Zip.Feedback_proc;
help_the_file_exists: Resolve_conflict_proc;
tell_data: Tell_data_proc;
get_pwd: Get_password_proc;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:257:13 (declaration)
unzip.adb:418:7 (call)
unzip.adb:602:10 (call)
unzip.adb:623:14 (body)
unzip.adb:672:8 (label)

Extract

procedure Extract 
(from: Zip.Zip_info;
what: String;
rename: String;
feedback: Zip.Feedback_proc;
tell_data: Tell_data_proc;
get_pwd: Get_password_proc;
options: Option_set := no_option;
password: String := "";
file_system_routines: FS_routines_type := null_routines );

References:

unzip.ads:272:13 (declaration)
unzip.adb:430:7 (call)
unzip.adb:678:14 (body)
unzip.adb:728:8 (label)

Called by:

Extract defined at unzip.ads:155:13