Blame doc/man/archive_util.3

Packit 08bd4c
.TH ARCHIVE_UTIL 3 "February 2, 2012" ""
Packit 08bd4c
.SH NAME
Packit 08bd4c
.ad l
Packit 08bd4c
\fB\%archive_clear_error\fP,
Packit 08bd4c
\fB\%archive_compression\fP,
Packit 08bd4c
\fB\%archive_compression_name\fP,
Packit 08bd4c
\fB\%archive_copy_error\fP,
Packit 08bd4c
\fB\%archive_errno\fP,
Packit 08bd4c
\fB\%archive_error_string\fP,
Packit 08bd4c
\fB\%archive_file_count\fP,
Packit 08bd4c
\fB\%archive_filter_code\fP,
Packit 08bd4c
\fB\%archive_filter_count\fP,
Packit 08bd4c
\fB\%archive_filter_name\fP,
Packit 08bd4c
\fB\%archive_format\fP,
Packit 08bd4c
\fB\%archive_format_name\fP,
Packit 08bd4c
\fB\%archive_position\fP,
Packit 08bd4c
\fB\%archive_set_error\fP
Packit 08bd4c
\- libarchive utility functions
Packit 08bd4c
.SH LIBRARY
Packit 08bd4c
.ad l
Packit 08bd4c
Streaming Archive Library (libarchive, -larchive)
Packit 08bd4c
.SH SYNOPSIS
Packit 08bd4c
.ad l
Packit 08bd4c
\fB#include <archive.h>\fP
Packit 08bd4c
.br
Packit 08bd4c
\fIvoid\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_clear_error\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIint\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_compression\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIconst char *\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_compression_name\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIvoid\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_copy_error\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIint\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_errno\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIconst char *\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_error_string\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIint\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_file_count\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIint\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_filter_code\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIint\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_filter_count\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIconst char *\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_filter_name\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIint\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_format\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIconst char *\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_format_name\fP(\fI\%struct\ archive\ *\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIint64_t\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_position\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
Packit 08bd4c
.br
Packit 08bd4c
\fIvoid\fP
Packit 08bd4c
.br
Packit 08bd4c
\fB\%archive_set_error\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ error_code\fP, \fI\%const\ char\ *fmt\fP, \fI\%...\fP);
Packit 08bd4c
.SH DESCRIPTION
Packit 08bd4c
.ad l
Packit 08bd4c
These functions provide access to various information about the
Packit 08bd4c
Tn struct archive
Packit 08bd4c
object used in the
Packit 08bd4c
\fBlibarchive\fP(3)
Packit 08bd4c
library.
Packit 08bd4c
.RS 5
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_clear_error\fP()
Packit 08bd4c
Clears any error information left over from a previous call.
Packit 08bd4c
Not generally used in client code.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_compression\fP()
Packit 08bd4c
Synonym for
Packit 08bd4c
\fB\%archive_filter_code(a,\fP(\fI\%0)\fP).
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_compression_name\fP()
Packit 08bd4c
Synonym for
Packit 08bd4c
\fB\%archive_filter_name(a,\fP(\fI\%0)\fP).
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_copy_error\fP()
Packit 08bd4c
Copies error information from one archive to another.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_errno\fP()
Packit 08bd4c
Returns a numeric error code (see
Packit 08bd4c
\fBerrno\fP(2))
Packit 08bd4c
indicating the reason for the most recent error return.
Packit 08bd4c
Note that this can not be reliably used to detect whether an
Packit 08bd4c
error has occurred.
Packit 08bd4c
It should be used only after another libarchive function
Packit 08bd4c
has returned an error status.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_error_string\fP()
Packit 08bd4c
Returns a textual error message suitable for display.
Packit 08bd4c
The error message here is usually more specific than that
Packit 08bd4c
obtained from passing the result of
Packit 08bd4c
\fB\%archive_errno\fP()
Packit 08bd4c
to
Packit 08bd4c
\fBstrerror\fP(3).
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_file_count\fP()
Packit 08bd4c
Returns a count of the number of files processed by this archive object.
Packit 08bd4c
The count is incremented by calls to
Packit 08bd4c
\fBarchive_write_header\fP(3)
Packit 08bd4c
or
Packit 08bd4c
\fBarchive_read_next_header\fP(3).
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_filter_code\fP()
Packit 08bd4c
Returns a numeric code identifying the indicated filter.
Packit 08bd4c
See
Packit 08bd4c
\fB\%archive_filter_count\fP()
Packit 08bd4c
for details of the numbering.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_filter_count\fP()
Packit 08bd4c
Returns the number of filters in the current pipeline.
Packit 08bd4c
For read archive handles, these filters are added automatically
Packit 08bd4c
by the automatic format detection.
Packit 08bd4c
For write archive handles, these filters are added by calls to the various
Packit 08bd4c
\fB\%archive_write_add_filter_XXX\fP()
Packit 08bd4c
functions.
Packit 08bd4c
Filters in the resulting pipeline are numbered so that filter 0
Packit 08bd4c
is the filter closest to the format handler.
Packit 08bd4c
As a convenience, functions that expect a filter number will
Packit 08bd4c
accept -1 as a synonym for the highest-numbered filter.
Packit 08bd4c
.PP
Packit 08bd4c
For example, when reading a uuencoded gzipped tar archive, there
Packit 08bd4c
are three filters:
Packit 08bd4c
filter 0 is the gunzip filter,
Packit 08bd4c
filter 1 is the uudecode filter,
Packit 08bd4c
and filter 2 is the pseudo-filter that wraps the archive read functions.
Packit 08bd4c
In this case, requesting
Packit 08bd4c
\fB\%archive_position(a,\fP(\fI\%-1)\fP)
Packit 08bd4c
would be a synonym for
Packit 08bd4c
\fB\%archive_position(a,\fP(\fI\%2)\fP)
Packit 08bd4c
which would return the number of bytes currently read from the archive, while
Packit 08bd4c
\fB\%archive_position(a,\fP(\fI\%1)\fP)
Packit 08bd4c
would return the number of bytes after uudecoding, and
Packit 08bd4c
\fB\%archive_position(a,\fP(\fI\%0)\fP)
Packit 08bd4c
would return the number of bytes after decompression.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_filter_name\fP()
Packit 08bd4c
Returns a textual name identifying the indicated filter.
Packit 08bd4c
See
Packit 08bd4c
\fB\%archive_filter_count\fP()
Packit 08bd4c
for details of the numbering.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_format\fP()
Packit 08bd4c
Returns a numeric code indicating the format of the current
Packit 08bd4c
archive entry.
Packit 08bd4c
This value is set by a successful call to
Packit 08bd4c
\fB\%archive_read_next_header\fP().
Packit 08bd4c
Note that it is common for this value to change from
Packit 08bd4c
entry to entry.
Packit 08bd4c
For example, a tar archive might have several entries that
Packit 08bd4c
utilize GNU tar extensions and several entries that do not.
Packit 08bd4c
These entries will have different format codes.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_format_name\fP()
Packit 08bd4c
A textual description of the format of the current entry.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_position\fP()
Packit 08bd4c
Returns the number of bytes read from or written to the indicated filter.
Packit 08bd4c
In particular,
Packit 08bd4c
\fB\%archive_position(a,\fP(\fI\%0)\fP)
Packit 08bd4c
returns the number of bytes read or written by the format handler, while
Packit 08bd4c
\fB\%archive_position(a,\fP(\fI\%-1)\fP)
Packit 08bd4c
returns the number of bytes read or written to the archive.
Packit 08bd4c
See
Packit 08bd4c
\fB\%archive_filter_count\fP()
Packit 08bd4c
for details of the numbering here.
Packit 08bd4c
.TP
Packit 08bd4c
\fB\%archive_set_error\fP()
Packit 08bd4c
Sets the numeric error code and error description that will be returned
Packit 08bd4c
by
Packit 08bd4c
\fB\%archive_errno\fP()
Packit 08bd4c
and
Packit 08bd4c
\fB\%archive_error_string\fP().
Packit 08bd4c
This function should be used within I/O callbacks to set system-specific
Packit 08bd4c
error codes and error descriptions.
Packit 08bd4c
This function accepts a printf-like format string and arguments.
Packit 08bd4c
However, you should be careful to use only the following printf
Packit 08bd4c
format specifiers:
Packit 08bd4c
``%c'',
Packit 08bd4c
``%d'',
Packit 08bd4c
``%jd'',
Packit 08bd4c
``%jo'',
Packit 08bd4c
``%ju'',
Packit 08bd4c
``%jx'',
Packit 08bd4c
``%ld'',
Packit 08bd4c
``%lo'',
Packit 08bd4c
``%lu'',
Packit 08bd4c
``%lx'',
Packit 08bd4c
``%o'',
Packit 08bd4c
``%u'',
Packit 08bd4c
``%s'',
Packit 08bd4c
``%x'',
Packit 08bd4c
``%%''.
Packit 08bd4c
Field-width specifiers and other printf features are
Packit 08bd4c
not uniformly supported and should not be used.
Packit 08bd4c
.RE
Packit 08bd4c
.SH SEE ALSO
Packit 08bd4c
.ad l
Packit 08bd4c
\fBarchive_read\fP(3),
Packit 08bd4c
\fBarchive_write\fP(3),
Packit 08bd4c
\fBlibarchive\fP(3),
Packit 08bd4c
\fBprintf\fP(3)
Packit 08bd4c
.SH HISTORY
Packit 08bd4c
.ad l
Packit 08bd4c
The
Packit 08bd4c
\fB\%libarchive\fP
Packit 08bd4c
library first appeared in
Packit 08bd4c
FreeBSD 5.3.
Packit 08bd4c
.SH AUTHORS
Packit 08bd4c
.ad l
Packit 08bd4c
-nosplit
Packit 08bd4c
The
Packit 08bd4c
\fB\%libarchive\fP
Packit 08bd4c
library was written by
Packit 08bd4c
Tim Kientzle \%<kientzle@acm.org.>