/usr/share/doc/liblzma-doc/html/stream__buffer__encoder_8c.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 | <!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: liblzma/common/stream_buffer_encoder.c 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_2e0898c272e1f0f93c8ef15f5da2a912.html">liblzma</a></li><li class="navelem"><a class="el" href="dir_db777975f8e21a5de5f283e04473bf67.html">common</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">stream_buffer_encoder.c File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Single-call .xz Stream encoder.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include "index.h"</code><br/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ace1b0af8bcbc7079142ac2587b02615f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="stream__buffer__encoder_8c.html#ace1b0af8bcbc7079142ac2587b02615f">INDEX_BOUND</a>   ((1 + 1 + 2 * <a class="el" href="vli_8h.html#a063ecff4133aa2f8899b9fa3fdefd310">LZMA_VLI_BYTES_MAX</a> + 4 + 3) & ~3)</td></tr>
<tr class="separator:ace1b0af8bcbc7079142ac2587b02615f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6cf3bc89aed406bb48c785dca58ae9da"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="stream__buffer__encoder_8c.html#a6cf3bc89aed406bb48c785dca58ae9da">HEADERS_BOUND</a>   (2 * <a class="el" href="stream__flags_8h.html#ada7e0a4f5e7146f547962cb9e9ef08ee">LZMA_STREAM_HEADER_SIZE</a> + <a class="el" href="stream__buffer__encoder_8c.html#ace1b0af8bcbc7079142ac2587b02615f">INDEX_BOUND</a>)</td></tr>
<tr class="memdesc:a6cf3bc89aed406bb48c785dca58ae9da"><td class="mdescLeft"> </td><td class="mdescRight">Stream Header, Stream Footer, and Index. <a href="#a6cf3bc89aed406bb48c785dca58ae9da">More...</a><br/></td></tr>
<tr class="separator:a6cf3bc89aed406bb48c785dca58ae9da"><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:a870286986caa1c0ac6ce6c4074284420"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="stream__buffer__encoder_8c.html#a870286986caa1c0ac6ce6c4074284420">lzma_stream_buffer_bound</a> (size_t uncompressed_size)</td></tr>
<tr class="memdesc:a870286986caa1c0ac6ce6c4074284420"><td class="mdescLeft"> </td><td class="mdescRight">Calculate output buffer size for single-call Stream encoder. <a href="#a870286986caa1c0ac6ce6c4074284420">More...</a><br/></td></tr>
<tr class="separator:a870286986caa1c0ac6ce6c4074284420"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a932a602de4f44d8525687698e51ce93d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="base_8h.html#a8494e0457e1463d6d2b6836018d87b6e">lzma_ret</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="stream__buffer__encoder_8c.html#a932a602de4f44d8525687698e51ce93d">lzma_stream_buffer_encode</a> (<a class="el" href="structlzma__filter.html">lzma_filter</a> *<a class="el" href="coder_8c.html#a9325236d5759d4eaadcba08a6bb5c96f">filters</a>, <a class="el" href="api_2lzma_2check_8h.html#a0a6100c719ac9aa49be3fdf7519e8c3f">lzma_check</a> <a class="el" href="coder_8c.html#a5c94b0defea7996f245faec2693056cb">check</a>, <a class="el" href="structlzma__allocator.html">lzma_allocator</a> *allocator, const uint8_t *in, size_t in_size, uint8_t *out, size_t *out_pos_ptr, size_t out_size)</td></tr>
<tr class="memdesc:a932a602de4f44d8525687698e51ce93d"><td class="mdescLeft"> </td><td class="mdescRight">Single-call .xz Stream encoder. <a href="#a932a602de4f44d8525687698e51ce93d">More...</a><br/></td></tr>
<tr class="separator:a932a602de4f44d8525687698e51ce93d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Single-call .xz Stream encoder. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ace1b0af8bcbc7079142ac2587b02615f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define INDEX_BOUND   ((1 + 1 + 2 * <a class="el" href="vli_8h.html#a063ecff4133aa2f8899b9fa3fdefd310">LZMA_VLI_BYTES_MAX</a> + 4 + 3) & ~3)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Maximum size of Index that has exactly one Record. Index Indicator + Number of Records + Record + CRC32 rounded up to the next multiple of four. </p>
</div>
</div>
<a class="anchor" id="a6cf3bc89aed406bb48c785dca58ae9da"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define HEADERS_BOUND   (2 * <a class="el" href="stream__flags_8h.html#ada7e0a4f5e7146f547962cb9e9ef08ee">LZMA_STREAM_HEADER_SIZE</a> + <a class="el" href="stream__buffer__encoder_8c.html#ace1b0af8bcbc7079142ac2587b02615f">INDEX_BOUND</a>)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Stream Header, Stream Footer, and Index. </p>
<p>Referenced by <a class="el" href="stream__buffer__encoder_8c.html#a870286986caa1c0ac6ce6c4074284420">lzma_stream_buffer_bound()</a>.</p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a870286986caa1c0ac6ce6c4074284420"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t lzma_stream_buffer_bound </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>uncompressed_size</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Calculate output buffer size for single-call Stream encoder. </p>
<p>When trying to compress uncompressible data, the encoded size will be slightly bigger than the input data. This function calculates how much output buffer space is required to be sure that <a class="el" href="container_8h.html#a558683e06e092cb3b9e7edb226d6a1b8" title="Single-call .xz Stream encoder. ">lzma_stream_buffer_encode()</a> doesn't return LZMA_BUF_ERROR.</p>
<p>The calculated value is not exact, but it is guaranteed to be big enough. The actual maximum output space required may be slightly smaller (up to about 100 bytes). This should not be a problem in practice.</p>
<p>If the calculated maximum size doesn't fit into size_t or would make the Stream grow past LZMA_VLI_MAX (which should never happen in practice), zero is returned to indicate the error.</p>
<dl class="section note"><dt>Note</dt><dd>The limit calculated by this function applies only to single-call encoding. Multi-call encoding may (and probably will) have larger maximum expansion when encoding uncompressible data. Currently there is no function to calculate the maximum expansion of multi-call encoding. </dd></dl>
<p>References <a class="el" href="stream__buffer__encoder_8c.html#a6cf3bc89aed406bb48c785dca58ae9da">HEADERS_BOUND</a>, <a class="el" href="block_8h.html#a58ff73e2572b529f48cc590bfffe5b4f">lzma_block_buffer_bound()</a>, and <a class="el" href="vli_8h.html#a7b782528bd1934db7c020adbedb20ec9">LZMA_VLI_MAX</a>.</p>
</div>
</div>
<a class="anchor" id="a932a602de4f44d8525687698e51ce93d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="base_8h.html#a8494e0457e1463d6d2b6836018d87b6e">lzma_ret</a> lzma_stream_buffer_encode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structlzma__filter.html">lzma_filter</a> * </td>
<td class="paramname"><em>filters</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="api_2lzma_2check_8h.html#a0a6100c719ac9aa49be3fdf7519e8c3f">lzma_check</a> </td>
<td class="paramname"><em>check</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structlzma__allocator.html">lzma_allocator</a> * </td>
<td class="paramname"><em>allocator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint8_t * </td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>in_size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t * </td>
<td class="paramname"><em>out</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"><em>out_pos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>out_size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Single-call .xz Stream encoder. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filters</td><td>Array of filters. This must be terminated with filters[n].id = LZMA_VLI_UNKNOWN. See <a class="el" href="filter_8h.html" title="Common filter related types and functions. ">filter.h</a> for more information. </td></tr>
<tr><td class="paramname">check</td><td>Type of the integrity check to calculate from uncompressed data. </td></tr>
<tr><td class="paramname">allocator</td><td><a class="el" href="structlzma__allocator.html" title="Custom functions for memory handling. ">lzma_allocator</a> for custom allocator functions. Set to NULL to use malloc() and free(). </td></tr>
<tr><td class="paramname">in</td><td>Beginning of the input buffer </td></tr>
<tr><td class="paramname">in_size</td><td>Size of the input buffer </td></tr>
<tr><td class="paramname">out</td><td>Beginning of the output buffer </td></tr>
<tr><td class="paramname">out_pos</td><td>The next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds. </td></tr>
<tr><td class="paramname">out_size</td><td>Size of the out buffer; the first byte into which no data is written to is out[out_size].</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- LZMA_OK: Encoding was successful.<ul>
<li>LZMA_BUF_ERROR: Not enough output buffer space.</li>
<li>LZMA_UNSUPPORTED_CHECK</li>
<li>LZMA_OPTIONS_ERROR</li>
<li>LZMA_MEM_ERROR</li>
<li>LZMA_DATA_ERROR</li>
<li>LZMA_PROG_ERROR </li>
</ul>
</dd></dl>
<p>References <a class="el" href="structlzma__stream__flags.html#aaa65ed7a55a098f829f04dba25d0f212">lzma_stream_flags::backward_size</a>, <a class="el" href="coder_8c.html#a5c94b0defea7996f245faec2693056cb">check</a>, <a class="el" href="coder_8c.html#a9325236d5759d4eaadcba08a6bb5c96f">filters</a>, <a class="el" href="block_8h.html#a41e080db33169819f985595d48a157bc">lzma_block_buffer_encode()</a>, <a class="el" href="block_8h.html#a412d5605280fa29befae1b89e344bf30">lzma_block_unpadded_size()</a>, <a class="el" href="base_8h.html#a8494e0457e1463d6d2b6836018d87b6ea9ca0ecb62459bdc84d6af47d16b23ae5">LZMA_BUF_ERROR</a>, <a class="el" href="api_2lzma_2check_8h.html#acd221ababe30230d9647aab469ad80cb">LZMA_CHECK_ID_MAX</a>, <a class="el" href="api_2lzma_2check_8h.html#ae9391ed2acfad0ce9357b68c608f07d8">lzma_check_is_supported()</a>, <a class="el" href="api_2lzma_2index_8h.html#aad24f1d4784b7c665b27ae91b52d3bd1">lzma_index_append()</a>, <a class="el" href="api_2lzma_2index_8h.html#add1ef06dec8a26d08ae8651cff0fd8d6">lzma_index_buffer_encode()</a>, <a class="el" href="api_2lzma_2index_8h.html#a469f89689529ea250969bb64f80ab874">lzma_index_end()</a>, <a class="el" href="api_2lzma_2index_8h.html#ad17c5c45cd2692cc296261a91a4690f1">lzma_index_init()</a>, <a class="el" href="api_2lzma_2index_8h.html#a669ed1a82b1941217cfbb07e7826afc2">lzma_index_size()</a>, <a class="el" href="base_8h.html#a8494e0457e1463d6d2b6836018d87b6ea567e1464feca03900a5425fb45b2f5b6">LZMA_MEM_ERROR</a>, <a class="el" href="base_8h.html#a8494e0457e1463d6d2b6836018d87b6eac003781ccb81bbd5578e29abed8a8cfe">LZMA_OK</a>, <a class="el" href="base_8h.html#a8494e0457e1463d6d2b6836018d87b6ea2dac8d451cb38da8550653d0d7be4ec2">LZMA_PROG_ERROR</a>, <a class="el" href="stream__flags_8h.html#a438249a75ea8da952a7474b92bfe7b7a">lzma_stream_footer_encode()</a>, <a class="el" href="stream__flags_8h.html#a2ebb8d6dff23daeb3de398913b845eff">lzma_stream_header_encode()</a>, <a class="el" href="stream__flags_8h.html#ada7e0a4f5e7146f547962cb9e9ef08ee">LZMA_STREAM_HEADER_SIZE</a>, <a class="el" href="base_8h.html#a8494e0457e1463d6d2b6836018d87b6ea989f393a1772d85bf545a9da48fc7ac2">LZMA_UNSUPPORTED_CHECK</a>, <a class="el" href="common_8h.html#a3e1bf9f33b917e883b886b8a10458d66">return_if_error</a>, <a class="el" href="structlzma__block.html#a17362d38d1946dd16a9686557ec19a94">lzma_block::uncompressed_size</a>, <a class="el" href="structlzma__block.html#ac3936a5b0ec3f9b8f9c7ad68e7d149a5">lzma_block::version</a>, and <a class="el" href="structlzma__stream__flags.html#a61e9151869d5b77c868aaa4958e74d10">lzma_stream_flags::version</a>.</p>
<p>Referenced by <a class="el" href="easy__buffer__encoder_8c.html#a802ea8c78e3fe12308c79b3ea385f643">lzma_easy_buffer_encode()</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>
|