head	1.22;
access;
symbols
	libarchive-3-8-7:1.1.1.23
	libarchive-3-8-6:1.1.1.22
	pkgsrc-2026Q1:1.20.0.2
	pkgsrc-2026Q1-base:1.20
	libarchive-3-8-5:1.1.1.21
	libarchive-3-8-4:1.1.1.20
	pkgsrc-2025Q4:1.18.0.2
	pkgsrc-2025Q4-base:1.18
	libarchive-3-8-3:1.1.1.19
	libarchive-3-8-2:1.1.1.18
	pkgsrc-2025Q3:1.16.0.2
	pkgsrc-2025Q3-base:1.16
	libarchive-3-8-1:1.1.1.17
	pkgsrc-2025Q2:1.15.0.2
	pkgsrc-2025Q2-base:1.15
	libarchive-3-8-0:1.1.1.16
	libarchive-3-7-9:1.1.1.15
	pkgsrc-2025Q1:1.13.0.4
	pkgsrc-2025Q1-base:1.13
	pkgsrc-2024Q4:1.13.0.2
	pkgsrc-2024Q4-base:1.13
	libarchive-3-7-7:1.1.1.14
	pkgsrc-2024Q3:1.12.0.2
	pkgsrc-2024Q3-base:1.12
	libarchive-3-7-5:1.1.1.13
	pkgsrc-2024Q2:1.11.0.2
	pkgsrc-2024Q2-base:1.11
	libarchive-3-7-4:1.1.1.12
	libarchive-3-7-3:1.1.1.11
	pkgsrc-2024Q1:1.9.0.2
	pkgsrc-2024Q1-base:1.9
	libarchive-3-7-2:1.1.1.10
	pkgsrc-2023Q4:1.8.0.30
	pkgsrc-2023Q4-base:1.8
	pkgsrc-2023Q3:1.8.0.28
	pkgsrc-2023Q3-base:1.8
	pkgsrc-2023Q2:1.8.0.26
	pkgsrc-2023Q2-base:1.8
	pkgsrc-2023Q1:1.8.0.24
	pkgsrc-2023Q1-base:1.8
	pkgsrc-2022Q4:1.8.0.22
	pkgsrc-2022Q4-base:1.8
	pkgsrc-2022Q3:1.8.0.20
	pkgsrc-2022Q3-base:1.8
	pkgsrc-2022Q2:1.8.0.18
	pkgsrc-2022Q2-base:1.8
	pkgsrc-2022Q1:1.8.0.16
	pkgsrc-2022Q1-base:1.8
	pkgsrc-2021Q4:1.8.0.14
	pkgsrc-2021Q4-base:1.8
	pkgsrc-2021Q3:1.8.0.12
	pkgsrc-2021Q3-base:1.8
	pkgsrc-2021Q2:1.8.0.10
	pkgsrc-2021Q2-base:1.8
	pkgsrc-2021Q1:1.8.0.8
	pkgsrc-2021Q1-base:1.8
	pkgsrc-2020Q4:1.8.0.6
	pkgsrc-2020Q4-base:1.8
	pkgsrc-2020Q3:1.8.0.4
	pkgsrc-2020Q3-base:1.8
	pkgsrc-2020Q2:1.8.0.2
	pkgsrc-2020Q2-base:1.8
	pkgsrc-2020Q1:1.7.0.4
	pkgsrc-2020Q1-base:1.7
	pkgsrc-2019Q4:1.7.0.6
	pkgsrc-2019Q4-base:1.7
	pkgsrc-2019Q3:1.7.0.2
	pkgsrc-2019Q3-base:1.7
	libarchive-3-4-0:1.1.1.9
	libarchive-3-3-3:1.1.1.8
	pkgsrc-2019Q2:1.6.0.2
	pkgsrc-2019Q2-base:1.6
	pkgsrc-2019Q1:1.5.0.16
	pkgsrc-2019Q1-base:1.5
	pkgsrc-2018Q4:1.5.0.14
	pkgsrc-2018Q4-base:1.5
	pkgsrc-2018Q3:1.5.0.12
	pkgsrc-2018Q3-base:1.5
	pkgsrc-2018Q2:1.5.0.10
	pkgsrc-2018Q2-base:1.5
	pkgsrc-2018Q1:1.5.0.8
	pkgsrc-2018Q1-base:1.5
	pkgsrc-2017Q4:1.5.0.6
	pkgsrc-2017Q4-base:1.5
	pkgsrc-2017Q3:1.5.0.4
	pkgsrc-2017Q3-base:1.5
	libarchive-3-3-2:1.1.1.7
	pkgsrc-2017Q2:1.4.0.4
	pkgsrc-2017Q2-base:1.4
	pkgsrc-2017Q1:1.4.0.2
	pkgsrc-2017Q1-base:1.4
	libarchive-3-3-1:1.1.1.6
	pkgsrc-2016Q4:1.3.0.6
	pkgsrc-2016Q4-base:1.3
	pkgsrc-2016Q3:1.3.0.4
	pkgsrc-2016Q3-base:1.3
	pkgsrc-2016Q2:1.3.0.2
	pkgsrc-2016Q2-base:1.3
	libarchive-3-2-1:1.1.1.5
	pkgsrc-2016Q1:1.2.0.10
	pkgsrc-2016Q1-base:1.2
	pkgsrc-2015Q4:1.2.0.8
	pkgsrc-2015Q4-base:1.2
	pkgsrc-2015Q3:1.2.0.6
	pkgsrc-2015Q3-base:1.2
	pkgsrc-2015Q2:1.2.0.4
	pkgsrc-2015Q2-base:1.2
	pkgsrc-2015Q1:1.2.0.2
	pkgsrc-2015Q1-base:1.2
	pkgsrc-2014Q4:1.1.1.4.0.36
	pkgsrc-2014Q4-base:1.1.1.4
	pkgsrc-2014Q3:1.1.1.4.0.34
	pkgsrc-2014Q3-base:1.1.1.4
	pkgsrc-2014Q2:1.1.1.4.0.32
	pkgsrc-2014Q2-base:1.1.1.4
	pkgsrc-2014Q1:1.1.1.4.0.30
	pkgsrc-2014Q1-base:1.1.1.4
	pkgsrc-2013Q4:1.1.1.4.0.28
	pkgsrc-2013Q4-base:1.1.1.4
	pkgsrc-2013Q3:1.1.1.4.0.26
	pkgsrc-2013Q3-base:1.1.1.4
	pkgsrc-2013Q2:1.1.1.4.0.24
	pkgsrc-2013Q2-base:1.1.1.4
	pkgsrc-2013Q1:1.1.1.4.0.22
	pkgsrc-2013Q1-base:1.1.1.4
	pkgsrc-2012Q4:1.1.1.4.0.20
	pkgsrc-2012Q4-base:1.1.1.4
	pkgsrc-2012Q3:1.1.1.4.0.18
	pkgsrc-2012Q3-base:1.1.1.4
	pkgsrc-2012Q2:1.1.1.4.0.16
	pkgsrc-2012Q2-base:1.1.1.4
	pkgsrc-2012Q1:1.1.1.4.0.14
	pkgsrc-2012Q1-base:1.1.1.4
	pkgsrc-2011Q4:1.1.1.4.0.12
	pkgsrc-2011Q4-base:1.1.1.4
	pkgsrc-2011Q3:1.1.1.4.0.10
	pkgsrc-2011Q3-base:1.1.1.4
	pkgsrc-2011Q2:1.1.1.4.0.8
	pkgsrc-2011Q2-base:1.1.1.4
	pkgsrc-2011Q1:1.1.1.4.0.6
	pkgsrc-2011Q1-base:1.1.1.4
	pkgsrc-2010Q4:1.1.1.4.0.4
	pkgsrc-2010Q4-base:1.1.1.4
	pkgsrc-2010Q3:1.1.1.4.0.2
	pkgsrc-2010Q3-base:1.1.1.4
	libarchive-2-8-4:1.1.1.4
	pkgsrc-2010Q2:1.1.1.3.0.4
	pkgsrc-2010Q2-base:1.1.1.3
	pkgsrc-2010Q1:1.1.1.3.0.2
	pkgsrc-2010Q1-base:1.1.1.3
	libarchive-2-8-3:1.1.1.3
	libarchive-2-8-2:1.1.1.2
	libarchive-2-8-0:1.1.1.1
	KIENTZLE:1.1.1;
locks; strict;
comment	@# @;


1.22
date	2026.04.15.08.46.33;	author adam;	state Exp;
branches;
next	1.21;
commitid	pL26mrnh4kOo62CG;

1.21
date	2026.03.26.11.20.05;	author adam;	state Exp;
branches;
next	1.20;
commitid	8pSUUUHFeJu1BtzG;

1.20
date	2026.01.06.11.55.22;	author adam;	state Exp;
branches;
next	1.19;
commitid	lOosf75XWhczkkpG;

1.19
date	2025.12.23.14.01.22;	author adam;	state Exp;
branches;
next	1.18;
commitid	3zKcl3VhUVXFtxnG;

1.18
date	2025.11.20.06.08.25;	author adam;	state Exp;
branches;
next	1.17;
commitid	kB7NF5kSlmUaVfjG;

1.17
date	2025.11.02.08.52.12;	author adam;	state Exp;
branches;
next	1.16;
commitid	hdaVwMAEUWR8pXgG;

1.16
date	2025.07.01.15.14.43;	author adam;	state Exp;
branches;
next	1.15;
commitid	sA2cBFYBXpUBv31G;

1.15
date	2025.05.21.15.25.49;	author adam;	state Exp;
branches;
next	1.14;
commitid	6aTN21WjRYk8TMVF;

1.14
date	2025.04.28.10.31.33;	author adam;	state Exp;
branches;
next	1.13;
commitid	Tocq615J6mYPZNSF;

1.13
date	2024.10.19.05.39.56;	author adam;	state Exp;
branches;
next	1.12;
commitid	fYRSlpIWMYluweuF;

1.12
date	2024.09.15.07.02.18;	author adam;	state Exp;
branches;
next	1.11;
commitid	x365AQIKhret4SpF;

1.11
date	2024.04.30.06.05.17;	author adam;	state Exp;
branches;
next	1.10;
commitid	id0E8i4RwCC4c88F;

1.10
date	2024.04.12.15.39.48;	author adam;	state Exp;
branches;
next	1.9;
commitid	52ilmjFHKDf0XR5F;

1.9
date	2024.01.18.18.00.13;	author adam;	state Exp;
branches;
next	1.8;
commitid	hNXpsHx3SuHqsXUE;

1.8
date	2020.05.26.09.16.40;	author nia;	state Exp;
branches;
next	1.7;
commitid	nNhsdZACz3PjmJ9C;

1.7
date	2019.09.22.09.55.07;	author joerg;	state Exp;
branches;
next	1.6;
commitid	FdPvRjF4OzwBwZDB;

1.6
date	2019.04.10.08.24.05;	author adam;	state Exp;
branches;
next	1.5;
commitid	LnliQ9ieqYkikMiB;

1.5
date	2017.08.01.22.26.22;	author joerg;	state Exp;
branches;
next	1.4;
commitid	32clTfkmVE8bPy1A;

1.4
date	2017.02.25.21.11.19;	author joerg;	state Exp;
branches;
next	1.3;
commitid	rW8QfCWrsCO1snHz;

1.3
date	2016.06.20.17.24.56;	author joerg;	state Exp;
branches;
next	1.2;
commitid	ArUvympBjfBseebz;

1.2
date	2015.01.17.12.44.48;	author adam;	state Exp;
branches;
next	1.1;
commitid	yy7e1hLrfmA2pn6y;

1.1
date	2010.02.20.03.49.43;	author joerg;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2010.02.20.03.49.43;	author joerg;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2010.03.14.17.57.24;	author joerg;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2010.03.16.17.07.03;	author joerg;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2010.07.09.11.53.33;	author joerg;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2016.06.20.17.11.50;	author joerg;	state Exp;
branches;
next	1.1.1.6;
commitid	rRgm3BqbmbI8aebz;

1.1.1.6
date	2017.02.25.20.54.24;	author joerg;	state Exp;
branches;
next	1.1.1.7;
commitid	ReqPI0ibLYjdmnHz;

1.1.1.7
date	2017.08.01.22.21.12;	author joerg;	state Exp;
branches;
next	1.1.1.8;
commitid	XQwPAFJku336Ny1A;

1.1.1.8
date	2019.09.22.09.47.03;	author joerg;	state Exp;
branches;
next	1.1.1.9;
commitid	N0KxAXOYyULduZDB;

1.1.1.9
date	2019.09.22.09.51.33;	author joerg;	state Exp;
branches;
next	1.1.1.10;
commitid	5kDbfPbiV3INvZDB;

1.1.1.10
date	2024.01.18.17.37.45;	author adam;	state Exp;
branches;
next	1.1.1.11;
commitid	zDULEPUODGjTkXUE;

1.1.1.11
date	2024.04.12.15.27.44;	author adam;	state Exp;
branches;
next	1.1.1.12;
commitid	tQWTddCoxBumSR5F;

1.1.1.12
date	2024.04.30.05.50.49;	author adam;	state Exp;
branches;
next	1.1.1.13;
commitid	e4DnFoZdQV9Z688F;

1.1.1.13
date	2024.09.15.06.45.25;	author adam;	state Exp;
branches;
next	1.1.1.14;
commitid	pOuXKsbh8iPCYRpF;

1.1.1.14
date	2024.10.19.05.27.34;	author adam;	state Exp;
branches;
next	1.1.1.15;
commitid	v1iXM4j1Na52seuF;

1.1.1.15
date	2025.04.28.09.44.10;	author adam;	state Exp;
branches;
next	1.1.1.16;
commitid	1zB7ffc4d2qCJNSF;

1.1.1.16
date	2025.05.21.15.11.28;	author adam;	state Exp;
branches;
next	1.1.1.17;
commitid	Nzqt2UgtvkVXNMVF;

1.1.1.17
date	2025.07.01.14.58.53;	author adam;	state Exp;
branches;
next	1.1.1.18;
commitid	wKXYoBc9F9j8q31G;

1.1.1.18
date	2025.11.02.08.32.34;	author adam;	state Exp;
branches;
next	1.1.1.19;
commitid	8C56Xg3dc0HriXgG;

1.1.1.19
date	2025.11.20.05.51.45;	author adam;	state Exp;
branches;
next	1.1.1.20;
commitid	LC6NMc2P0QpnPfjG;

1.1.1.20
date	2025.12.23.13.41.06;	author adam;	state Exp;
branches;
next	1.1.1.21;
commitid	hhQbXTytJ7PFmxnG;

1.1.1.21
date	2026.01.06.11.43.29;	author adam;	state Exp;
branches;
next	1.1.1.22;
commitid	Q4rjOheYoLWofkpG;

1.1.1.22
date	2026.03.26.11.11.16;	author adam;	state Exp;
branches;
next	1.1.1.23;
commitid	P6u0vpfNBymXxtzG;

1.1.1.23
date	2026.04.15.08.40.11;	author adam;	state Exp;
branches;
next	;
commitid	enlkxxj5Vxhi42CG;


desc
@@


1.22
log
@libarchive: updated to 3.8.7

Libarchive 3.8.7 is a security and bugfix release.

Notable fixes:

CAB: fix NULL pointer dereference during skip
CAB: Fix Heap OOB Write in CAB LZX decoder
cpio: various fixes and improvements
contrib/untar: fix out-of-bounds read
iso9660: fix undefined behavior
iso9660: fix posibble heap buffer overflow on 32-bit systems
libarchive: fix handling of option failures
libarchive: do not continue with truncated numbers
libarchive: lzop and grzip filter support
RAR: fix LZSS window size mismatch after PPMd block
@
text
@<!-- Creator     : groff version 1.23.0 -->
<!-- CreationDate: Mon Apr 13 12:57:33 2026 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }
</style>
<title></title>
</head>
<body>

<hr>


<p><i>ARCHIVE_READ</i>(3) Library Functions Manual
<i>ARCHIVE_READ</i>(3)</p>

<p style="margin-top: 1em"><b>NAME</b></p>

<p style="margin-left:9%;">archive_read &mdash; functions
for reading streaming archives</p>

<p style="margin-top: 1em"><b>LIBRARY</b></p>

<p style="margin-left:9%;">Streaming Archive Library
(libarchive, -larchive)</p>

<p style="margin-top: 1em"><b>SYNOPSIS</b></p>

<p style="margin-left:9%;"><b>#include
&lt;archive.h&gt;</b></p>

<p style="margin-top: 1em"><b>DESCRIPTION</b></p>

<p style="margin-left:9%;">These functions provide a
complete API for reading streaming archives. The general
process is to first create the struct archive object, set
options, initialize the reader, iterate over the archive
headers and associated data, then close the archive and
release all resources.</p>

<p style="margin-left:4%; margin-top: 1em"><b>Create
archive object</b></p>

<p style="margin-left:9%;">See
<i>archive_read_new</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">To read an
archive, you must first obtain an initialized struct archive
object from <b>archive_read_new</b>().</p>

<p style="margin-left:4%; margin-top: 1em"><b>Enable
filters and formats</b></p>

<p style="margin-left:9%;">See
<i>archive_read_filter</i>(3) and
<i>archive_read_format</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">You can then
modify this object for the desired operations with the
various <b>archive_read_set_XXX</b>() and
<b>archive_read_support_XXX</b>() functions. In particular,
you will need to invoke appropriate
<b>archive_read_support_XXX</b>() functions to enable the
corresponding compression and format support. Note that
these latter functions perform two distinct operations: they
cause the corresponding support code to be linked into your
program, and they enable the corresponding auto-detect code.
Unless you have specific constraints, you will generally
want to invoke <b>archive_read_support_filter_all</b>() and
<b>archive_read_support_format_all</b>() to enable
auto-detect for all formats and compression types currently
supported by the library.</p>

<p style="margin-left:4%; margin-top: 1em"><b>Set
options</b></p>

<p style="margin-left:9%;">See
<i>archive_read_set_options</i>(3).</p>

<p style="margin-left:4%; margin-top: 1em"><b>Open
archive</b></p>

<p style="margin-left:9%;">See
<i>archive_read_open</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">Once you have
prepared the struct archive object, you call
<b>archive_read_open</b>() to actually open the archive and
prepare it for reading. There are several variants of this
function; the most basic expects you to provide pointers to
several functions that can provide blocks of bytes from the
archive. There are convenience forms that allow you to
specify a filename, file descriptor, <i>FILE *</i> object,
or a block of memory from which to read the archive data.
Note that the core library makes no assumptions about the
size of the blocks read; callback functions are free to read
whatever block size is most appropriate for the medium.</p>

<p style="margin-left:4%; margin-top: 1em"><b>Consume
archive</b></p>

<p style="margin-left:9%;">See
<i>archive_read_header</i>(3), <i>archive_read_data</i>(3)
and <i>archive_read_extract</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">Each archive
entry consists of a header followed by a certain amount of
data. You can obtain the next header with
<b>archive_read_next_header</b>(), which returns a pointer
to an struct archive_entry structure with information about
the current archive element. If the entry is a regular file,
then the header will be followed by the file data. You can
use <b>archive_read_data</b>() (which works much like the
<i>read</i>(2) system call) to read this data from the
archive, or <b>archive_read_data_block</b>() which provides
a slightly more efficient interface. You may prefer to use
the higher-level <b>archive_read_data_skip</b>(), which
reads and discards the data for this entry,
<b>archive_read_data_into_fd</b>(), which copies the data to
the provided file descriptor, or
<b>archive_read_extract</b>(), which recreates the specified
entry on disk and copies data from the archive. In
particular, note that <b>archive_read_extract</b>() uses the
struct archive_entry structure that you provide it, which
may differ from the entry just read from the archive. In
particular, many applications will want to override the
pathname, file permissions, or ownership.</p>

<p style="margin-left:4%; margin-top: 1em"><b>Release
resources</b></p>

<p style="margin-left:9%;">See
<i>archive_read_free</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">Once you have
finished reading data from the archive, you should call
<b>archive_read_close</b>() to close the archive, then call
<b>archive_read_free</b>() to release all resources,
including all memory allocated by the library.</p>

<p style="margin-top: 1em"><b>EXAMPLES</b></p>

<p style="margin-left:9%;">The following illustrates basic
usage of the library. In this example, the callback
functions are simply wrappers around the standard
<i>open</i>(2), <i>read</i>(2), and <i>close</i>(2) system
calls.</p>

<p style="margin-left:17%; margin-top: 1em">void <br>
list_archive(const char *name) <br>
{ <br>
struct mydata *mydata; <br>
struct archive *a; <br>
struct archive_entry *entry;</p>

<p style="margin-left:17%; margin-top: 1em">mydata =
malloc(sizeof(struct mydata)); <br>
a = archive_read_new(); <br>
mydata-&gt;name = name; <br>
archive_read_support_filter_all(a); <br>
archive_read_support_format_all(a); <br>
archive_read_open(a, mydata, myopen, myread, myclose); <br>
while (archive_read_next_header(a, &amp;entry) ==
ARCHIVE_OK) { <br>
printf(&quot;%s\n&quot;,archive_entry_pathname(entry)); <br>
archive_read_data_skip(a); <br>
} <br>
archive_read_free(a); <br>
free(mydata); <br>
}</p>

<p style="margin-left:17%; margin-top: 1em">la_ssize_t <br>
myread(struct archive *a, void *client_data, const void
**buff) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:17%; margin-top: 1em">*buff =
mydata-&gt;buff; <br>
return (read(mydata-&gt;fd, mydata-&gt;buff, 10240)); <br>
}</p>

<p style="margin-left:17%; margin-top: 1em">int <br>
myopen(struct archive *a, void *client_data) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:17%; margin-top: 1em">mydata-&gt;fd =
open(mydata-&gt;name, O_RDONLY); <br>
return (mydata-&gt;fd &gt;= 0 ? ARCHIVE_OK : ARCHIVE_FATAL);
<br>
}</p>

<p style="margin-left:17%; margin-top: 1em">int <br>
myclose(struct archive *a, void *client_data) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:17%; margin-top: 1em">if
(mydata-&gt;fd &gt; 0) <br>
close(mydata-&gt;fd); <br>
return (ARCHIVE_OK); <br>
}</p>

<p style="margin-top: 1em"><b>SEE ALSO</b></p>

<p style="margin-left:9%;"><i>tar</i>(1),
<i>archive_read_data</i>(3), <i>archive_read_extract</i>(3),
<i>archive_read_filter</i>(3),
<i>archive_read_format</i>(3),
<i>archive_read_header</i>(3), <i>archive_read_new</i>(3),
<i>archive_read_open</i>(3),
<i>archive_read_set_options</i>(3), <i>archive_util</i>(3),
<i>libarchive</i>(3), <i>tar</i>(5)</p>

<p style="margin-top: 1em"><b>HISTORY</b></p>

<p style="margin-left:9%;">The <b>libarchive</b> library
first appeared in FreeBSD&nbsp;5.3.</p>

<p style="margin-top: 1em"><b>AUTHORS</b></p>

<p style="margin-left:9%;">The <b>libarchive</b> library
was written by Tim Kientzle &lt;kientzle@@acm.org&gt;.</p>

<p style="margin-top: 1em"><b>BUGS</b></p>

<p style="margin-left:9%;">Many traditional archiver
programs treat empty files as valid empty archives. For
example, many implementations of <i>tar</i>(1) allow you to
append entries to an empty file. Of course, it is impossible
to determine the format of an empty file by inspecting the
contents, so this library treats empty files as having a
special &ldquo;empty&rdquo; format. Debian February 2, 2012
<i>ARCHIVE_READ</i>(3)</p>
<hr>
</body>
</html>
@


1.21
log
@libarchive: updated to 3.8.6

Libarchive 3.8.6 is a security and bugfix release.

Notable fixes:

libarchive: fix incompatibility with Nettle 4.x
libarchive: fix NULL pointer dereference in archive_acl_from_text_w()
bsdunzip: fix ISO week year and Gregorian year confusion
7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
7zip: fix out-of-bounds access on ELF 64-bit header
RAR5 reader: fix infinite loop in rar5 decompression
RAR5 reader: fix potential memory leak
RAR5: fix SIGSEGV when archive_read_support_format_rar5 is called twice
CAB reader: fix memory leak on repeated calls to archive_read_support_format_cab
mtree reader: Fix file descriptor leak in mtree parser cleanup
various small bugfixes in code and documentation
@
text
@d2 1
a2 1
<!-- CreationDate: Tue Mar 10 09:57:27 2026 -->
@


1.20
log
@libarchive: updated to 3.8.5

3.8.5

Notable bugxies:

bsdtar: fix regression from 3.8.4 zero-length pattern issue bugfix
various small bugfixes in code and documentation
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jan  5 10:42:43 2026 -->
@


1.19
log
@libarchive: updated to 3.8.4

3.8.4

Notable bugxies:

bsdtar: Fix zero-length pattern issue
lib: Fix regression introduced in libarchive 3.8.2 when walking enterable but unreadable directories
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Dec  1 12:42:37 2025 -->
@


1.18
log
@libarchive: updated to 3.8.3

Libarchive 3.8.3 is a bugfix and security release.

Security fixes:

lib: Create temporary files in the target directory
lha: Fix for an out-of-bounds buffer overrun when using p[H_LEVEL_OFFSET]
7-zip: Fix a buffer overrun when reading truncated 7zip headers

Notable bugxies:

lz4 and zstd: Support both lz4 and zstd data with leading skippable frames
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Nov 17 22:19:01 2025 -->
@


1.17
log
@libarchive: updated to 3.8.2

Libarchive 3.8.2 is a bugfix and security release.

Security fixes:

7zip: Fix out of boundary access
tar reader: fix checking the result of the strftime

Notable bugfixes:

bsdtar: Allow filename to have CRLF endings
lib: archive_read_data: handle sparse holes at end of file correctly
lib: improve filter process handling
lib: fix error checking in writing files
lib: handle possible errors from system calls
lib: avoid leaking file descriptors into subprocesses
lib: parse_date: handle dates in 2038 and beyond if time_t is big enough
RAR5 reader: fix multiple issues in extra field parsing function
RAR5 reader: early fail when file declares data for a dir entry
tar writer: fix replacing a regular file with a dir for ARCHIVE_EXTRACT_SAFE_WRITES
tar reader (Windows): check WCS pathname in header_gnutar before overwriting
tar reader: fix an infinite loop when parsing V headers
zip writer: fix a memory leak if write callback error early
zip writer: fix writing with ZSTD compression
zstd write filter: enable Zstandard's checksum feature
@
text
@d2 1
a2 1
<!-- CreationDate: Wed Oct 15 21:49:45 2025 -->
@


1.16
log
@libarchive: updated to 3.8.1

3.8.1

Important bugfixes

various compilation fixes
fixed undefined behavior in a function in warc reader
Windows binary uses xz 5.2.5
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Jun  1 19:29:39 2025 -->
@


1.15
log
@libarchive bsdtar: updated to 3.8.0

Libarchive 3.8.0 is a feature and bugfix release.

New features:
bsdtar: support --mtime and --clamp-mtime
lib: mbedtls 3.x compatibility
7-zip reader: improve self-extracting archive detection
xar: xmllite support for the XAR reader and writer
zip writer: added XZ, LZMA, ZSTD and BZIP2 support
zip writer: added LZMA + RISCV BCJ filter

Notable security fixes:
rar: do not skip past EOF while reading
rar: fix double free with over 4 billion nodes
rar: fix heap-buffer-overflow
warc: prevent signed integer overflow
tar: fix overflow in build_ustar_entry

Notable bugfixes:
bsdtar: don't hardlink negative inode files together
gz: allow setting the original filename for gzip compressed files
lib: improve lseek handling
lib: support @@-prefixed Unix epoch timestamps as date strings
rar: support large headers on 32 bit systems
tar reader: Improve LFS support on 32 bit systems
@
text
@d2 1
a2 1
<!-- CreationDate: Tue May 20 09:02:18 2025 -->
@


