Blame libarchive/libarchive_changes.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 December 23, 2011
Packit Service 1d0348
.Dt LIBARCHIVE_CHANGES 3
Packit Service 1d0348
.Os
Packit Service 1d0348
.Sh NAME
Packit Service 1d0348
.Nm libarchive_changes
Packit Service 1d0348
.Nd changes in libarchive interface
Packit Service 1d0348
.\"
Packit Service 1d0348
.Sh CHANGES IN LIBARCHIVE 3
Packit Service 1d0348
This page describes user-visible changes in libarchive3, and lists
Packit Service 1d0348
public functions and other symbols changed, deprecated or removed
Packit Service 1d0348
in libarchive3, along with their replacements if any.
Packit Service 1d0348
.Pp
Packit Service 1d0348
.\"
Packit Service 1d0348
.Ss Multiple Filters
Packit Service 1d0348
.\"
Packit Service 1d0348
Libarchive2 permitted a single (input or output) filter active
Packit Service 1d0348
on an archive.
Packit Service 1d0348
Libarchive3 extends this into a variable-length stack.
Packit Service 1d0348
Where
Packit Service 1d0348
.Fn archive_write_set_compression_XXX
Packit Service 1d0348
would replace any existing filter,
Packit Service 1d0348
.Fn archive_write_add_filter_XXX
Packit Service 1d0348
extends the write pipeline with another filter.
Packit Service 1d0348
.\"
Packit Service 1d0348
.Ss Character Set Handling
Packit Service 1d0348
.\"
Packit Service 1d0348
Libarchive2 assumed that the local platform uses
Packit Service 1d0348
.Tn Unicode
Packit Service 1d0348
as the native
Packit Service 1d0348
.Tn wchar_t
Packit Service 1d0348
encoding, which is true on
Packit Service 1d0348
.Tn Windows ,
Packit Service 1d0348
modern
Packit Service 1d0348
.Tn Linux ,
Packit Service 1d0348
and a few other systems, but is certainly not universal.
Packit Service 1d0348
As a result, pax format archives were written incorrectly on some
Packit Service 1d0348
systems, since pax format requires
Packit Service 1d0348
.Tn UTF-8
Packit Service 1d0348
and libarchive 2 incorrectly
Packit Service 1d0348
assumed that
Packit Service 1d0348
.Tn wchar_t
Packit Service 1d0348
strings can be easily converted to
Packit Service 1d0348
.Tn UTF-8 .
Packit Service 1d0348
.Pp
Packit Service 1d0348
Libarchive3 uses the standard iconv library to convert between character
Packit Service 1d0348
sets and is introducing the notion of a
Packit Service 1d0348
.Dq default character set for the archive .
Packit Service 1d0348
To support this,
Packit Service 1d0348
.Tn archive_entry
Packit Service 1d0348
objects can now be bound to a particular archive when they are created.
Packit Service 1d0348
The automatic character set conversions performed by
Packit Service 1d0348
.Tn archive_entry
Packit Service 1d0348
objects when reading and writing filenames, usernames, and other strings
Packit Service 1d0348
will now use an appropriate default character set:
Packit Service 1d0348
.Pp
Packit Service 1d0348
If the
Packit Service 1d0348
.Tn archive_entry
Packit Service 1d0348
object is bound to an archive, it will use the
Packit Service 1d0348
default character set for that archive.
Packit Service 1d0348
.Pp
Packit Service 1d0348
The platform default character encoding (as returned by
Packit Service 1d0348
.Fn nl_langinfo CHARSET )
Packit Service 1d0348
will be used if nothing else is specified.
Packit Service 1d0348
.Pp
Packit Service 1d0348
Libarchive3 also introduces charset options to many of the archive
Packit Service 1d0348
readers and writers to control the character set that will be used for
Packit Service 1d0348
filenames written in those archives.
Packit Service 1d0348
When possible, this will be set automatically based on information in
Packit Service 1d0348
the archive itself.
Packit Service 1d0348
Combining this with the notion of a default character set for the
Packit Service 1d0348
archive should allow you to configure libarchive to read archives from
Packit Service 1d0348
other platforms and have the filenames and other information
Packit Service 1d0348
transparently converted to the character encoding suitable for your
Packit Service 1d0348
application.
Packit Service 1d0348
.\"
Packit Service 1d0348
.Ss Prototype Changes
Packit Service 1d0348
.\"
Packit Service 1d0348
These changes break binary compatibility; libarchive3 has a new shared
Packit Service 1d0348
library version to reflect these changes.
Packit Service 1d0348
The library now uses portable wide types such as
Packit Service 1d0348
.Tn int64_t
Packit Service 1d0348
instead of less-portable types such as
Packit Service 1d0348
.Tn off_t ,
Packit Service 1d0348
.Tn gid_t ,
Packit Service 1d0348
.Tn uid_t ,
Packit Service 1d0348
and
Packit Service 1d0348
.Tn ino_t .
Packit Service 1d0348
.Pp
Packit Service 1d0348
There are a few cases where these changes will affect your source code:
Packit Service 1d0348
.Bl -bullet -width ind
Packit Service 1d0348
.It
Packit Service 1d0348
In some cases, libarchive's wider types will introduce the possibility
Packit Service 1d0348
of truncation: for example, on a system with a 16-bit
Packit Service 1d0348
.Tn uid_t , you risk having uid
Packit Service 1d0348
.Li 65536
Packit Service 1d0348
be truncated to uid
Packit Service 1d0348
.Li 0 ,
Packit Service 1d0348
which can cause serious security problems.
Packit Service 1d0348
.It
Packit Service 1d0348
Typedef function pointer types will be incompatible.
Packit Service 1d0348
For example, if you define custom skip callbacks, you may have to use
Packit Service 1d0348
code similar to the following if you want to support building against
Packit Service 1d0348
libarchive2 and libarchive3:
Packit Service 1d0348
.Bd -literal
Packit Service 1d0348
#if ARCHIVE_VERSION_NUMBER < 3000000
Packit Service 1d0348
typedef off_t myoff_t;
Packit Service 1d0348
#else
Packit Service 1d0348
typedef int64_t myoff_t;
Packit Service 1d0348
#endif
Packit Service 1d0348
Packit Service 1d0348
myoff_t
Packit Service 1d0348
my_skip_function(struct archive *a, void *v, myoff_t o)
Packit Service 1d0348
{
Packit Service 1d0348
    ... implementation ...
Packit Service 1d0348
}
Packit Service 1d0348
.Ed
Packit Service 1d0348
.El
Packit Service 1d0348
.Pp
Packit Service 1d0348
Affected functions:
Packit Service 1d0348
.Pp
Packit Service 1d0348
.Bl -bullet -compact
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_entry_gid ,
Packit Service 1d0348
.Fn archive_entry_set_gid
Packit Service 1d0348
.Xc
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_entry_uid ,
Packit Service 1d0348
.Fn archive_entry_set_uid
Packit Service 1d0348
.Xc
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_entry_ino ,
Packit Service 1d0348
.Fn archive_entry_set_ino
Packit Service 1d0348
.Xc
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_read_data_block ,
Packit Service 1d0348
.Fn archive_write_data_block
Packit Service 1d0348
.Xc
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_read_disk_gname ,
Packit Service 1d0348
.Fn archive_read_disk_uname
Packit Service 1d0348
.Xc
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_read_disk_set_gname_lookup ,
Packit Service 1d0348
.Fn archive_read_disk_set_group_lookup ,
Packit Service 1d0348
.Fn archive_read_disk_set_uname_lookup ,
Packit Service 1d0348
.Fn archive_read_disk_set_user_lookup
Packit Service 1d0348
.Xc
Packit Service 1d0348
.It
Packit Service 1d0348
.Fn archive_skip_callback
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_read_extract_set_skip_file ,
Packit Service 1d0348
.Fn archive_write_disk_set_skip_file ,
Packit Service 1d0348
.Fn archive_write_set_skip_file
Packit Service 1d0348
.Xc
Packit Service 1d0348
.It
Packit Service 1d0348
.Xo
Packit Service 1d0348
.Fn archive_write_disk_set_group_lookup ,
Packit Service 1d0348
.Fn archive_write_disk_set_user_lookup
Packit Service 1d0348
.Xc
Packit Service 1d0348
.El
Packit Service 1d0348
.Pp
Packit Service 1d0348
Where these functions or their arguments took or returned
Packit Service 1d0348
.Tn gid_t ,
Packit Service 1d0348
.Tn ino_t ,
Packit Service 1d0348
.Tn off_t ,
Packit Service 1d0348
or
Packit Service 1d0348
.Tn uid_t
Packit Service 1d0348
they now take or return
Packit Service 1d0348
.Tn int64_t
Packit Service 1d0348
or equivalent.
Packit Service 1d0348
.\"
Packit Service 1d0348
.Ss Deprecated Symbols
Packit Service 1d0348
.\"
Packit Service 1d0348
Symbols deprecated in libarchive3 will be removed in libarchive4.
Packit Service 1d0348
These symbols, along with their replacements if any, are listed below:
Packit Service 1d0348
.\"
Packit Service 1d0348
.Bl -tag -width ind
Packit Service 1d0348
.It Fn archive_position_compressed , Fn archive_position_uncompressed
Packit Service 1d0348
.Fn archive_filter_bytes
Packit Service 1d0348
.It Fn archive_compression
Packit Service 1d0348
.Fn archive_filter_code
Packit Service 1d0348
.It Fn archive_compression_name
Packit Service 1d0348
.Fn archive_filter_name
Packit Service 1d0348
.It Fn archive_read_finish , Fn archive_write_finish
Packit Service 1d0348
.Fn archive_read_free ,
Packit Service 1d0348
.Fn archive_write_free
Packit Service 1d0348
.It Fn archive_read_open_file , Fn archive_write_open_file
Packit Service 1d0348
.Fn archive_read_open_filename ,
Packit Service 1d0348
.Fn archive_write_open_filename
Packit Service 1d0348
.It Fn archive_read_support_compression_all
Packit Service 1d0348
.\" archive_read_support_compression_* -> archive_read_support_filter_*
Packit Service 1d0348
.Fn archive_read_support_filter_all
Packit Service 1d0348
.It Fn archive_read_support_compression_bzip2
Packit Service 1d0348
.Fn archive_read_support_filter_bzip2
Packit Service 1d0348
.It Fn archive_read_support_compression_compress
Packit Service 1d0348
.Fn archive_read_support_filter_compress
Packit Service 1d0348
.It Fn archive_read_support_compression_gzip
Packit Service 1d0348
.Fn archive_read_support_filter_gzip
Packit Service 1d0348
.It Fn archive_read_support_compression_lzip
Packit Service 1d0348
.Fn archive_read_support_filter_lzip
Packit Service 1d0348
.It Fn archive_read_support_compression_lzma
Packit Service 1d0348
.Fn archive_read_support_filter_lzma
Packit Service 1d0348
.It Fn archive_read_support_compression_none
Packit Service 1d0348
.Fn archive_read_support_filter_none
Packit Service 1d0348
.It Fn archive_read_support_compression_program
Packit Service 1d0348
.Fn archive_read_support_filter_program
Packit Service 1d0348
.It Fn archive_read_support_compression_program_signature
Packit Service 1d0348
.Fn archive_read_support_filter_program_signature
Packit Service 1d0348
.It Fn archive_read_support_compression_rpm
Packit Service 1d0348
.Fn archive_read_support_filter_rpm
Packit Service 1d0348
.It Fn archive_read_support_compression_uu
Packit Service 1d0348
.Fn archive_read_support_filter_uu
Packit Service 1d0348
.It Fn archive_read_support_compression_xz
Packit Service 1d0348
.Fn archive_read_support_filter_xz
Packit Service 1d0348
.\" archive_write_set_compression_* -> archive_write_add_filter_*
Packit Service 1d0348
.It Fn archive_write_set_compression_bzip2
Packit Service 1d0348
.Fn archive_write_add_filter_bzip2
Packit Service 1d0348
.It Fn archive_write_set_compression_compress
Packit Service 1d0348
.Fn archive_write_add_filter_compress
Packit Service 1d0348
.It Fn archive_write_set_compression_gzip
Packit Service 1d0348
.Fn archive_write_add_filter_gzip
Packit Service 1d0348
.It Fn archive_write_set_compression_lzip
Packit Service 1d0348
.Fn archive_write_add_filter_lzip
Packit Service 1d0348
.It Fn archive_write_set_compression_lzma
Packit Service 1d0348
.Fn archive_write_add_filter_lzma
Packit Service 1d0348
.It Fn archive_write_set_compression_none
Packit Service 1d0348
.Fn archive_write_add_filter_none
Packit Service 1d0348
.It Fn archive_write_set_compression_program
Packit Service 1d0348
.Fn archive_write_add_filter_program
Packit Service 1d0348
.It Fn archive_write_set_compression_filter
Packit Service 1d0348
.Fn archive_write_add_filter_filter
Packit Service 1d0348
.El
Packit Service 1d0348
.\"
Packit Service 1d0348
.Ss Removed Symbols
Packit Service 1d0348
.\"
Packit Service 1d0348
These symbols, listed below along with their replacements if any,
Packit Service 1d0348
were deprecated in libarchive2, and are not part of libarchive3.
Packit Service 1d0348
.\"
Packit Service 1d0348
.Bl -tag -width ind
Packit Service 1d0348
.It Fn archive_api_feature
Packit Service 1d0348
.Fn archive_version_number
Packit Service 1d0348
.It Fn archive_api_version
Packit Service 1d0348
.Fn archive_version_number
Packit Service 1d0348
.It Fn archive_version
Packit Service 1d0348
.Fn archive_version_string
Packit Service 1d0348
.It Fn archive_version_stamp
Packit Service 1d0348
.Fn archive_version_number
Packit Service 1d0348
.It Fn archive_read_set_filter_options
Packit Service 1d0348
.Fn archive_read_set_options
Packit Service 1d0348
or
Packit Service 1d0348
.Fn archive_read_set_filter_option
Packit Service 1d0348
.It Fn archive_read_set_format_options
Packit Service 1d0348
.Fn archive_read_set_options
Packit Service 1d0348
or
Packit Service 1d0348
.Fn archive_read_set_format_option
Packit Service 1d0348
.It Fn archive_write_set_filter_options
Packit Service 1d0348
.Fn archive_write_set_options
Packit Service 1d0348
or
Packit Service 1d0348
.Fn archive_write_set_filter_option
Packit Service 1d0348
.It Fn archive_write_set_format_options
Packit Service 1d0348
.Fn archive_write_set_options
Packit Service 1d0348
or
Packit Service 1d0348
.Fn archive_write_set_format_option
Packit Service 1d0348
.It Dv ARCHIVE_API_FEATURE
Packit Service 1d0348
.Dv ARCHIVE_VERSION_NUMBER
Packit Service 1d0348
.It Dv ARCHIVE_API_VERSION
Packit Service 1d0348
.Dv ARCHIVE_VERSION_NUMBER
Packit Service 1d0348
.It Dv ARCHIVE_VERSION_STAMP
Packit Service 1d0348
.Dv ARCHIVE_VERSION_NUMBER
Packit Service 1d0348
.It Dv ARCHIVE_LIBRARY_VERSION
Packit Service 1d0348
.Dv ARCHIVE_VERSION_STRING
Packit Service 1d0348
.\"
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_NONE
Packit Service 1d0348
.Dv ARCHIVE_FILTER_NONE
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_GZIP
Packit Service 1d0348
.Dv ARCHIVE_FILTER_GZIP
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_BZIP2
Packit Service 1d0348
.Dv ARCHIVE_FILTER_BZIP2
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_COMPRESS
Packit Service 1d0348
.Dv ARCHIVE_FILTER_COMPRESS
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_PROGRAM
Packit Service 1d0348
.Dv ARCHIVE_FILTER_PROGRAM
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_LZMA
Packit Service 1d0348
.Dv ARCHIVE_FILTER_LZMA
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_XZ
Packit Service 1d0348
.Dv ARCHIVE_FILTER_XZ
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_UU
Packit Service 1d0348
.Dv ARCHIVE_FILTER_UU
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_RPM
Packit Service 1d0348
.Dv ARCHIVE_FILTER_RPM
Packit Service 1d0348
.It Dv ARCHIVE_COMPRESSION_LZIP
Packit Service 1d0348
.Dv ARCHIVE_FILTER_LZIP
Packit Service 1d0348
.\"
Packit Service 1d0348
.It Dv ARCHIVE_BYTES_PER_RECORD
Packit Service 1d0348
.Li 512
Packit Service 1d0348
.It Dv ARCHIVE_DEFAULT_BYTES_PER_BLOCK
Packit Service 1d0348
.Li 10240
Packit Service 1d0348
.El
Packit Service 1d0348
.Sh SEE ALSO
Packit Service 1d0348
.Xr libarchive 3 ,
Packit Service 1d0348
.Xr archive_read 3 ,
Packit Service 1d0348
.Xr archive_read_filter 3 ,
Packit Service 1d0348
.Xr archive_read_format 3 ,
Packit Service 1d0348
.Xr archive_read_set_options 3 ,
Packit Service 1d0348
.Xr archive_write 3 ,
Packit Service 1d0348
.Xr archive_write_filter 3 ,
Packit Service 1d0348
.Xr archive_write_format 3 ,
Packit Service 1d0348
.Xr archive_write_set_options 3 ,
Packit Service 1d0348
.Xr archive_util 3