Blame libarchive/archive_read_set_options.3

Packit Service 1d0348
.\" Copyright (c) 2011 Tim Kientzle
Packit Service 1d0348
.\" All rights reserved.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" Redistribution and use in source and binary forms, with or without
Packit Service 1d0348
.\" modification, are permitted provided that the following conditions
Packit Service 1d0348
.\" are met:
Packit Service 1d0348
.\" 1. Redistributions of source code must retain the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer.
Packit Service 1d0348
.\" 2. Redistributions in binary form must reproduce the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer in the
Packit Service 1d0348
.\"    documentation and/or other materials provided with the distribution.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
Packit Service 1d0348
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service 1d0348
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit Service 1d0348
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
Packit Service 1d0348
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service 1d0348
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit Service 1d0348
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit Service 1d0348
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit Service 1d0348
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit Service 1d0348
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit Service 1d0348
.\" SUCH DAMAGE.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" $FreeBSD$
Packit Service 1d0348
.\"
Packit Service 1d0348
.Dd February 2, 2012
Packit Service 1d0348
.Dt ARCHIVE_READ_OPTIONS 3
Packit Service 1d0348
.Os
Packit Service 1d0348
.Sh NAME
Packit Service 1d0348
.Nm archive_read_set_filter_option ,
Packit Service 1d0348
.Nm archive_read_set_format_option ,
Packit Service 1d0348
.Nm archive_read_set_option ,
Packit Service 1d0348
.Nm archive_read_set_options
Packit Service 1d0348
.Nd functions controlling options for reading archives
Packit Service 1d0348
.\"
Packit Service 1d0348
.Sh LIBRARY
Packit Service 1d0348
Streaming Archive Library (libarchive, -larchive)
Packit Service 1d0348
.Sh SYNOPSIS
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fo archive_read_set_filter_option
Packit Service 1d0348
.Fa "struct archive *"
Packit Service 1d0348
.Fa "const char *module"
Packit Service 1d0348
.Fa "const char *option"
Packit Service 1d0348
.Fa "const char *value"
Packit Service 1d0348
.Fc
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fo archive_read_set_format_option
Packit Service 1d0348
.Fa "struct archive *"
Packit Service 1d0348
.Fa "const char *module"
Packit Service 1d0348
.Fa "const char *option"
Packit Service 1d0348
.Fa "const char *value"
Packit Service 1d0348
.Fc
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fo archive_read_set_option
Packit Service 1d0348
.Fa "struct archive *"
Packit Service 1d0348
.Fa "const char *module"
Packit Service 1d0348
.Fa "const char *option"
Packit Service 1d0348
.Fa "const char *value"
Packit Service 1d0348
.Fc
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fo archive_read_set_options
Packit Service 1d0348
.Fa "struct archive *"
Packit Service 1d0348
.Fa "const char *options"
Packit Service 1d0348
.Fc
Packit Service 1d0348
.Sh DESCRIPTION
Packit Service 1d0348
These functions provide a way for libarchive clients to configure
Packit Service 1d0348
specific read modules.
Packit Service 1d0348
.Bl -tag -width indent
Packit Service 1d0348
.It Xo
Packit Service 1d0348
.Fn archive_read_set_filter_option ,
Packit Service 1d0348
.Fn archive_read_set_format_option
Packit Service 1d0348
.Xc
Packit Service 1d0348
Specifies an option that will be passed to currently-registered
Packit Service 1d0348
filters (including decompression filters) or format readers.
Packit Service 1d0348
.Pp
Packit Service 1d0348
If
Packit Service 1d0348
.Ar option
Packit Service 1d0348
and
Packit Service 1d0348
.Ar value
Packit Service 1d0348
are both
Packit Service 1d0348
.Dv NULL ,
Packit Service 1d0348
these functions will do nothing and
Packit Service 1d0348
.Cm ARCHIVE_OK
Packit Service 1d0348
will be returned.
Packit Service 1d0348
If
Packit Service 1d0348
.Ar option
Packit Service 1d0348
is
Packit Service 1d0348
.Dv NULL
Packit Service 1d0348
but
Packit Service 1d0348
.Ar value
Packit Service 1d0348
is not, these functions will do nothing and
Packit Service 1d0348
.Cm ARCHIVE_FAILED
Packit Service 1d0348
will be returned.
Packit Service 1d0348
.Pp
Packit Service 1d0348
If
Packit Service 1d0348
.Ar module
Packit Service 1d0348
is not
Packit Service 1d0348
.Dv NULL ,
Packit Service 1d0348
.Ar option
Packit Service 1d0348
and
Packit Service 1d0348
.Ar value
Packit Service 1d0348
will be provided to the filter or reader named
Packit Service 1d0348
.Ar module .
Packit Service 1d0348
The return value will be that of the module.
Packit Service 1d0348
If there is no such module,
Packit Service 1d0348
.Cm ARCHIVE_FAILED
Packit Service 1d0348
will be returned.
Packit Service 1d0348
.Pp
Packit Service 1d0348
If
Packit Service 1d0348
.Ar module
Packit Service 1d0348
is
Packit Service 1d0348
.Dv NULL ,
Packit Service 1d0348
.Ar option
Packit Service 1d0348
and
Packit Service 1d0348
.Ar value
Packit Service 1d0348
will be provided to every registered module.
Packit Service 1d0348
If any module returns
Packit Service 1d0348
.Cm ARCHIVE_FATAL ,
Packit Service 1d0348
this value will be returned immediately.
Packit Service 1d0348
Otherwise,
Packit Service 1d0348
.Cm ARCHIVE_OK
Packit Service 1d0348
will be returned if any module accepts the option, and
Packit Service 1d0348
.Cm ARCHIVE_FAILED
Packit Service 1d0348
in all other cases.
Packit Service 1d0348
.\"
Packit Service 1d0348
.It Xo
Packit Service 1d0348
.Fn archive_read_set_option
Packit Service 1d0348
.Xc
Packit Service 1d0348
Calls
Packit Service 1d0348
.Fn archive_read_set_format_option ,
Packit Service 1d0348
then
Packit Service 1d0348
.Fn archive_read_set_filter_option .
Packit Service 1d0348
If either function returns
Packit Service 1d0348
.Cm ARCHIVE_FATAL ,
Packit Service 1d0348
.Cm ARCHIVE_FATAL
Packit Service 1d0348
will be returned
Packit Service 1d0348
immediately.
Packit Service 1d0348
Otherwise, greater of the two values will be returned.
Packit Service 1d0348
.\"
Packit Service 1d0348
.It Xo
Packit Service 1d0348
.Fn archive_read_set_options
Packit Service 1d0348
.Xc
Packit Service 1d0348
.Ar options
Packit Service 1d0348
is a comma-separated list of options.
Packit Service 1d0348
If
Packit Service 1d0348
.Ar options
Packit Service 1d0348
is
Packit Service 1d0348
.Dv NULL
Packit Service 1d0348
or empty,
Packit Service 1d0348
.Cm ARCHIVE_OK
Packit Service 1d0348
will be returned immediately.
Packit Service 1d0348
.Pp
Packit Service 1d0348
Calls
Packit Service 1d0348
.Fn archive_read_set_option
Packit Service 1d0348
with each option in turn.
Packit Service 1d0348
If any
Packit Service 1d0348
.Fn archive_read_set_option
Packit Service 1d0348
call returns
Packit Service 1d0348
.Cm ARCHIVE_FATAL ,
Packit Service 1d0348
.Cm ARCHIVE_FATAL
Packit Service 1d0348
will be returned immediately.
Packit Service 1d0348
.Pp
Packit Service 1d0348
Individual options have one of the following forms:
Packit Service 1d0348
.Bl -tag -compact -width indent
Packit Service 1d0348
.It Ar option=value
Packit Service 1d0348
The option/value pair will be provided to every module.
Packit Service 1d0348
Modules that do not accept an option with this name will ignore it.
Packit Service 1d0348
.It Ar option
Packit Service 1d0348
The option will be provided to every module with a value of
Packit Service 1d0348
.Dq 1 .
Packit Service 1d0348
.It Ar !option
Packit Service 1d0348
The option will be provided to every module with a NULL value.
Packit Service 1d0348
.It Ar module:option=value , Ar module:option , Ar module:!option
Packit Service 1d0348
As above, but the corresponding option and value will be provided
Packit Service 1d0348
only to modules whose name matches
Packit Service 1d0348
.Ar module .
Packit Service 1d0348
.El
Packit Service 1d0348
.El
Packit Service 1d0348
.\"
Packit Service 1d0348
.Sh OPTIONS
Packit Service 1d0348
.Bl -tag -compact -width indent
Packit Service 1d0348
.It Format iso9660
Packit Service 1d0348
.Bl -tag -compact -width indent
Packit Service 1d0348
.It Cm joliet
Packit Service 1d0348
Support Joliet extensions.
Packit Service 1d0348
Defaults to enabled, use
Packit Service 1d0348
.Cm !joliet
Packit Service 1d0348
to disable.
Packit Service 1d0348
.It Cm rockridge
Packit Service 1d0348
Support RockRidge extensions.
Packit Service 1d0348
Defaults to enabled, use
Packit Service 1d0348
.Cm !rockridge
Packit Service 1d0348
to disable.
Packit Service 1d0348
.El
Packit Service 1d0348
.It Format tar
Packit Service 1d0348
.Bl -tag -compact -width indent
Packit Service 1d0348
.It Cm compat-2x
Packit Service 1d0348
Libarchive 2.x incorrectly encoded Unicode filenames on
Packit Service 1d0348
some platforms.
Packit Service 1d0348
This option mimics the libarchive 2.x filename handling
Packit Service 1d0348
so that such archives can be read correctly.
Packit Service 1d0348
.It Cm hdrcharset
Packit Service 1d0348
The value is used as a character set name that will be
Packit Service 1d0348
used when translating filenames.
Packit Service 1d0348
.It Cm mac-ext
Packit Service 1d0348
Support Mac OS metadata extension that records data in special
Packit Service 1d0348
files beginning with a period and underscore.
Packit Service 1d0348
Defaults to enabled on Mac OS, disabled on other platforms.
Packit Service 1d0348
Use
Packit Service 1d0348
.Cm !mac-ext
Packit Service 1d0348
to disable.
Packit Service 1d0348
.It Cm read_concatenated_archives
Packit Service 1d0348
Ignore zeroed blocks in the archive, which occurs when multiple tar archives
Packit Service 1d0348
have been concatenated together.  Without this option, only the contents of
Packit Service 1d0348
the first concatenated archive would be read.
Packit Service 1d0348
.El
Packit Service 1d0348
.El
Packit Service 1d0348
.\"
Packit Service 1d0348
.Sh ERRORS
Packit Service 1d0348
Detailed error codes and textual descriptions are available from the
Packit Service 1d0348
.Fn archive_errno
Packit Service 1d0348
and
Packit Service 1d0348
.Fn archive_error_string
Packit Service 1d0348
functions.
Packit Service 1d0348
.\"
Packit Service 1d0348
.Sh SEE ALSO
Packit Service 1d0348
.Xr tar 1 ,
Packit Service 1d0348
.Xr libarchive 3 ,
Packit Service 1d0348
.Xr archive_write_set_options 3 ,
Packit Service 1d0348
.Xr archive_read 3