1 <!-- Creator : groff version 1.22.3 -->
2 <!-- CreationDate: Fri Apr 29 22:04:22 2016 -->
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4 "http://www.w3.org/TR/html4/loose.dtd">
7 <meta name="generator" content="groff -Thtml, see www.gnu.org">
8 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9 <meta name="Content-Style" content="text/css">
10 <style type="text/css">
11 p { margin-top: 0; margin-bottom: 0; vertical-align: top }
12 pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
13 table { margin-top: 0; margin-bottom: 0; vertical-align: top }
14 h1 { text-align: center }
23 <p>ARCHIVE_UTIL(3) BSD Library Functions Manual
26 <p style="margin-top: 1em"><b>NAME</b></p>
28 <p style="margin-left:6%;"><b>archive_clear_error</b>,
29 <b>archive_compression</b>, <b>archive_compression_name</b>,
30 <b>archive_copy_error</b>, <b>archive_errno</b>,
31 <b>archive_error_string</b>, <b>archive_file_count</b>,
32 <b>archive_filter_code</b>, <b>archive_filter_count</b>,
33 <b>archive_filter_name</b>, <b>archive_format</b>,
34 <b>archive_format_name</b>, <b>archive_position</b>,
35 <b>archive_set_error</b> — libarchive utility
38 <p style="margin-top: 1em"><b>LIBRARY</b></p>
40 <p style="margin-left:6%;">Streaming Archive Library
41 (libarchive, -larchive)</p>
43 <p style="margin-top: 1em"><b>SYNOPSIS</b></p>
45 <p style="margin-left:6%;"><b>#include
46 <archive.h></b></p>
48 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
51 <p style="margin-left:12%;"><b>archive_clear_error</b>(<i>struct archive *</i>);</p>
53 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
56 <p style="margin-left:12%;"><b>archive_compression</b>(<i>struct archive *</i>);</p>
58 <p style="margin-left:6%; margin-top: 1em"><i>const char
62 <p style="margin-left:12%;"><b>archive_compression_name</b>(<i>struct archive *</i>);</p>
64 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
67 <p style="margin-left:12%;"><b>archive_copy_error</b>(<i>struct archive *</i>,
68 <i>struct archive *</i>);</p>
70 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
73 <p style="margin-left:12%;"><b>archive_errno</b>(<i>struct archive *</i>);</p>
75 <p style="margin-left:6%; margin-top: 1em"><i>const char
79 <p style="margin-left:12%;"><b>archive_error_string</b>(<i>struct archive *</i>);</p>
81 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
84 <p style="margin-left:12%;"><b>archive_file_count</b>(<i>struct archive *</i>);</p>
86 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
89 <p style="margin-left:12%;"><b>archive_filter_code</b>(<i>struct archive *</i>,
92 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
95 <p style="margin-left:12%;"><b>archive_filter_count</b>(<i>struct archive *</i>,
98 <p style="margin-left:6%; margin-top: 1em"><i>const char
102 <p style="margin-left:12%;"><b>archive_filter_name</b>(<i>struct archive *</i>,
105 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
108 <p style="margin-left:12%;"><b>archive_format</b>(<i>struct archive *</i>);</p>
110 <p style="margin-left:6%; margin-top: 1em"><i>const char
114 <p style="margin-left:12%;"><b>archive_format_name</b>(<i>struct archive *</i>);</p>
117 <p style="margin-left:6%; margin-top: 1em"><i>int64_t</i></p>
120 <p style="margin-left:12%;"><b>archive_position</b>(<i>struct archive *</i>,
123 <p style="margin-left:6%; margin-top: 1em"><i>void</i></p>
126 <p><b>archive_set_error</b>(<i>struct archive *</i>,
127 <i>int error_code</i>,
128 <i>const char *fmt</i>, <i>...</i>);</p>
130 <p style="margin-top: 1em"><b>DESCRIPTION</b></p>
132 <p style="margin-left:6%;">These functions provide access
133 to various information about the struct archive object used
134 in the libarchive(3) library.</p>
136 <p><b>archive_clear_error</b>()</p>
138 <p style="margin-left:17%;">Clears any error information
139 left over from a previous call. Not generally used in client
142 <p><b>archive_compression</b>()</p>
144 <p style="margin-left:17%;">Synonym for
145 <b>archive_filter_code(a,</b>(<i>0)</i>).</p>
147 <p><b>archive_compression_name</b>()</p>
149 <p style="margin-left:17%;">Synonym for
150 <b>archive_filter_name(a,</b>(<i>0)</i>).</p>
152 <p><b>archive_copy_error</b>()</p>
154 <p style="margin-left:17%;">Copies error information from
155 one archive to another.</p>
157 <p><b>archive_errno</b>()</p>
159 <p style="margin-left:17%;">Returns a numeric error code
160 (see errno(2)) indicating the reason for the most recent
161 error return. Note that this can not be reliably used to
162 detect whether an error has occurred. It should be used only
163 after another libarchive function has returned an error
166 <p><b>archive_error_string</b>()</p>
168 <p style="margin-left:17%;">Returns a textual error message
169 suitable for display. The error message here is usually more
170 specific than that obtained from passing the result of
171 <b>archive_errno</b>() to strerror(3).</p>
173 <p><b>archive_file_count</b>()</p>
175 <p style="margin-left:17%;">Returns a count of the number
176 of files processed by this archive object. The count is
177 incremented by calls to archive_write_header(3) or
178 archive_read_next_header(3).</p>
180 <p><b>archive_filter_code</b>()</p>
182 <p style="margin-left:17%;">Returns a numeric code
183 identifying the indicated filter. See
184 <b>archive_filter_count</b>() for details of the
187 <p><b>archive_filter_count</b>()</p>
189 <p style="margin-left:17%;">Returns the number of filters
190 in the current pipeline. For read archive handles, these
191 filters are added automatically by the automatic format
192 detection. For write archive handles, these filters are
193 added by calls to the various
194 <b>archive_write_add_filter_XXX</b>() functions. Filters in
195 the resulting pipeline are numbered so that filter 0 is the
196 filter closest to the format handler. As a convenience,
197 functions that expect a filter number will accept -1 as a
198 synonym for the highest-numbered filter.</p>
200 <p style="margin-left:17%; margin-top: 1em">For example,
201 when reading a uuencoded gzipped tar archive, there are
202 three filters: filter 0 is the gunzip filter, filter 1 is
203 the uudecode filter, and filter 2 is the pseudo-filter that
204 wraps the archive read functions. In this case, requesting
205 <b>archive_position(a,</b>(<i>-1)</i>) would be a synonym
206 for <b>archive_position(a,</b>(<i>2)</i>) which would return
207 the number of bytes currently read from the archive, while
208 <b>archive_position(a,</b>(<i>1)</i>) would return the
209 number of bytes after uudecoding, and
210 <b>archive_position(a,</b>(<i>0)</i>) would return the
211 number of bytes after decompression.</p>
213 <p><b>archive_filter_name</b>()</p>
215 <p style="margin-left:17%;">Returns a textual name
216 identifying the indicated filter. See
217 <b>archive_filter_count</b>() for details of the
220 <p><b>archive_format</b>()</p>
222 <p style="margin-left:17%;">Returns a numeric code
223 indicating the format of the current archive entry. This
224 value is set by a successful call to
225 <b>archive_read_next_header</b>(). Note that it is common
226 for this value to change from entry to entry. For example, a
227 tar archive might have several entries that utilize GNU tar
228 extensions and several entries that do not. These entries
229 will have different format codes.</p>
231 <p><b>archive_format_name</b>()</p>
233 <p style="margin-left:17%;">A textual description of the
234 format of the current entry.</p>
236 <p><b>archive_position</b>()</p>
238 <p style="margin-left:17%;">Returns the number of bytes
239 read from or written to the indicated filter. In particular,
240 <b>archive_position(a,</b>(<i>0)</i>) returns the number of
241 bytes read or written by the format handler, while
242 <b>archive_position(a,</b>(<i>-1)</i>) returns the number of
243 bytes read or written to the archive. See
244 <b>archive_filter_count</b>() for details of the numbering
247 <p><b>archive_set_error</b>()</p>
249 <p style="margin-left:17%;">Sets the numeric error code and
250 error description that will be returned by
251 <b>archive_errno</b>() and <b>archive_error_string</b>().
252 This function should be used within I/O callbacks to set
253 system-specific error codes and error descriptions. This
254 function accepts a printf-like format string and arguments.
255 However, you should be careful to use only the following
256 printf format specifiers: ’’%c’’,
257 ’’%d’’,
258 ’’%jd’’,
259 ’’%jo’’,
260 ’’%ju’’,
261 ’’%jx’’,
262 ’’%ld’’,
263 ’’%lo’’,
264 ’’%lu’’,
265 ’’%lx’’,
266 ’’%o’’,
267 ’’%u’’,
268 ’’%s’’,
269 ’’%x’’,
270 ’’%%’’. Field-width specifiers and
271 other printf features are not uniformly supported and should
274 <p style="margin-top: 1em"><b>SEE ALSO</b></p>
276 <p style="margin-left:6%;">archive_read(3),
277 archive_write(3), libarchive(3), printf(3)</p>
279 <p style="margin-top: 1em"><b>HISTORY</b></p>
281 <p style="margin-left:6%;">The <b>libarchive</b> library
282 first appeared in FreeBSD 5.3.</p>
284 <p style="margin-top: 1em"><b>AUTHORS</b></p>
286 <p style="margin-left:6%;">The <b>libarchive</b> library
287 was written by Tim Kientzle <kientzle@acm.org>.</p>
289 <p style="margin-left:6%; margin-top: 1em">BSD
290 February 2, 2012 BSD</p>