Blame libarchive/archive_read_set_options.3

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