1.14
log
@bsdtar libarchive: updated to 3.7.9

3.7.9

Important bugfixes:

a regression in libarchive 3.7.8 regarding GNU sparse entries was fixed


3.7.8

Security fixes:

tar reader: Handle truncation in the middle of a GNU long linkname
unzip: fix null pointer dereference
tar reader: fix unchecked return value in list_item_verbose()

Important bugfixes:

7zip reader: add SPARC
tar reader: Ignore ustar size when pax size is present
tar writer: Fix bug when -s/a/b/ used more than once with b flag
cpio: Fix a Y2038 bug on Windows
libarchive: Handle ARCHIVE_FILTER_LZOP in archive_read_append_filter
libarchive: Adding missing seeker function to archive_read_open_FILE()
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Mar 30 20:07:36 2025 -->
@


1.13
log
@libarchive: updated to 3.7.7

Libarchive 3.7.7 is a bugfix and security release

Security fixes:

gzip: prevent a hang when processing a malformed gzip inside a gzip
tar: don't crash on truncated tar archives
tar: fix two leaks in tar header parsing

Important bugfixes:

7-zip: read/write symlink paths as UTF-8
cpio: exit with an error code if an entry could not be extracted
rar5: report encrypted entries
tar: fix truncation of entry pathnames in specific archives
windows: fix ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS


Libarchive 3.7.6 is a bugfix and security release.
This release fixes a tar regression introduced in libarchive 3.7.5

Important bugfixes.

tar: clean up linkpath between entries
tar: fix memory leaks when processing symlinks or parsing pax headers
iso: be more cautious about parsing ISO-9660 timestamps
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Oct 13 08:12:08 2024 -->
@


1.12
log
@libarchive: updated to 3.7.5

Libarchive 3.7.5

Security fixes:

fix multiple vulnerabilities identified by SAST
cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing
lzop: prevent integer overflow
rar4: protect copy_from_lzss_window_to_unp()
rar4: fix CVE-2024-26256
rar4: fix OOB in delta and audio filter
rar4: fix out of boundary access with large files
rar4: add boundary checks to rgb filter
rar4: fix OOB access with unicode filenames
rar5: clear 'data ready' cache on window buffer reallocs
rpm: calculate huge header sizes correctly
unzip: unify EOF handling
util: fix out of boundary access in mktemp functions
uu: stop processing if lines are too long

Important bugfixes:

7zip: fix issue when skipping first file in 7zip archive that is a multiple of 65536 bytes
ar: fix archive entries having no type
lha: do not allow negative file sizes
lha: fix integer truncation on 32-bit systems
shar: check strdup return value
rar5: don't try to read rediculously long names
xar: fix another infinite loop and expat error handling
many Windows fixes, cleanups and improvements
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.4 -->
<!-- CreationDate: Fri Sep 13 20:31:04 2024 -->
d23 2
a24 2
<p>ARCHIVE_READ(3) BSD Library Functions Manual
ARCHIVE_READ(3)</p>
d28 2
a29 2
<p style="margin-left:6%;"><b>archive_read</b> &mdash;
functions for reading streaming archives</p>
d33 1
a33 1
<p style="margin-left:6%;">Streaming Archive Library
d38 1
a38 1
<p style="margin-left:6%;"><b>#include
d43 1
a43 1
<p style="margin-left:6%;">These functions provide a
d50 2
a51 3
<p style="margin-left:6%; margin-top: 1em"><b>Create
archive object</b> <br>
See archive_read_new(3).</p>
d53 4
a56 1
<p style="margin-left:6%; margin-top: 1em">To read an
d60 6
a65 3
<p style="margin-left:6%; margin-top: 1em"><b>Enable
filters and formats</b> <br>
See archive_read_filter(3) and archive_read_format(3).</p>
d67 1
a67 1
<p style="margin-left:6%; margin-top: 1em">You can then
d83 8
a90 7
<p style="margin-left:6%; margin-top: 1em"><b>Set
options</b> <br>
See archive_read_set_options(3).</p>

<p style="margin-left:6%; margin-top: 1em"><b>Open
archive</b> <br>
See archive_read_open(3).</p>
d92 4
a95 1
<p style="margin-left:6%; margin-top: 1em">Once you have
d108 6
a113 4
<p style="margin-left:6%; margin-top: 1em"><b>Consume
archive</b> <br>
See archive_read_header(3), archive_read_data(3) and
archive_read_extract(3).</p>
d115 1
a115 1
<p style="margin-left:6%; margin-top: 1em">Each archive
d123 5
a127 5
read(2) system call) to read this data from the archive, or
<b>archive_read_data_block</b>() which provides a slightly
more efficient interface. You may prefer to use the
higher-level <b>archive_read_data_skip</b>(), which reads
and discards the data for this entry,
d138 2
a139 3
<p style="margin-left:6%; margin-top: 1em"><b>Release
resources</b> <br>
See archive_read_free(3).</p>
d141 4
a144 1
<p style="margin-left:6%; margin-top: 1em">Once you have
d152 1
a152 1
<p style="margin-left:6%;">The following illustrates basic
d154 3
a156 2
functions are simply wrappers around the standard open(2),
read(2), and close(2) system calls.</p>
d158 1
a158 1
<p style="margin-left:14%; margin-top: 1em">void <br>
d165 1
a165 1
<p style="margin-left:14%; margin-top: 1em">mydata =
d181 1
a181 1
<p style="margin-left:14%; margin-top: 1em">la_ssize_t <br>
d187 1
a187 1
<p style="margin-left:14%; margin-top: 1em">*buff =
d192 1
a192 1
<p style="margin-left:14%; margin-top: 1em">int <br>
d197 1
a197 1
<p style="margin-left:14%; margin-top: 1em">mydata-&gt;fd =
d203 1
a203 1
<p style="margin-left:14%; margin-top: 1em">int <br>
d208 1
a208 1
<p style="margin-left:14%; margin-top: 1em">if
d216 8
a223 6
<p style="margin-left:6%;">tar(1), archive_read_data(3),
archive_read_extract(3), archive_read_filter(3),
archive_read_format(3), archive_read_header(3),
archive_read_new(3), archive_read_open(3),
archive_read_set_options(3), archive_util(3), libarchive(3),
tar(5)</p>
d227 1
a227 1
<p style="margin-left:6%;">The <b>libarchive</b> library
d232 1
a232 1
<p style="margin-left:6%;">The <b>libarchive</b> library
d237 1
a237 1
<p style="margin-left:6%;">Many traditional archiver
d239 3
a241 3
example, many implementations of tar(1) allow you to append
entries to an empty file. Of course, it is impossible to
determine the format of an empty file by inspecting the
d243 2
a244 4
special &ldquo;empty&rdquo; format.</p>

<p style="margin-left:6%; margin-top: 1em">BSD
February&nbsp;2, 2012 BSD</p>
@


1.11
log
@libarchive: updated to 3.7.4

Libarchive 3.7.4 is a bugfix and security release

Security fixes:

rar: Fix OOB in rar e8 filter (CVE-2024-26256)
zip: Fix out of boundary access

Important bugfixes:

7zip: Limit amount of properties
bsdtar: Fix error handling around strtol() usages
passphrase: Improve newline handling on Windows
passphrase: Never allow empty passwords
rar: Fix "File CRC Error" when extracting specific rar4 archives
xar: Avoid infinite link loop
zip: Update AppleDouble support for directories
zstd: Implement core detection
@
text
@d2 1
a2 1
<!-- CreationDate: Fri Apr 26 09:23:45 2024 -->
@


1.10
log
@libarchive: updated to 3.7.3

Libarchive 3.7.3 is a feature, security and bugfix release.

New features:

PCRE2 support
add trailing letter b to bsdtar(1) substitute pattern
add support for long options "--group" and "--owner" to tar(1)

Security fixes:

Fix possible vulnerability in tar error reporting introduced in f27c173

Important bugfixes:

ISO9660: preserve the natural order of links
rar5: fix decoding unicode filenames on Windows
rar5: fix infinite loop if during rar5 decompression the last block produced no data
xz filter: fix incorrect eof at the end of an lzip member
zip: fix end-of-data marker processing when decompressing zip archives
multiple bsdunzip(1) fixes
filetime truncation fix on Windows
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Apr  7 22:36:26 2024 -->
@


1.9
log
@libarchive: updated to 3.7.2

Libarchive 3.7.2 is a security, bugfix and feature release.

Security fixes:

Multiple vulnerabilities have been fixed in the PAX writer (1b4e0d0)
Important bugfixes:

bsdunzip(1) now correctly handles arguments following an -x after the zipfile
New features:

bsdunzip(1) now supports the "--version" flag
7-zip reader now translates Windows permissions into UNIX permissions
uudecode filter in raw mode now supports file name and file mode
zstd filter now supports the "long" write option


Libarchive 3.7.1 is a security, feature and bugfix release.

Security fixes:

SEGV and stack buffer overflow in verbose mode of cpio
Feature updates:

bsdunzip updated to match latest upstream code
Important bugfixes:

miscellaneous functional bugfixes
build fixes on multiple platforms


Libarchive 3.7.0 is a feature and bugfix release.

New features:

bsdunzip: new tool ported from FreeBSD
drop-in replacement for Info-ZIP unzip, not yet ported for Windows
7zip reader: support for Zstandard compression
7zip reader: support for ARM64 filter
zstd filter: support for multi-frame zstd archives
Other notable bugfixes and improvements:

pax: fix year 2038 problem on platforms with 64-bit time_t
Windows: Universal Windows Platform (UWP) fixes and improvements
Windows: bcrypt usage fixes and improvements
Windows: time function usage fixes and improvements
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Sep 11 22:06:19 2023 -->
@


1.8
log
@libarchive: Update to 3.4.3

Libarchive 3.4.3 is a feature and bugfix release.

