diff options
Diffstat (limited to 'doc/api/index__hash_8h.html')
-rw-r--r-- | doc/api/index__hash_8h.html | 317 |
1 files changed, 317 insertions, 0 deletions
diff --git a/doc/api/index__hash_8h.html b/doc/api/index__hash_8h.html new file mode 100644 index 00000000..788548b4 --- /dev/null +++ b/doc/api/index__hash_8h.html @@ -0,0 +1,317 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> +<head> +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> +<meta http-equiv="X-UA-Compatible" content="IE=11"/> +<meta name="generator" content="Doxygen 1.9.7"/> +<meta name="viewport" content="width=device-width, initial-scale=1"/> +<title>liblzma (XZ Utils): lzma/index_hash.h File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"/> + + +<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 id="projectrow"> + <td id="projectlogo"><img alt="Logo" src="xz-logo.png"/></td> + <td id="projectalign"> + <div id="projectname">liblzma (XZ Utils)<span id="projectnumber"> 5.6.1</span> + </div> + </td> + </tr> + </tbody> +</table> +</div> +<!-- end header part --> +<!-- Generated by Doxygen 1.9.7 --> + <div id="navrow1" class="tabs"> + <ul class="tablist"> + <li><a href="index.html"><span>Main Page</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_b17a1d403082bd69a703ed987cf158fb.html">lzma</a></li> </ul> +</div> +</div><!-- top --> +<div class="header"> + <div class="summary"> +<a href="#typedef-members">Typedefs</a> | +<a href="#func-members">Functions</a> </div> + <div class="headertitle"><div class="title">index_hash.h File Reference</div></div> +</div><!--header--> +<div class="contents"> + +<p>Validate Index by using a hash function. +<a href="#details">More...</a></p> +<table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a> +Typedefs</h2></td></tr> +<tr class="memitem:a2db9f438838c8ff72a8a6fd3fc856f8c"><td class="memItemLeft" align="right" valign="top"><a id="a2db9f438838c8ff72a8a6fd3fc856f8c" name="a2db9f438838c8ff72a8a6fd3fc856f8c"></a> +typedef struct lzma_index_hash_s </td><td class="memItemRight" valign="bottom"><b>lzma_index_hash</b></td></tr> +<tr class="memdesc:a2db9f438838c8ff72a8a6fd3fc856f8c"><td class="mdescLeft"> </td><td class="mdescRight">Opaque data type to hold the Index hash. <br /></td></tr> +<tr class="separator:a2db9f438838c8ff72a8a6fd3fc856f8c"><td class="memSeparator" colspan="2"> </td></tr> +</table><table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a> +Functions</h2></td></tr> +<tr class="memitem:aaafae4967a4a266d97dc34a98bfcabfb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="index__hash_8h.html#aaafae4967a4a266d97dc34a98bfcabfb">lzma_index_hash_init</a> (<a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> *index_hash, const <a class="el" href="structlzma__allocator.html">lzma_allocator</a> *allocator) lzma_nothrow lzma_attr_warn_unused_result</td></tr> +<tr class="memdesc:aaafae4967a4a266d97dc34a98bfcabfb"><td class="mdescLeft"> </td><td class="mdescRight">Allocate and initialize a new lzma_index_hash structure. <br /></td></tr> +<tr class="separator:aaafae4967a4a266d97dc34a98bfcabfb"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a7dacb41b9ec1c8df5d33dfdae97743b3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="index__hash_8h.html#a7dacb41b9ec1c8df5d33dfdae97743b3">lzma_index_hash_end</a> (<a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> *index_hash, const <a class="el" href="structlzma__allocator.html">lzma_allocator</a> *allocator) lzma_nothrow</td></tr> +<tr class="memdesc:a7dacb41b9ec1c8df5d33dfdae97743b3"><td class="mdescLeft"> </td><td class="mdescRight">Deallocate lzma_index_hash structure. <br /></td></tr> +<tr class="separator:a7dacb41b9ec1c8df5d33dfdae97743b3"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a2bdbe4f0b5fa2fadb7528447feaaa97f"><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="index__hash_8h.html#a2bdbe4f0b5fa2fadb7528447feaaa97f">lzma_index_hash_append</a> (<a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> *index_hash, <a class="el" href="vli_8h.html#a1dbc0ffc3e72748f64df8f7f71898272">lzma_vli</a> unpadded_size, <a class="el" href="vli_8h.html#a1dbc0ffc3e72748f64df8f7f71898272">lzma_vli</a> uncompressed_size) lzma_nothrow lzma_attr_warn_unused_result</td></tr> +<tr class="memdesc:a2bdbe4f0b5fa2fadb7528447feaaa97f"><td class="mdescLeft"> </td><td class="mdescRight">Add a new Record to an Index hash. <br /></td></tr> +<tr class="separator:a2bdbe4f0b5fa2fadb7528447feaaa97f"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a891eb955284c9117155f92eb0ddba44c"><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="index__hash_8h.html#a891eb955284c9117155f92eb0ddba44c">lzma_index_hash_decode</a> (<a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> *index_hash, const uint8_t *in, size_t *in_pos, size_t in_size) lzma_nothrow lzma_attr_warn_unused_result</td></tr> +<tr class="memdesc:a891eb955284c9117155f92eb0ddba44c"><td class="mdescLeft"> </td><td class="mdescRight">Decode and validate the Index field. <br /></td></tr> +<tr class="separator:a891eb955284c9117155f92eb0ddba44c"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a0f8ab3b57b117f9547866156755c917f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="vli_8h.html#a1dbc0ffc3e72748f64df8f7f71898272">lzma_vli</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="index__hash_8h.html#a0f8ab3b57b117f9547866156755c917f">lzma_index_hash_size</a> (const <a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> *index_hash) lzma_nothrow lzma_attr_pure</td></tr> +<tr class="memdesc:a0f8ab3b57b117f9547866156755c917f"><td class="mdescLeft"> </td><td class="mdescRight">Get the size of the Index field as bytes. <br /></td></tr> +<tr class="separator:a0f8ab3b57b117f9547866156755c917f"><td class="memSeparator" colspan="2"> </td></tr> +</table> +<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> +<div class="textblock"><p>Validate Index by using a hash function. </p> +<dl class="section note"><dt>Note</dt><dd>Never include this file directly. Use <<a class="el" href="lzma_8h.html" title="The public API of liblzma data compression library.">lzma.h</a>> instead.</dd></dl> +<p>Hashing makes it possible to use constant amount of memory to validate Index of arbitrary size. </p> +</div><h2 class="groupheader">Function Documentation</h2> +<a id="aaafae4967a4a266d97dc34a98bfcabfb" name="aaafae4967a4a266d97dc34a98bfcabfb"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aaafae4967a4a266d97dc34a98bfcabfb">◆ </a></span>lzma_index_hash_init()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> * lzma_index_hash_init </td> + <td>(</td> + <td class="paramtype"><a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> * </td> + <td class="paramname"><em>index_hash</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="structlzma__allocator.html">lzma_allocator</a> * </td> + <td class="paramname"><em>allocator</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Allocate and initialize a new lzma_index_hash structure. </p> +<p>If index_hash is NULL, this function allocates and initializes a new lzma_index_hash structure and returns a pointer to it. If allocation fails, NULL is returned.</p> +<p>If index_hash is non-NULL, this function reinitializes the lzma_index_hash structure and returns the same pointer. In this case, return value cannot be NULL or a different pointer than the index_hash that was given as an argument.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">index_hash</td><td>Pointer to a lzma_index_hash structure or NULL. </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> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Initialized lzma_index_hash structure on success or NULL on failure. </dd></dl> + +</div> +</div> +<a id="a7dacb41b9ec1c8df5d33dfdae97743b3" name="a7dacb41b9ec1c8df5d33dfdae97743b3"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a7dacb41b9ec1c8df5d33dfdae97743b3">◆ </a></span>lzma_index_hash_end()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void lzma_index_hash_end </td> + <td>(</td> + <td class="paramtype"><a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> * </td> + <td class="paramname"><em>index_hash</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="structlzma__allocator.html">lzma_allocator</a> * </td> + <td class="paramname"><em>allocator</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Deallocate lzma_index_hash structure. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">index_hash</td><td>Pointer to a lzma_index_hash structure to free. </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> + </table> + </dd> +</dl> + +</div> +</div> +<a id="a2bdbe4f0b5fa2fadb7528447feaaa97f" name="a2bdbe4f0b5fa2fadb7528447feaaa97f"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a2bdbe4f0b5fa2fadb7528447feaaa97f">◆ </a></span>lzma_index_hash_append()</h2> + +<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_index_hash_append </td> + <td>(</td> + <td class="paramtype"><a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> * </td> + <td class="paramname"><em>index_hash</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="vli_8h.html#a1dbc0ffc3e72748f64df8f7f71898272">lzma_vli</a> </td> + <td class="paramname"><em>unpadded_size</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="vli_8h.html#a1dbc0ffc3e72748f64df8f7f71898272">lzma_vli</a> </td> + <td class="paramname"><em>uncompressed_size</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Add a new Record to an Index hash. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">index_hash</td><td>Pointer to a lzma_index_hash structure </td></tr> + <tr><td class="paramname">unpadded_size</td><td>Unpadded Size of a Block </td></tr> + <tr><td class="paramname">uncompressed_size</td><td>Uncompressed Size of a Block</td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Possible lzma_ret values:<ul> +<li>LZMA_OK</li> +<li>LZMA_DATA_ERROR: Compressed or uncompressed size of the Stream or size of the Index field would grow too big.</li> +<li>LZMA_PROG_ERROR: Invalid arguments or this function is being used when <a class="el" href="index__hash_8h.html#a891eb955284c9117155f92eb0ddba44c" title="Decode and validate the Index field.">lzma_index_hash_decode()</a> has already been used. </li> +</ul> +</dd></dl> + +</div> +</div> +<a id="a891eb955284c9117155f92eb0ddba44c" name="a891eb955284c9117155f92eb0ddba44c"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a891eb955284c9117155f92eb0ddba44c">◆ </a></span>lzma_index_hash_decode()</h2> + +<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_index_hash_decode </td> + <td>(</td> + <td class="paramtype"><a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> * </td> + <td class="paramname"><em>index_hash</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_pos</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></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Decode and validate the Index field. </p> +<p>After telling the sizes of all Blocks with <a class="el" href="index__hash_8h.html#a2bdbe4f0b5fa2fadb7528447feaaa97f" title="Add a new Record to an Index hash.">lzma_index_hash_append()</a>, the actual Index field is decoded with this function. Specifically, once decoding of the Index field has been started, no more Records can be added using <a class="el" href="index__hash_8h.html#a2bdbe4f0b5fa2fadb7528447feaaa97f" title="Add a new Record to an Index hash.">lzma_index_hash_append()</a>.</p> +<p>This function doesn't use <a class="el" href="structlzma__stream.html" title="Passing data to and from liblzma.">lzma_stream</a> structure to pass the input data. Instead, the input buffer is specified using three arguments. This is because it matches better the internal APIs of liblzma.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramdir"></td><td class="paramname">index_hash</td><td>Pointer to a lzma_index_hash structure </td></tr> + <tr><td class="paramdir"></td><td class="paramname">in</td><td>Pointer to the beginning of the input buffer </td></tr> + <tr><td class="paramdir">[out]</td><td class="paramname">in_pos</td><td>in[*in_pos] is the next byte to process </td></tr> + <tr><td class="paramdir"></td><td class="paramname">in_size</td><td>in[in_size] is the first byte not to process</td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Possible lzma_ret values:<ul> +<li>LZMA_OK: So far good, but more input is needed.</li> +<li>LZMA_STREAM_END: Index decoded successfully and it matches the Records given with <a class="el" href="index__hash_8h.html#a2bdbe4f0b5fa2fadb7528447feaaa97f" title="Add a new Record to an Index hash.">lzma_index_hash_append()</a>.</li> +<li>LZMA_DATA_ERROR: Index is corrupt or doesn't match the information given with <a class="el" href="index__hash_8h.html#a2bdbe4f0b5fa2fadb7528447feaaa97f" title="Add a new Record to an Index hash.">lzma_index_hash_append()</a>.</li> +<li>LZMA_BUF_ERROR: Cannot progress because *in_pos >= in_size.</li> +<li>LZMA_PROG_ERROR </li> +</ul> +</dd></dl> + +</div> +</div> +<a id="a0f8ab3b57b117f9547866156755c917f" name="a0f8ab3b57b117f9547866156755c917f"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a0f8ab3b57b117f9547866156755c917f">◆ </a></span>lzma_index_hash_size()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="vli_8h.html#a1dbc0ffc3e72748f64df8f7f71898272">lzma_vli</a> lzma_index_hash_size </td> + <td>(</td> + <td class="paramtype">const <a class="el" href="index__hash_8h.html#a2db9f438838c8ff72a8a6fd3fc856f8c">lzma_index_hash</a> * </td> + <td class="paramname"><em>index_hash</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Get the size of the Index field as bytes. </p> +<p>This is needed to verify the Backward Size field in the Stream Footer.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">index_hash</td><td>Pointer to a lzma_index_hash structure</td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Size of the Index field in bytes. </dd></dl> + +</div> +</div> +</div><!-- contents --> +<hr class="footer"/> +<p style="text-align: right;padding-right: 12px;"> + XZ logo © 2023 by Jia Tan is licensed under + <a href="COPYING.CC-BY-SA-4.0" + rel="license" + style="display:inline-block;"> + CC BY-SA 4.0 + </a> +</p> +</body> +</html> |