1 .\" Copyright (c) 2003-2011 Tim Kientzle
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .Dt ARCHIVE_READ_FORMAT 3
31 .Nm archive_read_support_format_7zip ,
32 .Nm archive_read_support_format_all ,
33 .Nm archive_read_support_format_ar ,
34 .Nm archive_read_support_format_by_code ,
35 .Nm archive_read_support_format_cab ,
36 .Nm archive_read_support_format_cpio ,
37 .Nm archive_read_support_format_empty ,
38 .Nm archive_read_support_format_iso9660 ,
39 .Nm archive_read_support_format_lha ,
40 .Nm archive_read_support_format_mtree,
41 .Nm archive_read_support_format_rar,
42 .Nm archive_read_support_format_raw,
43 .Nm archive_read_support_format_tar ,
44 .Nm archive_read_support_format_xar ,
45 .Nm archive_read_support_format_zip
46 .Nd functions for reading streaming archives
49 Streaming Archive Library (libarchive, -larchive)
53 .Fn archive_read_support_format_7zip "struct archive *"
55 .Fn archive_read_support_format_all "struct archive *"
57 .Fn archive_read_support_format_ar "struct archive *"
59 .Fn archive_read_support_format_by_code "struct archive *" "int"
61 .Fn archive_read_support_format_cab "struct archive *"
63 .Fn archive_read_support_format_cpio "struct archive *"
65 .Fn archive_read_support_format_empty "struct archive *"
67 .Fn archive_read_support_format_iso9660 "struct archive *"
69 .Fn archive_read_support_format_lha "struct archive *"
71 .Fn archive_read_support_format_mtree "struct archive *"
73 .Fn archive_read_support_format_rar "struct archive *"
75 .Fn archive_read_support_format_raw "struct archive *"
77 .Fn archive_read_support_format_tar "struct archive *"
79 .Fn archive_read_support_format_xar "struct archive *"
81 .Fn archive_read_support_format_zip "struct archive *"
84 .Bl -tag -compact -width indent
86 .Fn archive_read_support_format_7zip ,
87 .Fn archive_read_support_format_ar ,
88 .Fn archive_read_support_format_cab ,
89 .Fn archive_read_support_format_cpio ,
90 .Fn archive_read_support_format_iso9660 ,
91 .Fn archive_read_support_format_lha ,
92 .Fn archive_read_support_format_mtree ,
93 .Fn archive_read_support_format_rar ,
94 .Fn archive_read_support_format_raw ,
95 .Fn archive_read_support_format_tar ,
96 .Fn archive_read_support_format_xar ,
97 .Fn archive_read_support_format_zip
99 Enables support---including auto-detection code---for the
100 specified archive format.
102 .Fn archive_read_support_format_tar
103 enables support for a variety of standard tar formats, old-style tar,
104 ustar, pax interchange format, and many common variants.
105 .It Fn archive_read_support_format_all
106 Enables support for all available formats except the
109 .It Fn archive_read_support_format_by_code
110 Enables a single format specified by the format code.
111 This can be useful when reading a single archive twice;
114 after reading the first time and pass the resulting code
115 to this function to selectively enable only the necessary
117 Note: In statically-linked executables, this will cause
118 your program to include support for every format.
119 If executable size is a concern, you may wish to avoid
121 .It Fn archive_read_support_format_empty
122 Enables support for treating empty files as empty archives.
123 Because empty files are valid for several different formats,
124 it is not possible to accurately determine a format for
125 an empty file based purely on contents.
126 So empty files are treated by libarchive as a distinct
128 .It Fn archive_read_support_format_raw
131 format handler allows libarchive to be used to read arbitrary data.
132 It treats any data stream as an archive with a single entry.
133 The pathname of this entry is
135 all other entry fields are unset.
136 This is not enabled by
137 .Fn archive_read_support_format_all
138 in order to avoid erroneous handling of damaged archives.
142 These functions return
148 Detailed error codes and textual descriptions are available from the
151 .Fn archive_error_string
157 .Xr archive_read_data 3 ,
158 .Xr archive_read_filter 3 ,
159 .Xr archive_read_set_options 3 ,
163 Many traditional archiver programs treat
164 empty files as valid empty archives.
165 For example, many implementations of
167 allow you to append entries to an empty file.
168 Of course, it is impossible to determine the format of an empty file
169 by inspecting the contents, so this library treats empty files as
176 handler together with any other handler will often work
177 but can produce surprising results.