New features:

    support for pzstd compressed files (#1357)
    support for RHT.security.selinux tar extended attribute (#1348)

Important bugfixes:

    various zstd fixes and improvements (#1342 #1352 #1359)
    child process handling fixes (#1372)

Libarchive 3.4.2 is a feature and security release.

New features:

    support for atomic file extraction (bsdtar -x --safe-writes) (#1289)
    support for mbed TLS (PolarSSL) (#1301)

Important bugfixes:

    security fixes in RAR5 reader (#1280 #1326)
    compression buffer fix in XAR writer (#1317)
    fix uname and gname longer than 32 characters in PAX writer (#1319)
    fix segfault when archiving hard links in ISO9660 and XAR writers (#1325)
    fix support for extracting 7z archive entries with Delta filter (#987)

Libarchive 3.4.1 is a feature and security release.

New features:

    Unicode filename support for reading lha/lzh archives
    New pax write option "xattrhdr"

Important bugfixes:

    security fixes in wide string processing (#1276 #1298)
    security fixes in RAR5 reader (#1212 #1217 #1296)
    security fixes and optimizations to write filter logic (#351)
    security fix related to use of readlink(2) (1dae5a5)
    sparse file handling fixes (#1218 #1260)

Thanks to all contributors and bug reporters.
Special thanks to Christos Zoulas (@@zoulasc) from NetBSD for the atomic file extraction feature.
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Wed May 20 01:10:06 2020 -->
d227 1
a227 1
special &rsquo;&rsquo;empty&rsquo;&rsquo; format.</p>
@


1.7
log
@Update for libarchive-3.4.0:
- improvements for Android APK and JAR archives
- better support for non-recursive list and extract
- tar --exclude-vcs support
- fixes for file attributes and flags handling
- zipx support
- rar 5.0 reader
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.4 -->
<!-- CreationDate: Wed Jun 12 21:10:15 2019 -->
d137 1
a137 1
<p style="margin-top: 1em"><b>EXAMPLE</b></p>
d202 1
a202 2
<p style="margin-left:6%;">tar(1), libarchive(3),
archive_read_new(3), archive_read_data(3),
d205 3
a207 2
archive_read_open(3), archive_read_set_options(3),
archive_util(3), tar(5)</p>
d227 1
a227 1
special &ldquo;empty&rdquo; format.</p>
@


1.6
log
@libarchive: updated to 3.3.3

libarchive 3.3.3:
Avoid super-linear slowdown on malformed mtree files
Many fixes for building with Visual Studio
NO_OVERWRITE doesn't change existing directory attributes
New support for Zstandard read and write filters
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Mon Sep  3 22:55:07 2018 -->
d227 1
a227 1
special &rsquo;&rsquo;empty&rsquo;&rsquo; format.</p>
@


1.5
log
@Merge for libarchive-3.3.2.
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
@


1.4
log
@Merge libarchive-3.3.1.
@
text
@d2 1
a2 1
<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
d227 1
a227 1
special &lsquo;&lsquo;empty&rsquo;&rsquo; format.</p>
@


1.3
log
@Update for libarchive 3.2.1.
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
d227 1
a227 1
special &rsquo;&rsquo;empty&rsquo;&rsquo; format.</p>
@


1.2
log
@Changes 3.1.2:
This is a maintenance update to fix issues with the new RAR seeking
feature. This new release also contains fixes for build failures when
building libarchive using Visual Studio 2012 and MinGW.
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.21 -->
<!-- CreationDate: Sat Feb  9 12:24:03 2013 -->
d117 1
a117 1
<b>archive_read_data_to_file</b>(), which copies the data to
d167 1
a167 1
<p style="margin-left:14%; margin-top: 1em">ssize_t <br>
d217 1
a217 2
was written by Tim Kientzle &lang; kientzle@@acm.org&rang;
.</p>
@


1.1
log
@Initial revision
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.19.2 -->
<!-- CreationDate: Thu Feb  4 20:36:31 2010 -->
d11 4
a14 3
       p     { margin-top: 0; margin-bottom: 0; }
       pre   { margin-top: 0; margin-bottom: 0; }
       table { margin-top: 0; margin-bottom: 0; }
d23 2
a24 2
<p valign="top">archive_read(3) FreeBSD Library Functions
Manual archive_read(3)</p>
d26 1
a26 1
<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
d28 2
a29 36
<p style="margin-left:8%;"><b>archive_read_new</b>,
<b>archive_read_set_filter_options</b>,
<b>archive_read_set_format_options</b>,
<b>archive_read_set_options</b>,
<b>archive_read_support_compression_all</b>,
<b>archive_read_support_compression_bzip2</b>,
<b>archive_read_support_compression_compress</b>,
<b>archive_read_support_compression_gzip</b>,
<b>archive_read_support_compression_lzma</b>,
<b>archive_read_support_compression_none</b>,
<b>archive_read_support_compression_xz</b>,
<b>archive_read_support_compression_program</b>,
<b>archive_read_support_compression_program_signature</b>,
<b>archive_read_support_format_all</b>,
<b>archive_read_support_format_ar</b>,
<b>archive_read_support_format_cpio</b>,
<b>archive_read_support_format_empty</b>,
<b>archive_read_support_format_iso9660</b>,
<b>archive_read_support_format_mtree,
archive_read_support_format_raw,
archive_read_support_format_tar</b>,
<b>archive_read_support_format_zip</b>,
<b>archive_read_open</b>, <b>archive_read_open2</b>,
<b>archive_read_open_fd</b>, <b>archive_read_open_FILE</b>,
<b>archive_read_open_filename</b>,
<b>archive_read_open_memory</b>,
<b>archive_read_next_header</b>,
<b>archive_read_next_header2</b>, <b>archive_read_data</b>,
<b>archive_read_data_block</b>,
<b>archive_read_data_skip</b>,
<b>archive_read_data_into_buffer</b>,
<b>archive_read_data_into_fd</b>,
<b>archive_read_extract</b>, <b>archive_read_extract2</b>,
<b>archive_read_extract_set_progress_callback</b>,
<b>archive_read_close</b>, <b>archive_read_finish</b>
&mdash; functions for reading streaming archives</p>
d31 1
d33 2
a34 1
<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>
d36 3
a38 1
<p style="margin-left:8%;"><b>#include
d41 1
a41 113
<p style="margin-left:8%; margin-top: 1em"><i>struct
archive *</i></p>


<p style="margin-left:14%;"><b>archive_read_new</b>(<i>void</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_all</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_bzip2</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_compress</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_gzip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_lzma</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_none</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_xz</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_support_compression_program</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*cmd</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_support_compression_program_signature</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*cmd</i>,
<i>const&nbsp;void&nbsp;*signature</i>,
<i>size_t&nbsp;signature_length</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_all</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_ar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_cpio</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_empty</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_iso9660</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_mtree</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_raw</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_tar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_zip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_set_filter_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_set_format_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>
d43 1
a43 126

<p style="margin-left:14%;"><b>archive_read_set_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_open</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>archive_open_callback&nbsp;*</i>,
<i>archive_read_callback&nbsp;*</i>,
<i>archive_close_callback&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_open2</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>archive_open_callback&nbsp;*</i>,
<i>archive_read_callback&nbsp;*</i>,
<i>archive_skip_callback&nbsp;*</i>,
<i>archive_close_callback&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_open_FILE</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>FILE&nbsp;*file</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_open_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>int&nbsp;fd</i>, <i>size_t&nbsp;block_size</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_open_filename</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*filename</i>,
<i>size_t&nbsp;block_size</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_open_memory</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*buff</i>, <i>size_t&nbsp;size</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_next_header</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>struct&nbsp;archive_entry&nbsp;**</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_next_header2</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>


<p style="margin-left:8%; margin-top: 1em"><i>ssize_t</i></p>


<p style="margin-left:14%;"><b>archive_read_data</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*buff</i>, <i>size_t&nbsp;len</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_data_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;void&nbsp;**buff</i>, <i>size_t&nbsp;*len</i>,
<i>off_t&nbsp;*offset</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_data_skip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_data_into_buffer</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*</i>, <i>ssize_t&nbsp;len</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_data_into_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>int&nbsp;fd</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_extract</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>struct&nbsp;archive_entry&nbsp;*</i>,
<i>int&nbsp;flags</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_extract2</b>(<i>struct&nbsp;archive&nbsp;*src</i>,
<i>struct&nbsp;archive_entry&nbsp;*</i>,
<i>struct&nbsp;archive&nbsp;*dest</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>


<p valign="top"><b>archive_read_extract_set_progress_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;(*func)(void&nbsp;*)</i>,
<i>void&nbsp;*user_data</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_close</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_finish</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>


<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>

<p style="margin-left:8%;">These functions provide a
d48 1
a48 4
release all resources. The following summary describes the
functions in approximately the order they would be used:</p>

<p valign="top"><b>archive_read_new</b>()</p>
d50 86
a135 365
<p style="margin-left:20%;">Allocates and initializes a
struct archive object suitable for reading from an
archive.</p>


<p valign="top"><b>archive_read_support_compression_bzip2</b>(),
<b>archive_read_support_compression_compress</b>(),
<b>archive_read_support_compression_gzip</b>(),
<b>archive_read_support_compression_lzma</b>(),
<b>archive_read_support_compression_none</b>(),
<b>archive_read_support_compression_xz</b>()</p>

<p style="margin-left:20%;">Enables auto-detection code and
decompression support for the specified compression. Returns
<b>ARCHIVE_OK</b> if the compression is fully supported, or
<b>ARCHIVE_WARN</b> if the compression is supported only
through an external program. Note that decompression using
an external program is usually slower than decompression
through built-in libraries. Note that
&lsquo;&lsquo;none&rsquo;&rsquo; is always enabled by
default.</p>


<p valign="top"><b>archive_read_support_compression_all</b>()</p>

<p style="margin-left:20%;">Enables all available
decompression filters.</p>


<p valign="top"><b>archive_read_support_compression_program</b>()</p>

<p style="margin-left:20%;">Data is fed through the
specified external program before being dearchived. Note
that this disables automatic detection of the compression
format, so it makes no sense to specify this in conjunction
with any other decompression option.</p>


<p valign="top"><b>archive_read_support_compression_program_signature</b>()</p>

<p style="margin-left:20%;">This feeds data through the
specified external program but only if the initial bytes of
the data match the specified signature value.</p>

<p valign="top"><b>archive_read_support_format_all</b>(),
<b>archive_read_support_format_ar</b>(),
<b>archive_read_support_format_cpio</b>(),
<b>archive_read_support_format_empty</b>(),
<b>archive_read_support_format_iso9660</b>(),
<b>archive_read_support_format_mtree</b>(),
<b>archive_read_support_format_tar</b>(),
<b>archive_read_support_format_zip</b>()</p>

<p style="margin-left:20%;">Enables support---including
auto-detection code---for the specified archive format. For
example, <b>archive_read_support_format_tar</b>() enables
support for a variety of standard tar formats, old-style
tar, ustar, pax interchange format, and many common
variants. For convenience,
<b>archive_read_support_format_all</b>() enables support for
all available formats. Only empty archives are supported by
default.</p>


<p valign="top"><b>archive_read_support_format_raw</b>()</p>

<p style="margin-left:20%;">The
&lsquo;&lsquo;raw&rsquo;&rsquo; format handler allows
libarchive to be used to read arbitrary data. It treats any
data stream as an archive with a single entry. The pathname
of this entry is &lsquo;&lsquo;data&rsquo;&rsquo;; all other
entry fields are unset. This is not enabled by
<b>archive_read_support_format_all</b>() in order to avoid
erroneous handling of damaged archives.</p>

<p valign="top"><b>archive_read_set_filter_options</b>(),
<b>archive_read_set_format_options</b>(),
<b>archive_read_set_options</b>()</p>

<p style="margin-left:20%;">Specifies options that will be
passed to currently-registered filters (including
decompression filters) and/or format readers. The argument
is a comma-separated list of individual options. Individual
options have one of the following forms:</p>

<p valign="top"><i>option=value</i></p>

<p style="margin-left:32%;">The option/value pair will be
provided to every module. Modules that do not accept an
option with this name will ignore it.</p>

<p valign="top"><i>option</i></p>

<p style="margin-left:32%; margin-top: 1em">The option will
be provided to every module with a value of
&lsquo;&lsquo;1&rsquo;&rsquo;.</p>

<p valign="top"><i>!option</i></p>

<p style="margin-left:32%;">The option will be provided to
every module with a NULL value.</p>

<p valign="top"><i>module:option=value</i>,
<i>module:option</i>, <i>module:!option</i></p>

<p style="margin-left:32%;">As above, but the corresponding
option and value will be provided only to modules whose name
matches <i>module</i>.</p>

<p style="margin-left:20%;">The return value will be
<b>ARCHIVE_OK</b> if any module accepts the option, or
<b>ARCHIVE_WARN</b> if no module accepted the option, or
<b>ARCHIVE_FATAL</b> if there was a fatal error while
attempting to process the option.</p>

<p style="margin-left:20%; margin-top: 1em">The currently
supported options are:</p>

<p valign="top">Format iso9660 <b><br>
joliet</b></p>

<p style="margin-left:45%; margin-top: 1em">Support Joliet
extensions. Defaults to enabled, use <b>!joliet</b> to
disable.</p>

<p valign="top"><b>archive_read_open</b>()</p>

<p style="margin-left:20%;">The same as
<b>archive_read_open2</b>(), except that the skip callback
is assumed to be NULL.</p>

<p valign="top"><b>archive_read_open2</b>()</p>

<p style="margin-left:20%;">Freeze the settings, open the
archive, and prepare for reading entries. This is the most
generic version of this call, which accepts four callback
functions. Most clients will want to use
<b>archive_read_open_filename</b>(),
<b>archive_read_open_FILE</b>(),
<b>archive_read_open_fd</b>(), or
<b>archive_read_open_memory</b>() instead. The library
invokes the client-provided functions to obtain raw bytes
from the archive.</p>

<p valign="top"><b>archive_read_open_FILE</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a <i>FILE
*</i> pointer. This function should not be used with tape
drives or other devices that require strict I/O
blocking.</p>

<p valign="top"><b>archive_read_open_fd</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a file
descriptor and block size rather than a set of function
pointers. Note that the file descriptor will not be
automatically closed at end-of-archive. This function is
safe for use with tape drives or other blocked devices.</p>

<p valign="top"><b>archive_read_open_file</b>()</p>

<p style="margin-left:20%;">This is a deprecated synonym
for <b>archive_read_open_filename</b>().</p>

<p valign="top"><b>archive_read_open_filename</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a simple
filename and a block size. A NULL filename represents
standard input. This function is safe for use with tape
drives or other blocked devices.</p>

<p valign="top"><b>archive_read_open_memory</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a pointer
and size of a block of memory containing the archive
data.</p>

<p valign="top"><b>archive_read_next_header</b>()</p>

<p style="margin-left:20%;">Read the header for the next
entry and return a pointer to a struct archive_entry. This
is a convenience wrapper around
<b>archive_read_next_header2</b>() that reuses an internal
struct archive_entry object for each request.</p>

<p valign="top"><b>archive_read_next_header2</b>()</p>

<p style="margin-left:20%;">Read the header for the next
entry and populate the provided struct archive_entry.</p>

<p valign="top"><b>archive_read_data</b>()</p>

<p style="margin-left:20%;">Read data associated with the
header just read. Internally, this is a convenience function
that calls <b>archive_read_data_block</b>() and fills any
gaps with nulls so that callers see a single continuous
stream of data.</p>

<p valign="top"><b>archive_read_data_block</b>()</p>

<p style="margin-left:20%;">Return the next available block
of data for this entry. Unlike <b>archive_read_data</b>(),
the <b>archive_read_data_block</b>() function avoids copying
data and allows you to correctly handle sparse files, as
supported by some archive formats. The library guarantees
that offsets will increase and that blocks will not overlap.
Note that the blocks returned from this function can be much
larger than the block size read from disk, due to
compression and internal buffer optimizations.</p>

<p valign="top"><b>archive_read_data_skip</b>()</p>

<p style="margin-left:20%;">A convenience function that
repeatedly calls <b>archive_read_data_block</b>() to skip
all of the data for this archive entry.</p>

<p valign="top"><b>archive_read_data_into_buffer</b>()</p>

<p style="margin-left:20%;">This function is deprecated and
will be removed. Use <b>archive_read_data</b>() instead.</p>

<p valign="top"><b>archive_read_data_into_fd</b>()</p>

<p style="margin-left:20%;">A convenience function that
repeatedly calls <b>archive_read_data_block</b>() to copy
the entire entry to the provided file descriptor.</p>

<p valign="top"><b>archive_read_extract</b>(),
<b>archive_read_extract_set_skip_file</b>()</p>

<p style="margin-left:20%;">A convenience function that
wraps the corresponding archive_write_disk(3) interfaces.
The first call to <b>archive_read_extract</b>() creates a
restore object using archive_write_disk_new(3) and
archive_write_disk_set_standard_lookup(3), then
transparently invokes archive_write_disk_set_options(3),
archive_write_header(3), archive_write_data(3), and
archive_write_finish_entry(3) to create the entry on disk
and copy data into it. The <i>flags</i> argument is passed
unmodified to archive_write_disk_set_options(3).</p>

<p valign="top"><b>archive_read_extract2</b>()</p>

<p style="margin-left:20%;">This is another version of
<b>archive_read_extract</b>() that allows you to provide
your own restore object. In particular, this allows you to
override the standard lookup functions using
archive_write_disk_set_group_lookup(3), and
archive_write_disk_set_user_lookup(3). Note that
<b>archive_read_extract2</b>() does not accept a
<i>flags</i> argument; you should use
<b>archive_write_disk_set_options</b>() to set the restore
options yourself.</p>


<p valign="top"><b>archive_read_extract_set_progress_callback</b>()</p>

<p style="margin-left:20%;">Sets a pointer to a
user-defined callback that can be used for updating progress
displays during extraction. The progress function will be
invoked during the extraction of large regular files. The
progress function will be invoked with the pointer provided
to this call. Generally, the data pointed to should include
a reference to the archive object and the archive_entry
object so that various statistics can be retrieved for the
progress display.</p>

<p valign="top"><b>archive_read_close</b>()</p>

<p style="margin-left:20%;">Complete the archive and invoke
the close callback.</p>

<p valign="top"><b>archive_read_finish</b>()</p>

<p style="margin-left:20%;">Invokes
<b>archive_read_close</b>() if it was not invoked manually,
then release all resources. Note: In libarchive 1.x, this
function was declared to return <i>void</i>, which made it
impossible to detect certain errors when
<b>archive_read_close</b>() was invoked implicitly from this
function. The declaration is corrected beginning with
libarchive 2.0.</p>

<p style="margin-left:8%; margin-top: 1em">Note that the
library determines most of the relevant information about
the archive by inspection. In particular, it automatically
detects gzip(1) or bzip2(1) compression and transparently
performs the appropriate decompression. It also
automatically detects the archive format.</p>

<p style="margin-left:8%; margin-top: 1em">A complete
description of the struct archive and struct archive_entry
objects can be found in the overview manual page for
libarchive(3).</p>

<p style="margin-top: 1em" valign="top"><b>CLIENT
CALLBACKS</b></p>

<p style="margin-left:8%;">The callback functions must
match the following prototypes:</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
ssize_t</i></p>


<p valign="top"><b>archive_read_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>const&nbsp;void&nbsp;**buffer</i>)</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
int</i></p>


<p valign="top"><b>archive_skip_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>size_t&nbsp;request</i>)</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
int</i> <b>archive_open_callback</b>(<i>struct archive
*</i>, <i>void *client_data</i>)</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
int</i> <b>archive_close_callback</b>(<i>struct archive
*</i>, <i>void *client_data</i>)</p>

<p style="margin-left:8%; margin-top: 1em">The open
callback is invoked by <b>archive_open</b>(). It should
return <b>ARCHIVE_OK</b> if the underlying file or data
source is successfully opened. If the open fails, it should
call <b>archive_set_error</b>() to register an error code
and message and return <b>ARCHIVE_FATAL</b>.</p>

<p style="margin-left:8%; margin-top: 1em">The read
callback is invoked whenever the library requires raw bytes
from the archive. The read callback should read data into a
buffer, set the const void **buffer argument to point to the
available data, and return a count of the number of bytes
available. The library will invoke the read callback again
only after it has consumed this data. The library imposes no
constraints on the size of the data blocks returned. On
end-of-file, the read callback should return zero. On error,
the read callback should invoke <b>archive_set_error</b>()
to register an error code and message and return -1.</p>

<p style="margin-left:8%; margin-top: 1em">The skip
callback is invoked when the library wants to ignore a block
of data. The return value is the number of bytes actually
skipped, which may differ from the request. If the callback
cannot skip data, it should return zero. If the skip
callback is not provided (the function pointer is NULL ),
the library will invoke the read function instead and simply
discard the result. A skip callback can provide significant
performance gains when reading uncompressed archives from
slow disk drives or other media that can skip quickly.</p>

<p style="margin-left:8%; margin-top: 1em">The close
callback is invoked by archive_close when the archive
processing is complete. The callback should return
<b>ARCHIVE_OK</b> on success. On failure, the callback
should invoke <b>archive_set_error</b>() to register an
error code and message and return <b>ARCHIVE_FATAL.</b></p>
d137 1
a137 1
<p style="margin-top: 1em" valign="top"><b>EXAMPLE</b></p>
d139 1
a139 1
<p style="margin-left:8%;">The following illustrates basic
d144 1
a144 1
<p style="margin-left:17%; margin-top: 1em">void <br>
d151 1
a151 1
<p style="margin-left:17%; margin-top: 1em">mydata =
d155 1
a155 1
archive_read_support_compression_all(a); <br>
d163 1
a163 1
archive_read_finish(a); <br>
d167 1
a167 1
<p style="margin-left:17%; margin-top: 1em">ssize_t <br>
d173 1
a173 1
<p style="margin-left:17%; margin-top: 1em">*buff =
d178 1
a178 1
<p style="margin-left:17%; margin-top: 1em">int <br>
d183 1
a183 1
<p style="margin-left:17%; margin-top: 1em">mydata-&gt;fd =
d189 1
a189 1
<p style="margin-left:17%; margin-top: 1em">int <br>
d194 1
a194 1
<p style="margin-left:17%; margin-top: 1em">if
d200 1
a200 2
<p style="margin-top: 1em" valign="top"><b>RETURN
VALUES</b></p>
d202 5
a206 41
<p style="margin-left:8%;">Most functions return zero on
success, non-zero on error. The possible return codes
include: <b>ARCHIVE_OK</b> (the operation succeeded),
<b>ARCHIVE_WARN</b> (the operation succeeded but a
non-critical error was encountered), <b>ARCHIVE_EOF</b>
(end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the
operation failed but can be retried), and
<b>ARCHIVE_FATAL</b> (there was a fatal error; the archive
should be closed immediately). Detailed error codes and
textual descriptions are available from the
<b>archive_errno</b>() and <b>archive_error_string</b>()
functions.</p>


<p style="margin-left:8%; margin-top: 1em"><b>archive_read_new</b>()
returns a pointer to a freshly allocated struct archive
object. It returns NULL on error.</p>


<p style="margin-left:8%; margin-top: 1em"><b>archive_read_data</b>()
returns a count of bytes actually read or zero at the end of
the entry. On error, a value of <b>ARCHIVE_FATAL</b>,
<b>ARCHIVE_WARN</b>, or <b>ARCHIVE_RETRY</b> is returned and
an error code and textual description can be retrieved from
the <b>archive_errno</b>() and <b>archive_error_string</b>()
functions.</p>

<p style="margin-left:8%; margin-top: 1em">The library
expects the client callbacks to behave similarly. If there
is an error, you can use <b>archive_set_error</b>() to set
an appropriate error code and description, then return one
of the non-zero values above. (Note that the value
eventually returned to the client may not be the same; many
errors that are not critical at the level of basic I/O can
prevent the archive from being properly read, thus most I/O
errors eventually cause <b>ARCHIVE_FATAL</b> to be
returned.)</p>

<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>

<p style="margin-left:8%;">tar(1), archive(3),
d209 1
a209 1
<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>
d211 1
a211 1
<p style="margin-left:8%;">The <b>libarchive</b> library
d214 1
a214 1
<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>
d216 3
a218 3
<p style="margin-left:8%;">The <b>libarchive</b> library
was written by Tim Kientzle
&lang;kientzle@@acm.org&rang;.</p>
d220 1
a220 1
<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
d222 1
a222 1
<p style="margin-left:8%;">Many traditional archiver
d228 1
a228 2
special &lsquo;&lsquo;empty&rsquo;&rsquo; format.</p>

d230 2
a231 2
<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
April&nbsp;13, 2009 FreeBSD&nbsp;8.0</p>
@


1.1.1.1
log
@Import libarchive 2.8.0:
- Infrastructure:
  - Allow command line tools as fallback for missing compression
    libraries. If compiled without gzip for example, gunzip will
    be used automatically.
  - Improved support for a number of platforms like high-resolution
    timestamps and Extended Attributes on various Unix systems
  - New convience interface for creating archives based on disk content,
    complement of the archive_write_disk interface.
- Frontends:
  - bsdcpio ready for public consumption
  - hand-written date parser replaces the yacc code
- Filter system:
  - Simplified read filter chains
  - Option support for filters
  - LZMA, XZ, uudecode handled
- Format support:
  - Write support for mtree files based on file system or archive
    content
  - Basic read support for Joliet
  - Write support for zip files
  - Write support for shar archives, both text-only and binary-safe
@
text
@@


1.1.1.2
log
@libarchive-2.8.2:
- Fix NULL deference for short self-extracting zip archives
- Don't dereference symlinks on Linux when reading ACLs
- Better detection of SHA2 support for old OpenSSL versions
- Fix parsing of input files for bsdtar -T
- Do not leak setup_xattr into the global namespace
- Fix build when an older libarchive is already installed
- Use O_BINARY opening files in bsdtar
- Include missing archive_crc32.h
- Correctly include iconv.h required by libxml2
@
text
@d1 820
a820 1509
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Sun Mar 14 02:49:15 2010
%%DocumentNeededResources: font Times-Roman
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 118
%%PageOrder: Ascend
%%DocumentMedia: Default 612 792 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.19 2
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/Fr{
setrgbcolor fill
}bind def
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
/Fg{
setgray fill
}bind def
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
/setcmykcolor where{
pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
/setpagedevice{}def
}bind def
/PEND{
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Roman
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Roman@@0 ENC0/Times-Roman RE
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<html>)0 12 Q(<head>)0 24 Q(<title>)36 36 Q
(April 13, 2009 archi)74.5 48 Q -.15(ve)-.25 G(_read 3).15 E(</title>)36
72 Q 0 Cg EP
%%Page: 2 2
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<style type="te)36 12 Q(xt/css">)-.15 E(<!--)36
24 Q(body { mar)72 36 Q(gin-left:4%; })-.18 E(H1, H2, H3, H4, H5 {)72 48
Q(color: maroon; padding: 4pt; mar)108 60 Q(gin-left: -4%;)-.18 E
(border: solid; border)108 72 Q(-width: thin; width: 100%;)-.2 E 0 Cg EP
%%Page: 3 3
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(background: r)108 12 Q(gb\(204,204,255\))-.18 E
(})72 24 Q(-->)36 36 Q(</style>)36 48 Q(</head>)0 60 Q
(<body bgcolor="#FFFFFF" te)0 72 Q(xt="#000000">)-.15 E 0 Cg EP
%%Page: 4 4
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="N)36 12 Q(AME">)-.35 E -.35(NA)36 24 S
(ME).35 E(</h3>)36 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G(_read_ne).15 E
(w</b>,)-.25 E(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_set_\214lter_options</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G
(_read_set_format_options</b>,).15 E 0 Cg EP
%%Page: 5 5
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_set_options</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_support_compression_all</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_bzip2</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25
G(_read_support_compression_compress</b>,).15 E(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_compression_gzip</b>,).15 E(<b>archi)0 72 Q -.15
(ve)-.25 G(_read_support_compression_lzma</b>,).15 E 0 Cg EP
%%Page: 6 6
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_none</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25
G(_read_support_compression_xz</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_program</b>,).15 E(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_support_compression_program_signature</b>,).15 E(<b>archi)0
60 Q -.15(ve)-.25 G(_read_support_format_all</b>,).15 E(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_support_format_ar</b>,).15 E 0 Cg EP
%%Page: 7 7
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_cpio</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_support_format_empty</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_iso9660</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_support_format_mtree,</b>).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_support_format_ra).15 E -.65(w,)-.15 G(</b>).65 E(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_support_format_tar</b>,).15 E 0 Cg EP
%%Page: 8 8
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_zip</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_open</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G(_read_open2</b>,)
.15 E(<b>archi)0 48 Q -.15(ve)-.25 G(_read_open_fd</b>,).15 E(<b>archi)0
60 Q -.15(ve)-.25 G(_read_open_FILE</b>,).15 E(<b>archi)0 72 Q -.15(ve)
-.25 G(_read_open_\214lename</b>,).15 E 0 Cg EP
%%Page: 9 9
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open_memory</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G(_read_ne)
.15 E(xt_header</b>,)-.15 E(<b>archi)0 36 Q -.15(ve)-.25 G(_read_ne).15
E(xt_header2</b>,)-.15 E(<b>archi)0 48 Q -.15(ve)-.25 G(_read_data</b>,)
.15 E(<b>archi)0 60 Q -.15(ve)-.25 G(_read_data_block</b>,).15 E
(<b>archi)0 72 Q -.15(ve)-.25 G(_read_data_skip</b>,).15 E 0 Cg EP
%%Page: 10 10
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data_into_b).15 E(uf)-.2 E(fer</b>,)-.25 E(<b>archi)0 24 Q -.15
(ve)-.25 G(_read_data_into_fd</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_e).15 E(xtract</b>,)-.15 E(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_e).15 E(xtract2</b>,)-.15 E(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_e).15 E(xtract_set_progress_callback</b>,)-.15 E(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_close</b>,).15 E 0 Cg EP
%%Page: 11 11
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_\214nish</b>).15 E 2.5(-f)0 24 S
(unctions for reading streaming archi)-2.5 E -.15(ve)-.25 G(s).15 E
(<h3 id="SYNOPSIS">)36 36 Q(SYNOPSIS)36 48 Q(</h3>)36 60 Q
(<br><br><code></code><code>struct</code><code> archi)0 72 Q -.15(ve)
-.25 G(</code><code> *</code>).15 E 0 Cg EP
%%Page: 12 12
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G(_read_ne).15 E
(w</b>\(<code></code><code>v)-.25 E(oid</code>\))-.2 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G
(_read_support_compression_all</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G
(_read_support_compression_bzip2</b>\(<code></code><code>struct archi)
.15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 13 13
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G(_read_support_co\
mpression_compress</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0 24
Q(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_gzip</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G
(_read_support_compression_lzma</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 14 14
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_none</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G
(_read_support_compression_xz</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_compression_program</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 15 15
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>const char *cmd</code>)0 12 Q
(\))0 24 Q(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q
-.15(ve)-.25 G
(_read_support_compression_program_signature</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 60 Q .3 -.15(ve *)-.25 H(</code>).15
E(<code></code><code>const char *cmd</code>)0 72 Q 0 Cg EP
%%Page: 16 16
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>const v)0 12 Q
(oid *signature</code>)-.2 E
(<code></code><code>size_t signature_length</code>)0 24 Q(\))0 36 Q
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_format_all</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 17 17
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_ar</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_cpio</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
48 Q(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_support_format_empty</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 18 18
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_iso9660</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_support_format_mtree</b>\(<code></code><code>struct archi)
.15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_format_ra).15 E
(w</b>\(<code></code><code>struct archi)-.15 E .3 -.15(ve *)-.25 H
(</code>\)).15 E(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 19 19
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_tar</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_zip</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
48 Q(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_set_\214lter_options</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_set_format_options</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_set_options</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_open</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 21 21
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>v)0 12 Q
(oid *client_data</code>)-.2 E(<code></code><code>archi)0 24 Q -.15(ve)
-.25 G(_open_callback *</code>).15 E(<code></code><code>archi)0 36 Q
-.15(ve)-.25 G(_read_callback *</code>).15 E(<code></code><code>archi)0
48 Q -.15(ve)-.25 G(_close_callback *</code>).15 E(\))0 60 Q
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 22 22
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open2</b>\(<code></code>).15 E(<code></code><code>struct archi)0
24 Q .3 -.15(ve *)-.25 H(</code>).15 E(<code></code><code>v)0 36 Q
(oid *client_data</code>)-.2 E(<code></code><code>archi)0 48 Q -.15(ve)
-.25 G(_open_callback *</code>).15 E(<code></code><code>archi)0 60 Q
-.15(ve)-.25 G(_read_callback *</code>).15 E(<code></code><code>archi)0
72 Q -.15(ve)-.25 G(_skip_callback *</code>).15 E 0 Cg EP
%%Page: 23 23
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>archi)0 12 Q -.15(ve)-.25 G
(_close_callback *</code>).15 E(\))0 24 Q
(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_open_FILE</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, FILE *\214le</code>\)).15 E
(<br><br><code></code><code>int</code>)0 60 Q(<b>archi)0 72 Q -.15(ve)
-.25 G(_read_open_fd</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H
(</code><code>, int fd</code><code>, size_t block_size</code>\)).15 E 0
Cg EP
%%Page: 24 24
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<br><br><code></code><code>int</code>)0 12 Q
(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_open_\214lename</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 36 Q .3 -.15(ve *)-.25 H(</code>).15
E(<code></code><code>const char *\214lename</code>)0 48 Q
(<code></code><code>size_t block_size</code>)0 60 Q(\))0 72 Q 0 Cg EP
%%Page: 25 25
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<br><br><code></code><code>int</code>)0 12 Q
(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_open_memory</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code><code>, v).15 E(oid *b)-.2 E(uf)-.2 E
(f</code><code>, size_t size</code>\))-.25 E
(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_ne).15 E(xt_header</b>\(<code></code><code>struct archi)
-.15 E .3 -.15(ve *)-.25 H(</code><code>, struct archi).15 E -.15(ve)
-.25 G(_entry **</code>\)).15 E(<br><br><code></code><code>int</code>)0
60 Q(<b>archi)0 72 Q -.15(ve)-.25 G(_read_ne).15 E
(xt_header2</b>\(<code></code><code>struct archi)-.15 E .3 -.15(ve *)
-.25 H(</code><code>, struct archi).15 E -.15(ve)-.25 G
(_entry *</code>\)).15 E 0 Cg EP
%%Page: 26 26
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<br><br><code></code><code>ssize_t</code>)0 12 Q
(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_data</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)-.25
H(</code><code>, v).15 E(oid *b)-.2 E(uf)-.2 E
(f</code><code>, size_t len</code>\))-.25 E
(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_data_block</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 60 Q .3 -.15(ve *)-.25 H(</code>).15
E(<code></code><code>const v)0 72 Q(oid **b)-.2 E(uf)-.2 E(f</code>)-.25
E 0 Cg EP
%%Page: 27 27
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>size_t *len</code>)0 12 Q
(<code></code><code>of)0 24 Q(f_t *of)-.25 E(fset</code>)-.25 E(\))0 36
Q(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_data_skip</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
72 Q 0 Cg EP
%%Page: 28 28
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data_into_b).15 E(uf)-.2 E
(fer</b>\(<code></code><code>struct archi)-.25 E .3 -.15(ve *)-.25 H
(</code><code>, v).15 E(oid *</code><code>, ssize_t len</code>\))-.2 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_data_into_fd</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, int fd</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_e).15 E(xtract</b>\(<code></code>)-.15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 29 29
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>struct archi)0 12 Q -.15(ve)
-.25 G(_entry *</code>).15 E(<code></code><code>int \215ags</code>)0 24
Q(\))0 36 Q(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q
-.15(ve)-.25 G(_read_e).15 E(xtract2</b>\(<code></code>)-.15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(src</code>)
.15 E 0 Cg EP
%%Page: 30 30
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>struct archi)0 12 Q -.15(ve)
-.25 G(_entry *</code>).15 E(<code></code><code>struct archi)0 24 Q .3
-.15(ve *)-.25 H(dest</code>).15 E(\))0 36 Q
(<br><br><code></code><code>v)0 48 Q(oid</code>)-.2 E(<b>archi)0 60 Q
-.15(ve)-.25 G(_read_e).15 E
(xtract_set_progress_callback</b>\(<code></code>)-.15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 31 31
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>v)0 12 Q(oid \(*func\)\(v)-.2
E(oid *\)</code>)-.2 E(<code></code><code>v)0 24 Q
(oid *user_data</code>)-.2 E(\))0 36 Q
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_close</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0 72
Q 0 Cg EP
%%Page: 32 32
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_\214nish</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
-.25 H(</code>\)).15 E(<h3 id="DESCRIPTION">)36 24 Q(DESCRIPTION)36 36 Q
(</h3>)36 48 Q(These functions pro)0 60 Q
(vide a complete API for reading streaming archi)-.15 E -.15(ve)-.25 G
(s.).15 E(The general process is to \214rst create the)0 72 Q 0 Cg EP
%%Page: 33 33
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<font size="-1"></font><font size="-1">struct</\
font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(</font>).15 E
(object, set options, initialize the reader)0 24 Q 2.5(,i)-.4 G
(terate o)-2.5 E -.15(ve)-.15 G 2.5(rt).15 G(he archi)-2.5 E -.15(ve)
-.25 G(headers and associated data, then close the archi)0 36 Q .3 -.15
(ve a)-.25 H(nd release all).15 E(resources.)0 48 Q(The follo)0 60 Q
(wing summary describes the functions in approximately the)-.25 E
(order the)0 72 Q 2.5(yw)-.15 G(ould be used:)-2.6 E 0 Cg EP
%%Page: 34 34
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dl compact>)0 12 Q(<dt><b>archi)0 24 Q -.15(ve)
-.25 G(_read_ne).15 E(w</b>\(<code></code>\)<dd>)-.25 E
(Allocates and initializes a)0 36 Q(<font size="-1"></font><font size="\
-1">struct</font><font size="-1"> archi)0 48 Q -.15(ve)-.25 G(</font>)
.15 E(object suitable for reading from an archi)0 60 Q -.15(ve)-.25 G(.)
.15 E(<dt>Xo<dd>)0 72 Q 0 Cg EP
%%Page: 35 35
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_bzip2</b>\(<code></code>\),).15 E(<b>archi)0
24 Q -.15(ve)-.25 G
(_read_support_compression_compress</b>\(<code></code>\),).15 E
(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_gzip</b>\(<code></code>\),).15 E(<b>archi)0
48 Q -.15(ve)-.25 G
(_read_support_compression_lzma</b>\(<code></code>\),).15 E(<b>archi)0
60 Q -.15(ve)-.25 G
(_read_support_compression_none</b>\(<code></code>\),).15 E(<b>archi)0
72 Q -.15(ve)-.25 G(_read_support_compression_xz</b>\(<code></code>\))
.15 E 0 Cg EP
%%Page: 36 36
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(Enables auto-detection code and decompression support for the)0 12 Q
(speci\214ed compression.)0 24 Q(Returns)0 36 Q
(<b></b><b>ARCHIVE_OK</b>)0 48 Q
(if the compression is fully supported, or)0 60 Q(<b></b><b>ARCHIVE_W)0
72 Q(ARN</b>)-1.2 E 0 Cg EP
%%Page: 37 37
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(if the compression is supported only through an e)0 12 Q
(xternal program.)-.15 E(Note that decompression using an e)0 24 Q
(xternal program is usually slo)-.15 E(wer than)-.25 E
(decompression through b)0 36 Q(uilt-in libraries.)-.2 E(Note that)0 48
Q -.74(``)0 60 S(none').74 E(')-.74 E(is al)0 72 Q -.1(wa)-.1 G
(ys enabled by def).1 E(ault.)-.1 E 0 Cg EP
%%Page: 38 38
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_all</b>\(<code></code>\)<dd>).15 E
(Enables all a)0 24 Q -.25(va)-.2 G(ilable decompression \214lters.).25
E(<dt><b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_program</b>\(<code></code>\)<dd>).15 E
(Data is fed through the speci\214ed e)0 48 Q
(xternal program before being dearchi)-.15 E -.15(ve)-.25 G(d.).15 E
(Note that this disables automatic detection of the compression format,)
0 60 Q(so it mak)0 72 Q
(es no sense to specify this in conjunction with an)-.1 E 2.5(yo)-.15 G
(ther)-2.5 E 0 Cg EP
%%Page: 39 39
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(decompression option.)0 12 Q(<dt><b>archi)0 24 Q
-.15(ve)-.25 G
(_read_support_compression_program_signature</b>\(<code></code>\)<dd>)
.15 E(This feeds data through the speci\214ed e)0 36 Q(xternal program)
-.15 E -.2(bu)0 48 S 2.5(to).2 G
(nly if the initial bytes of the data match the speci\214ed)-2.5 E
(signature v)0 60 Q(alue.)-.25 E(<dt>Xo<dd>)0 72 Q 0 Cg EP
%%Page: 40 40
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_all</b>\(<code></code>\),).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_support_format_ar</b>\(<code></code>\),).15 E
(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_cpio</b>\(<code></code>\),).15 E(<b>archi)0 48 Q
-.15(ve)-.25 G(_read_support_format_empty</b>\(<code></code>\),).15 E
(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_support_format_iso9660</b>\(<code></code>\),).15 E(<b>archi)0 72
Q -.15(ve)-.25 G(_read_support_format_mtree</b>\(<code></code>\),).15 E
0 Cg EP
%%Page: 41 41
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_tar</b>\(<code></code>\),).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_support_format_zip</b>\(<code></code>\)).15 E
(Enables support---including auto-detection code---for the)0 36 Q
(speci\214ed archi)0 48 Q .3 -.15(ve f)-.25 H(ormat.).15 E -.15(Fo)0 60
S 2.5(re).15 G(xample,)-2.65 E(<b>archi)0 72 Q -.15(ve)-.25 G
(_read_support_format_tar</b>\(<code></code>\)).15 E 0 Cg EP
%%Page: 42 42
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(enables support for a v)0 12 Q
(ariety of standard tar formats, old-style tar)-.25 E(,)-.4 E(ustar)0 24
Q 2.5(,p)-.4 G(ax interchange format, and man)-2.5 E 2.5(yc)-.15 G
(ommon v)-2.5 E(ariants.)-.25 E -.15(Fo)0 36 S 2.5(rc).15 G(on)-2.5 E
-.15(ve)-.4 G(nience,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_support_format_all</b>\(<code></code>\)).15 E
(enables support for all a)0 60 Q -.25(va)-.2 G(ilable formats.).25 E
(Only empty archi)0 72 Q -.15(ve)-.25 G 2.5(sa).15 G
(re supported by def)-2.5 E(ault.)-.1 E 0 Cg EP
%%Page: 43 43
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_ra).15 E(w</b>\(<code></code>\)<dd>)-.15 E(The)0
24 Q -.74(``)0 36 S(ra).74 E(w')-.15 E(')-.74 E(format handler allo)0 48
Q(ws libarchi)-.25 E .3 -.15(ve t)-.25 H 2.5(ob).15 G 2.5(eu)-2.5 G
(sed to read arbitrary data.)-2.5 E(It treats an)0 60 Q 2.5(yd)-.15 G
(ata stream as an archi)-2.5 E .3 -.15(ve w)-.25 H(ith a single entry)
.15 E(.)-.65 E(The pathname of this entry is)0 72 Q 0 Cg EP
%%Page: 44 44
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF -.74(``)0 12 S(data').74 E(';)-.74 E
(all other entry \214elds are unset.)0 24 Q(This is not enabled by)0 36
Q(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_support_format_all</b>\(<code></code>\)).15 E(in order to a)0 60
Q -.2(vo)-.2 G(id erroneous handling of damaged archi).2 E -.15(ve)-.25
G(s.).15 E(<dt>Xo<dd>)0 72 Q 0 Cg EP
%%Page: 45 45
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_set_\214lter_options</b>\(<code></code>\),).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_set_format_options</b>\(<code></code>\),).15 E
(<b>archi)0 36 Q -.15(ve)-.25 G(_read_set_options</b>\(<code></code>\))
.15 E(Speci\214es options that will be passed to currently-re)0 48 Q
(gistered)-.15 E
(\214lters \(including decompression \214lters\) and/or format readers.)
0 60 Q(The ar)0 72 Q(gument is a comma-separated list of indi)-.18 E
(vidual options.)-.25 E 0 Cg EP
%%Page: 46 46
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Indi)0 12 Q(vidual options ha)-.25 E .3 -.15
(ve o)-.2 H(ne of the follo).15 E(wing forms:)-.25 E(<dl compact>)0 24 Q
(<dt><i></i><i>option=v)0 36 Q(alue</i><dd>)-.25 E(The option/v)0 48 Q
(alue pair will be pro)-.25 E(vided to e)-.15 E -.15(ve)-.25 G
(ry module.).15 E
(Modules that do not accept an option with this name will ignore it.)0
60 Q(<dt><i></i><i>option</i><dd>)0 72 Q 0 Cg EP
%%Page: 47 47
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The option will be pro)0 12 Q(vided to e)-.15 E
-.15(ve)-.25 G(ry module with a v).15 E(alue of)-.25 E -.74(``)0 24 S
(1').74 E('.)-.74 E(<dt><i></i><i>!option</i><dd>)0 36 Q
(The option will be pro)0 48 Q(vided to e)-.15 E -.15(ve)-.25 G
(ry module with a NULL v).15 E(alue.)-.25 E
(<dt><i></i><i>module:option=v)0 60 Q(alue</i><i></i>,<i> module:option\
</i><i></i>,<i> module:!option</i><dd>)-.25 E(As abo)0 72 Q -.15(ve)-.15
G 2.5(,b).15 G(ut the corresponding option and v)-2.7 E
(alue will be pro)-.25 E(vided)-.15 E 0 Cg EP
%%Page: 48 48
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(only to modules whose name matches)0 12 Q
(<i></i><i>module</i>.)0 24 Q(</dl>)0 36 Q(The return v)0 48 Q
(alue will be)-.25 E(<b></b><b>ARCHIVE_OK</b>)0 60 Q(if an)0 72 Q 2.5
(ym)-.15 G(odule accepts the option, or)-2.5 E 0 Cg EP
%%Page: 49 49
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_W)0 12 Q(ARN</b>)-1.2 E
(if no module accepted the option, or)0 24 Q(<b></b><b>ARCHIVE_F)0 36 Q
-1.21 -1.11(AT A)-.74 H(L</b>)1.11 E(if there w)0 48 Q(as a f)-.1 E
(atal error while attempting to process the option.)-.1 E(<p>)36 60 Q
(The currently supported options are:)0 72 Q 0 Cg EP
%%Page: 50 50
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dl compact>)0 12 Q(<dt>F)0 24 Q
(ormat iso9660<dd>)-.15 E(<dl compact>)0 36 Q
(<dt><b></b><b>joliet</b><dd>)0 48 Q(Support Joliet e)0 60 Q(xtensions.)
-.15 E(Def)0 72 Q(aults to enabled, use)-.1 E 0 Cg EP
%%Page: 51 51
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>!joliet</b>)0 12 Q(to disable.)0 24 Q
(</dl>)0 36 Q(</dl>)0 48 Q(<dt><b>archi)0 60 Q -.15(ve)-.25 G
(_read_open</b>\(<code></code>\)<dd>).15 E(The same as)0 72 Q 0 Cg EP
%%Page: 52 52
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open2</b>\(<code></code>\),).15 E -.15(ex)0 24 S
(cept that the skip callback is assumed to be).15 E
(<code></code><code>NULL</code>.)0 36 Q(<dt><b>archi)0 48 Q -.15(ve)-.25
G(_read_open2</b>\(<code></code>\)<dd>).15 E
(Freeze the settings, open the archi)0 60 Q -.15(ve)-.25 G 2.5(,a).15 G
(nd prepare for reading entries.)-2.5 E(This is the most generic v)0 72
Q(ersion of this call, which accepts)-.15 E 0 Cg EP
%%Page: 53 53
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(four callback functions.)0 12 Q
(Most clients will w)0 24 Q(ant to use)-.1 E(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_open_\214lename</b>\(<code></code>\),).15 E(<b>archi)0 48 Q
-.15(ve)-.25 G(_read_open_FILE</b>\(<code></code>\),).15 E(<b>archi)0 60
Q -.15(ve)-.25 G(_read_open_fd</b>\(<code></code>\),).15 E(or)0 72 Q 0
Cg EP
%%Page: 54 54
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open_memory</b>\(<code></code>\)).15 E(instead.)0 24 Q
(The library in)0 36 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(st).1 G
(he client-pro)-2.5 E(vided functions to obtain)-.15 E(ra)0 48 Q 2.5(wb)
-.15 G(ytes from the archi)-2.5 E -.15(ve)-.25 G(.).15 E(<dt><b>archi)0
60 Q -.15(ve)-.25 G(_read_open_FILE</b>\(<code></code>\)<dd>).15 E(Lik)0
72 Q(e)-.1 E 0 Cg EP
%%Page: 55 55
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open</b>\(<code></code>\),).15 E -.15(ex)0 24 S
(cept that it accepts a).15 E(<br><br><code></code><code>FILE *</code>)0
36 Q(pointer)0 48 Q(.)-.55 E
(This function should not be used with tape dri)0 60 Q -.15(ve)-.25 G
2.5(so).15 G 2.5(ro)-2.5 G(ther de)-2.5 E(vices)-.25 E
(that require strict I/O blocking.)0 72 Q 0 Cg EP
%%Page: 56 56
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_open_fd</b>\(<code></code>\)<dd>).15 E(Lik)0 24 Q(e)-.1 E
(<b>archi)0 36 Q -.15(ve)-.25 G(_read_open</b>\(<code></code>\),).15 E
-.15(ex)0 48 S
(cept that it accepts a \214le descriptor and block size rather than).15
E 2.5(as)0 60 S(et of function pointers.)-2.5 E
(Note that the \214le descriptor will not be automatically closed at)0
72 Q 0 Cg EP
%%Page: 57 57
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(end-of-archi)0 12 Q -.15(ve)-.25 G(.).15 E
(This function is safe for use with tape dri)0 24 Q -.15(ve)-.25 G 2.5
(so).15 G 2.5(ro)-2.5 G(ther block)-2.5 E(ed de)-.1 E(vices.)-.25 E
(<dt><b>archi)0 36 Q -.15(ve)-.25 G
(_read_open_\214le</b>\(<code></code>\)<dd>).15 E
(This is a deprecated synon)0 48 Q(ym for)-.15 E(<b>archi)0 60 Q -.15
(ve)-.25 G(_read_open_\214lename</b>\(<code></code>\).).15 E
(<dt><b>archi)0 72 Q -.15(ve)-.25 G
(_read_open_\214lename</b>\(<code></code>\)<dd>).15 E 0 Cg EP
%%Page: 58 58
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Lik)0 12 Q(e)-.1 E(<b>archi)0 24 Q -.15(ve)-.25
G(_read_open</b>\(<code></code>\),).15 E -.15(ex)0 36 S
(cept that it accepts a simple \214lename and a block size.).15 E 2.5
(AN)0 48 S(ULL \214lename represents standard input.)-2.5 E
(This function is safe for use with tape dri)0 60 Q -.15(ve)-.25 G 2.5
(so).15 G 2.5(ro)-2.5 G(ther block)-2.5 E(ed de)-.1 E(vices.)-.25 E
(<dt><b>archi)0 72 Q -.15(ve)-.25 G
(_read_open_memory</b>\(<code></code>\)<dd>).15 E 0 Cg EP
%%Page: 59 59
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Lik)0 12 Q(e)-.1 E(<b>archi)0 24 Q -.15(ve)-.25
G(_read_open</b>\(<code></code>\),).15 E -.15(ex)0 36 S
(cept that it accepts a pointer and size of a block of).15 E
(memory containing the archi)0 48 Q .3 -.15(ve d)-.25 H(ata.).15 E
(<dt><b>archi)0 60 Q -.15(ve)-.25 G(_read_ne).15 E
(xt_header</b>\(<code></code>\)<dd>)-.15 E(Read the header for the ne)0
72 Q(xt entry and return a pointer to)-.15 E 0 Cg EP
%%Page: 60 60
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(a)0 12 Q(<font size="-1"></font><font size="-1"\
>struct</font><font size="-1"> archi)0 24 Q -.15(ve)-.25 G
(_entry</font>.).15 E(This is a con)0 36 Q -.15(ve)-.4 G
(nience wrapper around).15 E(<b>archi)0 48 Q -.15(ve)-.25 G(_read_ne).15
E(xt_header2</b>\(<code></code>\))-.15 E(that reuses an internal)0 60 Q
(<font size="-1"></font><font size="-1">struct</font><font size="-1"> a\
rchi)0 72 Q -.15(ve)-.25 G(_entry</font>).15 E 0 Cg EP
%%Page: 61 61
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(object for each request.)0 12 Q(<dt><b>archi)0
24 Q -.15(ve)-.25 G(_read_ne).15 E(xt_header2</b>\(<code></code>\)<dd>)
-.15 E(Read the header for the ne)0 36 Q(xt entry and populate the pro)
-.15 E(vided)-.15 E(<font size="-1"></font><font size="-1">struct</font\
><font size="-1"> archi)0 48 Q -.15(ve)-.25 G(_entry</font>.).15 E
(<dt><b>archi)0 60 Q -.15(ve)-.25 G(_read_data</b>\(<code></code>\)<dd>)
.15 E(Read data associated with the header just read.)0 72 Q 0 Cg EP
%%Page: 62 62
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Internally)0 12 Q 2.5(,t)-.65 G(his is a con)
-2.5 E -.15(ve)-.4 G(nience function that calls).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_data_block</b>\(<code></code>\)).15 E
(and \214lls an)0 36 Q 2.5(yg)-.15 G
(aps with nulls so that callers see a single)-2.55 E
(continuous stream of data.)0 48 Q(<dt><b>archi)0 60 Q -.15(ve)-.25 G
(_read_data_block</b>\(<code></code>\)<dd>).15 E(Return the ne)0 72 Q
(xt a)-.15 E -.25(va)-.2 G(ilable block of data for this entry).25 E(.)
-.65 E 0 Cg EP
%%Page: 63 63
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Unlik)0 12 Q(e)-.1 E(<b>archi)0 24 Q -.15(ve)
-.25 G(_read_data</b>\(<code></code>\),).15 E(the)0 36 Q(<b>archi)0 48 Q
-.15(ve)-.25 G(_read_data_block</b>\(<code></code>\)).15 E(function a)0
60 Q -.2(vo)-.2 G(ids cop).2 E(ying data and allo)-.1 E
(ws you to correctly handle)-.25 E
(sparse \214les, as supported by some archi)0 72 Q .3 -.15(ve f)-.25 H
(ormats.).15 E 0 Cg EP
%%Page: 64 64
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The library guarantees that of)0 12 Q
(fsets will increase and that blocks)-.25 E(will not o)0 24 Q -.15(ve)
-.15 G(rlap.).15 E
(Note that the blocks returned from this function can be much lar)0 36 Q
(ger)-.18 E(than the block size read from disk, due to compression)0 48
Q(and internal b)0 60 Q(uf)-.2 E(fer optimizations.)-.25 E(<dt><b>archi)
0 72 Q -.15(ve)-.25 G(_read_data_skip</b>\(<code></code>\)<dd>).15 E 0
Cg EP
%%Page: 65 65
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 2.5(Ac)0 12 S(on)-2.5 E -.15(ve)-.4 G
(nience function that repeatedly calls).15 E(<b>archi)0 24 Q -.15(ve)
-.25 G(_read_data_block</b>\(<code></code>\)).15 E
(to skip all of the data for this archi)0 36 Q .3 -.15(ve e)-.25 H(ntry)
.15 E(.)-.65 E(<dt><b>archi)0 48 Q -.15(ve)-.25 G(_read_data_into_b).15
E(uf)-.2 E(fer</b>\(<code></code>\)<dd>)-.25 E
(This function is deprecated and will be remo)0 60 Q -.15(ve)-.15 G(d.)
.15 E(Use)0 72 Q 0 Cg EP
%%Page: 66 66
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data</b>\(<code></code>\)).15 E(instead.)0 24 Q(<dt><b>archi)0 36
Q -.15(ve)-.25 G(_read_data_into_fd</b>\(<code></code>\)<dd>).15 E 2.5
(Ac)0 48 S(on)-2.5 E -.15(ve)-.4 G
(nience function that repeatedly calls).15 E(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_data_block</b>\(<code></code>\)).15 E(to cop)0 72 Q 2.5(yt)
-.1 G(he entire entry to the pro)-2.5 E(vided \214le descriptor)-.15 E
(.)-.55 E 0 Cg EP
%%Page: 67 67
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G(_read_e).15 E
(xtract</b>\(<code></code><b>archi)-.15 E -.15(ve)-.25 G(_read_e).15 E
(xtract_set_skip_\214le</b>\(<code></code>\)\)<dd>,)-.15 E 2.5(Ac)0 24 S
(on)-2.5 E -.15(ve)-.4 G(nience function that wraps the corresponding)
.15 E(<a href="../html3/archi)0 36 Q -.15(ve)-.25 G
(_write_disk.html">archi).15 E -.15(ve)-.25 G(_write_disk\(3\)</a>).15 E
(interf)0 48 Q(aces.)-.1 E(The \214rst call to)0 60 Q(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_e).15 E(xtract</b>\(<code></code>\))-.15 E 0 Cg EP
%%Page: 68 68
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(creates a restore object using)0 12 Q
(<a href="../html3/archi)0 24 Q -.15(ve)-.25 G(_write_disk_ne).15 E -.65
(w.)-.25 G(html">archi).65 E -.15(ve)-.25 G(_write_disk_ne).15 E
(w\(3\)</a>)-.25 E(and)0 36 Q(<a href="../html3/archi)0 48 Q -.15(ve)
-.25 G(_write_disk_set_standard_lookup.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_standard_lookup\(3\)</a>,).15 E(then transparently in)0
60 Q -.2(vo)-.4 G -.1(ke).2 G(s).1 E(<a href="../html3/archi)0 72 Q -.15
(ve)-.25 G(_write_disk_set_options.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_options\(3\)</a>,).15 E 0 Cg EP
%%Page: 69 69
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<a href="../html3/archi)0 12 Q -.15(ve)-.25 G
(_write_header).15 E(.html">archi)-.55 E -.15(ve)-.25 G
(_write_header\(3\)</a>,).15 E(<a href="../html3/archi)0 24 Q -.15(ve)
-.25 G(_write_data.html">archi).15 E -.15(ve)-.25 G
(_write_data\(3\)</a>,).15 E(and)0 36 Q(<a href="../html3/archi)0 48 Q
-.15(ve)-.25 G(_write_\214nish_entry).15 E(.html">archi)-.65 E -.15(ve)
-.25 G(_write_\214nish_entry\(3\)</a>).15 E
(to create the entry on disk and cop)0 60 Q 2.5(yd)-.1 G(ata into it.)
-2.5 E(The)0 72 Q 0 Cg EP
%%Page: 70 70
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<i></i><i>\215ags</i>)0 12 Q(ar)0 24 Q
(gument is passed unmodi\214ed to)-.18 E(<a href="../html3/archi)0 36 Q
-.15(ve)-.25 G(_write_disk_set_options.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_options\(3\)</a>.).15 E(<dt><b>archi)0 48 Q -.15(ve)
-.25 G(_read_e).15 E(xtract2</b>\(<code></code>\)<dd>)-.15 E
(This is another v)0 60 Q(ersion of)-.15 E(<b>archi)0 72 Q -.15(ve)-.25
G(_read_e).15 E(xtract</b>\(<code></code>\))-.15 E 0 Cg EP
%%Page: 71 71
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(that allo)0 12 Q(ws you to pro)-.25 E
(vide your o)-.15 E(wn restore object.)-.25 E(In particular)0 24 Q 2.5
(,t)-.4 G(his allo)-2.5 E(ws you to o)-.25 E -.15(ve)-.15 G
(rride the standard lookup functions).15 E(using)0 36 Q
(<a href="../html3/archi)0 48 Q -.15(ve)-.25 G
(_write_disk_set_group_lookup.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_group_lookup\(3\)</a>,).15 E(and)0 60 Q
(<a href="../html3/archi)0 72 Q -.15(ve)-.25 G
(_write_disk_set_user_lookup.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_user_lookup\(3\)</a>.).15 E 0 Cg EP
%%Page: 72 72
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Note that)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_e).15 E(xtract2</b>\(<code></code>\))-.15 E(does not accept a)0
36 Q(<i></i><i>\215ags</i>)0 48 Q(ar)0 60 Q(gument; you should use)-.18
E(<b>archi)0 72 Q -.15(ve)-.25 G
(_write_disk_set_options</b>\(<code></code>\)).15 E 0 Cg EP
%%Page: 73 73
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(to set the restore options yourself.)0 12 Q
(<dt><b>archi)0 24 Q -.15(ve)-.25 G(_read_e).15 E
(xtract_set_progress_callback</b>\(<code></code>\)<dd>)-.15 E
(Sets a pointer to a user)0 36 Q(-de\214ned callback that can be used)
-.2 E(for updating progress displays during e)0 48 Q(xtraction.)-.15 E
(The progress function will be in)0 60 Q -.2(vo)-.4 G -.1(ke).2 G 2.5
(dd).1 G(uring the e)-2.5 E(xtraction of lar)-.15 E(ge)-.18 E(re)0 72 Q
(gular \214les.)-.15 E 0 Cg EP
%%Page: 74 74
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The progress function will be in)0 12 Q -.2(vo)
-.4 G -.1(ke).2 G 2.5(dw).1 G(ith the pointer pro)-2.5 E
(vided to this call.)-.15 E(Generally)0 24 Q 2.5(,t)-.65 G
(he data pointed to should include a reference to the archi)-2.5 E -.15
(ve)-.25 G(object and the archi)0 36 Q -.15(ve)-.25 G
(_entry object so that v).15 E(arious statistics)-.25 E(can be retrie)0
48 Q -.15(ve)-.25 G 2.5(df).15 G(or the progress display)-2.5 E(.)-.65 E
(<dt><b>archi)0 60 Q -.15(ve)-.25 G
(_read_close</b>\(<code></code>\)<dd>).15 E(Complete the archi)0 72 Q .3
-.15(ve a)-.25 H(nd in).15 E -.2(vo)-.4 G .2 -.1(ke t).2 H
(he close callback.).1 E 0 Cg EP
%%Page: 75 75
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_\214nish</b>\(<code></code>\)<dd>).15 E(In)0 24 Q -.2(vo)-.4 G
-.1(ke).2 G(s).1 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_close</b>\(<code></code>\)).15 E(if it w)0 48 Q(as not in)-.1 E
-.2(vo)-.4 G -.1(ke).2 G 2.5(dm).1 G(anually)-2.5 E 2.5(,t)-.65 G
(hen release all resources.)-2.5 E(Note: In libarchi)0 60 Q .3 -.15
(ve 1)-.25 H(.x, this function w).15 E(as declared to return)-.1 E
(<br><br><code></code><code>v)0 72 Q(oid</code>,)-.2 E 0 Cg EP
%%Page: 76 76
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(which made it impossible to detect certain errors when)0 12 Q(<b>archi)
0 24 Q -.15(ve)-.25 G(_read_close</b>\(<code></code>\)).15 E -.1(wa)0 36
S 2.5(si).1 G -1.9 -.4(nv o)-2.5 H -.1(ke).4 G 2.5(di).1 G
(mplicitly from this function.)-2.5 E(The declaration is corrected be)0
48 Q(ginning with libarchi)-.15 E .3 -.15(ve 2)-.25 H(.0.).15 E(</dl>)0
60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 77 77
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(Note that the library determines most of the rele)0 12 Q -.25(va)-.25 G
(nt information about).25 E(the archi)0 24 Q .3 -.15(ve b)-.25 H 2.5(yi)
.15 G(nspection.)-2.5 E(In particular)0 36 Q 2.5(,i)-.4 G 2.5(ta)-2.5 G
(utomatically detects)-2.5 E(<a href="../html1/gzip.html">gzip\(1\)</a>)
0 48 Q(or)0 60 Q(<a href="../html1/bzip2.html">bzip2\(1\)</a>)0 72 Q 0
Cg EP
%%Page: 78 78
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(compression and transparently performs the appropriate decompression.)0
12 Q(It also automatically detects the archi)0 24 Q .3 -.15(ve f)-.25 H
(ormat.).15 E(<p>)36 36 Q 2.5(Ac)0 48 S(omplete description of the)-2.5
E(<font size="-1"></font><font size="-1">struct</font><font size="-1"> \
archi)0 60 Q -.15(ve)-.25 G(</font>).15 E(and)0 72 Q 0 Cg EP
%%Page: 79 79
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<font size="-1"></font><font size="-1">struct</\
font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(_entry</font>).15 E
(objects can be found in the o)0 24 Q -.15(ve)-.15 G(rvie).15 E 2.5(wm)
-.25 G(anual page for)-2.5 E(<a href="../html3/libarchi)0 36 Q -.15(ve)
-.25 G(.html">libarchi).15 E -.15(ve)-.25 G(\(3\)</a>.).15 E
(<h3 id="CLIENT CALLB)36 48 Q -.4(AC)-.35 G(KS">).4 E(CLIENT CALLB)36 60
Q -.4(AC)-.35 G(KS).4 E(</h3>)36 72 Q 0 Cg EP
%%Page: 80 80
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The callback functions must match the follo)0 12
Q(wing prototypes:)-.25 E(<dl>)0 24 Q(<p><dd>)0 36 Q
(<br><br><code></code><code>typedef</code><code> ssize_t</code>)0 48 Q
(<b>archi)0 60 Q -.15(ve)-.25 G(_read_callback</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 81 81
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>v)0 12 Q
(oid *client_data</code>)-.2 E(<code></code><code>const v)0 24 Q
(oid **b)-.2 E(uf)-.2 E(fer</code>)-.25 E(\))0 36 Q(<p><dd>)0 48 Q
(<br><br><code></code><code>typedef</code><code> int</code>)0 60 Q
(<b>archi)0 72 Q -.15(ve)-.25 G(_skip_callback</b>\(<code></code>).15 E
0 Cg EP
%%Page: 82 82
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>struct archi)0 12 Q .3 -.15
(ve *)-.25 H(</code>).15 E(<code></code><code>v)0 24 Q
(oid *client_data</code>)-.2 E(<code></code><code>size_t request</code>)
0 36 Q(\))0 48 Q(<p><dd>)0 60 Q
(<br><br><code></code><code>typedef</code><code> int</code>)0 72 Q 0 Cg
EP
%%Page: 83 83
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_open_callback</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
-.25 H(</code><code>, v).15 E(oid *client_data</code>\))-.2 E(<p><dd>)0
24 Q(<br><br><code></code><code>typedef</code><code> int</code>)0 36 Q
(<b>archi)0 48 Q -.15(ve)-.25 G
(_close_callback</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code><code>, v).15 E(oid *client_data</code>\))-.2 E
(</dl>)0 60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 84 84
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The open callback is in)0 12 Q -.2(vo)-.4 G -.1
(ke).2 G 2.5(db).1 G(y)-2.5 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_open</b>\(<code></code>\).).15 E(It should return)0 36 Q
(<b></b><b>ARCHIVE_OK</b>)0 48 Q
(if the underlying \214le or data source is successfully)0 60 Q(opened.)
0 72 Q 0 Cg EP
%%Page: 85 85
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(If the open f)0 12 Q(ails, it should call)-.1 E
(<b>archi)0 24 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15 E
(to re)0 36 Q(gister an error code and message and return)-.15 E
(<b></b><b>ARCHIVE_F)0 48 Q -1.21 -1.11(AT A)-.74 H(L</b>.)1.11 E(<p>)36
60 Q(The read callback is in)0 72 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G
(hene)-2.5 E -.15(ve)-.25 G 2.5(rt).15 G(he library)-2.5 E 0 Cg EP
%%Page: 86 86
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(requires ra)0 12 Q 2.5(wb)-.15 G
(ytes from the archi)-2.5 E -.15(ve)-.25 G(.).15 E
(The read callback should read data into a b)0 24 Q(uf)-.2 E(fer)-.25 E
(,)-.4 E(set the)0 36 Q(<code></code><code>const</code><code> v)0 48 Q
(oid</code><code> **b)-.2 E(uf)-.2 E(fer</code>)-.25 E(ar)0 60 Q
(gument to point to the a)-.18 E -.25(va)-.2 G(ilable data, and).25 E
(return a count of the number of bytes a)0 72 Q -.25(va)-.2 G(ilable.)
.25 E 0 Cg EP
%%Page: 87 87
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The library will in)0 12 Q -.2(vo)-.4 G .2 -.1
(ke t).2 H(he read callback ag).1 E(ain)-.05 E
(only after it has consumed this data.)0 24 Q
(The library imposes no constraints on the size)0 36 Q
(of the data blocks returned.)0 48 Q
(On end-of-\214le, the read callback should)0 60 Q(return zero.)0 72 Q 0
Cg EP
%%Page: 88 88
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(On error)0 12 Q 2.5(,t)-.4 G
(he read callback should in)-2.5 E -.2(vo)-.4 G -.1(ke).2 G(<b>archi)0
24 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15 E(to re)0 36 Q
(gister an error code and message and)-.15 E(return -1.)0 48 Q(<p>)36 60
Q(The skip callback is in)0 72 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G
(hen the)-2.5 E 0 Cg EP
%%Page: 89 89
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(library w)0 12 Q
(ants to ignore a block of data.)-.1 E(The return v)0 24 Q
(alue is the number of bytes actually)-.25 E(skipped, which may dif)0 36
Q(fer from the request.)-.25 E
(If the callback cannot skip data, it should return)0 48 Q(zero.)0 60 Q
(If the skip callback is not pro)0 72 Q(vided \(the)-.15 E 0 Cg EP
%%Page: 90 90
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(function pointer is)0 12 Q
(<code></code><code>NULL</code><code> \),</code>)0 24 Q
(the library will in)0 36 Q -.2(vo)-.4 G .2 -.1(ke t).2 H
(he read function).1 E(instead and simply discard the result.)0 48 Q 2.5
(As)0 60 S(kip callback can pro)-2.5 E(vide signi\214cant)-.15 E
(performance g)0 72 Q(ains when reading uncompressed)-.05 E 0 Cg EP
%%Page: 91 91
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(archi)0 12 Q -.15(ve)-.25 G 2.5(sf).15 G
(rom slo)-2.5 E 2.5(wd)-.25 G(isk dri)-2.5 E -.15(ve)-.25 G 2.5(so).15 G
2.5(ro)-2.5 G(ther media)-2.5 E(that can skip quickly)0 24 Q(.)-.65 E
(<p>)36 36 Q(The close callback is in)0 48 Q -.2(vo)-.4 G -.1(ke).2 G
2.5(db).1 G 2.5(ya)-2.5 G(rchi)-2.5 E -.15(ve)-.25 G(_close when).15 E
(the archi)0 60 Q .3 -.15(ve p)-.25 H(rocessing is complete.).15 E
(The callback should return)0 72 Q 0 Cg EP
%%Page: 92 92
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_OK</b>)0 12 Q(on success.)0 24
Q(On f)0 36 Q(ailure, the callback should in)-.1 E -.2(vo)-.4 G -.1(ke)
.2 G(<b>archi)0 48 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15
E(to re)0 60 Q(gister an error code and message and)-.15 E(return)0 72 Q
0 Cg EP
%%Page: 93 93
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_F)0 12 Q -1.21 -1.11(AT A)-.74
H(L.</b>)1.11 E(<h3 id="EXAMPLE">)36 24 Q(EXAMPLE)36 36 Q(</h3>)36 48 Q
(The follo)0 60 Q(wing illustrates basic usage of the library)-.25 E(.)
-.65 E(In this e)0 72 Q(xample,)-.15 E 0 Cg EP
%%Page: 94 94
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(the callback functions are simply wrappers around the standard)0 12 Q
(<a href="../html2/open.html">open\(2\)</a>,)0 24 Q
(<a href="../html2/read.html">read\(2\)</a>,)0 36 Q(and)0 48 Q
(<a href="../html2/close.html">close\(2\)</a>)0 60 Q(system calls.)0 72
Q 0 Cg EP
%%Page: 95 95
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dl compact><dt><dd>)0 12 Q(<code>)0 24 Q(<pre>)
0 36 Q -.2(vo)0 48 S(id).2 E(list_archi)0 60 Q -.15(ve)-.25 G
(\(const char *name\)).15 E({)0 72 Q 0 Cg EP
%%Page: 96 96
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(struct mydata *mydata;)5 12 Q(struct archi)5 24
Q .3 -.15(ve *)-.25 H(a;).15 E(struct archi)5 36 Q -.15(ve)-.25 G
(_entry *entry;).15 E(<p>)36 48 Q
(mydata = malloc\(sizeof\(struct mydata\)\);)5 60 Q 2.5(a=a)5 72 S(rchi)
-2.5 E -.15(ve)-.25 G(_read_ne).15 E(w\(\);)-.25 E 0 Cg EP
%%Page: 97 97
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(mydata->name = name;)5 12 Q(archi)5 24 Q -.15
(ve)-.25 G(_read_support_compression_all\(a\);).15 E(archi)5 36 Q -.15
(ve)-.25 G(_read_support_format_all\(a\);).15 E(archi)5 48 Q -.15(ve)
-.25 G(_read_open\(a, mydata, myopen, myread, myclose\);).15 E
(while \(archi)5 60 Q -.15(ve)-.25 G(_read_ne).15 E
(xt_header\(a, &entry\) == ARCHIVE_OK\) {)-.15 E(printf\("%s\\n",archi)
10 72 Q -.15(ve)-.25 G(_entry_pathname\(entry\)\);).15 E 0 Cg EP
%%Page: 98 98
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(archi)10 12 Q -.15(ve)-.25 G
(_read_data_skip\(a\);).15 E(})5 24 Q(archi)5 36 Q -.15(ve)-.25 G
(_read_\214nish\(a\);).15 E(free\(mydata\);)5 48 Q(})0 60 Q(<p>)36 72 Q
0 Cg EP
%%Page: 99 99
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(ssize_t)0 12 Q(myread\(struct archi)0 24 Q .3
-.15(ve *)-.25 H(a, v).15 E(oid *client_data, const v)-.2 E(oid **b)-.2
E(uf)-.2 E(f\))-.25 E({)0 36 Q(struct mydata *mydata = client_data;)5 48
Q(<p>)36 60 Q(*b)5 72 Q(uf)-.2 E 2.5(f=m)-.25 G(ydata->b)-2.5 E(uf)-.2 E
(f;)-.25 E 0 Cg EP
%%Page: 100 100
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(return \(read\(mydata->fd, mydata->b)5 12 Q(uf)
-.2 E(f, 10240\)\);)-.25 E(})0 24 Q(<p>)36 36 Q(int)0 48 Q
(myopen\(struct archi)0 60 Q .3 -.15(ve *)-.25 H(a, v).15 E
(oid *client_data\))-.2 E({)0 72 Q 0 Cg EP
%%Page: 101 101
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(struct mydata *mydata = client_data;)5 12 Q(<p>)
36 24 Q(mydata->fd = open\(mydata->name, O_RDONL)5 36 Q(Y\);)-1 E
(return \(mydata->fd >= 0 ? ARCHIVE_OK : ARCHIVE_F)5 48 Q -1.21 -1.11
(AT A)-.74 H(L\);)1.11 E(})0 60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 102 102
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(int)0 12 Q(myclose\(struct archi)0 24 Q .3 -.15
(ve *)-.25 H(a, v).15 E(oid *client_data\))-.2 E({)0 36 Q
(struct mydata *mydata = client_data;)5 48 Q(<p>)36 60 Q
(if \(mydata->fd > 0\))5 72 Q 0 Cg EP
%%Page: 103 103
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(close\(mydata->fd\);)10 12 Q
(return \(ARCHIVE_OK\);)5 24 Q(})0 36 Q(</pre>)0 48 Q(</code>)0 60 Q
(</dl>)0 72 Q 0 Cg EP
%%Page: 104 104
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="RETURN V)36 12 Q(ALUES">)-1.35 E
(RETURN V)36 24 Q(ALUES)-1.35 E(</h3>)36 36 Q
(Most functions return zero on success, non-zero on error)0 48 Q(.)-.55
E(The possible return codes include:)0 60 Q(<b></b><b>ARCHIVE_OK</b>)0
72 Q 0 Cg EP
%%Page: 105 105
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(\(the operation succeeded\),)0 12 Q
(<b></b><b>ARCHIVE_W)0 24 Q(ARN</b>)-1.2 E(\(the operation succeeded b)0
36 Q(ut a non-critical error w)-.2 E(as encountered\),)-.1 E
(<b></b><b>ARCHIVE_EOF</b>)0 48 Q(\(end-of-archi)0 60 Q .3 -.15(ve w)
-.25 H(as encountered\),).05 E(<b></b><b>ARCHIVE_RETR)0 72 Q(Y</b>)-.65
E 0 Cg EP
%%Page: 106 106
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(\(the operation f)0 12 Q(ailed b)-.1 E
(ut can be retried\),)-.2 E(and)0 24 Q(<b></b><b>ARCHIVE_F)0 36 Q -1.21
-1.11(AT A)-.74 H(L</b>)1.11 E(\(there w)0 48 Q(as a f)-.1 E
(atal error; the archi)-.1 E .3 -.15(ve s)-.25 H
(hould be closed immediately\).).15 E(Detailed error codes and te)0 60 Q
(xtual descriptions are a)-.15 E -.25(va)-.2 G(ilable from the).25 E
(<b>archi)0 72 Q -.15(ve)-.25 G(_errno</b>\(<code></code>\)).15 E 0 Cg
EP
%%Page: 107 107
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G
(_error_string</b>\(<code></code>\)).15 E(functions.)0 36 Q(<p>)36 48 Q
(<b>archi)0 60 Q -.15(ve)-.25 G(_read_ne).15 E(w</b>\(<code></code>\))
-.25 E(returns a pointer to a freshly allocated)0 72 Q 0 Cg EP
%%Page: 108 108
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<font size="-1"></font><font size="-1">struct</\
font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(</font>).15 E(object.)
0 24 Q(It returns)0 36 Q(<code></code><code>NULL</code>)0 48 Q(on error)
0 60 Q(.)-.55 E(<p>)36 72 Q 0 Cg EP
%%Page: 109 109
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data</b>\(<code></code>\)).15 E
(returns a count of bytes actually read or zero at the end of the entry)
0 24 Q(.)-.65 E(On error)0 36 Q 2.5(,av)-.4 G(alue of)-2.75 E
(<b></b><b>ARCHIVE_F)0 48 Q -1.21 -1.11(AT A)-.74 H(L</b>,)1.11 E
(<b></b><b>ARCHIVE_W)0 60 Q(ARN</b>,)-1.2 E(or)0 72 Q 0 Cg EP
%%Page: 110 110
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_RETR)0 12 Q(Y</b>)-.65 E
(is returned and an error code and te)0 24 Q
(xtual description can be retrie)-.15 E -.15(ve)-.25 G 2.5(df).15 G
(rom the)-2.5 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_errno</b>\(<code></code>\)).15 E(and)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_error_string</b>\(<code></code>\)).15 E(functions.)0 72 Q 0 Cg
EP
%%Page: 111 111
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p>)36 12 Q(The library e)0 24 Q
(xpects the client callbacks to beha)-.15 E .3 -.15(ve s)-.2 H(imilarly)
.15 E(.)-.65 E(If there is an error)0 36 Q 2.5(,y)-.4 G(ou can use)-2.5
E(<b>archi)0 48 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15 E
(to set an appropriate error code and description,)0 60 Q
(then return one of the non-zero v)0 72 Q(alues abo)-.25 E -.15(ve)-.15
G(.).15 E 0 Cg EP
%%Page: 112 112
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(\(Note that the v)0 12 Q(alue e)-.25 E -.15(ve)
-.25 G(ntually returned to the client may).15 E(not be the same; man)0
24 Q 2.5(ye)-.15 G(rrors that are not critical at the le)-2.5 E -.15(ve)
-.25 G(l).15 E(of basic I/O can pre)0 36 Q -.15(ve)-.25 G(nt the archi)
.15 E .3 -.15(ve f)-.25 H(rom being properly read,).15 E
(thus most I/O errors e)0 48 Q -.15(ve)-.25 G(ntually cause).15 E
(<b></b><b>ARCHIVE_F)0 60 Q -1.21 -1.11(AT A)-.74 H(L</b>)1.11 E
(to be returned.\))0 72 Q 0 Cg EP
%%Page: 113 113
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="SEE ALSO">)36 12 Q(SEE ALSO)36 24 Q
(</h3>)36 36 Q(<a href="../html1/tar)0 48 Q(.html">tar\(1\)</a>,)-.55 E
(<a href="../html3/archi)0 60 Q -.15(ve)-.25 G(.html">archi).15 E -.15
(ve)-.25 G(\(3\)</a>,).15 E(<a href="../html3/archi)0 72 Q -.15(ve)-.25
G(_util.html">archi).15 E -.15(ve)-.25 G(_util\(3\)</a>,).15 E 0 Cg EP
%%Page: 114 114
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<a href="../html5/tar)0 12 Q
(.html">tar\(5\)</a>)-.55 E(<h3 id="HIST)36 24 Q(OR)-.18 E(Y">)-.65 E
(HIST)36 36 Q(OR)-.18 E(Y)-.65 E(</h3>)36 48 Q(The)0 60 Q(<b>libarchi)0
72 Q -.15(ve)-.25 G(</b>).15 E 0 Cg EP
%%Page: 115 115
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(library \214rst appeared in)0 12 Q(FreeBSD5.3.)0
24 Q(<h3 id="A)36 36 Q(UTHORS">)-.55 E -.55(AU)36 48 S(THORS).55 E
(</h3>)36 60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 116 116
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The)0 12 Q(<b>libarchi)0 24 Q -.15(ve)-.25 G
(</b>).15 E(library w)0 36 Q(as written by)-.1 E -.35(Ti)0 48 S 2.5(mK)
.35 G(ientzle &lt;kientzle@@acm.or)-2.5 E(g&gt;.)-.18 E(<h3 id="B)36 60 Q
(UGS">)-.1 E -.1(BU)36 72 S(GS).1 E 0 Cg EP
%%Page: 117 117
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</h3>)36 12 Q(Man)0 24 Q 2.5(yt)-.15 G
(raditional archi)-2.5 E -.15(ve)-.25 G 2.5(rp).15 G(rograms treat)-2.5
E(empty \214les as v)0 36 Q(alid empty archi)-.25 E -.15(ve)-.25 G(s.)
.15 E -.15(Fo)0 48 S 2.5(re).15 G(xample, man)-2.65 E 2.5(yi)-.15 G
(mplementations of)-2.5 E(<a href="../html1/tar)0 60 Q
(.html">tar\(1\)</a>)-.55 E(allo)0 72 Q 2.5(wy)-.25 G
(ou to append entries to an empty \214le.)-2.5 E 0 Cg EP
%%Page: 118 118
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(Of course, it is impossible to determine the format of an empty \214le)
0 12 Q
(by inspecting the contents, so this library treats empty \214les as)0
24 Q(ha)0 36 Q(ving a special)-.2 E -.74(``)0 48 S(empty').74 E(')-.74 E
(format.)0 60 Q(</body>)0 72 Q 0 Cg EP
%%Trailer
end
%%EOF
@


1.1.1.3
log
@libarchive-2.8.3: Build fix for Linux
@
text
@d1 1509
a1509 820
<!-- Creator     : groff version 1.19.2 -->
<!-- CreationDate: Sun Mar 14 19:50:17 2010 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p     { margin-top: 0; margin-bottom: 0; }
       pre   { margin-top: 0; margin-bottom: 0; }
       table { margin-top: 0; margin-bottom: 0; }
</style>
<title></title>
</head>
<body>

<hr>


<p valign="top">archive_read(3) FreeBSD Library Functions
Manual archive_read(3)</p>

<p style="margin-top: 1em" valign="top"><b>NAME</b></p>

<p style="margin-left:8%;"><b>archive_read_new</b>,
<b>archive_read_set_filter_options</b>,
<b>archive_read_set_format_options</b>,
<b>archive_read_set_options</b>,
<b>archive_read_support_compression_all</b>,
<b>archive_read_support_compression_bzip2</b>,
<b>archive_read_support_compression_compress</b>,
<b>archive_read_support_compression_gzip</b>,
<b>archive_read_support_compression_lzma</b>,
<b>archive_read_support_compression_none</b>,
<b>archive_read_support_compression_xz</b>,
<b>archive_read_support_compression_program</b>,
<b>archive_read_support_compression_program_signature</b>,
<b>archive_read_support_format_all</b>,
<b>archive_read_support_format_ar</b>,
<b>archive_read_support_format_cpio</b>,
<b>archive_read_support_format_empty</b>,
<b>archive_read_support_format_iso9660</b>,
<b>archive_read_support_format_mtree,
archive_read_support_format_raw,
archive_read_support_format_tar</b>,
<b>archive_read_support_format_zip</b>,
<b>archive_read_open</b>, <b>archive_read_open2</b>,
<b>archive_read_open_fd</b>, <b>archive_read_open_FILE</b>,
<b>archive_read_open_filename</b>,
<b>archive_read_open_memory</b>,
<b>archive_read_next_header</b>,
<b>archive_read_next_header2</b>, <b>archive_read_data</b>,
<b>archive_read_data_block</b>,
<b>archive_read_data_skip</b>,
<b>archive_read_data_into_buffer</b>,
<b>archive_read_data_into_fd</b>,
<b>archive_read_extract</b>, <b>archive_read_extract2</b>,
<b>archive_read_extract_set_progress_callback</b>,
<b>archive_read_close</b>, <b>archive_read_finish</b>
&mdash; functions for reading streaming archives</p>


<p style="margin-top: 1em" valign="top"><b>SYNOPSIS</b></p>

<p style="margin-left:8%;"><b>#include
&lt;archive.h&gt;</b></p>

<p style="margin-left:8%; margin-top: 1em"><i>struct
archive *</i></p>


<p style="margin-left:14%;"><b>archive_read_new</b>(<i>void</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_all</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_bzip2</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_compress</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_gzip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_lzma</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_none</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_compression_xz</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_support_compression_program</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*cmd</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_support_compression_program_signature</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*cmd</i>,
<i>const&nbsp;void&nbsp;*signature</i>,
<i>size_t&nbsp;signature_length</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_all</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_ar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_cpio</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_empty</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_iso9660</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_mtree</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_raw</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_tar</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_support_format_zip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_set_filter_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_set_format_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_set_options</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_open</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>archive_open_callback&nbsp;*</i>,
<i>archive_read_callback&nbsp;*</i>,
<i>archive_close_callback&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_open2</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>archive_open_callback&nbsp;*</i>,
<i>archive_read_callback&nbsp;*</i>,
<i>archive_skip_callback&nbsp;*</i>,
<i>archive_close_callback&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_open_FILE</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>FILE&nbsp;*file</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_open_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>int&nbsp;fd</i>, <i>size_t&nbsp;block_size</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_open_filename</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;char&nbsp;*filename</i>,
<i>size_t&nbsp;block_size</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_open_memory</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*buff</i>, <i>size_t&nbsp;size</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_next_header</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>struct&nbsp;archive_entry&nbsp;**</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_next_header2</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>struct&nbsp;archive_entry&nbsp;*</i>);</p>


<p style="margin-left:8%; margin-top: 1em"><i>ssize_t</i></p>


<p style="margin-left:14%;"><b>archive_read_data</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*buff</i>, <i>size_t&nbsp;len</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_data_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>const&nbsp;void&nbsp;**buff</i>, <i>size_t&nbsp;*len</i>,
<i>off_t&nbsp;*offset</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_data_skip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_data_into_buffer</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*</i>, <i>ssize_t&nbsp;len</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_data_into_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>int&nbsp;fd</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_extract</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>struct&nbsp;archive_entry&nbsp;*</i>,
<i>int&nbsp;flags</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p valign="top"><b>archive_read_extract2</b>(<i>struct&nbsp;archive&nbsp;*src</i>,
<i>struct&nbsp;archive_entry&nbsp;*</i>,
<i>struct&nbsp;archive&nbsp;*dest</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>void</i></p>


<p valign="top"><b>archive_read_extract_set_progress_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;(*func)(void&nbsp;*)</i>,
<i>void&nbsp;*user_data</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_close</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>

<p style="margin-left:8%; margin-top: 1em"><i>int</i></p>


<p style="margin-left:14%;"><b>archive_read_finish</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>


<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>

<p style="margin-left:8%;">These functions provide a
complete API for reading streaming archives. The general
process is to first create the struct archive object, set
options, initialize the reader, iterate over the archive
headers and associated data, then close the archive and
release all resources. The following summary describes the
functions in approximately the order they would be used:</p>

<p valign="top"><b>archive_read_new</b>()</p>

<p style="margin-left:20%;">Allocates and initializes a
struct archive object suitable for reading from an
archive.</p>


<p valign="top"><b>archive_read_support_compression_bzip2</b>(),
<b>archive_read_support_compression_compress</b>(),
<b>archive_read_support_compression_gzip</b>(),
<b>archive_read_support_compression_lzma</b>(),
<b>archive_read_support_compression_none</b>(),
<b>archive_read_support_compression_xz</b>()</p>

<p style="margin-left:20%;">Enables auto-detection code and
decompression support for the specified compression. Returns
<b>ARCHIVE_OK</b> if the compression is fully supported, or
<b>ARCHIVE_WARN</b> if the compression is supported only
through an external program. Note that decompression using
an external program is usually slower than decompression
through built-in libraries. Note that
&lsquo;&lsquo;none&rsquo;&rsquo; is always enabled by
default.</p>


<p valign="top"><b>archive_read_support_compression_all</b>()</p>

<p style="margin-left:20%;">Enables all available
decompression filters.</p>


<p valign="top"><b>archive_read_support_compression_program</b>()</p>

<p style="margin-left:20%;">Data is fed through the
specified external program before being dearchived. Note
that this disables automatic detection of the compression
format, so it makes no sense to specify this in conjunction
with any other decompression option.</p>


<p valign="top"><b>archive_read_support_compression_program_signature</b>()</p>

<p style="margin-left:20%;">This feeds data through the
specified external program but only if the initial bytes of
the data match the specified signature value.</p>

<p valign="top"><b>archive_read_support_format_all</b>(),
<b>archive_read_support_format_ar</b>(),
<b>archive_read_support_format_cpio</b>(),
<b>archive_read_support_format_empty</b>(),
<b>archive_read_support_format_iso9660</b>(),
<b>archive_read_support_format_mtree</b>(),
<b>archive_read_support_format_tar</b>(),
<b>archive_read_support_format_zip</b>()</p>

<p style="margin-left:20%;">Enables support---including
auto-detection code---for the specified archive format. For
example, <b>archive_read_support_format_tar</b>() enables
support for a variety of standard tar formats, old-style
tar, ustar, pax interchange format, and many common
variants. For convenience,
<b>archive_read_support_format_all</b>() enables support for
all available formats. Only empty archives are supported by
default.</p>


<p valign="top"><b>archive_read_support_format_raw</b>()</p>

<p style="margin-left:20%;">The
&lsquo;&lsquo;raw&rsquo;&rsquo; format handler allows
libarchive to be used to read arbitrary data. It treats any
data stream as an archive with a single entry. The pathname
of this entry is &lsquo;&lsquo;data&rsquo;&rsquo;; all other
entry fields are unset. This is not enabled by
<b>archive_read_support_format_all</b>() in order to avoid
erroneous handling of damaged archives.</p>

<p valign="top"><b>archive_read_set_filter_options</b>(),
<b>archive_read_set_format_options</b>(),
<b>archive_read_set_options</b>()</p>

<p style="margin-left:20%;">Specifies options that will be
passed to currently-registered filters (including
decompression filters) and/or format readers. The argument
is a comma-separated list of individual options. Individual
options have one of the following forms:</p>

<p valign="top"><i>option=value</i></p>

<p style="margin-left:32%;">The option/value pair will be
provided to every module. Modules that do not accept an
option with this name will ignore it.</p>

<p valign="top"><i>option</i></p>

<p style="margin-left:32%; margin-top: 1em">The option will
be provided to every module with a value of
&lsquo;&lsquo;1&rsquo;&rsquo;.</p>

<p valign="top"><i>!option</i></p>

<p style="margin-left:32%;">The option will be provided to
every module with a NULL value.</p>

<p valign="top"><i>module:option=value</i>,
<i>module:option</i>, <i>module:!option</i></p>

<p style="margin-left:32%;">As above, but the corresponding
option and value will be provided only to modules whose name
matches <i>module</i>.</p>

<p style="margin-left:20%;">The return value will be
<b>ARCHIVE_OK</b> if any module accepts the option, or
<b>ARCHIVE_WARN</b> if no module accepted the option, or
<b>ARCHIVE_FATAL</b> if there was a fatal error while
attempting to process the option.</p>

<p style="margin-left:20%; margin-top: 1em">The currently
supported options are:</p>

<p valign="top">Format iso9660 <b><br>
joliet</b></p>

<p style="margin-left:45%; margin-top: 1em">Support Joliet
extensions. Defaults to enabled, use <b>!joliet</b> to
disable.</p>

<p valign="top"><b>archive_read_open</b>()</p>

<p style="margin-left:20%;">The same as
<b>archive_read_open2</b>(), except that the skip callback
is assumed to be NULL.</p>

<p valign="top"><b>archive_read_open2</b>()</p>

<p style="margin-left:20%;">Freeze the settings, open the
archive, and prepare for reading entries. This is the most
generic version of this call, which accepts four callback
functions. Most clients will want to use
<b>archive_read_open_filename</b>(),
<b>archive_read_open_FILE</b>(),
<b>archive_read_open_fd</b>(), or
<b>archive_read_open_memory</b>() instead. The library
invokes the client-provided functions to obtain raw bytes
from the archive.</p>

<p valign="top"><b>archive_read_open_FILE</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a <i>FILE
*</i> pointer. This function should not be used with tape
drives or other devices that require strict I/O
blocking.</p>

<p valign="top"><b>archive_read_open_fd</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a file
descriptor and block size rather than a set of function
pointers. Note that the file descriptor will not be
automatically closed at end-of-archive. This function is
safe for use with tape drives or other blocked devices.</p>

<p valign="top"><b>archive_read_open_file</b>()</p>

<p style="margin-left:20%;">This is a deprecated synonym
for <b>archive_read_open_filename</b>().</p>

<p valign="top"><b>archive_read_open_filename</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a simple
filename and a block size. A NULL filename represents
standard input. This function is safe for use with tape
drives or other blocked devices.</p>

<p valign="top"><b>archive_read_open_memory</b>()</p>

<p style="margin-left:20%;">Like
<b>archive_read_open</b>(), except that it accepts a pointer
and size of a block of memory containing the archive
data.</p>

<p valign="top"><b>archive_read_next_header</b>()</p>

<p style="margin-left:20%;">Read the header for the next
entry and return a pointer to a struct archive_entry. This
is a convenience wrapper around
<b>archive_read_next_header2</b>() that reuses an internal
struct archive_entry object for each request.</p>

<p valign="top"><b>archive_read_next_header2</b>()</p>

<p style="margin-left:20%;">Read the header for the next
entry and populate the provided struct archive_entry.</p>

<p valign="top"><b>archive_read_data</b>()</p>

<p style="margin-left:20%;">Read data associated with the
header just read. Internally, this is a convenience function
that calls <b>archive_read_data_block</b>() and fills any
gaps with nulls so that callers see a single continuous
stream of data.</p>

<p valign="top"><b>archive_read_data_block</b>()</p>

<p style="margin-left:20%;">Return the next available block
of data for this entry. Unlike <b>archive_read_data</b>(),
the <b>archive_read_data_block</b>() function avoids copying
data and allows you to correctly handle sparse files, as
supported by some archive formats. The library guarantees
that offsets will increase and that blocks will not overlap.
Note that the blocks returned from this function can be much
larger than the block size read from disk, due to
compression and internal buffer optimizations.</p>

<p valign="top"><b>archive_read_data_skip</b>()</p>

<p style="margin-left:20%;">A convenience function that
repeatedly calls <b>archive_read_data_block</b>() to skip
all of the data for this archive entry.</p>

<p valign="top"><b>archive_read_data_into_buffer</b>()</p>

<p style="margin-left:20%;">This function is deprecated and
will be removed. Use <b>archive_read_data</b>() instead.</p>

<p valign="top"><b>archive_read_data_into_fd</b>()</p>

<p style="margin-left:20%;">A convenience function that
repeatedly calls <b>archive_read_data_block</b>() to copy
the entire entry to the provided file descriptor.</p>

<p valign="top"><b>archive_read_extract</b>(),
<b>archive_read_extract_set_skip_file</b>()</p>

<p style="margin-left:20%;">A convenience function that
wraps the corresponding archive_write_disk(3) interfaces.
The first call to <b>archive_read_extract</b>() creates a
restore object using archive_write_disk_new(3) and
archive_write_disk_set_standard_lookup(3), then
transparently invokes archive_write_disk_set_options(3),
archive_write_header(3), archive_write_data(3), and
archive_write_finish_entry(3) to create the entry on disk
and copy data into it. The <i>flags</i> argument is passed
unmodified to archive_write_disk_set_options(3).</p>

<p valign="top"><b>archive_read_extract2</b>()</p>

<p style="margin-left:20%;">This is another version of
<b>archive_read_extract</b>() that allows you to provide
your own restore object. In particular, this allows you to
override the standard lookup functions using
archive_write_disk_set_group_lookup(3), and
archive_write_disk_set_user_lookup(3). Note that
<b>archive_read_extract2</b>() does not accept a
<i>flags</i> argument; you should use
<b>archive_write_disk_set_options</b>() to set the restore
options yourself.</p>


<p valign="top"><b>archive_read_extract_set_progress_callback</b>()</p>

<p style="margin-left:20%;">Sets a pointer to a
user-defined callback that can be used for updating progress
displays during extraction. The progress function will be
invoked during the extraction of large regular files. The
progress function will be invoked with the pointer provided
to this call. Generally, the data pointed to should include
a reference to the archive object and the archive_entry
object so that various statistics can be retrieved for the
progress display.</p>

<p valign="top"><b>archive_read_close</b>()</p>

<p style="margin-left:20%;">Complete the archive and invoke
the close callback.</p>

<p valign="top"><b>archive_read_finish</b>()</p>

<p style="margin-left:20%;">Invokes
<b>archive_read_close</b>() if it was not invoked manually,
then release all resources. Note: In libarchive 1.x, this
function was declared to return <i>void</i>, which made it
impossible to detect certain errors when
<b>archive_read_close</b>() was invoked implicitly from this
function. The declaration is corrected beginning with
libarchive 2.0.</p>

<p style="margin-left:8%; margin-top: 1em">Note that the
library determines most of the relevant information about
the archive by inspection. In particular, it automatically
detects gzip(1) or bzip2(1) compression and transparently
performs the appropriate decompression. It also
automatically detects the archive format.</p>

<p style="margin-left:8%; margin-top: 1em">A complete
description of the struct archive and struct archive_entry
objects can be found in the overview manual page for
libarchive(3).</p>

<p style="margin-top: 1em" valign="top"><b>CLIENT
CALLBACKS</b></p>

<p style="margin-left:8%;">The callback functions must
match the following prototypes:</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
ssize_t</i></p>


<p valign="top"><b>archive_read_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>const&nbsp;void&nbsp;**buffer</i>)</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
int</i></p>


<p valign="top"><b>archive_skip_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>,
<i>void&nbsp;*client_data</i>,
<i>size_t&nbsp;request</i>)</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
int</i> <b>archive_open_callback</b>(<i>struct archive
*</i>, <i>void *client_data</i>)</p>

<p style="margin-left:17%; margin-top: 1em"><i>typedef
int</i> <b>archive_close_callback</b>(<i>struct archive
*</i>, <i>void *client_data</i>)</p>

<p style="margin-left:8%; margin-top: 1em">The open
callback is invoked by <b>archive_open</b>(). It should
return <b>ARCHIVE_OK</b> if the underlying file or data
source is successfully opened. If the open fails, it should
call <b>archive_set_error</b>() to register an error code
and message and return <b>ARCHIVE_FATAL</b>.</p>

<p style="margin-left:8%; margin-top: 1em">The read
callback is invoked whenever the library requires raw bytes
from the archive. The read callback should read data into a
buffer, set the const void **buffer argument to point to the
available data, and return a count of the number of bytes
available. The library will invoke the read callback again
only after it has consumed this data. The library imposes no
constraints on the size of the data blocks returned. On
end-of-file, the read callback should return zero. On error,
the read callback should invoke <b>archive_set_error</b>()
to register an error code and message and return -1.</p>

<p style="margin-left:8%; margin-top: 1em">The skip
callback is invoked when the library wants to ignore a block
of data. The return value is the number of bytes actually
skipped, which may differ from the request. If the callback
cannot skip data, it should return zero. If the skip
callback is not provided (the function pointer is NULL ),
the library will invoke the read function instead and simply
discard the result. A skip callback can provide significant
performance gains when reading uncompressed archives from
slow disk drives or other media that can skip quickly.</p>

<p style="margin-left:8%; margin-top: 1em">The close
callback is invoked by archive_close when the archive
processing is complete. The callback should return
<b>ARCHIVE_OK</b> on success. On failure, the callback
should invoke <b>archive_set_error</b>() to register an
error code and message and return <b>ARCHIVE_FATAL.</b></p>

<p style="margin-top: 1em" valign="top"><b>EXAMPLE</b></p>

<p style="margin-left:8%;">The following illustrates basic
usage of the library. In this example, the callback
functions are simply wrappers around the standard open(2),
read(2), and close(2) system calls.</p>

<p style="margin-left:17%; margin-top: 1em">void <br>
list_archive(const char *name) <br>
{ <br>
struct mydata *mydata; <br>
struct archive *a; <br>
struct archive_entry *entry;</p>

<p style="margin-left:17%; margin-top: 1em">mydata =
malloc(sizeof(struct mydata)); <br>
a = archive_read_new(); <br>
mydata-&gt;name = name; <br>
archive_read_support_compression_all(a); <br>
archive_read_support_format_all(a); <br>
archive_read_open(a, mydata, myopen, myread, myclose); <br>
while (archive_read_next_header(a, &amp;entry) ==
ARCHIVE_OK) { <br>
printf(&quot;%s\n&quot;,archive_entry_pathname(entry)); <br>
archive_read_data_skip(a); <br>
} <br>
archive_read_finish(a); <br>
free(mydata); <br>
}</p>

<p style="margin-left:17%; margin-top: 1em">ssize_t <br>
myread(struct archive *a, void *client_data, const void
**buff) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:17%; margin-top: 1em">*buff =
mydata-&gt;buff; <br>
return (read(mydata-&gt;fd, mydata-&gt;buff, 10240)); <br>
}</p>

<p style="margin-left:17%; margin-top: 1em">int <br>
myopen(struct archive *a, void *client_data) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:17%; margin-top: 1em">mydata-&gt;fd =
open(mydata-&gt;name, O_RDONLY); <br>
return (mydata-&gt;fd &gt;= 0 ? ARCHIVE_OK : ARCHIVE_FATAL);
<br>
}</p>

<p style="margin-left:17%; margin-top: 1em">int <br>
myclose(struct archive *a, void *client_data) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:17%; margin-top: 1em">if
(mydata-&gt;fd &gt; 0) <br>
close(mydata-&gt;fd); <br>
return (ARCHIVE_OK); <br>
}</p>

<p style="margin-top: 1em" valign="top"><b>RETURN
VALUES</b></p>

<p style="margin-left:8%;">Most functions return zero on
success, non-zero on error. The possible return codes
include: <b>ARCHIVE_OK</b> (the operation succeeded),
<b>ARCHIVE_WARN</b> (the operation succeeded but a
non-critical error was encountered), <b>ARCHIVE_EOF</b>
(end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the
operation failed but can be retried), and
<b>ARCHIVE_FATAL</b> (there was a fatal error; the archive
should be closed immediately). Detailed error codes and
textual descriptions are available from the
<b>archive_errno</b>() and <b>archive_error_string</b>()
functions.</p>


<p style="margin-left:8%; margin-top: 1em"><b>archive_read_new</b>()
returns a pointer to a freshly allocated struct archive
object. It returns NULL on error.</p>


<p style="margin-left:8%; margin-top: 1em"><b>archive_read_data</b>()
returns a count of bytes actually read or zero at the end of
the entry. On error, a value of <b>ARCHIVE_FATAL</b>,
<b>ARCHIVE_WARN</b>, or <b>ARCHIVE_RETRY</b> is returned and
an error code and textual description can be retrieved from
the <b>archive_errno</b>() and <b>archive_error_string</b>()
functions.</p>

<p style="margin-left:8%; margin-top: 1em">The library
expects the client callbacks to behave similarly. If there
is an error, you can use <b>archive_set_error</b>() to set
an appropriate error code and description, then return one
of the non-zero values above. (Note that the value
eventually returned to the client may not be the same; many
errors that are not critical at the level of basic I/O can
prevent the archive from being properly read, thus most I/O
errors eventually cause <b>ARCHIVE_FATAL</b> to be
returned.)</p>

<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>

<p style="margin-left:8%;">tar(1), archive(3),
archive_util(3), tar(5)</p>

<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>

<p style="margin-left:8%;">The <b>libarchive</b> library
first appeared in FreeBSD&nbsp;5.3.</p>

<p style="margin-top: 1em" valign="top"><b>AUTHORS</b></p>

<p style="margin-left:8%;">The <b>libarchive</b> library
was written by Tim Kientzle
&lang;kientzle@@acm.org&rang;.</p>

<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>

<p style="margin-left:8%;">Many traditional archiver
programs treat empty files as valid empty archives. For
example, many implementations of tar(1) allow you to append
entries to an empty file. Of course, it is impossible to
determine the format of an empty file by inspecting the
contents, so this library treats empty files as having a
special &lsquo;&lsquo;empty&rsquo;&rsquo; format.</p>


<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;9.0
April&nbsp;13, 2009 FreeBSD&nbsp;9.0</p>
<hr>
</body>
</html>
@


1.1.1.4
log
@Import libarchive-2.8.4:
- Improved reliability of hash function detection
- Fix issues on ancient FreeBSD, QNX, ancient NetBSD and Minix
@
text
@d1 820
a820 1509
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Wed Jun 30 11:55:52 2010
%%DocumentNeededResources: font Times-Roman
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 118
%%PageOrder: Ascend
%%DocumentMedia: Default 612 792 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.19 2
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/Fr{
setrgbcolor fill
}bind def
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
/Fg{
setgray fill
}bind def
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
/setcmykcolor where{
pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
/setpagedevice{}def
}bind def
/PEND{
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Roman
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Roman@@0 ENC0/Times-Roman RE
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<html>)0 12 Q(<head>)0 24 Q(<title>)36 36 Q
(April 13, 2009 archi)74.5 48 Q -.15(ve)-.25 G(_read 3).15 E(</title>)36
72 Q 0 Cg EP
%%Page: 2 2
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<style type="te)36 12 Q(xt/css">)-.15 E(<!--)36
24 Q(body { mar)72 36 Q(gin-left:4%; })-.18 E(H1, H2, H3, H4, H5 {)72 48
Q(color: maroon; padding: 4pt; mar)108 60 Q(gin-left: -4%;)-.18 E
(border: solid; border)108 72 Q(-width: thin; width: 100%;)-.2 E 0 Cg EP
%%Page: 3 3
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(background: r)108 12 Q(gb\(204,204,255\))-.18 E
(})72 24 Q(-->)36 36 Q(</style>)36 48 Q(</head>)0 60 Q
(<body bgcolor="#FFFFFF" te)0 72 Q(xt="#000000">)-.15 E 0 Cg EP
%%Page: 4 4
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="N)36 12 Q(AME">)-.35 E -.35(NA)36 24 S
(ME).35 E(</h3>)36 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G(_read_ne).15 E
(w</b>,)-.25 E(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_set_\214lter_options</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G
(_read_set_format_options</b>,).15 E 0 Cg EP
%%Page: 5 5
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_set_options</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_support_compression_all</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_bzip2</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25
G(_read_support_compression_compress</b>,).15 E(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_compression_gzip</b>,).15 E(<b>archi)0 72 Q -.15
(ve)-.25 G(_read_support_compression_lzma</b>,).15 E 0 Cg EP
%%Page: 6 6
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_none</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25
G(_read_support_compression_xz</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_program</b>,).15 E(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_support_compression_program_signature</b>,).15 E(<b>archi)0
60 Q -.15(ve)-.25 G(_read_support_format_all</b>,).15 E(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_support_format_ar</b>,).15 E 0 Cg EP
%%Page: 7 7
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_cpio</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_support_format_empty</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_iso9660</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_support_format_mtree,</b>).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_support_format_ra).15 E -.65(w,)-.15 G(</b>).65 E(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_support_format_tar</b>,).15 E 0 Cg EP
%%Page: 8 8
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_zip</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_open</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G(_read_open2</b>,)
.15 E(<b>archi)0 48 Q -.15(ve)-.25 G(_read_open_fd</b>,).15 E(<b>archi)0
60 Q -.15(ve)-.25 G(_read_open_FILE</b>,).15 E(<b>archi)0 72 Q -.15(ve)
-.25 G(_read_open_\214lename</b>,).15 E 0 Cg EP
%%Page: 9 9
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open_memory</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G(_read_ne)
.15 E(xt_header</b>,)-.15 E(<b>archi)0 36 Q -.15(ve)-.25 G(_read_ne).15
E(xt_header2</b>,)-.15 E(<b>archi)0 48 Q -.15(ve)-.25 G(_read_data</b>,)
.15 E(<b>archi)0 60 Q -.15(ve)-.25 G(_read_data_block</b>,).15 E
(<b>archi)0 72 Q -.15(ve)-.25 G(_read_data_skip</b>,).15 E 0 Cg EP
%%Page: 10 10
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data_into_b).15 E(uf)-.2 E(fer</b>,)-.25 E(<b>archi)0 24 Q -.15
(ve)-.25 G(_read_data_into_fd</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_e).15 E(xtract</b>,)-.15 E(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_e).15 E(xtract2</b>,)-.15 E(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_e).15 E(xtract_set_progress_callback</b>,)-.15 E(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_close</b>,).15 E 0 Cg EP
%%Page: 11 11
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_\214nish</b>).15 E 2.5(-f)0 24 S
(unctions for reading streaming archi)-2.5 E -.15(ve)-.25 G(s).15 E
(<h3 id="SYNOPSIS">)36 36 Q(SYNOPSIS)36 48 Q(</h3>)36 60 Q
(<br><br><code></code><code>struct</code><code> archi)0 72 Q -.15(ve)
-.25 G(</code><code> *</code>).15 E 0 Cg EP
%%Page: 12 12
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G(_read_ne).15 E
(w</b>\(<code></code><code>v)-.25 E(oid</code>\))-.2 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G
(_read_support_compression_all</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G
(_read_support_compression_bzip2</b>\(<code></code><code>struct archi)
.15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 13 13
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G(_read_support_co\
mpression_compress</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0 24
Q(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_gzip</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G
(_read_support_compression_lzma</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 14 14
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_none</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G
(_read_support_compression_xz</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_compression_program</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 15 15
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>const char *cmd</code>)0 12 Q
(\))0 24 Q(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q
-.15(ve)-.25 G
(_read_support_compression_program_signature</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 60 Q .3 -.15(ve *)-.25 H(</code>).15
E(<code></code><code>const char *cmd</code>)0 72 Q 0 Cg EP
%%Page: 16 16
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>const v)0 12 Q
(oid *signature</code>)-.2 E
(<code></code><code>size_t signature_length</code>)0 24 Q(\))0 36 Q
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_format_all</b>\(<code></code><code>struct archi).15
E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 17 17
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_ar</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_cpio</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
48 Q(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_support_format_empty</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 18 18
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_iso9660</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_support_format_mtree</b>\(<code></code><code>struct archi)
.15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_support_format_ra).15 E
(w</b>\(<code></code><code>struct archi)-.15 E .3 -.15(ve *)-.25 H
(</code>\)).15 E(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 19 19
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_tar</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_zip</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
48 Q(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_set_\214lter_options</b>\(<code></code><code>struct archi).15 E
.3 -.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_set_format_options</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_set_options</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_open</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 21 21
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>v)0 12 Q
(oid *client_data</code>)-.2 E(<code></code><code>archi)0 24 Q -.15(ve)
-.25 G(_open_callback *</code>).15 E(<code></code><code>archi)0 36 Q
-.15(ve)-.25 G(_read_callback *</code>).15 E(<code></code><code>archi)0
48 Q -.15(ve)-.25 G(_close_callback *</code>).15 E(\))0 60 Q
(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
%%Page: 22 22
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open2</b>\(<code></code>).15 E(<code></code><code>struct archi)0
24 Q .3 -.15(ve *)-.25 H(</code>).15 E(<code></code><code>v)0 36 Q
(oid *client_data</code>)-.2 E(<code></code><code>archi)0 48 Q -.15(ve)
-.25 G(_open_callback *</code>).15 E(<code></code><code>archi)0 60 Q
-.15(ve)-.25 G(_read_callback *</code>).15 E(<code></code><code>archi)0
72 Q -.15(ve)-.25 G(_skip_callback *</code>).15 E 0 Cg EP
%%Page: 23 23
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>archi)0 12 Q -.15(ve)-.25 G
(_close_callback *</code>).15 E(\))0 24 Q
(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_open_FILE</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, FILE *\214le</code>\)).15 E
(<br><br><code></code><code>int</code>)0 60 Q(<b>archi)0 72 Q -.15(ve)
-.25 G(_read_open_fd</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H
(</code><code>, int fd</code><code>, size_t block_size</code>\)).15 E 0
Cg EP
%%Page: 24 24
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<br><br><code></code><code>int</code>)0 12 Q
(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_open_\214lename</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 36 Q .3 -.15(ve *)-.25 H(</code>).15
E(<code></code><code>const char *\214lename</code>)0 48 Q
(<code></code><code>size_t block_size</code>)0 60 Q(\))0 72 Q 0 Cg EP
%%Page: 25 25
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<br><br><code></code><code>int</code>)0 12 Q
(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_open_memory</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code><code>, v).15 E(oid *b)-.2 E(uf)-.2 E
(f</code><code>, size_t size</code>\))-.25 E
(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_ne).15 E(xt_header</b>\(<code></code><code>struct archi)
-.15 E .3 -.15(ve *)-.25 H(</code><code>, struct archi).15 E -.15(ve)
-.25 G(_entry **</code>\)).15 E(<br><br><code></code><code>int</code>)0
60 Q(<b>archi)0 72 Q -.15(ve)-.25 G(_read_ne).15 E
(xt_header2</b>\(<code></code><code>struct archi)-.15 E .3 -.15(ve *)
-.25 H(</code><code>, struct archi).15 E -.15(ve)-.25 G
(_entry *</code>\)).15 E 0 Cg EP
%%Page: 26 26
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<br><br><code></code><code>ssize_t</code>)0 12 Q
(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_data</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)-.25
H(</code><code>, v).15 E(oid *b)-.2 E(uf)-.2 E
(f</code><code>, size_t len</code>\))-.25 E
(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q -.15(ve)
-.25 G(_read_data_block</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 60 Q .3 -.15(ve *)-.25 H(</code>).15
E(<code></code><code>const v)0 72 Q(oid **b)-.2 E(uf)-.2 E(f</code>)-.25
E 0 Cg EP
%%Page: 27 27
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>size_t *len</code>)0 12 Q
(<code></code><code>of)0 24 Q(f_t *of)-.25 E(fset</code>)-.25 E(\))0 36
Q(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_data_skip</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
72 Q 0 Cg EP
%%Page: 28 28
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data_into_b).15 E(uf)-.2 E
(fer</b>\(<code></code><code>struct archi)-.25 E .3 -.15(ve *)-.25 H
(</code><code>, v).15 E(oid *</code><code>, ssize_t len</code>\))-.2 E
(<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_data_into_fd</b>\(<code></code><code>struct archi).15 E .3
-.15(ve *)-.25 H(</code><code>, int fd</code>\)).15 E
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_e).15 E(xtract</b>\(<code></code>)-.15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 29 29
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>struct archi)0 12 Q -.15(ve)
-.25 G(_entry *</code>).15 E(<code></code><code>int \215ags</code>)0 24
Q(\))0 36 Q(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q
-.15(ve)-.25 G(_read_e).15 E(xtract2</b>\(<code></code>)-.15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(src</code>)
.15 E 0 Cg EP
%%Page: 30 30
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>struct archi)0 12 Q -.15(ve)
-.25 G(_entry *</code>).15 E(<code></code><code>struct archi)0 24 Q .3
-.15(ve *)-.25 H(dest</code>).15 E(\))0 36 Q
(<br><br><code></code><code>v)0 48 Q(oid</code>)-.2 E(<b>archi)0 60 Q
-.15(ve)-.25 G(_read_e).15 E
(xtract_set_progress_callback</b>\(<code></code>)-.15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 31 31
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>v)0 12 Q(oid \(*func\)\(v)-.2
E(oid *\)</code>)-.2 E(<code></code><code>v)0 24 Q
(oid *user_data</code>)-.2 E(\))0 36 Q
(<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_close</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0 72
Q 0 Cg EP
%%Page: 32 32
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_\214nish</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
-.25 H(</code>\)).15 E(<h3 id="DESCRIPTION">)36 24 Q(DESCRIPTION)36 36 Q
(</h3>)36 48 Q(These functions pro)0 60 Q
(vide a complete API for reading streaming archi)-.15 E -.15(ve)-.25 G
(s.).15 E(The general process is to \214rst create the)0 72 Q 0 Cg EP
%%Page: 33 33
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<font size="-1"></font><font size="-1">struct</\
font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(</font>).15 E
(object, set options, initialize the reader)0 24 Q 2.5(,i)-.4 G
(terate o)-2.5 E -.15(ve)-.15 G 2.5(rt).15 G(he archi)-2.5 E -.15(ve)
-.25 G(headers and associated data, then close the archi)0 36 Q .3 -.15
(ve a)-.25 H(nd release all).15 E(resources.)0 48 Q(The follo)0 60 Q
(wing summary describes the functions in approximately the)-.25 E
(order the)0 72 Q 2.5(yw)-.15 G(ould be used:)-2.6 E 0 Cg EP
%%Page: 34 34
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dl compact>)0 12 Q(<dt><b>archi)0 24 Q -.15(ve)
-.25 G(_read_ne).15 E(w</b>\(<code></code>\)<dd>)-.25 E
(Allocates and initializes a)0 36 Q(<font size="-1"></font><font size="\
-1">struct</font><font size="-1"> archi)0 48 Q -.15(ve)-.25 G(</font>)
.15 E(object suitable for reading from an archi)0 60 Q -.15(ve)-.25 G(.)
.15 E(<dt>Xo<dd>)0 72 Q 0 Cg EP
%%Page: 35 35
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_bzip2</b>\(<code></code>\),).15 E(<b>archi)0
24 Q -.15(ve)-.25 G
(_read_support_compression_compress</b>\(<code></code>\),).15 E
(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_gzip</b>\(<code></code>\),).15 E(<b>archi)0
48 Q -.15(ve)-.25 G
(_read_support_compression_lzma</b>\(<code></code>\),).15 E(<b>archi)0
60 Q -.15(ve)-.25 G
(_read_support_compression_none</b>\(<code></code>\),).15 E(<b>archi)0
72 Q -.15(ve)-.25 G(_read_support_compression_xz</b>\(<code></code>\))
.15 E 0 Cg EP
%%Page: 36 36
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(Enables auto-detection code and decompression support for the)0 12 Q
(speci\214ed compression.)0 24 Q(Returns)0 36 Q
(<b></b><b>ARCHIVE_OK</b>)0 48 Q
(if the compression is fully supported, or)0 60 Q(<b></b><b>ARCHIVE_W)0
72 Q(ARN</b>)-1.2 E 0 Cg EP
%%Page: 37 37
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(if the compression is supported only through an e)0 12 Q
(xternal program.)-.15 E(Note that decompression using an e)0 24 Q
(xternal program is usually slo)-.15 E(wer than)-.25 E
(decompression through b)0 36 Q(uilt-in libraries.)-.2 E(Note that)0 48
Q -.74(``)0 60 S(none').74 E(')-.74 E(is al)0 72 Q -.1(wa)-.1 G
(ys enabled by def).1 E(ault.)-.1 E 0 Cg EP
%%Page: 38 38
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_compression_all</b>\(<code></code>\)<dd>).15 E
(Enables all a)0 24 Q -.25(va)-.2 G(ilable decompression \214lters.).25
E(<dt><b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_compression_program</b>\(<code></code>\)<dd>).15 E
(Data is fed through the speci\214ed e)0 48 Q
(xternal program before being dearchi)-.15 E -.15(ve)-.25 G(d.).15 E
(Note that this disables automatic detection of the compression format,)
0 60 Q(so it mak)0 72 Q
(es no sense to specify this in conjunction with an)-.1 E 2.5(yo)-.15 G
(ther)-2.5 E 0 Cg EP
%%Page: 39 39
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(decompression option.)0 12 Q(<dt><b>archi)0 24 Q
-.15(ve)-.25 G
(_read_support_compression_program_signature</b>\(<code></code>\)<dd>)
.15 E(This feeds data through the speci\214ed e)0 36 Q(xternal program)
-.15 E -.2(bu)0 48 S 2.5(to).2 G
(nly if the initial bytes of the data match the speci\214ed)-2.5 E
(signature v)0 60 Q(alue.)-.25 E(<dt>Xo<dd>)0 72 Q 0 Cg EP
%%Page: 40 40
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_all</b>\(<code></code>\),).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_support_format_ar</b>\(<code></code>\),).15 E
(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_support_format_cpio</b>\(<code></code>\),).15 E(<b>archi)0 48 Q
-.15(ve)-.25 G(_read_support_format_empty</b>\(<code></code>\),).15 E
(<b>archi)0 60 Q -.15(ve)-.25 G
(_read_support_format_iso9660</b>\(<code></code>\),).15 E(<b>archi)0 72
Q -.15(ve)-.25 G(_read_support_format_mtree</b>\(<code></code>\),).15 E
0 Cg EP
%%Page: 41 41
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_tar</b>\(<code></code>\),).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_support_format_zip</b>\(<code></code>\)).15 E
(Enables support---including auto-detection code---for the)0 36 Q
(speci\214ed archi)0 48 Q .3 -.15(ve f)-.25 H(ormat.).15 E -.15(Fo)0 60
S 2.5(re).15 G(xample,)-2.65 E(<b>archi)0 72 Q -.15(ve)-.25 G
(_read_support_format_tar</b>\(<code></code>\)).15 E 0 Cg EP
%%Page: 42 42
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(enables support for a v)0 12 Q
(ariety of standard tar formats, old-style tar)-.25 E(,)-.4 E(ustar)0 24
Q 2.5(,p)-.4 G(ax interchange format, and man)-2.5 E 2.5(yc)-.15 G
(ommon v)-2.5 E(ariants.)-.25 E -.15(Fo)0 36 S 2.5(rc).15 G(on)-2.5 E
-.15(ve)-.4 G(nience,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_support_format_all</b>\(<code></code>\)).15 E
(enables support for all a)0 60 Q -.25(va)-.2 G(ilable formats.).25 E
(Only empty archi)0 72 Q -.15(ve)-.25 G 2.5(sa).15 G
(re supported by def)-2.5 E(ault.)-.1 E 0 Cg EP
%%Page: 43 43
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_support_format_ra).15 E(w</b>\(<code></code>\)<dd>)-.15 E(The)0
24 Q -.74(``)0 36 S(ra).74 E(w')-.15 E(')-.74 E(format handler allo)0 48
Q(ws libarchi)-.25 E .3 -.15(ve t)-.25 H 2.5(ob).15 G 2.5(eu)-2.5 G
(sed to read arbitrary data.)-2.5 E(It treats an)0 60 Q 2.5(yd)-.15 G
(ata stream as an archi)-2.5 E .3 -.15(ve w)-.25 H(ith a single entry)
.15 E(.)-.65 E(The pathname of this entry is)0 72 Q 0 Cg EP
%%Page: 44 44
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF -.74(``)0 12 S(data').74 E(';)-.74 E
(all other entry \214elds are unset.)0 24 Q(This is not enabled by)0 36
Q(<b>archi)0 48 Q -.15(ve)-.25 G
(_read_support_format_all</b>\(<code></code>\)).15 E(in order to a)0 60
Q -.2(vo)-.2 G(id erroneous handling of damaged archi).2 E -.15(ve)-.25
G(s.).15 E(<dt>Xo<dd>)0 72 Q 0 Cg EP
%%Page: 45 45
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_set_\214lter_options</b>\(<code></code>\),).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_set_format_options</b>\(<code></code>\),).15 E
(<b>archi)0 36 Q -.15(ve)-.25 G(_read_set_options</b>\(<code></code>\))
.15 E(Speci\214es options that will be passed to currently-re)0 48 Q
(gistered)-.15 E
(\214lters \(including decompression \214lters\) and/or format readers.)
0 60 Q(The ar)0 72 Q(gument is a comma-separated list of indi)-.18 E
(vidual options.)-.25 E 0 Cg EP
%%Page: 46 46
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Indi)0 12 Q(vidual options ha)-.25 E .3 -.15
(ve o)-.2 H(ne of the follo).15 E(wing forms:)-.25 E(<dl compact>)0 24 Q
(<dt><i></i><i>option=v)0 36 Q(alue</i><dd>)-.25 E(The option/v)0 48 Q
(alue pair will be pro)-.25 E(vided to e)-.15 E -.15(ve)-.25 G
(ry module.).15 E
(Modules that do not accept an option with this name will ignore it.)0
60 Q(<dt><i></i><i>option</i><dd>)0 72 Q 0 Cg EP
%%Page: 47 47
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The option will be pro)0 12 Q(vided to e)-.15 E
-.15(ve)-.25 G(ry module with a v).15 E(alue of)-.25 E -.74(``)0 24 S
(1').74 E('.)-.74 E(<dt><i></i><i>!option</i><dd>)0 36 Q
(The option will be pro)0 48 Q(vided to e)-.15 E -.15(ve)-.25 G
(ry module with a NULL v).15 E(alue.)-.25 E
(<dt><i></i><i>module:option=v)0 60 Q(alue</i><i></i>,<i> module:option\
</i><i></i>,<i> module:!option</i><dd>)-.25 E(As abo)0 72 Q -.15(ve)-.15
G 2.5(,b).15 G(ut the corresponding option and v)-2.7 E
(alue will be pro)-.25 E(vided)-.15 E 0 Cg EP
%%Page: 48 48
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(only to modules whose name matches)0 12 Q
(<i></i><i>module</i>.)0 24 Q(</dl>)0 36 Q(The return v)0 48 Q
(alue will be)-.25 E(<b></b><b>ARCHIVE_OK</b>)0 60 Q(if an)0 72 Q 2.5
(ym)-.15 G(odule accepts the option, or)-2.5 E 0 Cg EP
%%Page: 49 49
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_W)0 12 Q(ARN</b>)-1.2 E
(if no module accepted the option, or)0 24 Q(<b></b><b>ARCHIVE_F)0 36 Q
-1.21 -1.11(AT A)-.74 H(L</b>)1.11 E(if there w)0 48 Q(as a f)-.1 E
(atal error while attempting to process the option.)-.1 E(<p>)36 60 Q
(The currently supported options are:)0 72 Q 0 Cg EP
%%Page: 50 50
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dl compact>)0 12 Q(<dt>F)0 24 Q
(ormat iso9660<dd>)-.15 E(<dl compact>)0 36 Q
(<dt><b></b><b>joliet</b><dd>)0 48 Q(Support Joliet e)0 60 Q(xtensions.)
-.15 E(Def)0 72 Q(aults to enabled, use)-.1 E 0 Cg EP
%%Page: 51 51
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>!joliet</b>)0 12 Q(to disable.)0 24 Q
(</dl>)0 36 Q(</dl>)0 48 Q(<dt><b>archi)0 60 Q -.15(ve)-.25 G
(_read_open</b>\(<code></code>\)<dd>).15 E(The same as)0 72 Q 0 Cg EP
%%Page: 52 52
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open2</b>\(<code></code>\),).15 E -.15(ex)0 24 S
(cept that the skip callback is assumed to be).15 E
(<code></code><code>NULL</code>.)0 36 Q(<dt><b>archi)0 48 Q -.15(ve)-.25
G(_read_open2</b>\(<code></code>\)<dd>).15 E
(Freeze the settings, open the archi)0 60 Q -.15(ve)-.25 G 2.5(,a).15 G
(nd prepare for reading entries.)-2.5 E(This is the most generic v)0 72
Q(ersion of this call, which accepts)-.15 E 0 Cg EP
%%Page: 53 53
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(four callback functions.)0 12 Q
(Most clients will w)0 24 Q(ant to use)-.1 E(<b>archi)0 36 Q -.15(ve)
-.25 G(_read_open_\214lename</b>\(<code></code>\),).15 E(<b>archi)0 48 Q
-.15(ve)-.25 G(_read_open_FILE</b>\(<code></code>\),).15 E(<b>archi)0 60
Q -.15(ve)-.25 G(_read_open_fd</b>\(<code></code>\),).15 E(or)0 72 Q 0
Cg EP
%%Page: 54 54
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open_memory</b>\(<code></code>\)).15 E(instead.)0 24 Q
(The library in)0 36 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(st).1 G
(he client-pro)-2.5 E(vided functions to obtain)-.15 E(ra)0 48 Q 2.5(wb)
-.15 G(ytes from the archi)-2.5 E -.15(ve)-.25 G(.).15 E(<dt><b>archi)0
60 Q -.15(ve)-.25 G(_read_open_FILE</b>\(<code></code>\)<dd>).15 E(Lik)0
72 Q(e)-.1 E 0 Cg EP
%%Page: 55 55
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_open</b>\(<code></code>\),).15 E -.15(ex)0 24 S
(cept that it accepts a).15 E(<br><br><code></code><code>FILE *</code>)0
36 Q(pointer)0 48 Q(.)-.55 E
(This function should not be used with tape dri)0 60 Q -.15(ve)-.25 G
2.5(so).15 G 2.5(ro)-2.5 G(ther de)-2.5 E(vices)-.25 E
(that require strict I/O blocking.)0 72 Q 0 Cg EP
%%Page: 56 56
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_open_fd</b>\(<code></code>\)<dd>).15 E(Lik)0 24 Q(e)-.1 E
(<b>archi)0 36 Q -.15(ve)-.25 G(_read_open</b>\(<code></code>\),).15 E
-.15(ex)0 48 S
(cept that it accepts a \214le descriptor and block size rather than).15
E 2.5(as)0 60 S(et of function pointers.)-2.5 E
(Note that the \214le descriptor will not be automatically closed at)0
72 Q 0 Cg EP
%%Page: 57 57
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(end-of-archi)0 12 Q -.15(ve)-.25 G(.).15 E
(This function is safe for use with tape dri)0 24 Q -.15(ve)-.25 G 2.5
(so).15 G 2.5(ro)-2.5 G(ther block)-2.5 E(ed de)-.1 E(vices.)-.25 E
(<dt><b>archi)0 36 Q -.15(ve)-.25 G
(_read_open_\214le</b>\(<code></code>\)<dd>).15 E
(This is a deprecated synon)0 48 Q(ym for)-.15 E(<b>archi)0 60 Q -.15
(ve)-.25 G(_read_open_\214lename</b>\(<code></code>\).).15 E
(<dt><b>archi)0 72 Q -.15(ve)-.25 G
(_read_open_\214lename</b>\(<code></code>\)<dd>).15 E 0 Cg EP
%%Page: 58 58
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Lik)0 12 Q(e)-.1 E(<b>archi)0 24 Q -.15(ve)-.25
G(_read_open</b>\(<code></code>\),).15 E -.15(ex)0 36 S
(cept that it accepts a simple \214lename and a block size.).15 E 2.5
(AN)0 48 S(ULL \214lename represents standard input.)-2.5 E
(This function is safe for use with tape dri)0 60 Q -.15(ve)-.25 G 2.5
(so).15 G 2.5(ro)-2.5 G(ther block)-2.5 E(ed de)-.1 E(vices.)-.25 E
(<dt><b>archi)0 72 Q -.15(ve)-.25 G
(_read_open_memory</b>\(<code></code>\)<dd>).15 E 0 Cg EP
%%Page: 59 59
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Lik)0 12 Q(e)-.1 E(<b>archi)0 24 Q -.15(ve)-.25
G(_read_open</b>\(<code></code>\),).15 E -.15(ex)0 36 S
(cept that it accepts a pointer and size of a block of).15 E
(memory containing the archi)0 48 Q .3 -.15(ve d)-.25 H(ata.).15 E
(<dt><b>archi)0 60 Q -.15(ve)-.25 G(_read_ne).15 E
(xt_header</b>\(<code></code>\)<dd>)-.15 E(Read the header for the ne)0
72 Q(xt entry and return a pointer to)-.15 E 0 Cg EP
%%Page: 60 60
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(a)0 12 Q(<font size="-1"></font><font size="-1"\
>struct</font><font size="-1"> archi)0 24 Q -.15(ve)-.25 G
(_entry</font>.).15 E(This is a con)0 36 Q -.15(ve)-.4 G
(nience wrapper around).15 E(<b>archi)0 48 Q -.15(ve)-.25 G(_read_ne).15
E(xt_header2</b>\(<code></code>\))-.15 E(that reuses an internal)0 60 Q
(<font size="-1"></font><font size="-1">struct</font><font size="-1"> a\
rchi)0 72 Q -.15(ve)-.25 G(_entry</font>).15 E 0 Cg EP
%%Page: 61 61
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(object for each request.)0 12 Q(<dt><b>archi)0
24 Q -.15(ve)-.25 G(_read_ne).15 E(xt_header2</b>\(<code></code>\)<dd>)
-.15 E(Read the header for the ne)0 36 Q(xt entry and populate the pro)
-.15 E(vided)-.15 E(<font size="-1"></font><font size="-1">struct</font\
><font size="-1"> archi)0 48 Q -.15(ve)-.25 G(_entry</font>.).15 E
(<dt><b>archi)0 60 Q -.15(ve)-.25 G(_read_data</b>\(<code></code>\)<dd>)
.15 E(Read data associated with the header just read.)0 72 Q 0 Cg EP
%%Page: 62 62
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Internally)0 12 Q 2.5(,t)-.65 G(his is a con)
-2.5 E -.15(ve)-.4 G(nience function that calls).15 E(<b>archi)0 24 Q
-.15(ve)-.25 G(_read_data_block</b>\(<code></code>\)).15 E
(and \214lls an)0 36 Q 2.5(yg)-.15 G
(aps with nulls so that callers see a single)-2.55 E
(continuous stream of data.)0 48 Q(<dt><b>archi)0 60 Q -.15(ve)-.25 G
(_read_data_block</b>\(<code></code>\)<dd>).15 E(Return the ne)0 72 Q
(xt a)-.15 E -.25(va)-.2 G(ilable block of data for this entry).25 E(.)
-.65 E 0 Cg EP
%%Page: 63 63
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Unlik)0 12 Q(e)-.1 E(<b>archi)0 24 Q -.15(ve)
-.25 G(_read_data</b>\(<code></code>\),).15 E(the)0 36 Q(<b>archi)0 48 Q
-.15(ve)-.25 G(_read_data_block</b>\(<code></code>\)).15 E(function a)0
60 Q -.2(vo)-.2 G(ids cop).2 E(ying data and allo)-.1 E
(ws you to correctly handle)-.25 E
(sparse \214les, as supported by some archi)0 72 Q .3 -.15(ve f)-.25 H
(ormats.).15 E 0 Cg EP
%%Page: 64 64
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The library guarantees that of)0 12 Q
(fsets will increase and that blocks)-.25 E(will not o)0 24 Q -.15(ve)
-.15 G(rlap.).15 E
(Note that the blocks returned from this function can be much lar)0 36 Q
(ger)-.18 E(than the block size read from disk, due to compression)0 48
Q(and internal b)0 60 Q(uf)-.2 E(fer optimizations.)-.25 E(<dt><b>archi)
0 72 Q -.15(ve)-.25 G(_read_data_skip</b>\(<code></code>\)<dd>).15 E 0
Cg EP
%%Page: 65 65
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 2.5(Ac)0 12 S(on)-2.5 E -.15(ve)-.4 G
(nience function that repeatedly calls).15 E(<b>archi)0 24 Q -.15(ve)
-.25 G(_read_data_block</b>\(<code></code>\)).15 E
(to skip all of the data for this archi)0 36 Q .3 -.15(ve e)-.25 H(ntry)
.15 E(.)-.65 E(<dt><b>archi)0 48 Q -.15(ve)-.25 G(_read_data_into_b).15
E(uf)-.2 E(fer</b>\(<code></code>\)<dd>)-.25 E
(This function is deprecated and will be remo)0 60 Q -.15(ve)-.15 G(d.)
.15 E(Use)0 72 Q 0 Cg EP
%%Page: 66 66
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data</b>\(<code></code>\)).15 E(instead.)0 24 Q(<dt><b>archi)0 36
Q -.15(ve)-.25 G(_read_data_into_fd</b>\(<code></code>\)<dd>).15 E 2.5
(Ac)0 48 S(on)-2.5 E -.15(ve)-.4 G
(nience function that repeatedly calls).15 E(<b>archi)0 60 Q -.15(ve)
-.25 G(_read_data_block</b>\(<code></code>\)).15 E(to cop)0 72 Q 2.5(yt)
-.1 G(he entire entry to the pro)-2.5 E(vided \214le descriptor)-.15 E
(.)-.55 E 0 Cg EP
%%Page: 67 67
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G(_read_e).15 E
(xtract</b>\(<code></code><b>archi)-.15 E -.15(ve)-.25 G(_read_e).15 E
(xtract_set_skip_\214le</b>\(<code></code>\)\)<dd>,)-.15 E 2.5(Ac)0 24 S
(on)-2.5 E -.15(ve)-.4 G(nience function that wraps the corresponding)
.15 E(<a href="../html3/archi)0 36 Q -.15(ve)-.25 G
(_write_disk.html">archi).15 E -.15(ve)-.25 G(_write_disk\(3\)</a>).15 E
(interf)0 48 Q(aces.)-.1 E(The \214rst call to)0 60 Q(<b>archi)0 72 Q
-.15(ve)-.25 G(_read_e).15 E(xtract</b>\(<code></code>\))-.15 E 0 Cg EP
%%Page: 68 68
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(creates a restore object using)0 12 Q
(<a href="../html3/archi)0 24 Q -.15(ve)-.25 G(_write_disk_ne).15 E -.65
(w.)-.25 G(html">archi).65 E -.15(ve)-.25 G(_write_disk_ne).15 E
(w\(3\)</a>)-.25 E(and)0 36 Q(<a href="../html3/archi)0 48 Q -.15(ve)
-.25 G(_write_disk_set_standard_lookup.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_standard_lookup\(3\)</a>,).15 E(then transparently in)0
60 Q -.2(vo)-.4 G -.1(ke).2 G(s).1 E(<a href="../html3/archi)0 72 Q -.15
(ve)-.25 G(_write_disk_set_options.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_options\(3\)</a>,).15 E 0 Cg EP
%%Page: 69 69
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<a href="../html3/archi)0 12 Q -.15(ve)-.25 G
(_write_header).15 E(.html">archi)-.55 E -.15(ve)-.25 G
(_write_header\(3\)</a>,).15 E(<a href="../html3/archi)0 24 Q -.15(ve)
-.25 G(_write_data.html">archi).15 E -.15(ve)-.25 G
(_write_data\(3\)</a>,).15 E(and)0 36 Q(<a href="../html3/archi)0 48 Q
-.15(ve)-.25 G(_write_\214nish_entry).15 E(.html">archi)-.65 E -.15(ve)
-.25 G(_write_\214nish_entry\(3\)</a>).15 E
(to create the entry on disk and cop)0 60 Q 2.5(yd)-.1 G(ata into it.)
-2.5 E(The)0 72 Q 0 Cg EP
%%Page: 70 70
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<i></i><i>\215ags</i>)0 12 Q(ar)0 24 Q
(gument is passed unmodi\214ed to)-.18 E(<a href="../html3/archi)0 36 Q
-.15(ve)-.25 G(_write_disk_set_options.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_options\(3\)</a>.).15 E(<dt><b>archi)0 48 Q -.15(ve)
-.25 G(_read_e).15 E(xtract2</b>\(<code></code>\)<dd>)-.15 E
(This is another v)0 60 Q(ersion of)-.15 E(<b>archi)0 72 Q -.15(ve)-.25
G(_read_e).15 E(xtract</b>\(<code></code>\))-.15 E 0 Cg EP
%%Page: 71 71
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(that allo)0 12 Q(ws you to pro)-.25 E
(vide your o)-.15 E(wn restore object.)-.25 E(In particular)0 24 Q 2.5
(,t)-.4 G(his allo)-2.5 E(ws you to o)-.25 E -.15(ve)-.15 G
(rride the standard lookup functions).15 E(using)0 36 Q
(<a href="../html3/archi)0 48 Q -.15(ve)-.25 G
(_write_disk_set_group_lookup.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_group_lookup\(3\)</a>,).15 E(and)0 60 Q
(<a href="../html3/archi)0 72 Q -.15(ve)-.25 G
(_write_disk_set_user_lookup.html">archi).15 E -.15(ve)-.25 G
(_write_disk_set_user_lookup\(3\)</a>.).15 E 0 Cg EP
%%Page: 72 72
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Note that)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G
(_read_e).15 E(xtract2</b>\(<code></code>\))-.15 E(does not accept a)0
36 Q(<i></i><i>\215ags</i>)0 48 Q(ar)0 60 Q(gument; you should use)-.18
E(<b>archi)0 72 Q -.15(ve)-.25 G
(_write_disk_set_options</b>\(<code></code>\)).15 E 0 Cg EP
%%Page: 73 73
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(to set the restore options yourself.)0 12 Q
(<dt><b>archi)0 24 Q -.15(ve)-.25 G(_read_e).15 E
(xtract_set_progress_callback</b>\(<code></code>\)<dd>)-.15 E
(Sets a pointer to a user)0 36 Q(-de\214ned callback that can be used)
-.2 E(for updating progress displays during e)0 48 Q(xtraction.)-.15 E
(The progress function will be in)0 60 Q -.2(vo)-.4 G -.1(ke).2 G 2.5
(dd).1 G(uring the e)-2.5 E(xtraction of lar)-.15 E(ge)-.18 E(re)0 72 Q
(gular \214les.)-.15 E 0 Cg EP
%%Page: 74 74
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The progress function will be in)0 12 Q -.2(vo)
-.4 G -.1(ke).2 G 2.5(dw).1 G(ith the pointer pro)-2.5 E
(vided to this call.)-.15 E(Generally)0 24 Q 2.5(,t)-.65 G
(he data pointed to should include a reference to the archi)-2.5 E -.15
(ve)-.25 G(object and the archi)0 36 Q -.15(ve)-.25 G
(_entry object so that v).15 E(arious statistics)-.25 E(can be retrie)0
48 Q -.15(ve)-.25 G 2.5(df).15 G(or the progress display)-2.5 E(.)-.65 E
(<dt><b>archi)0 60 Q -.15(ve)-.25 G
(_read_close</b>\(<code></code>\)<dd>).15 E(Complete the archi)0 72 Q .3
-.15(ve a)-.25 H(nd in).15 E -.2(vo)-.4 G .2 -.1(ke t).2 H
(he close callback.).1 E 0 Cg EP
%%Page: 75 75
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt><b>archi)0 12 Q -.15(ve)-.25 G
(_read_\214nish</b>\(<code></code>\)<dd>).15 E(In)0 24 Q -.2(vo)-.4 G
-.1(ke).2 G(s).1 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_read_close</b>\(<code></code>\)).15 E(if it w)0 48 Q(as not in)-.1 E
-.2(vo)-.4 G -.1(ke).2 G 2.5(dm).1 G(anually)-2.5 E 2.5(,t)-.65 G
(hen release all resources.)-2.5 E(Note: In libarchi)0 60 Q .3 -.15
(ve 1)-.25 H(.x, this function w).15 E(as declared to return)-.1 E
(<br><br><code></code><code>v)0 72 Q(oid</code>,)-.2 E 0 Cg EP
%%Page: 76 76
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(which made it impossible to detect certain errors when)0 12 Q(<b>archi)
0 24 Q -.15(ve)-.25 G(_read_close</b>\(<code></code>\)).15 E -.1(wa)0 36
S 2.5(si).1 G -1.9 -.4(nv o)-2.5 H -.1(ke).4 G 2.5(di).1 G
(mplicitly from this function.)-2.5 E(The declaration is corrected be)0
48 Q(ginning with libarchi)-.15 E .3 -.15(ve 2)-.25 H(.0.).15 E(</dl>)0
60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 77 77
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(Note that the library determines most of the rele)0 12 Q -.25(va)-.25 G
(nt information about).25 E(the archi)0 24 Q .3 -.15(ve b)-.25 H 2.5(yi)
.15 G(nspection.)-2.5 E(In particular)0 36 Q 2.5(,i)-.4 G 2.5(ta)-2.5 G
(utomatically detects)-2.5 E(<a href="../html1/gzip.html">gzip\(1\)</a>)
0 48 Q(or)0 60 Q(<a href="../html1/bzip2.html">bzip2\(1\)</a>)0 72 Q 0
Cg EP
%%Page: 78 78
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(compression and transparently performs the appropriate decompression.)0
12 Q(It also automatically detects the archi)0 24 Q .3 -.15(ve f)-.25 H
(ormat.).15 E(<p>)36 36 Q 2.5(Ac)0 48 S(omplete description of the)-2.5
E(<font size="-1"></font><font size="-1">struct</font><font size="-1"> \
archi)0 60 Q -.15(ve)-.25 G(</font>).15 E(and)0 72 Q 0 Cg EP
%%Page: 79 79
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<font size="-1"></font><font size="-1">struct</\
font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(_entry</font>).15 E
(objects can be found in the o)0 24 Q -.15(ve)-.15 G(rvie).15 E 2.5(wm)
-.25 G(anual page for)-2.5 E(<a href="../html3/libarchi)0 36 Q -.15(ve)
-.25 G(.html">libarchi).15 E -.15(ve)-.25 G(\(3\)</a>.).15 E
(<h3 id="CLIENT CALLB)36 48 Q -.4(AC)-.35 G(KS">).4 E(CLIENT CALLB)36 60
Q -.4(AC)-.35 G(KS).4 E(</h3>)36 72 Q 0 Cg EP
%%Page: 80 80
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The callback functions must match the follo)0 12
Q(wing prototypes:)-.25 E(<dl>)0 24 Q(<p><dd>)0 36 Q
(<br><br><code></code><code>typedef</code><code> ssize_t</code>)0 48 Q
(<b>archi)0 60 Q -.15(ve)-.25 G(_read_callback</b>\(<code></code>).15 E
(<code></code><code>struct archi)0 72 Q .3 -.15(ve *)-.25 H(</code>).15
E 0 Cg EP
%%Page: 81 81
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>v)0 12 Q
(oid *client_data</code>)-.2 E(<code></code><code>const v)0 24 Q
(oid **b)-.2 E(uf)-.2 E(fer</code>)-.25 E(\))0 36 Q(<p><dd>)0 48 Q
(<br><br><code></code><code>typedef</code><code> int</code>)0 60 Q
(<b>archi)0 72 Q -.15(ve)-.25 G(_skip_callback</b>\(<code></code>).15 E
0 Cg EP
%%Page: 82 82
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<code></code><code>struct archi)0 12 Q .3 -.15
(ve *)-.25 H(</code>).15 E(<code></code><code>v)0 24 Q
(oid *client_data</code>)-.2 E(<code></code><code>size_t request</code>)
0 36 Q(\))0 48 Q(<p><dd>)0 60 Q
(<br><br><code></code><code>typedef</code><code> int</code>)0 72 Q 0 Cg
EP
%%Page: 83 83
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_open_callback</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
-.25 H(</code><code>, v).15 E(oid *client_data</code>\))-.2 E(<p><dd>)0
24 Q(<br><br><code></code><code>typedef</code><code> int</code>)0 36 Q
(<b>archi)0 48 Q -.15(ve)-.25 G
(_close_callback</b>\(<code></code><code>struct archi).15 E .3 -.15
(ve *)-.25 H(</code><code>, v).15 E(oid *client_data</code>\))-.2 E
(</dl>)0 60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 84 84
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The open callback is in)0 12 Q -.2(vo)-.4 G -.1
(ke).2 G 2.5(db).1 G(y)-2.5 E(<b>archi)0 24 Q -.15(ve)-.25 G
(_open</b>\(<code></code>\).).15 E(It should return)0 36 Q
(<b></b><b>ARCHIVE_OK</b>)0 48 Q
(if the underlying \214le or data source is successfully)0 60 Q(opened.)
0 72 Q 0 Cg EP
%%Page: 85 85
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(If the open f)0 12 Q(ails, it should call)-.1 E
(<b>archi)0 24 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15 E
(to re)0 36 Q(gister an error code and message and return)-.15 E
(<b></b><b>ARCHIVE_F)0 48 Q -1.21 -1.11(AT A)-.74 H(L</b>.)1.11 E(<p>)36
60 Q(The read callback is in)0 72 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G
(hene)-2.5 E -.15(ve)-.25 G 2.5(rt).15 G(he library)-2.5 E 0 Cg EP
%%Page: 86 86
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(requires ra)0 12 Q 2.5(wb)-.15 G
(ytes from the archi)-2.5 E -.15(ve)-.25 G(.).15 E
(The read callback should read data into a b)0 24 Q(uf)-.2 E(fer)-.25 E
(,)-.4 E(set the)0 36 Q(<code></code><code>const</code><code> v)0 48 Q
(oid</code><code> **b)-.2 E(uf)-.2 E(fer</code>)-.25 E(ar)0 60 Q
(gument to point to the a)-.18 E -.25(va)-.2 G(ilable data, and).25 E
(return a count of the number of bytes a)0 72 Q -.25(va)-.2 G(ilable.)
.25 E 0 Cg EP
%%Page: 87 87
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The library will in)0 12 Q -.2(vo)-.4 G .2 -.1
(ke t).2 H(he read callback ag).1 E(ain)-.05 E
(only after it has consumed this data.)0 24 Q
(The library imposes no constraints on the size)0 36 Q
(of the data blocks returned.)0 48 Q
(On end-of-\214le, the read callback should)0 60 Q(return zero.)0 72 Q 0
Cg EP
%%Page: 88 88
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(On error)0 12 Q 2.5(,t)-.4 G
(he read callback should in)-2.5 E -.2(vo)-.4 G -.1(ke).2 G(<b>archi)0
24 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15 E(to re)0 36 Q
(gister an error code and message and)-.15 E(return -1.)0 48 Q(<p>)36 60
Q(The skip callback is in)0 72 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G
(hen the)-2.5 E 0 Cg EP
%%Page: 89 89
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(library w)0 12 Q
(ants to ignore a block of data.)-.1 E(The return v)0 24 Q
(alue is the number of bytes actually)-.25 E(skipped, which may dif)0 36
Q(fer from the request.)-.25 E
(If the callback cannot skip data, it should return)0 48 Q(zero.)0 60 Q
(If the skip callback is not pro)0 72 Q(vided \(the)-.15 E 0 Cg EP
%%Page: 90 90
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(function pointer is)0 12 Q
(<code></code><code>NULL</code><code> \),</code>)0 24 Q
(the library will in)0 36 Q -.2(vo)-.4 G .2 -.1(ke t).2 H
(he read function).1 E(instead and simply discard the result.)0 48 Q 2.5
(As)0 60 S(kip callback can pro)-2.5 E(vide signi\214cant)-.15 E
(performance g)0 72 Q(ains when reading uncompressed)-.05 E 0 Cg EP
%%Page: 91 91
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(archi)0 12 Q -.15(ve)-.25 G 2.5(sf).15 G
(rom slo)-2.5 E 2.5(wd)-.25 G(isk dri)-2.5 E -.15(ve)-.25 G 2.5(so).15 G
2.5(ro)-2.5 G(ther media)-2.5 E(that can skip quickly)0 24 Q(.)-.65 E
(<p>)36 36 Q(The close callback is in)0 48 Q -.2(vo)-.4 G -.1(ke).2 G
2.5(db).1 G 2.5(ya)-2.5 G(rchi)-2.5 E -.15(ve)-.25 G(_close when).15 E
(the archi)0 60 Q .3 -.15(ve p)-.25 H(rocessing is complete.).15 E
(The callback should return)0 72 Q 0 Cg EP
%%Page: 92 92
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_OK</b>)0 12 Q(on success.)0 24
Q(On f)0 36 Q(ailure, the callback should in)-.1 E -.2(vo)-.4 G -.1(ke)
.2 G(<b>archi)0 48 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15
E(to re)0 60 Q(gister an error code and message and)-.15 E(return)0 72 Q
0 Cg EP
%%Page: 93 93
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_F)0 12 Q -1.21 -1.11(AT A)-.74
H(L.</b>)1.11 E(<h3 id="EXAMPLE">)36 24 Q(EXAMPLE)36 36 Q(</h3>)36 48 Q
(The follo)0 60 Q(wing illustrates basic usage of the library)-.25 E(.)
-.65 E(In this e)0 72 Q(xample,)-.15 E 0 Cg EP
%%Page: 94 94
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(the callback functions are simply wrappers around the standard)0 12 Q
(<a href="../html2/open.html">open\(2\)</a>,)0 24 Q
(<a href="../html2/read.html">read\(2\)</a>,)0 36 Q(and)0 48 Q
(<a href="../html2/close.html">close\(2\)</a>)0 60 Q(system calls.)0 72
Q 0 Cg EP
%%Page: 95 95
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dl compact><dt><dd>)0 12 Q(<code>)0 24 Q(<pre>)
0 36 Q -.2(vo)0 48 S(id).2 E(list_archi)0 60 Q -.15(ve)-.25 G
(\(const char *name\)).15 E({)0 72 Q 0 Cg EP
%%Page: 96 96
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(struct mydata *mydata;)5 12 Q(struct archi)5 24
Q .3 -.15(ve *)-.25 H(a;).15 E(struct archi)5 36 Q -.15(ve)-.25 G
(_entry *entry;).15 E(<p>)36 48 Q
(mydata = malloc\(sizeof\(struct mydata\)\);)5 60 Q 2.5(a=a)5 72 S(rchi)
-2.5 E -.15(ve)-.25 G(_read_ne).15 E(w\(\);)-.25 E 0 Cg EP
%%Page: 97 97
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(mydata->name = name;)5 12 Q(archi)5 24 Q -.15
(ve)-.25 G(_read_support_compression_all\(a\);).15 E(archi)5 36 Q -.15
(ve)-.25 G(_read_support_format_all\(a\);).15 E(archi)5 48 Q -.15(ve)
-.25 G(_read_open\(a, mydata, myopen, myread, myclose\);).15 E
(while \(archi)5 60 Q -.15(ve)-.25 G(_read_ne).15 E
(xt_header\(a, &entry\) == ARCHIVE_OK\) {)-.15 E(printf\("%s\\n",archi)
10 72 Q -.15(ve)-.25 G(_entry_pathname\(entry\)\);).15 E 0 Cg EP
%%Page: 98 98
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(archi)10 12 Q -.15(ve)-.25 G
(_read_data_skip\(a\);).15 E(})5 24 Q(archi)5 36 Q -.15(ve)-.25 G
(_read_\214nish\(a\);).15 E(free\(mydata\);)5 48 Q(})0 60 Q(<p>)36 72 Q
0 Cg EP
%%Page: 99 99
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(ssize_t)0 12 Q(myread\(struct archi)0 24 Q .3
-.15(ve *)-.25 H(a, v).15 E(oid *client_data, const v)-.2 E(oid **b)-.2
E(uf)-.2 E(f\))-.25 E({)0 36 Q(struct mydata *mydata = client_data;)5 48
Q(<p>)36 60 Q(*b)5 72 Q(uf)-.2 E 2.5(f=m)-.25 G(ydata->b)-2.5 E(uf)-.2 E
(f;)-.25 E 0 Cg EP
%%Page: 100 100
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(return \(read\(mydata->fd, mydata->b)5 12 Q(uf)
-.2 E(f, 10240\)\);)-.25 E(})0 24 Q(<p>)36 36 Q(int)0 48 Q
(myopen\(struct archi)0 60 Q .3 -.15(ve *)-.25 H(a, v).15 E
(oid *client_data\))-.2 E({)0 72 Q 0 Cg EP
%%Page: 101 101
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(struct mydata *mydata = client_data;)5 12 Q(<p>)
36 24 Q(mydata->fd = open\(mydata->name, O_RDONL)5 36 Q(Y\);)-1 E
(return \(mydata->fd >= 0 ? ARCHIVE_OK : ARCHIVE_F)5 48 Q -1.21 -1.11
(AT A)-.74 H(L\);)1.11 E(})0 60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 102 102
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(int)0 12 Q(myclose\(struct archi)0 24 Q .3 -.15
(ve *)-.25 H(a, v).15 E(oid *client_data\))-.2 E({)0 36 Q
(struct mydata *mydata = client_data;)5 48 Q(<p>)36 60 Q
(if \(mydata->fd > 0\))5 72 Q 0 Cg EP
%%Page: 103 103
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(close\(mydata->fd\);)10 12 Q
(return \(ARCHIVE_OK\);)5 24 Q(})0 36 Q(</pre>)0 48 Q(</code>)0 60 Q
(</dl>)0 72 Q 0 Cg EP
%%Page: 104 104
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="RETURN V)36 12 Q(ALUES">)-1.35 E
(RETURN V)36 24 Q(ALUES)-1.35 E(</h3>)36 36 Q
(Most functions return zero on success, non-zero on error)0 48 Q(.)-.55
E(The possible return codes include:)0 60 Q(<b></b><b>ARCHIVE_OK</b>)0
72 Q 0 Cg EP
%%Page: 105 105
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(\(the operation succeeded\),)0 12 Q
(<b></b><b>ARCHIVE_W)0 24 Q(ARN</b>)-1.2 E(\(the operation succeeded b)0
36 Q(ut a non-critical error w)-.2 E(as encountered\),)-.1 E
(<b></b><b>ARCHIVE_EOF</b>)0 48 Q(\(end-of-archi)0 60 Q .3 -.15(ve w)
-.25 H(as encountered\),).05 E(<b></b><b>ARCHIVE_RETR)0 72 Q(Y</b>)-.65
E 0 Cg EP
%%Page: 106 106
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(\(the operation f)0 12 Q(ailed b)-.1 E
(ut can be retried\),)-.2 E(and)0 24 Q(<b></b><b>ARCHIVE_F)0 36 Q -1.21
-1.11(AT A)-.74 H(L</b>)1.11 E(\(there w)0 48 Q(as a f)-.1 E
(atal error; the archi)-.1 E .3 -.15(ve s)-.25 H
(hould be closed immediately\).).15 E(Detailed error codes and te)0 60 Q
(xtual descriptions are a)-.15 E -.25(va)-.2 G(ilable from the).25 E
(<b>archi)0 72 Q -.15(ve)-.25 G(_errno</b>\(<code></code>\)).15 E 0 Cg
EP
%%Page: 107 107
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G
(_error_string</b>\(<code></code>\)).15 E(functions.)0 36 Q(<p>)36 48 Q
(<b>archi)0 60 Q -.15(ve)-.25 G(_read_ne).15 E(w</b>\(<code></code>\))
-.25 E(returns a pointer to a freshly allocated)0 72 Q 0 Cg EP
%%Page: 108 108
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<font size="-1"></font><font size="-1">struct</\
font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(</font>).15 E(object.)
0 24 Q(It returns)0 36 Q(<code></code><code>NULL</code>)0 48 Q(on error)
0 60 Q(.)-.55 E(<p>)36 72 Q 0 Cg EP
%%Page: 109 109
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
(_read_data</b>\(<code></code>\)).15 E
(returns a count of bytes actually read or zero at the end of the entry)
0 24 Q(.)-.65 E(On error)0 36 Q 2.5(,av)-.4 G(alue of)-2.75 E
(<b></b><b>ARCHIVE_F)0 48 Q -1.21 -1.11(AT A)-.74 H(L</b>,)1.11 E
(<b></b><b>ARCHIVE_W)0 60 Q(ARN</b>,)-1.2 E(or)0 72 Q 0 Cg EP
%%Page: 110 110
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b></b><b>ARCHIVE_RETR)0 12 Q(Y</b>)-.65 E
(is returned and an error code and te)0 24 Q
(xtual description can be retrie)-.15 E -.15(ve)-.25 G 2.5(df).15 G
(rom the)-2.5 E(<b>archi)0 36 Q -.15(ve)-.25 G
(_errno</b>\(<code></code>\)).15 E(and)0 48 Q(<b>archi)0 60 Q -.15(ve)
-.25 G(_error_string</b>\(<code></code>\)).15 E(functions.)0 72 Q 0 Cg
EP
%%Page: 111 111
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p>)36 12 Q(The library e)0 24 Q
(xpects the client callbacks to beha)-.15 E .3 -.15(ve s)-.2 H(imilarly)
.15 E(.)-.65 E(If there is an error)0 36 Q 2.5(,y)-.4 G(ou can use)-2.5
E(<b>archi)0 48 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15 E
(to set an appropriate error code and description,)0 60 Q
(then return one of the non-zero v)0 72 Q(alues abo)-.25 E -.15(ve)-.15
G(.).15 E 0 Cg EP
%%Page: 112 112
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(\(Note that the v)0 12 Q(alue e)-.25 E -.15(ve)
-.25 G(ntually returned to the client may).15 E(not be the same; man)0
24 Q 2.5(ye)-.15 G(rrors that are not critical at the le)-2.5 E -.15(ve)
-.25 G(l).15 E(of basic I/O can pre)0 36 Q -.15(ve)-.25 G(nt the archi)
.15 E .3 -.15(ve f)-.25 H(rom being properly read,).15 E
(thus most I/O errors e)0 48 Q -.15(ve)-.25 G(ntually cause).15 E
(<b></b><b>ARCHIVE_F)0 60 Q -1.21 -1.11(AT A)-.74 H(L</b>)1.11 E
(to be returned.\))0 72 Q 0 Cg EP
%%Page: 113 113
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="SEE ALSO">)36 12 Q(SEE ALSO)36 24 Q
(</h3>)36 36 Q(<a href="../html1/tar)0 48 Q(.html">tar\(1\)</a>,)-.55 E
(<a href="../html3/archi)0 60 Q -.15(ve)-.25 G(.html">archi).15 E -.15
(ve)-.25 G(\(3\)</a>,).15 E(<a href="../html3/archi)0 72 Q -.15(ve)-.25
G(_util.html">archi).15 E -.15(ve)-.25 G(_util\(3\)</a>,).15 E 0 Cg EP
%%Page: 114 114
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<a href="../html5/tar)0 12 Q
(.html">tar\(5\)</a>)-.55 E(<h3 id="HIST)36 24 Q(OR)-.18 E(Y">)-.65 E
(HIST)36 36 Q(OR)-.18 E(Y)-.65 E(</h3>)36 48 Q(The)0 60 Q(<b>libarchi)0
72 Q -.15(ve)-.25 G(</b>).15 E 0 Cg EP
%%Page: 115 115
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(library \214rst appeared in)0 12 Q(FreeBSD5.3.)0
24 Q(<h3 id="A)36 36 Q(UTHORS">)-.55 E -.55(AU)36 48 S(THORS).55 E
(</h3>)36 60 Q(<p>)36 72 Q 0 Cg EP
%%Page: 116 116
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The)0 12 Q(<b>libarchi)0 24 Q -.15(ve)-.25 G
(</b>).15 E(library w)0 36 Q(as written by)-.1 E -.35(Ti)0 48 S 2.5(mK)
.35 G(ientzle &lt;kientzle@@acm.or)-2.5 E(g&gt;.)-.18 E(<h3 id="B)36 60 Q
(UGS">)-.1 E -.1(BU)36 72 S(GS).1 E 0 Cg EP
%%Page: 117 117
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</h3>)36 12 Q(Man)0 24 Q 2.5(yt)-.15 G
(raditional archi)-2.5 E -.15(ve)-.25 G 2.5(rp).15 G(rograms treat)-2.5
E(empty \214les as v)0 36 Q(alid empty archi)-.25 E -.15(ve)-.25 G(s.)
.15 E -.15(Fo)0 48 S 2.5(re).15 G(xample, man)-2.65 E 2.5(yi)-.15 G
(mplementations of)-2.5 E(<a href="../html1/tar)0 60 Q
(.html">tar\(1\)</a>)-.55 E(allo)0 72 Q 2.5(wy)-.25 G
(ou to append entries to an empty \214le.)-2.5 E 0 Cg EP
%%Page: 118 118
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(Of course, it is impossible to determine the format of an empty \214le)
0 12 Q
(by inspecting the contents, so this library treats empty \214les as)0
24 Q(ha)0 36 Q(ving a special)-.2 E -.74(``)0 48 S(empty').74 E(')-.74 E
(format.)0 60 Q(</body>)0 72 Q 0 Cg EP
%%Trailer
end
%%EOF
@


1.1.1.5
log
@Import libarchive-3.2.1:
- security fixes and other bugfixes
- support for multhreading in xz 5.2+
@
text
@d1 1509
a1509 233
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }
</style>
<title></title>
</head>
<body>

<hr>


<p>ARCHIVE_READ(3) BSD Library Functions Manual
ARCHIVE_READ(3)</p>

<p style="margin-top: 1em"><b>NAME</b></p>

<p style="margin-left:6%;"><b>archive_read</b> &mdash;
functions for reading streaming archives</p>

<p style="margin-top: 1em"><b>LIBRARY</b></p>

<p style="margin-left:6%;">Streaming Archive Library
(libarchive, -larchive)</p>

<p style="margin-top: 1em"><b>SYNOPSIS</b></p>

<p style="margin-left:6%;"><b>#include
&lt;archive.h&gt;</b></p>

<p style="margin-top: 1em"><b>DESCRIPTION</b></p>

<p style="margin-left:6%;">These functions provide a
complete API for reading streaming archives. The general
process is to first create the struct archive object, set
options, initialize the reader, iterate over the archive
headers and associated data, then close the archive and
release all resources.</p>

<p style="margin-left:6%; margin-top: 1em"><b>Create
archive object</b> <br>
See archive_read_new(3).</p>

<p style="margin-left:6%; margin-top: 1em">To read an
archive, you must first obtain an initialized struct archive
object from <b>archive_read_new</b>().</p>

<p style="margin-left:6%; margin-top: 1em"><b>Enable
filters and formats</b> <br>
See archive_read_filter(3) and archive_read_format(3).</p>

<p style="margin-left:6%; margin-top: 1em">You can then
modify this object for the desired operations with the
various <b>archive_read_set_XXX</b>() and
<b>archive_read_support_XXX</b>() functions. In particular,
you will need to invoke appropriate
<b>archive_read_support_XXX</b>() functions to enable the
corresponding compression and format support. Note that
these latter functions perform two distinct operations: they
cause the corresponding support code to be linked into your
program, and they enable the corresponding auto-detect code.
Unless you have specific constraints, you will generally
want to invoke <b>archive_read_support_filter_all</b>() and
<b>archive_read_support_format_all</b>() to enable
auto-detect for all formats and compression types currently
supported by the library.</p>

<p style="margin-left:6%; margin-top: 1em"><b>Set
options</b> <br>
See archive_read_set_options(3).</p>

<p style="margin-left:6%; margin-top: 1em"><b>Open
archive</b> <br>
See archive_read_open(3).</p>

<p style="margin-left:6%; margin-top: 1em">Once you have
prepared the struct archive object, you call
<b>archive_read_open</b>() to actually open the archive and
prepare it for reading. There are several variants of this
function; the most basic expects you to provide pointers to
several functions that can provide blocks of bytes from the
archive. There are convenience forms that allow you to
specify a filename, file descriptor, <i>FILE *</i> object,
or a block of memory from which to read the archive data.
Note that the core library makes no assumptions about the
size of the blocks read; callback functions are free to read
whatever block size is most appropriate for the medium.</p>

<p style="margin-left:6%; margin-top: 1em"><b>Consume
archive</b> <br>
See archive_read_header(3), archive_read_data(3) and
archive_read_extract(3).</p>

<p style="margin-left:6%; margin-top: 1em">Each archive
entry consists of a header followed by a certain amount of
data. You can obtain the next header with
<b>archive_read_next_header</b>(), which returns a pointer
to an struct archive_entry structure with information about
the current archive element. If the entry is a regular file,
then the header will be followed by the file data. You can
use <b>archive_read_data</b>() (which works much like the
read(2) system call) to read this data from the archive, or
<b>archive_read_data_block</b>() which provides a slightly
more efficient interface. You may prefer to use the
higher-level <b>archive_read_data_skip</b>(), which reads
and discards the data for this entry,
<b>archive_read_data_into_fd</b>(), which copies the data to
the provided file descriptor, or
<b>archive_read_extract</b>(), which recreates the specified
entry on disk and copies data from the archive. In
particular, note that <b>archive_read_extract</b>() uses the
struct archive_entry structure that you provide it, which
may differ from the entry just read from the archive. In
particular, many applications will want to override the
pathname, file permissions, or ownership.</p>

<p style="margin-left:6%; margin-top: 1em"><b>Release
resources</b> <br>
See archive_read_free(3).</p>

<p style="margin-left:6%; margin-top: 1em">Once you have
finished reading data from the archive, you should call
<b>archive_read_close</b>() to close the archive, then call
<b>archive_read_free</b>() to release all resources,
including all memory allocated by the library.</p>

<p style="margin-top: 1em"><b>EXAMPLE</b></p>

<p style="margin-left:6%;">The following illustrates basic
usage of the library. In this example, the callback
functions are simply wrappers around the standard open(2),
read(2), and close(2) system calls.</p>

<p style="margin-left:14%; margin-top: 1em">void <br>
list_archive(const char *name) <br>
{ <br>
struct mydata *mydata; <br>
struct archive *a; <br>
struct archive_entry *entry;</p>

<p style="margin-left:14%; margin-top: 1em">mydata =
malloc(sizeof(struct mydata)); <br>
a = archive_read_new(); <br>
mydata-&gt;name = name; <br>
archive_read_support_filter_all(a); <br>
archive_read_support_format_all(a); <br>
archive_read_open(a, mydata, myopen, myread, myclose); <br>
while (archive_read_next_header(a, &amp;entry) ==
ARCHIVE_OK) { <br>
printf(&quot;%s\n&quot;,archive_entry_pathname(entry)); <br>
archive_read_data_skip(a); <br>
} <br>
archive_read_free(a); <br>
free(mydata); <br>
}</p>

<p style="margin-left:14%; margin-top: 1em">la_ssize_t <br>
myread(struct archive *a, void *client_data, const void
**buff) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:14%; margin-top: 1em">*buff =
mydata-&gt;buff; <br>
return (read(mydata-&gt;fd, mydata-&gt;buff, 10240)); <br>
}</p>

<p style="margin-left:14%; margin-top: 1em">int <br>
myopen(struct archive *a, void *client_data) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:14%; margin-top: 1em">mydata-&gt;fd =
open(mydata-&gt;name, O_RDONLY); <br>
return (mydata-&gt;fd &gt;= 0 ? ARCHIVE_OK : ARCHIVE_FATAL);
<br>
}</p>

<p style="margin-left:14%; margin-top: 1em">int <br>
myclose(struct archive *a, void *client_data) <br>
{ <br>
struct mydata *mydata = client_data;</p>

<p style="margin-left:14%; margin-top: 1em">if
(mydata-&gt;fd &gt; 0) <br>
close(mydata-&gt;fd); <br>
return (ARCHIVE_OK); <br>
}</p>

<p style="margin-top: 1em"><b>SEE ALSO</b></p>

<p style="margin-left:6%;">tar(1), libarchive(3),
archive_read_new(3), archive_read_data(3),
archive_read_extract(3), archive_read_filter(3),
archive_read_format(3), archive_read_header(3),
archive_read_open(3), archive_read_set_options(3),
archive_util(3), tar(5)</p>

<p style="margin-top: 1em"><b>HISTORY</b></p>

<p style="margin-left:6%;">The <b>libarchive</b> library
first appeared in FreeBSD&nbsp;5.3.</p>

<p style="margin-top: 1em"><b>AUTHORS</b></p>

<p style="margin-left:6%;">The <b>libarchive</b> library
was written by Tim Kientzle &lt;kientzle@@acm.org&gt;.</p>

<p style="margin-top: 1em"><b>BUGS</b></p>

<p style="margin-left:6%;">Many traditional archiver
programs treat empty files as valid empty archives. For
example, many implementations of tar(1) allow you to append
entries to an empty file. Of course, it is impossible to
determine the format of an empty file by inspecting the
contents, so this library treats empty files as having a
special &rsquo;&rsquo;empty&rsquo;&rsquo; format.</p>

<p style="margin-left:6%; margin-top: 1em">BSD
February&nbsp;2, 2012 BSD</p>
<hr>
</body>
</html>
@


1.1.1.6
log
@Import libarchive-3.3.1.
@
text
@d2 1
a2 1
<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
d227 1
a227 1
special &lsquo;&lsquo;empty&rsquo;&rsquo; format.</p>
@


1.1.1.7
log
@Import libarchive-3.3.2 + 9de5f3 + f9dacbf:
- Support NFS4 ACLs on Linux
- Bugfixes
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
d227 1
a227 1
special &rsquo;&rsquo;empty&rsquo;&rsquo; format.</p>
@


1.1.1.8
log
@Import libarchive-3.3.3 as should have done originally.
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Sep  3 22:55:07 2018 -->
@


1.1.1.9
log
@Import libarchive 3.4.0
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.4 -->
<!-- CreationDate: Wed Jun 12 21:10:15 2019 -->
d227 1
a227 1
special &ldquo;empty&rdquo; format.</p>
@


1.1.1.10
log
@Import libarchive 3.7.2
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Sep 11 22:06:19 2023 -->
d137 1
a137 1
<p style="margin-top: 1em"><b>EXAMPLES</b></p>
d202 2
a203 1
<p style="margin-left:6%;">tar(1), archive_read_data(3),
d206 2
a207 3
archive_read_new(3), archive_read_open(3),
archive_read_set_options(3), archive_util(3), libarchive(3),
tar(5)</p>
@


1.1.1.11
log
@libarchive: import version 3.7.3
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Apr  7 22:36:26 2024 -->
@


1.1.1.12
log
@Libarchive 3.7.4 is a bugfix and security release

Security fixes:

rar: Fix OOB in rar e8 filter (CVE-2024-26256)
zip: Fix out of boundary access

Important bugfixes:

7zip: Limit amount of properties
bsdtar: Fix error handling around strtol() usages
passphrase: Improve newline handling on Windows
passphrase: Never allow empty passwords
rar: Fix "File CRC Error" when extracting specific rar4 archives
xar: Avoid infinite link loop
zip: Update AppleDouble support for directories
zstd: Implement core detection
@
text
@d2 1
a2 1
<!-- CreationDate: Fri Apr 26 09:23:45 2024 -->
@


1.1.1.13
log
@libarchive: imported version 3.7.5

Libarchive 3.7.5

Security fixes:

fix multiple vulnerabilities identified by SAST
cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing
lzop: prevent integer overflow
rar4: protect copy_from_lzss_window_to_unp()
rar4: fix CVE-2024-26256
rar4: fix OOB in delta and audio filter
rar4: fix out of boundary access with large files
rar4: add boundary checks to rgb filter
rar4: fix OOB access with unicode filenames
rar5: clear 'data ready' cache on window buffer reallocs
rpm: calculate huge header sizes correctly
unzip: unify EOF handling
util: fix out of boundary access in mktemp functions
uu: stop processing if lines are too long

Important bugfixes:

7zip: fix issue when skipping first file in 7zip archive that is a multiple of 65536 bytes
ar: fix archive entries having no type
lha: do not allow negative file sizes
lha: fix integer truncation on 32-bit systems
shar: check strdup return value
rar5: don't try to read rediculously long names
xar: fix another infinite loop and expat error handling
many Windows fixes, cleanups and improvements
@
text
@d2 1
a2 1
<!-- CreationDate: Fri Sep 13 20:31:04 2024 -->
@


1.1.1.14
log
@libarchove: import version 3.7.7
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.23.0 -->
<!-- CreationDate: Sun Oct 13 08:12:08 2024 -->
d23 2
a24 2
<p><i>ARCHIVE_READ</i>(3) Library Functions Manual
<i>ARCHIVE_READ</i>(3)</p>
d28 2
a29 2
<p style="margin-left:9%;">archive_read &mdash; functions
for reading streaming archives</p>
d33 1
a33 1
<p style="margin-left:9%;">Streaming Archive Library
d38 1
a38 1
<p style="margin-left:9%;"><b>#include
d43 1
a43 1
<p style="margin-left:9%;">These functions provide a
d50 3
a52 2
<p style="margin-left:4%; margin-top: 1em"><b>Create
archive object</b></p>
d54 1
a54 4
<p style="margin-left:9%;">See
<i>archive_read_new</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">To read an
d58 3
a60 6
<p style="margin-left:4%; margin-top: 1em"><b>Enable
filters and formats</b></p>

<p style="margin-left:9%;">See
<i>archive_read_filter</i>(3) and
<i>archive_read_format</i>(3).</p>
d62 1
a62 1
<p style="margin-left:9%; margin-top: 1em">You can then
d78 7
a84 8
<p style="margin-left:4%; margin-top: 1em"><b>Set
options</b></p>

<p style="margin-left:9%;">See
<i>archive_read_set_options</i>(3).</p>

<p style="margin-left:4%; margin-top: 1em"><b>Open
archive</b></p>
d86 1
a86 4
<p style="margin-left:9%;">See
<i>archive_read_open</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">Once you have
d99 4
a102 6
<p style="margin-left:4%; margin-top: 1em"><b>Consume
archive</b></p>

<p style="margin-left:9%;">See
<i>archive_read_header</i>(3), <i>archive_read_data</i>(3)
and <i>archive_read_extract</i>(3).</p>
d104 1
a104 1
<p style="margin-left:9%; margin-top: 1em">Each archive
d112 5
a116 5
<i>read</i>(2) system call) to read this data from the
archive, or <b>archive_read_data_block</b>() which provides
a slightly more efficient interface. You may prefer to use
the higher-level <b>archive_read_data_skip</b>(), which
reads and discards the data for this entry,
d127 3
a129 2
<p style="margin-left:4%; margin-top: 1em"><b>Release
resources</b></p>
d131 1
a131 4
<p style="margin-left:9%;">See
<i>archive_read_free</i>(3).</p>

<p style="margin-left:9%; margin-top: 1em">Once you have
d139 1
a139 1
<p style="margin-left:9%;">The following illustrates basic
d141 2
a142 3
functions are simply wrappers around the standard
<i>open</i>(2), <i>read</i>(2), and <i>close</i>(2) system
calls.</p>
d144 1
a144 1
<p style="margin-left:17%; margin-top: 1em">void <br>
d151 1
a151 1
<p style="margin-left:17%; margin-top: 1em">mydata =
d167 1
a167 1
<p style="margin-left:17%; margin-top: 1em">la_ssize_t <br>
d173 1
a173 1
<p style="margin-left:17%; margin-top: 1em">*buff =
d178 1
a178 1
<p style="margin-left:17%; margin-top: 1em">int <br>
d183 1
a183 1
<p style="margin-left:17%; margin-top: 1em">mydata-&gt;fd =
d189 1
a189 1
<p style="margin-left:17%; margin-top: 1em">int <br>
d194 1
a194 1
<p style="margin-left:17%; margin-top: 1em">if
d202 6
a207 8
<p style="margin-left:9%;"><i>tar</i>(1),
<i>archive_read_data</i>(3), <i>archive_read_extract</i>(3),
<i>archive_read_filter</i>(3),
<i>archive_read_format</i>(3),
<i>archive_read_header</i>(3), <i>archive_read_new</i>(3),
<i>archive_read_open</i>(3),
<i>archive_read_set_options</i>(3), <i>archive_util</i>(3),
<i>libarchive</i>(3), <i>tar</i>(5)</p>
d211 1
a211 1
<p style="margin-left:9%;">The <b>libarchive</b> library
d216 1
a216 1
<p style="margin-left:9%;">The <b>libarchive</b> library
d221 1
a221 1
<p style="margin-left:9%;">Many traditional archiver
d223 3
a225 3
example, many implementations of <i>tar</i>(1) allow you to
append entries to an empty file. Of course, it is impossible
to determine the format of an empty file by inspecting the
d227 4
a230 2
special &ldquo;empty&rdquo; format. Debian February 2, 2012
<i>ARCHIVE_READ</i>(3)</p>
@


1.1.1.15
log
@libarchive: imported version 3.7.9
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Mar 30 20:07:36 2025 -->
@


1.1.1.16
log
@libarchive: import version 3.8.0

Libarchive 3.8.0 is a feature and bugfix release.

New features:
bsdtar: support --mtime and --clamp-mtime
lib: mbedtls 3.x compatibility
7-zip reader: improve self-extracting archive detection
xar: xmllite support for the XAR reader and writer
zip writer: added XZ, LZMA, ZSTD and BZIP2 support
zip writer: added LZMA + RISCV BCJ filter

Notable security fixes:
rar: do not skip past EOF while reading
rar: fix double free with over 4 billion nodes
rar: fix heap-buffer-overflow
warc: prevent signed integer overflow
tar: fix overflow in build_ustar_entry

Notable bugfixes:
bsdtar: don't hardlink negative inode files together
gz: allow setting the original filename for gzip compressed files
lib: improve lseek handling
lib: support @@-prefixed Unix epoch timestamps as date strings
rar: support large headers on 32 bit systems
tar reader: Improve LFS support on 32 bit systems
@
text
@d2 1
a2 1
<!-- CreationDate: Tue May 20 09:02:18 2025 -->
@


1.1.1.17
log
@libarchive: import version 3.8.1
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Jun  1 19:29:39 2025 -->
@


1.1.1.18
log
@libarchive: imported version 3.8.2
@
text
@d2 1
a2 1
<!-- CreationDate: Wed Oct 15 21:49:45 2025 -->
@


1.1.1.19
log
@libarchive: import version 3.8.3
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Nov 17 22:19:01 2025 -->
@


1.1.1.20
log
@libarchive: import 3.8.4
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Dec  1 12:42:37 2025 -->
@


1.1.1.21
log
@libarchive: import version 3.8.5
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jan  5 10:42:43 2026 -->
@


1.1.1.22
log
@libarchive: imported version 3.8.6
@
text
@d2 1
a2 1
<!-- CreationDate: Tue Mar 10 09:57:27 2026 -->
@


1.1.1.23
log
@libarchive: imported version 3.8.7
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Apr 13 12:57:33 2026 -->
@


