]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libarchive/libarchive/archive_read_format.3
Merge ACPICA 20120320.
[FreeBSD/FreeBSD.git] / contrib / libarchive / libarchive / archive_read_format.3
1 .\" Copyright (c) 2003-2011 Tim Kientzle
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
12 .\"
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
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: head/lib/libarchive/archive_read.3 191595 2009-04-27 20:13:13Z kientzle $
26 .\"
27 .Dd March 19, 2011
28 .Dt ARCHIVE_READ_FORMAT 3
29 .Os
30 .Sh NAME
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
47 .\"
48 .Sh SYNOPSIS
49 .In archive.h
50 .Ft int
51 .Fn archive_read_support_format_7zip "struct archive *"
52 .Ft int
53 .Fn archive_read_support_format_all "struct archive *"
54 .Ft int
55 .Fn archive_read_support_format_ar "struct archive *"
56 .Ft int
57 .Fn archive_read_support_format_by_code "struct archive *" "int"
58 .Ft int
59 .Fn archive_read_support_format_cab "struct archive *"
60 .Ft int
61 .Fn archive_read_support_format_cpio "struct archive *"
62 .Ft int
63 .Fn archive_read_support_format_empty "struct archive *"
64 .Ft int
65 .Fn archive_read_support_format_iso9660 "struct archive *"
66 .Ft int
67 .Fn archive_read_support_format_lha "struct archive *"
68 .Ft int
69 .Fn archive_read_support_format_mtree "struct archive *"
70 .Ft int
71 .Fn archive_read_support_format_rar "struct archive *"
72 .Ft int
73 .Fn archive_read_support_format_raw "struct archive *"
74 .Ft int
75 .Fn archive_read_support_format_tar "struct archive *"
76 .Ft int
77 .Fn archive_read_support_format_xar "struct archive *"
78 .Ft int
79 .Fn archive_read_support_format_zip "struct archive *"
80 .\"
81 .Sh DESCRIPTION
82 .Bl -tag -compact -width indent
83 .It Xo
84 .Fn archive_read_support_format_7zip ,
85 .Fn archive_read_support_format_ar ,
86 .Fn archive_read_support_format_cab ,
87 .Fn archive_read_support_format_cpio ,
88 .Fn archive_read_support_format_iso9660 ,
89 .Fn archive_read_support_format_lha ,
90 .Fn archive_read_support_format_mtree ,
91 .Fn archive_read_support_format_rar ,
92 .Fn archive_read_support_format_raw ,
93 .Fn archive_read_support_format_tar ,
94 .Fn archive_read_support_format_xar ,
95 .Fn archive_read_support_format_zip
96 .Xc
97 Enables support---including auto-detection code---for the
98 specified archive format.
99 For example,
100 .Fn archive_read_support_format_tar
101 enables support for a variety of standard tar formats, old-style tar,
102 ustar, pax interchange format, and many common variants.
103 .It Fn archive_read_support_format_all 
104 Enables support for all available formats except the
105 .Dq raw
106 format (see below).
107 .It Fn archive_read_support_format_by_code
108 Enables a single format specified by the format code.
109 This can be useful when reading a single archive twice;
110 use
111 .Fn archive_format
112 after reading the first time and pass the resulting code
113 to this function to selectively enable only the necessary
114 format support.
115 Note:  In statically-linked executables, this will cause
116 your program to include support for every format.
117 If executable size is a concern, you may wish to avoid
118 using this function.
119 .It Fn archive_read_support_format_empty
120 Enables support for treating empty files as empty archives.
121 Because empty files are valid for several different formats,
122 it is not possible to accurately determine a format for
123 an empty file based purely on contents.
124 So empty files are treated by libarchive as a distinct
125 format.
126 .It Fn archive_read_support_format_raw 
127 The
128 .Dq raw
129 format handler allows libarchive to be used to read arbitrary data.
130 It treats any data stream as an archive with a single entry.
131 The pathname of this entry is
132 .Dq data ;
133 all other entry fields are unset.
134 This is not enabled by
135 .Fn archive_read_support_format_all
136 in order to avoid erroneous handling of damaged archives.
137 .El
138 .\" .Sh EXAMPLE
139 .Sh RETURN VALUES
140 These functions return
141 .Cm ARCHIVE_OK
142 on success, or
143 .Cm ARCHIVE_FATAL .
144 .\"
145 .Sh ERRORS
146 Detailed error codes and textual descriptions are available from the
147 .Fn archive_errno
148 and
149 .Fn archive_error_string
150 functions.
151 .\"
152 .Sh SEE ALSO
153 .Xr tar 1 ,
154 .Xr libarchive 3 ,
155 .Xr archive_read_data 3 ,
156 .Xr archive_read_filter 3 ,
157 .Xr archive_read_set_options 3 ,
158 .Xr archive_util 3 ,
159 .Xr tar 5
160 .Sh BUGS
161 Many traditional archiver programs treat
162 empty files as valid empty archives.
163 For example, many implementations of
164 .Xr tar 1
165 allow you to append entries to an empty file.
166 Of course, it is impossible to determine the format of an empty file
167 by inspecting the contents, so this library treats empty files as
168 having a special
169 .Dq empty
170 format.
171 .Pp
172 Using the
173 .Dq raw
174 handler together with any other handler will often work
175 but can produce surprising results.