Imported Upstream version 3.3.1
[platform/upstream/libarchive.git] / doc / html / archive_read_data.3.html
1 <!-- Creator     : groff version 1.22.3 -->
2 <!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4 "http://www.w3.org/TR/html4/loose.dtd">
5 <html>
6 <head>
7 <meta name="generator" content="groff -Thtml, see www.gnu.org">
8 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9 <meta name="Content-Style" content="text/css">
10 <style type="text/css">
11        p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
12        pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
13        table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
14        h1      { text-align: center }
15 </style>
16 <title></title>
17 </head>
18 <body>
19
20 <hr>
21
22
23 <p>ARCHIVE_READ_DATA(3) BSD Library Functions Manual
24 ARCHIVE_READ_DATA(3)</p>
25
26 <p style="margin-top: 1em"><b>NAME</b></p>
27
28 <p style="margin-left:6%;"><b>archive_read_data
29 archive_read_data_block</b>, <b>archive_read_data_skip</b>,
30 <b>archive_read_data_into_fd</b> &mdash; functions for
31 reading streaming archives</p>
32
33 <p style="margin-top: 1em"><b>LIBRARY</b></p>
34
35 <p style="margin-left:6%;">Streaming Archive Library
36 (libarchive, -larchive)</p>
37
38 <p style="margin-top: 1em"><b>SYNOPSIS</b></p>
39
40 <p style="margin-left:6%;"><b>#include
41 &lt;archive.h&gt;</b></p>
42
43
44 <p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p>
45
46
47 <p style="margin-left:12%;"><b>archive_read_data</b>(<i>struct&nbsp;archive&nbsp;*</i>,
48 <i>void&nbsp;*buff</i>, <i>size_t&nbsp;len</i>);</p>
49
50 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
51
52
53 <p><b>archive_read_data_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
54 <i>const&nbsp;void&nbsp;**buff</i>, <i>size_t&nbsp;*len</i>,
55 <i>off_t&nbsp;*offset</i>);</p>
56
57 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
58
59
60 <p style="margin-left:12%;"><b>archive_read_data_skip</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
61
62 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
63
64
65 <p style="margin-left:12%;"><b>archive_read_data_into_fd</b>(<i>struct&nbsp;archive&nbsp;*</i>,
66 <i>int&nbsp;fd</i>);</p>
67
68 <p style="margin-top: 1em"><b>DESCRIPTION <br>
69 archive_read_data</b>()</p>
70
71 <p style="margin-left:17%;">Read data associated with the
72 header just read. Internally, this is a convenience function
73 that calls <b>archive_read_data_block</b>() and fills any
74 gaps with nulls so that callers see a single continuous
75 stream of data.</p>
76
77 <p><b>archive_read_data_block</b>()</p>
78
79 <p style="margin-left:17%;">Return the next available block
80 of data for this entry. Unlike <b>archive_read_data</b>(),
81 the <b>archive_read_data_block</b>() function avoids copying
82 data and allows you to correctly handle sparse files, as
83 supported by some archive formats. The library guarantees
84 that offsets will increase and that blocks will not overlap.
85 Note that the blocks returned from this function can be much
86 larger than the block size read from disk, due to
87 compression and internal buffer optimizations.</p>
88
89 <p><b>archive_read_data_skip</b>()</p>
90
91 <p style="margin-left:17%;">A convenience function that
92 repeatedly calls <b>archive_read_data_block</b>() to skip
93 all of the data for this archive entry. Note that this
94 function is invoked automatically by
95 <b>archive_read_next_header2</b>() if the previous entry was
96 not completely consumed.</p>
97
98 <p><b>archive_read_data_into_fd</b>()</p>
99
100 <p style="margin-left:17%;">A convenience function that
101 repeatedly calls <b>archive_read_data_block</b>() to copy
102 the entire entry to the provided file descriptor.</p>
103
104 <p style="margin-top: 1em"><b>RETURN VALUES</b></p>
105
106 <p style="margin-left:6%;">Most functions return zero on
107 success, non-zero on error. The possible return codes
108 include: <b>ARCHIVE_OK</b> (the operation succeeded),
109 <b>ARCHIVE_WARN</b> (the operation succeeded but a
110 non-critical error was encountered), <b>ARCHIVE_EOF</b>
111 (end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the
112 operation failed but can be retried), and
113 <b>ARCHIVE_FATAL</b> (there was a fatal error; the archive
114 should be closed immediately).</p>
115
116
117 <p style="margin-left:6%; margin-top: 1em"><b>archive_read_data</b>()
118 returns a count of bytes actually read or zero at the end of
119 the entry. On error, a value of <b>ARCHIVE_FATAL</b>,
120 <b>ARCHIVE_WARN</b>, or <b>ARCHIVE_RETRY</b> is
121 returned.</p>
122
123 <p style="margin-top: 1em"><b>ERRORS</b></p>
124
125 <p style="margin-left:6%;">Detailed error codes and textual
126 descriptions are available from the <b>archive_errno</b>()
127 and <b>archive_error_string</b>() functions.</p>
128
129 <p style="margin-top: 1em"><b>SEE ALSO</b></p>
130
131 <p style="margin-left:6%;">tar(1), libarchive(3),
132 archive_read(3), archive_read_extract(3),
133 archive_read_filter(3), archive_read_format(3),
134 archive_read_header(3), archive_read_open(3),
135 archive_read_set_options(3), archive_util(3), tar(5)</p>
136
137 <p style="margin-left:6%; margin-top: 1em">BSD
138 February&nbsp;2, 2012 BSD</p>
139 <hr>
140 </body>
141 </html>