/usr/share/doc/liblzma-doc/html/file__io_8h.html is in liblzma-doc 5.1.1alpha+20120614-2ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>XZ Utils: xz/file_io.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">XZ Utils
 <span id="projectnumber">5.1.0alpha</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_53e01eec41348db90f08d9ee7e6793af.html">xz</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#define-members">Macros</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">file_io.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>I/O types and functions.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union  </td><td class="memItemRight" valign="bottom"><a class="el" href="unionio__buf.html">io_buf</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structfile__pair.html">file_pair</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:abe5d3c90538920357e5f36e108e5dcaa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe5d3c90538920357e5f36e108e5dcaa"></a>
#define </td><td class="memItemRight" valign="bottom"><b>IO_BUFFER_SIZE</b>   8192</td></tr>
<tr class="separator:abe5d3c90538920357e5f36e108e5dcaa"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a43bba613ce0efd6af387cd04458ede8d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#a43bba613ce0efd6af387cd04458ede8d">io_init</a> (void)</td></tr>
<tr class="memdesc:a43bba613ce0efd6af387cd04458ede8d"><td class="mdescLeft"> </td><td class="mdescRight">Initialize the I/O module. <a href="#a43bba613ce0efd6af387cd04458ede8d">More...</a><br/></td></tr>
<tr class="separator:a43bba613ce0efd6af387cd04458ede8d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a26350b70a7ef7ae45e57f04157ade2aa"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#a26350b70a7ef7ae45e57f04157ade2aa">io_no_sparse</a> (void)</td></tr>
<tr class="memdesc:a26350b70a7ef7ae45e57f04157ade2aa"><td class="mdescLeft"> </td><td class="mdescRight">Disable creation of sparse files when decompressing. <a href="#a26350b70a7ef7ae45e57f04157ade2aa">More...</a><br/></td></tr>
<tr class="separator:a26350b70a7ef7ae45e57f04157ade2aa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac4fb03f340ee03676cbde913682a3719"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structfile__pair.html">file_pair</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#ac4fb03f340ee03676cbde913682a3719">io_open_src</a> (const char *src_name)</td></tr>
<tr class="memdesc:ac4fb03f340ee03676cbde913682a3719"><td class="mdescLeft"> </td><td class="mdescRight">Open the source file. <a href="#ac4fb03f340ee03676cbde913682a3719">More...</a><br/></td></tr>
<tr class="separator:ac4fb03f340ee03676cbde913682a3719"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a51c7b0ad8b7829773a69972565b7d08d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#a51c7b0ad8b7829773a69972565b7d08d">io_open_dest</a> (<a class="el" href="structfile__pair.html">file_pair</a> *pair)</td></tr>
<tr class="memdesc:a51c7b0ad8b7829773a69972565b7d08d"><td class="mdescLeft"> </td><td class="mdescRight">Open the destination file. <a href="#a51c7b0ad8b7829773a69972565b7d08d">More...</a><br/></td></tr>
<tr class="separator:a51c7b0ad8b7829773a69972565b7d08d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8dcc56461111f392398385820ad9c1d9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#a8dcc56461111f392398385820ad9c1d9">io_close</a> (<a class="el" href="structfile__pair.html">file_pair</a> *pair, bool success)</td></tr>
<tr class="memdesc:a8dcc56461111f392398385820ad9c1d9"><td class="mdescLeft"> </td><td class="mdescRight">Closes the file descriptors and frees possible allocated memory. <a href="#a8dcc56461111f392398385820ad9c1d9">More...</a><br/></td></tr>
<tr class="separator:a8dcc56461111f392398385820ad9c1d9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aeda6fa2567b1b96603abbae64217e2f8"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#aeda6fa2567b1b96603abbae64217e2f8">io_read</a> (<a class="el" href="structfile__pair.html">file_pair</a> *pair, <a class="el" href="unionio__buf.html">io_buf</a> *buf, size_t size)</td></tr>
<tr class="memdesc:aeda6fa2567b1b96603abbae64217e2f8"><td class="mdescLeft"> </td><td class="mdescRight">Reads from the source file to a buffer. <a href="#aeda6fa2567b1b96603abbae64217e2f8">More...</a><br/></td></tr>
<tr class="separator:aeda6fa2567b1b96603abbae64217e2f8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa06dd4cd771d5a19bc191ff334f0623a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#aa06dd4cd771d5a19bc191ff334f0623a">io_fix_src_pos</a> (<a class="el" href="structfile__pair.html">file_pair</a> *pair, size_t rewind_size)</td></tr>
<tr class="memdesc:aa06dd4cd771d5a19bc191ff334f0623a"><td class="mdescLeft"> </td><td class="mdescRight">Fix the position in src_fd. <a href="#aa06dd4cd771d5a19bc191ff334f0623a">More...</a><br/></td></tr>
<tr class="separator:aa06dd4cd771d5a19bc191ff334f0623a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af0781545c818796c48a4ee8dadd2c2a7"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#af0781545c818796c48a4ee8dadd2c2a7">io_pread</a> (<a class="el" href="structfile__pair.html">file_pair</a> *pair, <a class="el" href="unionio__buf.html">io_buf</a> *buf, size_t size, off_t pos)</td></tr>
<tr class="memdesc:af0781545c818796c48a4ee8dadd2c2a7"><td class="mdescLeft"> </td><td class="mdescRight">Read from source file from given offset to a buffer. <a href="#af0781545c818796c48a4ee8dadd2c2a7">More...</a><br/></td></tr>
<tr class="separator:af0781545c818796c48a4ee8dadd2c2a7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a42ccfb816386ca04e622762bad58ef6f"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="file__io_8h.html#a42ccfb816386ca04e622762bad58ef6f">io_write</a> (<a class="el" href="structfile__pair.html">file_pair</a> *pair, const <a class="el" href="unionio__buf.html">io_buf</a> *buf, size_t size)</td></tr>
<tr class="memdesc:a42ccfb816386ca04e622762bad58ef6f"><td class="mdescLeft"> </td><td class="mdescRight">Writes a buffer to the destination file. <a href="#a42ccfb816386ca04e622762bad58ef6f">More...</a><br/></td></tr>
<tr class="separator:a42ccfb816386ca04e622762bad58ef6f"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>I/O types and functions. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a43bba613ce0efd6af387cd04458ede8d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void io_init </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize the I/O module. </p>
</div>
</div>
<a class="anchor" id="a26350b70a7ef7ae45e57f04157ade2aa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void io_no_sparse </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Disable creation of sparse files when decompressing. </p>
<p>References <a class="el" href="file__io_8c.html#a96b3b450da5d99ec1f6bd3e57d5f340a">try_sparse</a>.</p>
</div>
</div>
<a class="anchor" id="ac4fb03f340ee03676cbde913682a3719"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structfile__pair.html">file_pair</a>* io_open_src </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>src_name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open the source file. </p>
<p>References <a class="el" href="file__io_8c.html#af0470bc137d3ae386126db2ca94b5e65">io_open_src_real()</a>, <a class="el" href="util_8c.html#a365345158771d9f70b1487c23149af53">is_empty_filename()</a>, <a class="el" href="signals_8c.html#a6c7cbcd4595590670a3784d393770693">signals_block()</a>, <a class="el" href="signals_8c.html#a55ea2250ff5153a3a4daf1f5a75ea921">signals_unblock()</a>, and <a class="el" href="structfile__pair.html#abcd6b5b852a5bc8815a44dd025113bcf">file_pair::src_name</a>.</p>
<p>Referenced by <a class="el" href="coder_8h.html#acbe7065d22ed54ab19a1a9bb0cb808de">coder_run()</a>, and <a class="el" href="list_8h.html#a2b9bdcc3cdcc48e99a29e178df9d4899">list_file()</a>.</p>
</div>
</div>
<a class="anchor" id="a51c7b0ad8b7829773a69972565b7d08d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool io_open_dest </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfile__pair.html">file_pair</a> * </td>
<td class="paramname"><em>pair</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open the destination file. </p>
<p>References <a class="el" href="signals_8c.html#a6c7cbcd4595590670a3784d393770693">signals_block()</a>, and <a class="el" href="signals_8c.html#a55ea2250ff5153a3a4daf1f5a75ea921">signals_unblock()</a>.</p>
<p>Referenced by <a class="el" href="coder_8h.html#acbe7065d22ed54ab19a1a9bb0cb808de">coder_run()</a>.</p>
</div>
</div>
<a class="anchor" id="a8dcc56461111f392398385820ad9c1d9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void io_close </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfile__pair.html">file_pair</a> * </td>
<td class="paramname"><em>pair</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>success</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes the file descriptors and frees possible allocated memory. </p>
<p>The success argument determines if source or destination file gets unlinked:</p>
<ul>
<li>false: The destination file is unlinked.</li>
<li>true: The source file is unlinked unless writing to stdout or –keep was used. </li>
</ul>
<p>References <a class="el" href="structfile__pair.html#a95b05b836e2abd7cb9b227f03dcb5492">file_pair::dest_fd</a>, <a class="el" href="structfile__pair.html#a7f1b46a8a665881ffa22d2d7b33b91ed">file_pair::dest_name</a>, <a class="el" href="structfile__pair.html#a8372ad2043ad566b72c2743bd42bbe22">file_pair::dest_pending_sparse</a>, <a class="el" href="structfile__pair.html#a0267a1a379d041c2c4dbf6db1035a20c">file_pair::dest_try_sparse</a>, <a class="el" href="file__io_8c.html#a2e1e4bee9c2f87daa8ec40b3072816a5">io_close_dest()</a>, <a class="el" href="file__io_8c.html#ac4e485a5d6cbb717f7eddfc8eae35841">io_close_src()</a>, <a class="el" href="file__io_8c.html#a1884e01ba0a7757bb6fd96fa8a0bf09b">io_copy_attrs()</a>, <a class="el" href="message_8h.html#a61c64c39e7ec889482a901fbd63f794c">message_error()</a>, <a class="el" href="signals_8c.html#a6c7cbcd4595590670a3784d393770693">signals_block()</a>, and <a class="el" href="signals_8c.html#a55ea2250ff5153a3a4daf1f5a75ea921">signals_unblock()</a>.</p>
<p>Referenced by <a class="el" href="coder_8h.html#acbe7065d22ed54ab19a1a9bb0cb808de">coder_run()</a>, and <a class="el" href="list_8h.html#a2b9bdcc3cdcc48e99a29e178df9d4899">list_file()</a>.</p>
</div>
</div>
<a class="anchor" id="aeda6fa2567b1b96603abbae64217e2f8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t io_read </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfile__pair.html">file_pair</a> * </td>
<td class="paramname"><em>pair</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="unionio__buf.html">io_buf</a> * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads from the source file to a buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pair</td><td>File pair having the source file open for reading </td></tr>
<tr><td class="paramname">buf</td><td>Destination buffer to hold the read data </td></tr>
<tr><td class="paramname">size</td><td>Size of the buffer; assumed be smaller than SSIZE_MAX</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, number of bytes read is returned. On end of file zero is returned and pair->src_eof set to true. On error, SIZE_MAX is returned and error message printed. </dd></dl>
<p>References <a class="el" href="message_8h.html#a61c64c39e7ec889482a901fbd63f794c">message_error()</a>, <a class="el" href="structfile__pair.html#afee08cdab4c8f19e0734a6da48e21921">file_pair::src_eof</a>, <a class="el" href="structfile__pair.html#acbab9ee46b39f49a7996360ae6dbe0a4">file_pair::src_fd</a>, <a class="el" href="structfile__pair.html#abcd6b5b852a5bc8815a44dd025113bcf">file_pair::src_name</a>, and <a class="el" href="signals_8c.html#a190aaf6ae9eaa75671718e1ceed999e6">user_abort</a>.</p>
<p>Referenced by <a class="el" href="coder_8c.html#a1dc9a6813d9158c93ad48053549825b0">coder_normal()</a>, <a class="el" href="coder_8c.html#ae31acd560ee4d35b7bd0d1bdc94fde0a">coder_passthru()</a>, <a class="el" href="coder_8h.html#acbe7065d22ed54ab19a1a9bb0cb808de">coder_run()</a>, and <a class="el" href="file__io_8h.html#af0781545c818796c48a4ee8dadd2c2a7">io_pread()</a>.</p>
</div>
</div>
<a class="anchor" id="aa06dd4cd771d5a19bc191ff334f0623a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void io_fix_src_pos </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfile__pair.html">file_pair</a> * </td>
<td class="paramname"><em>pair</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>rewind_size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Fix the position in src_fd. </p>
<p>This is used when –single-thream has been specified and decompression is successful. If the input file descriptor supports seeking, this function fixes the input position to point to the next byte after the decompressed stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pair</td><td>File pair having the source file open for reading </td></tr>
<tr><td class="paramname">rewind_size</td><td>How many bytes of extra have been read i.e. how much to seek backwards. </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="structfile__pair.html#acbab9ee46b39f49a7996360ae6dbe0a4">file_pair::src_fd</a>.</p>
<p>Referenced by <a class="el" href="coder_8c.html#a1dc9a6813d9158c93ad48053549825b0">coder_normal()</a>.</p>
</div>
</div>
<a class="anchor" id="af0781545c818796c48a4ee8dadd2c2a7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool io_pread </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfile__pair.html">file_pair</a> * </td>
<td class="paramname"><em>pair</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="unionio__buf.html">io_buf</a> * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">off_t </td>
<td class="paramname"><em>pos</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Read from source file from given offset to a buffer. </p>
<p>This is remotely similar to standard pread(). This uses lseek() though, so the read offset is changed on each call.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pair</td><td>Seekable source file </td></tr>
<tr><td class="paramname">buf</td><td>Destination buffer </td></tr>
<tr><td class="paramname">size</td><td>Amount of data to read </td></tr>
<tr><td class="paramname">pos</td><td>Offset relative to the beginning of the file, from which the data should be read.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, false is returned. On error, error message is printed and true is returned. </dd></dl>
<p>References <a class="el" href="file__io_8c.html#ae7642411c20e8800874f7f95489c8d9d">io_read()</a>, <a class="el" href="message_8h.html#a61c64c39e7ec889482a901fbd63f794c">message_error()</a>, <a class="el" href="structfile__pair.html#acbab9ee46b39f49a7996360ae6dbe0a4">file_pair::src_fd</a>, and <a class="el" href="structfile__pair.html#abcd6b5b852a5bc8815a44dd025113bcf">file_pair::src_name</a>.</p>
<p>Referenced by <a class="el" href="list_8c.html#ae8bf55be793e1ad58bc179ac19168c90">parse_block_header()</a>, <a class="el" href="list_8c.html#a9e7a2155d21e8e64be85e248e8a77f62">parse_check_value()</a>, and <a class="el" href="list_8c.html#ada243f83a8540051b161d0a114ef8f24">parse_indexes()</a>.</p>
</div>
</div>
<a class="anchor" id="a42ccfb816386ca04e622762bad58ef6f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool io_write </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfile__pair.html">file_pair</a> * </td>
<td class="paramname"><em>pair</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="unionio__buf.html">io_buf</a> * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes a buffer to the destination file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pair</td><td>File pair having the destination file open for writing </td></tr>
<tr><td class="paramname">buf</td><td>Buffer containing the data to be written </td></tr>
<tr><td class="paramname">size</td><td>Size of the buffer; assumed be smaller than SSIZE_MAX</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, zero is returned. On error, -1 is returned and error message printed. </dd></dl>
<p>References <a class="el" href="structfile__pair.html#a95b05b836e2abd7cb9b227f03dcb5492">file_pair::dest_fd</a>, <a class="el" href="structfile__pair.html#a7f1b46a8a665881ffa22d2d7b33b91ed">file_pair::dest_name</a>, <a class="el" href="structfile__pair.html#a8372ad2043ad566b72c2743bd42bbe22">file_pair::dest_pending_sparse</a>, <a class="el" href="structfile__pair.html#a0267a1a379d041c2c4dbf6db1035a20c">file_pair::dest_try_sparse</a>, and <a class="el" href="message_8h.html#a61c64c39e7ec889482a901fbd63f794c">message_error()</a>.</p>
<p>Referenced by <a class="el" href="coder_8c.html#a1dc9a6813d9158c93ad48053549825b0">coder_normal()</a>, and <a class="el" href="coder_8c.html#ae31acd560ee4d35b7bd0d1bdc94fde0a">coder_passthru()</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Feb 12 2014 15:12:37 for XZ Utils by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
|