mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
2799 lines
232 KiB
HTML
2799 lines
232 KiB
HTML
<!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.14.0"/>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||
<title>libaaruformat: include/internal.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>
|
||
<script type="text/javascript" src="clipboard.js"></script>
|
||
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||
<script type="text/javascript" src="navtreedata.js"></script>
|
||
<script type="text/javascript" src="navtree.js"></script>
|
||
<script type="text/javascript" src="cookie.js"></script>
|
||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||
<script type="text/javascript" src="search/search.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 id="projectrow">
|
||
<td id="projectalign">
|
||
<div id="projectname">libaaruformat<span id="projectnumber"> 1.0</span>
|
||
</div>
|
||
<div id="projectbrief">Aaru Data Preservation Suite - Format Library</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<!-- end header part -->
|
||
<!-- Generated by Doxygen 1.14.0 -->
|
||
<script type="text/javascript">
|
||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||
</script>
|
||
<script type="text/javascript">
|
||
$(function() { codefold.init(); });
|
||
</script>
|
||
<script type="text/javascript" src="menudata.js"></script>
|
||
<script type="text/javascript" src="menu.js"></script>
|
||
<script type="text/javascript">
|
||
$(function() {
|
||
initMenu('',true,false,'search.php','Search',true);
|
||
$(function() { init_search(); });
|
||
});
|
||
</script>
|
||
<div id="main-nav"></div>
|
||
</div><!-- top -->
|
||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||
<div id="nav-tree">
|
||
<div id="nav-tree-contents">
|
||
<div id="nav-sync" class="sync"></div>
|
||
</div>
|
||
</div>
|
||
<div id="splitbar" style="-moz-user-select:none;"
|
||
class="ui-resizable-handle">
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">
|
||
$(function(){initNavTree('internal_8h.html','',''); });
|
||
</script>
|
||
<div id="container">
|
||
<div id="doc-content">
|
||
<!-- window showing the filter options -->
|
||
<div id="MSearchSelectWindow"
|
||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
</div>
|
||
|
||
<!-- iframe showing the search results (closed by default) -->
|
||
<div id="MSearchResultsWindow">
|
||
<div id="MSearchResults">
|
||
<div class="SRPage">
|
||
<div id="SRIndex">
|
||
<div id="SRResults"></div>
|
||
<div class="SRStatus" id="Loading">Loading...</div>
|
||
<div class="SRStatus" id="Searching">Searching...</div>
|
||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="header">
|
||
<div class="headertitle"><div class="title">internal.h File Reference</div></div>
|
||
</div><!--header-->
|
||
<div class="contents">
|
||
<div class="textblock"><code>#include "utarray.h"</code><br />
|
||
</div>
|
||
<p><a href="internal_8h_source.html">Go to the source code of this file.</a></p>
|
||
<table class="memberdecls">
|
||
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
|
||
Functions</h2></td></tr>
|
||
<tr class="memitem:a5d3b1092abc36a27a441a01a8a0b3b48" id="r_a5d3b1092abc36a27a441a01a8a0b3b48"><td class="memItemLeft" align="right" valign="top">UT_array * </td><td class="memItemRight" valign="bottom"><a class="el" href="#a5d3b1092abc36a27a441a01a8a0b3b48">process_index_v1</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
||
<tr class="memdesc:a5d3b1092abc36a27a441a01a8a0b3b48"><td class="mdescLeft"> </td><td class="mdescRight">Processes an index block (version 1) from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a89ed93d216c4dce0ae5e2acccf8cc2b4" id="r_a89ed93d216c4dce0ae5e2acccf8cc2b4"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a89ed93d216c4dce0ae5e2acccf8cc2b4">verify_index_v1</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
||
<tr class="memdesc:a89ed93d216c4dce0ae5e2acccf8cc2b4"><td class="mdescLeft"> </td><td class="mdescRight">Verifies the integrity of an index block (version 1) in the image stream. <br /></td></tr>
|
||
<tr class="memitem:a1baad6508d1cde5a712794e956fb3d3c" id="r_a1baad6508d1cde5a712794e956fb3d3c"><td class="memItemLeft" align="right" valign="top">UT_array * </td><td class="memItemRight" valign="bottom"><a class="el" href="#a1baad6508d1cde5a712794e956fb3d3c">process_index_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
||
<tr class="memdesc:a1baad6508d1cde5a712794e956fb3d3c"><td class="mdescLeft"> </td><td class="mdescRight">Processes an index block (version 2) from the image stream. <br /></td></tr>
|
||
<tr class="memitem:ae234e22b16b085d18614110630034db5" id="r_ae234e22b16b085d18614110630034db5"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae234e22b16b085d18614110630034db5">verify_index_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
||
<tr class="memdesc:ae234e22b16b085d18614110630034db5"><td class="mdescLeft"> </td><td class="mdescRight">Verifies the integrity of an index block (version 2) in the image stream. <br /></td></tr>
|
||
<tr class="memitem:aff88fae9938d5f56318bfd7a455d5e94" id="r_aff88fae9938d5f56318bfd7a455d5e94"><td class="memItemLeft" align="right" valign="top">UT_array * </td><td class="memItemRight" valign="bottom"><a class="el" href="#aff88fae9938d5f56318bfd7a455d5e94">process_index_v3</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
||
<tr class="memdesc:aff88fae9938d5f56318bfd7a455d5e94"><td class="mdescLeft"> </td><td class="mdescRight">Processes an index block (version 3) from the image stream. <br /></td></tr>
|
||
<tr class="memitem:ad7ed9250463c320c7bc8d83689bcfefb" id="r_ad7ed9250463c320c7bc8d83689bcfefb"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad7ed9250463c320c7bc8d83689bcfefb">verify_index_v3</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
||
<tr class="memdesc:ad7ed9250463c320c7bc8d83689bcfefb"><td class="mdescLeft"> </td><td class="mdescRight">Verifies the integrity of an index block (version 3) in the image stream. <br /></td></tr>
|
||
<tr class="memitem:a28d844a06cecbbf436d825a3c99ff0eb" id="r_a28d844a06cecbbf436d825a3c99ff0eb"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a28d844a06cecbbf436d825a3c99ff0eb">process_data_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a28d844a06cecbbf436d825a3c99ff0eb"><td class="mdescLeft"> </td><td class="mdescRight">Processes a data block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:abaf38090f967423898b99e0455751c07" id="r_abaf38090f967423898b99e0455751c07"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#abaf38090f967423898b99e0455751c07">process_ddt_v1</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry, bool *found_user_data_ddt)</td></tr>
|
||
<tr class="memdesc:abaf38090f967423898b99e0455751c07"><td class="mdescLeft"> </td><td class="mdescRight">Processes a DDT v1 block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a1caeae710ee5e1dd356e43b3b659e9c0" id="r_a1caeae710ee5e1dd356e43b3b659e9c0"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a1caeae710ee5e1dd356e43b3b659e9c0">process_ddt_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry, bool *found_user_data_ddt)</td></tr>
|
||
<tr class="memdesc:a1caeae710ee5e1dd356e43b3b659e9c0"><td class="mdescLeft"> </td><td class="mdescRight">Processes a DDT v2 block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a43974d4c183240be30d49ff09ef7b8c2" id="r_a43974d4c183240be30d49ff09ef7b8c2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a43974d4c183240be30d49ff09ef7b8c2">process_metadata_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a43974d4c183240be30d49ff09ef7b8c2"><td class="mdescLeft"> </td><td class="mdescRight">Processes a metadata block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a81d410de6727d95a85b827067e1a8bc6" id="r_a81d410de6727d95a85b827067e1a8bc6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a81d410de6727d95a85b827067e1a8bc6">process_geometry_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a81d410de6727d95a85b827067e1a8bc6"><td class="mdescLeft"> </td><td class="mdescRight">Processes a logical geometry block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a375a516fdf6f81e997365d93b21f6708" id="r_a375a516fdf6f81e997365d93b21f6708"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a375a516fdf6f81e997365d93b21f6708">process_tracks_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a375a516fdf6f81e997365d93b21f6708"><td class="mdescLeft"> </td><td class="mdescRight">Parse and integrate a Tracks block from the image stream into the context. <br /></td></tr>
|
||
<tr class="memitem:a5e0397faed8aea27c5a6a3881875de54" id="r_a5e0397faed8aea27c5a6a3881875de54"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a5e0397faed8aea27c5a6a3881875de54">process_cicm_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a5e0397faed8aea27c5a6a3881875de54"><td class="mdescLeft"> </td><td class="mdescRight">Processes a CICM XML metadata block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a84003ec881425a7b28ec24cb48d19f02" id="r_a84003ec881425a7b28ec24cb48d19f02"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a84003ec881425a7b28ec24cb48d19f02">process_aaru_metadata_json_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a84003ec881425a7b28ec24cb48d19f02"><td class="mdescLeft"> </td><td class="mdescRight">Processes an Aaru metadata JSON block from the image stream during image opening. <br /></td></tr>
|
||
<tr class="memitem:a0e2cfc858c0551bc9bef11d5bdb85aac" id="r_a0e2cfc858c0551bc9bef11d5bdb85aac"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a0e2cfc858c0551bc9bef11d5bdb85aac">process_dumphw_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a0e2cfc858c0551bc9bef11d5bdb85aac"><td class="mdescLeft"> </td><td class="mdescRight">Processes a dump hardware block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a565eace88f86c500249be1f2a89a1c60" id="r_a565eace88f86c500249be1f2a89a1c60"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a565eace88f86c500249be1f2a89a1c60">process_checksum_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a565eace88f86c500249be1f2a89a1c60"><td class="mdescLeft"> </td><td class="mdescRight">Processes a checksum block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a829bbac3c17b60efd8f93188a8de8278" id="r_a829bbac3c17b60efd8f93188a8de8278"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a829bbac3c17b60efd8f93188a8de8278">process_tape_files_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:a829bbac3c17b60efd8f93188a8de8278"><td class="mdescLeft"> </td><td class="mdescRight">Processes a tape file metadata block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:aa76718b0402b1a28be3d563d5e62028e" id="r_aa76718b0402b1a28be3d563d5e62028e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#aa76718b0402b1a28be3d563d5e62028e">process_tape_partitions_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, const <a class="el" href="structIndexEntry.html">IndexEntry</a> *entry)</td></tr>
|
||
<tr class="memdesc:aa76718b0402b1a28be3d563d5e62028e"><td class="mdescLeft"> </td><td class="mdescRight">Processes a tape partition metadata block from the image stream. <br /></td></tr>
|
||
<tr class="memitem:a26e5fd58cdfd39948f1b724fafffcdc2" id="r_a26e5fd58cdfd39948f1b724fafffcdc2"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a26e5fd58cdfd39948f1b724fafffcdc2">decode_ddt_entry_v1</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, uint64_t *offset, uint64_t *block_offset, uint8_t *sector_status)</td></tr>
|
||
<tr class="memdesc:a26e5fd58cdfd39948f1b724fafffcdc2"><td class="mdescLeft"> </td><td class="mdescRight">Decodes a DDT v1 entry for a given sector address. <br /></td></tr>
|
||
<tr class="memitem:a805d607b45bb8ad8a3e6b0bcfabe3265" id="r_a805d607b45bb8ad8a3e6b0bcfabe3265"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a805d607b45bb8ad8a3e6b0bcfabe3265">decode_ddt_entry_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, bool negative, uint64_t *offset, uint64_t *block_offset, uint8_t *sector_status)</td></tr>
|
||
<tr class="memdesc:a805d607b45bb8ad8a3e6b0bcfabe3265"><td class="mdescLeft"> </td><td class="mdescRight">Decodes a DDT v2 entry for a given sector address. <br /></td></tr>
|
||
<tr class="memitem:a40c571bc4778040f22ac211cea670db1" id="r_a40c571bc4778040f22ac211cea670db1"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a40c571bc4778040f22ac211cea670db1">decode_ddt_single_level_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, bool negative, uint64_t *offset, uint64_t *block_offset, uint8_t *sector_status)</td></tr>
|
||
<tr class="memdesc:a40c571bc4778040f22ac211cea670db1"><td class="mdescLeft"> </td><td class="mdescRight">Decodes a single-level DDT v2 entry for a given sector address. <br /></td></tr>
|
||
<tr class="memitem:a83aff4d408ab17f8f350cb03b0e12ef6" id="r_a83aff4d408ab17f8f350cb03b0e12ef6"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a83aff4d408ab17f8f350cb03b0e12ef6">decode_ddt_multi_level_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, bool negative, uint64_t *offset, uint64_t *block_offset, uint8_t *sector_status)</td></tr>
|
||
<tr class="memdesc:a83aff4d408ab17f8f350cb03b0e12ef6"><td class="mdescLeft"> </td><td class="mdescRight">Decodes a multi-level DDT v2 entry for a given sector address. <br /></td></tr>
|
||
<tr class="memitem:a1906cbcaef9f44b8ac4360beb70a0120" id="r_a1906cbcaef9f44b8ac4360beb70a0120"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a1906cbcaef9f44b8ac4360beb70a0120">set_ddt_entry_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, bool negative, uint64_t offset, uint64_t block_offset, uint8_t sector_status, uint64_t *ddt_entry)</td></tr>
|
||
<tr class="memdesc:a1906cbcaef9f44b8ac4360beb70a0120"><td class="mdescLeft"> </td><td class="mdescRight">Sets a DDT v2 entry for a given sector address. <br /></td></tr>
|
||
<tr class="memitem:a7471ae33a70bae7e3aa93a52f8e519ca" id="r_a7471ae33a70bae7e3aa93a52f8e519ca"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a7471ae33a70bae7e3aa93a52f8e519ca">set_ddt_single_level_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, bool negative, uint64_t offset, uint64_t block_offset, uint8_t sector_status, uint64_t *ddt_entry)</td></tr>
|
||
<tr class="memdesc:a7471ae33a70bae7e3aa93a52f8e519ca"><td class="mdescLeft"> </td><td class="mdescRight">Sets a single-level DDT v2 entry for a given sector address. <br /></td></tr>
|
||
<tr class="memitem:a69ff2e68fe4d92a2d2d469ac69f41d82" id="r_a69ff2e68fe4d92a2d2d469ac69f41d82"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a69ff2e68fe4d92a2d2d469ac69f41d82">set_ddt_multi_level_v2</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, bool negative, uint64_t offset, uint64_t block_offset, uint8_t sector_status, uint64_t *ddt_entry)</td></tr>
|
||
<tr class="memdesc:a69ff2e68fe4d92a2d2d469ac69f41d82"><td class="mdescLeft"> </td><td class="mdescRight">Sets a multi-level DDT v2 entry for a given sector address. <br /></td></tr>
|
||
<tr class="memitem:a8241636367dc185ee88d1dc5af9caf59" id="r_a8241636367dc185ee88d1dc5af9caf59"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a8241636367dc185ee88d1dc5af9caf59">set_ddt_tape</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx, uint64_t sector_address, uint64_t offset, uint64_t block_offset, uint8_t sector_status, uint64_t *ddt_entry)</td></tr>
|
||
<tr class="memdesc:a8241636367dc185ee88d1dc5af9caf59"><td class="mdescLeft"> </td><td class="mdescRight">Sets a DDT entry for tape media using a hash-based lookup table. <br /></td></tr>
|
||
<tr class="memitem:aaae42bff244df727b6c029f58d4957df" id="r_aaae42bff244df727b6c029f58d4957df"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structaaru__options.html">aaru_options</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#aaae42bff244df727b6c029f58d4957df">parse_options</a> (const char *options)</td></tr>
|
||
<tr class="memdesc:aaae42bff244df727b6c029f58d4957df"><td class="mdescLeft"> </td><td class="mdescRight">Parses the options string for AaruFormat image creation/opening. <br /></td></tr>
|
||
<tr class="memitem:a36c1cca0e4cea9c2e0dffb582b836f6f" id="r_a36c1cca0e4cea9c2e0dffb582b836f6f"><td class="memItemLeft" align="right" valign="top">uint64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a36c1cca0e4cea9c2e0dffb582b836f6f">get_filetime_uint64</a> ()</td></tr>
|
||
<tr class="memdesc:a36c1cca0e4cea9c2e0dffb582b836f6f"><td class="mdescLeft"> </td><td class="mdescRight">Gets the current time as a 64-bit FILETIME value. <br /></td></tr>
|
||
<tr class="memitem:a2402812f5e04ba16765208c0b70fa6c5" id="r_a2402812f5e04ba16765208c0b70fa6c5"><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a2402812f5e04ba16765208c0b70fa6c5">aaruf_close_current_block</a> (<a class="el" href="structaaruformat__context.html">aaruformat_context</a> *ctx)</td></tr>
|
||
<tr class="memdesc:a2402812f5e04ba16765208c0b70fa6c5"><td class="mdescLeft"> </td><td class="mdescRight">Finalizes and writes the current data block to the AaruFormat image file. <br /></td></tr>
|
||
<tr class="memitem:ac93ebc6d918745be56b680e19bf7e8d5" id="r_ac93ebc6d918745be56b680e19bf7e8d5"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ac93ebc6d918745be56b680e19bf7e8d5">compare_extents</a> (const void *a, const void *b)</td></tr>
|
||
<tr class="memdesc:ac93ebc6d918745be56b680e19bf7e8d5"><td class="mdescLeft"> </td><td class="mdescRight">Comparison function for sorting <a class="el" href="structDumpExtent.html" title="Inclusive [start,end] logical sector range contributed by a single hardware environment.">DumpExtent</a> arrays by start sector. <br /></td></tr>
|
||
<tr class="memitem:a7db9f44b931877b306de9cf7cd1deed2" id="r_a7db9f44b931877b306de9cf7cd1deed2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a7db9f44b931877b306de9cf7cd1deed2">generate_random_bytes</a> (uint8_t *buffer, size_t length)</td></tr>
|
||
<tr class="memdesc:a7db9f44b931877b306de9cf7cd1deed2"><td class="mdescLeft"> </td><td class="mdescRight">Generates cryptographically strong random bytes. <br /></td></tr>
|
||
</table>
|
||
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
|
||
<a id="a2402812f5e04ba16765208c0b70fa6c5" name="a2402812f5e04ba16765208c0b70fa6c5"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a2402812f5e04ba16765208c0b70fa6c5">◆ </a></span>aaruf_close_current_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t aaruf_close_current_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Finalizes and writes the current data block to the AaruFormat image file. </p>
|
||
<p>This function completes the current writing block by computing checksums, optionally compressing the buffered sector data, writing the block header and data to the image file, updating the index, and cleaning up resources. It is called automatically when a block is full (reaches maximum size determined by dataShift), when sector size changes, or when image finalization begins. The function supports multiple compression algorithms (FLAC for audio, LZMA for data) with automatic fallback to uncompressed storage if compression is ineffective.</p>
|
||
<p><b>Block Finalization Sequence:</b></p>
|
||
<ol type="1">
|
||
<li><b>Context Validation</b>: Verify context is valid and opened for writing</li>
|
||
<li><b>Length Calculation</b>: Set block length = currentBlockOffset × sectorSize</li>
|
||
<li><b>CRC64 Computation</b>: Calculate checksum of uncompressed block data</li>
|
||
<li><b>Compression Processing</b> (if enabled):<ul>
|
||
<li>FLAC: For audio tracks, compress using Red Book audio encoding with configurable block size</li>
|
||
<li>LZMA: For data tracks, compress using LZMA algorithm with dictionary size optimization</li>
|
||
<li>Fallback: If compressed size ≥ uncompressed size, use uncompressed storage</li>
|
||
</ul>
|
||
</li>
|
||
<li><b>Compressed CRC64</b>: Calculate checksum of compressed data (if compression was applied)</li>
|
||
<li><b>Index Registration</b>: Add <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> to ctx->indexEntries for block lookup</li>
|
||
<li><b>File Writing</b>: Write <a class="el" href="structBlockHeader.html" title="Header preceding the compressed data payload of a data block (BlockType::DataBlock).">BlockHeader</a>, optional LZMA properties, and block data to image stream</li>
|
||
<li><b>Position Update</b>: Calculate next block position with alignment boundary adjustment</li>
|
||
<li><b>Resource Cleanup</b>: Free buffers, reset counters, clear block header</li>
|
||
</ol>
|
||
<p><b>Compression Handling:</b></p>
|
||
<ul>
|
||
<li><b>None (<a class="el" href="enums_8h.html#affec749ed88365143745313ae9168263" title="List of known compression types.">CompressionType</a> = 0)</b>: No compression applied<ul>
|
||
<li>cmpLength = length (uncompressed size)</li>
|
||
<li>cmpCrc64 = crc64 (same checksum)</li>
|
||
<li>Direct write of ctx->writingBuffer to file</li>
|
||
</ul>
|
||
</li>
|
||
<li><b>FLAC (<a class="el" href="enums_8h.html#affec749ed88365143745313ae9168263" title="List of known compression types.">CompressionType</a> = 2)</b>: For CD audio tracks (Red Book format)<ul>
|
||
<li>Allocates 2× length buffer for compressed data</li>
|
||
<li>Calculates optimal FLAC block size (MIN_FLAKE_BLOCK to MAX_FLAKE_BLOCK range)</li>
|
||
<li>Pads incomplete blocks with zeros to meet FLAC block size requirements</li>
|
||
<li>Encoding parameters: mid-side stereo, Hamming apodization, 12 max LPC order</li>
|
||
<li>Falls back to None if compression ineffective (compressed ≥ uncompressed)</li>
|
||
</ul>
|
||
</li>
|
||
<li><b>LZMA (<a class="el" href="enums_8h.html#affec749ed88365143745313ae9168263" title="List of known compression types.">CompressionType</a> = 1)</b>: For data tracks and non-audio content<ul>
|
||
<li>Allocates 2× length buffer for compressed data</li>
|
||
<li>LZMA properties: level 9, dictionary size from ctx->lzma_dict_size</li>
|
||
<li>Properties stored as 5-byte header: lc=4, lp=0, pb=2, fb=273, threads=8</li>
|
||
<li>Falls back to None if compression ineffective (compressed ≥ uncompressed)</li>
|
||
<li>Compressed length includes LZMA_PROPERTIES_LENGTH (5 bytes) overhead</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<p><b>Index Entry Creation:</b></p>
|
||
<p>Each closed block is registered in the index with:</p><ul>
|
||
<li>blockType = DataBlock (0x4B4C4244)</li>
|
||
<li>dataType = UserData (1)</li>
|
||
<li>offset = ctx->nextBlockPosition (file position where block was written)</li>
|
||
</ul>
|
||
<p>This enables efficient block lookup during image reading via binary search on index entries.</p>
|
||
<p><b>File Layout:</b></p>
|
||
<p>Written to ctx->imageStream at ctx->nextBlockPosition:</p><ol type="1">
|
||
<li><a class="el" href="structBlockHeader.html" title="Header preceding the compressed data payload of a data block (BlockType::DataBlock).">BlockHeader</a> (sizeof(BlockHeader) bytes)</li>
|
||
<li>LZMA properties (5 bytes, only if compression = Lzma)</li>
|
||
<li>Block data (cmpLength bytes - compressed or uncompressed depending on compression type)</li>
|
||
</ol>
|
||
<p><b>Next Block Position Calculation:</b></p>
|
||
<p>After writing, nextBlockPosition is updated to the next aligned boundary:</p><ul>
|
||
<li>block_total_size = sizeof(BlockHeader) + cmpLength</li>
|
||
<li>alignment_mask = (1 << blockAlignmentShift) - 1</li>
|
||
<li>nextBlockPosition = (currentPosition + block_total_size + alignment_mask) & ~alignment_mask</li>
|
||
</ul>
|
||
<p>This ensures all blocks begin on properly aligned file offsets for efficient I/O.</p>
|
||
<p><b>Resource Cleanup:</b></p>
|
||
<p>Before returning, the function:</p><ul>
|
||
<li>Frees ctx->writingBuffer and sets pointer to NULL</li>
|
||
<li>Resets ctx->currentBlockOffset to 0</li>
|
||
<li>Clears ctx->currentBlockHeader (memset to 0)</li>
|
||
<li>Frees ctx->crc64Context</li>
|
||
<li>Resets ctx->writingBufferPosition to 0</li>
|
||
</ul>
|
||
<p>This prepares the context for the next block or signals that no block is currently open.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to an initialized aaruformatContext in write mode.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully finalized and wrote the block. This is returned when:<ul>
|
||
<li>The context is valid and properly initialized</li>
|
||
<li>CRC64 computation completed successfully</li>
|
||
<li>Compression (if applicable) succeeded or fell back appropriately</li>
|
||
<li>Block header was successfully written to the image file</li>
|
||
<li>Block data (compressed or uncompressed) was successfully written</li>
|
||
<li>LZMA properties (if applicable) were successfully written</li>
|
||
<li>Index entry was added to ctx->indexEntries</li>
|
||
<li>Next block position was calculated and updated</li>
|
||
<li>All resources were freed and context reset for next block</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context is invalid. This occurs when:<ul>
|
||
<li>The context parameter is NULL</li>
|
||
<li>The context magic number doesn't match AARU_MAGIC (invalid context type)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_READ_ONLY</td><td>(-22) Attempting to finalize block on read-only image. This occurs when:<ul>
|
||
<li>The context's isWriting flag is false</li>
|
||
<li>The image was opened in read-only mode with <a class="el" href="decls_8h.html#aefe69fae905b957bb4349ac59fad9bc7">aaruf_open()</a></li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_ENOUGH_MEMORY</td><td>(-9) Memory allocation failed. This occurs when:<ul>
|
||
<li>Cannot allocate compression buffer (2× block length) for FLAC compression</li>
|
||
<li>Cannot allocate compression buffer (2× block length) for LZMA compression</li>
|
||
<li>System is out of memory or memory is severely fragmented</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_WRITE_BLOCK_HEADER</td><td>(-23) Failed to write block header. This occurs when:<ul>
|
||
<li>fwrite() for <a class="el" href="structBlockHeader.html" title="Header preceding the compressed data payload of a data block (BlockType::DataBlock).">BlockHeader</a> returns != 1 (incomplete write or I/O error)</li>
|
||
<li>Disk space is insufficient for header</li>
|
||
<li>File system errors or permissions prevent writing</li>
|
||
<li>Media errors on the destination storage device</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_WRITE_BLOCK_DATA</td><td>(-24) Failed to write block data. This occurs when:<ul>
|
||
<li>fwrite() for LZMA properties returns != 1 (when compression = Lzma)</li>
|
||
<li>fwrite() for uncompressed data returns != 1 (when compression = None)</li>
|
||
<li>fwrite() for compressed data returns != 1 (when compression = Flac/Lzma)</li>
|
||
<li>Disk space is insufficient for block data</li>
|
||
<li>File system errors or permissions prevent writing</li>
|
||
<li>Invalid compression type (not None, Flac, or Lzma)</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Compression Algorithm Selection:<ul>
|
||
<li>Compression type is determined when block is created in <a class="el" href="write_8c.html#a4b8cd2bb5fd9e2c670a0a13695c6f9e3" title="Writes a sector to the AaruFormat image.">aaruf_write_sector()</a></li>
|
||
<li>Audio tracks (<a class="el" href="enums_8h.html#ad80740dd555f7d3688d2c4d9f44d3b04" title="Track (partitioning element) types for optical media.">TrackType</a> = Audio) use FLAC compression if enabled</li>
|
||
<li>Data tracks use LZMA compression if enabled</li>
|
||
<li>Special cases (JaguarCD data in audio, VideoNow) force LZMA even for audio tracks</li>
|
||
<li>Compression can be disabled entirely via ctx->compression_enabled flag</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Compression Fallback Logic:<ul>
|
||
<li>If compressed size ≥ uncompressed size, compression is abandoned</li>
|
||
<li>Compression buffer is freed and compression type set to None</li>
|
||
<li>This prevents storage expansion from ineffective compression</li>
|
||
<li>Fallback is transparent to caller; function still returns success</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
FLAC Encoding Parameters:<ul>
|
||
<li>Encoding for Red Book audio (44.1kHz, 16-bit stereo)</li>
|
||
<li>Block size: auto-selected between MIN_FLAKE_BLOCK and MAX_FLAKE_BLOCK samples</li>
|
||
<li>Mid-side stereo enabled for better compression on correlated channels</li>
|
||
<li>Hamming window apodization for LPC analysis</li>
|
||
<li>Max LPC order: 12, QLP coefficient precision: 15 bits</li>
|
||
<li>Application ID: "Aaru" with 4-byte signature</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
LZMA Encoding Parameters:<ul>
|
||
<li>Compression level: 9 (maximum compression)</li>
|
||
<li>Dictionary size: from ctx->lzma_dict_size (configurable per context)</li>
|
||
<li>Literal context bits (lc): 4</li>
|
||
<li>Literal position bits (lp): 0</li>
|
||
<li>Position bits (pb): 2</li>
|
||
<li>Fast bytes (fb): 273</li>
|
||
<li>Threads: 8 (for multi-threaded compression)</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Index Management:<ul>
|
||
<li>Every closed block gets an index entry for efficient lookup</li>
|
||
<li>Index entries are stored in ctx->indexEntries (dynamic array)</li>
|
||
<li>Final index is serialized during <a class="el" href="decls_8h.html#a6823e139f81a9dfd08efcb0e9b213a49" title="Close an Aaru image context, flushing pending data structures and releasing resources.">aaruf_close()</a> for image finalization</li>
|
||
<li>Index enables O(log n) block lookup during image reading</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Alignment Requirements:<ul>
|
||
<li>Blocks must start on aligned boundaries per blockAlignmentShift</li>
|
||
<li>Typical alignment: 512 bytes (shift=9) or 4096 bytes (shift=12)</li>
|
||
<li>Alignment ensures efficient sector-aligned I/O on modern storage</li>
|
||
<li>Gap between blocks is implicit; no padding data is written</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>This function assumes ctx->writingBuffer contains valid data for ctx->currentBlockOffset sectors of ctx->currentBlockHeader.sectorSize bytes each.</dd>
|
||
<dd>
|
||
Do not call this function when no block is open (ctx->writingBuffer == NULL). This will result in undefined behavior or segmentation fault.</dd>
|
||
<dd>
|
||
The function modifies ctx->nextBlockPosition, which affects where subsequent blocks are written. Ensure file positioning is properly managed.</dd>
|
||
<dd>
|
||
Memory allocated for compression buffers is freed before returning. Do not retain pointers to compressed data after function completion.</dd>
|
||
<dd>
|
||
CRC64 context (ctx->crc64Context) is freed during cleanup. Do not access this pointer after calling this function. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="write_8c_source.html#l01403">1403</a> of file <a class="el" href="write_8c_source.html">write.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="consts_8h_source.html#l00064">AARU_MAGIC</a>, <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="crc64_8c_source.html#l00141">aaruf_crc64_final()</a>, <a class="el" href="crc64_8c_source.html#l00155">aaruf_crc64_free()</a>, <a class="el" href="crc64_8c_source.html#l00032">aaruf_crc64_init()</a>, <a class="el" href="crc64_8c_source.html#l00055">aaruf_crc64_update()</a>, <a class="el" href="errors_8h_source.html#l00063">AARUF_ERROR_CANNOT_WRITE_BLOCK_DATA</a>, <a class="el" href="errors_8h_source.html#l00062">AARUF_ERROR_CANNOT_WRITE_BLOCK_HEADER</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="errors_8h_source.html#l00048">AARUF_ERROR_NOT_ENOUGH_MEMORY</a>, <a class="el" href="flac_8c_source.html#l00175">aaruf_flac_encode_redbook_buffer()</a>, <a class="el" href="lzma_8c_source.html#l00065">aaruf_lzma_encode_buffer()</a>, <a class="el" href="errors_8h_source.html#l00061">AARUF_READ_ONLY</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="ddt_8h_source.html#l00154">DdtHeader2::blockAlignmentShift</a>, <a class="el" href="index_8h_source.html#l00110">IndexEntry::blockType</a>, <a class="el" href="data_8h_source.html#l00078">BlockHeader::cmpCrc64</a>, <a class="el" href="data_8h_source.html#l00076">BlockHeader::cmpLength</a>, <a class="el" href="data_8h_source.html#l00074">BlockHeader::compression</a>, <a class="el" href="data_8h_source.html#l00079">BlockHeader::crc64</a>, <a class="el" href="context_8h_source.html#l00249">aaruformat_context::crc64_context</a>, <a class="el" href="context_8h_source.html#l00281">aaruformat_context::current_block_header</a>, <a class="el" href="context_8h_source.html#l00288">aaruformat_context::current_block_offset</a>, <a class="el" href="enums_8h_source.html#l00141">DataBlock</a>, <a class="el" href="index_8h_source.html#l00111">IndexEntry::dataType</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="enums_8h_source.html#l00035">Flac</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00252">aaruformat_context::index_entries</a>, <a class="el" href="context_8h_source.html#l00292">aaruformat_context::is_writing</a>, <a class="el" href="data_8h_source.html#l00077">BlockHeader::length</a>, <a class="el" href="enums_8h_source.html#l00034">Lzma</a>, <a class="el" href="context_8h_source.html#l00298">aaruformat_context::lzma_dict_size</a>, <a class="el" href="consts_8h_source.html#l00082">LZMA_PROPERTIES_LENGTH</a>, <a class="el" href="context_8h_source.html#l00174">aaruformat_context::magic</a>, <a class="el" href="consts_8h_source.html#l00094">MAX_FLAKE_BLOCK</a>, <a class="el" href="consts_8h_source.html#l00096">MIN_FLAKE_BLOCK</a>, <a class="el" href="context_8h_source.html#l00282">aaruformat_context::next_block_position</a>, <a class="el" href="enums_8h_source.html#l00033">None</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="consts_8h_source.html#l00090">SAMPLES_PER_SECTOR</a>, <a class="el" href="data_8h_source.html#l00075">BlockHeader::sectorSize</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>, <a class="el" href="enums_8h_source.html#l00046">UserData</a>, <a class="el" href="context_8h_source.html#l00280">aaruformat_context::writing_buffer</a>, and <a class="el" href="context_8h_source.html#l00289">aaruformat_context::writing_buffer_position</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="close_8c_source.html#l03997">aaruf_close()</a>, <a class="el" href="write_8c_source.html#l00098">aaruf_write_sector()</a>, and <a class="el" href="ddt__v2_8c_source.html#l01092">set_ddt_multi_level_v2()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="ac93ebc6d918745be56b680e19bf7e8d5" name="ac93ebc6d918745be56b680e19bf7e8d5"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#ac93ebc6d918745be56b680e19bf7e8d5">◆ </a></span>compare_extents()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int compare_extents </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const void *</td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const void *</td> <td class="paramname"><span class="paramname"><em>b</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Comparison function for sorting <a class="el" href="structDumpExtent.html" title="Inclusive [start,end] logical sector range contributed by a single hardware environment.">DumpExtent</a> arrays by start sector. </p>
|
||
<p>This function is used by qsort() to order dump extents in ascending order based on their start sector values. Extents with lower start sectors will appear first in the sorted array. This ordering is important for efficient extent lookup and validation during image operations.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">a</td><td>Pointer to the first <a class="el" href="structDumpExtent.html" title="Inclusive [start,end] logical sector range contributed by a single hardware environment.">DumpExtent</a> to compare. </td></tr>
|
||
<tr><td class="paramname">b</td><td>Pointer to the second <a class="el" href="structDumpExtent.html" title="Inclusive [start,end] logical sector range contributed by a single hardware environment.">DumpExtent</a> to compare. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Negative value if a->start < b->start, zero if equal, positive if a->start > b->start. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="helpers_8c_source.html#l00459">459</a> of file <a class="el" href="helpers_8c_source.html">helpers.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="context_8h_source.html#l00335">DumpExtent::start</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="dump_8c_source.html#l00531">aaruf_set_dumphw()</a>, and <a class="el" href="blocks_2dump_8c_source.html#l00107">process_dumphw_block()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a26e5fd58cdfd39948f1b724fafffcdc2" name="a26e5fd58cdfd39948f1b724fafffcdc2"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a26e5fd58cdfd39948f1b724fafffcdc2">◆ </a></span>decode_ddt_entry_v1()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t decode_ddt_entry_v1 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint8_t *</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Decodes a DDT v1 entry for a given sector address. </p>
|
||
<p>Determines the offset and block offset for a sector using the DDT v1 table. This function performs bit manipulation on the DDT entry to extract the sector offset within a block and the block offset, and determines whether the sector was dumped or not based on the DDT entry value.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing the loaded DDT table. </td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address to decode (must be within valid range). </td></tr>
|
||
<tr><td class="paramname">offset</td><td>Pointer to store the resulting sector offset within the block. </td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Pointer to store the resulting block offset in the image. </td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Pointer to store the sector status (dumped or not dumped).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully decoded the DDT entry. This is always returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The DDT entry is successfully extracted and decoded</li>
|
||
<li>The offset, block_offset, and sector_status are successfully populated</li>
|
||
<li>A zero DDT entry is encountered (indicates sector not dumped)</li>
|
||
<li>A non-zero DDT entry is encountered (indicates sector was dumped)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context or image stream is invalid (NULL pointers). This is the only error condition that can occur in this function.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This is a lightweight function that performs only basic validation and bit manipulation. It does not perform bounds checking on the sector_address parameter.</dd>
|
||
<dd>
|
||
DDT Entry Decoding:<ul>
|
||
<li>Uses a bit mask derived from ctx->shift to extract the offset within block</li>
|
||
<li>Right-shifts the DDT entry by ctx->shift bits to get the block offset</li>
|
||
<li>A zero DDT entry indicates the sector was not dumped (SectorStatusNotDumped)</li>
|
||
<li>A non-zero DDT entry indicates the sector was dumped (SectorStatusDumped)</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The function assumes:<ul>
|
||
<li>The DDT table (ctx->userDataDdt) has been properly loaded by <a class="el" href="ddt__v1_8c.html#abaf38090f967423898b99e0455751c07" title="Processes a DDT v1 block from the image stream.">process_ddt_v1()</a></li>
|
||
<li>The sector_address is within the valid range of the DDT table</li>
|
||
<li>The shift value (ctx->shift) has been properly initialized</li>
|
||
<li>All output parameters (offset, block_offset, sector_status) are valid pointers</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
No bounds checking is performed on sector_address. Accessing beyond the DDT table boundaries will result in undefined behavior. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v1_8c_source.html#l00405">405</a> of file <a class="el" href="ddt__v1_8c_source.html">ddt_v1.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="errors_8h_source.html#l00065">AARUF_ERROR_INCORRECT_DATA_SIZE</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="enums_8h_source.html#l00231">SectorStatusDumped</a>, <a class="el" href="enums_8h_source.html#l00230">SectorStatusNotDumped</a>, <a class="el" href="context_8h_source.html#l00195">aaruformat_context::shift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, and <a class="el" href="context_8h_source.html#l00181">aaruformat_context::user_data_ddt</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="read_8c_source.html#l00253">aaruf_read_sector()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a805d607b45bb8ad8a3e6b0bcfabe3265" name="a805d607b45bb8ad8a3e6b0bcfabe3265"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a805d607b45bb8ad8a3e6b0bcfabe3265">◆ </a></span>decode_ddt_entry_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t decode_ddt_entry_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>negative</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint8_t *</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Decodes a DDT v2 entry for a given sector address. </p>
|
||
<p>Determines the offset and block offset for a sector using the DDT v2 table(s). This function acts as a dispatcher that automatically selects between single-level and multi-level DDT decoding based on the tableShift parameter in the DDT header. It provides a unified interface for DDT v2 entry decoding regardless of the underlying table structure complexity.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing the loaded DDT structures. </td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address to decode (will be adjusted for negative sectors). </td></tr>
|
||
<tr><td class="paramname">negative</td><td>Indicates if the sector address is negative. </td></tr>
|
||
<tr><td class="paramname">offset</td><td>Pointer to store the resulting sector offset within the block. </td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Pointer to store the resulting block offset in the image. </td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Pointer to store the sector status (dumped, not dumped, etc.).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully decoded the DDT entry. This is always returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The appropriate decoding function (single-level or multi-level) completes successfully</li>
|
||
<li>All output parameters are properly populated with decoded values</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context or image stream is invalid (NULL pointers). This is the only error condition that can occur at this dispatcher level.</td></tr>
|
||
<tr><td class="paramname">Other</td><td>error codes may be returned by the underlying decoding functions:<ul>
|
||
<li>From <a class="el" href="ddt__v2_8c.html#a40c571bc4778040f22ac211cea670db1" title="Decodes a single-level DDT v2 entry for a given sector address.">decode_ddt_single_level_v2()</a>: AARUF_ERROR_CANNOT_READ_BLOCK (-7)</li>
|
||
<li>From <a class="el" href="ddt__v2_8c.html#a83aff4d408ab17f8f350cb03b0e12ef6" title="Decodes a multi-level DDT v2 entry for a given sector address.">decode_ddt_multi_level_v2()</a>: AARUF_ERROR_CANNOT_READ_BLOCK (-7), AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK (-17), AARUF_ERROR_INVALID_BLOCK_CRC (-18)</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Function Selection:<ul>
|
||
<li>If tableShift > 0: Uses multi-level DDT decoding (decode_ddt_multi_level_v2)</li>
|
||
<li>If tableShift = 0: Uses single-level DDT decoding (decode_ddt_single_level_v2)</li>
|
||
<li>The tableShift parameter is read from ctx->userDataDdtHeader.tableShift</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
This function performs minimal validation and primarily acts as a dispatcher. Most error conditions and complex logic are handled by the underlying functions.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The function assumes the DDT has been properly loaded by <a class="el" href="ddt__v2_8c.html#a1caeae710ee5e1dd356e43b3b659e9c0" title="Processes a DDT v2 block from the image stream.">process_ddt_v2()</a>. Calling this function with an uninitialized or corrupted DDT will result in undefined behavior from the underlying decoding functions.</dd>
|
||
<dd>
|
||
All output parameters must be valid pointers. No bounds checking is performed on the sector_address parameter at this level. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l00507">507</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="ddt__v2_8c_source.html#l00724">decode_ddt_multi_level_v2()</a>, <a class="el" href="ddt__v2_8c_source.html#l00581">decode_ddt_single_level_v2()</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="ddt_8h_source.html#l00156">DdtHeader2::tableShift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, and <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="read_8c_source.html#l00253">aaruf_read_sector()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a83aff4d408ab17f8f350cb03b0e12ef6" name="a83aff4d408ab17f8f350cb03b0e12ef6"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a83aff4d408ab17f8f350cb03b0e12ef6">◆ </a></span>decode_ddt_multi_level_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t decode_ddt_multi_level_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>negative</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint8_t *</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Decodes a multi-level DDT v2 entry for a given sector address. </p>
|
||
<p>Used when the DDT table uses multi-level indirection (tableShift > 0). This function handles the complex process of navigating a hierarchical DDT structure where the primary table points to secondary tables that contain the actual sector mappings. It includes caching mechanisms for secondary tables, supports both compressed and uncompressed secondary tables, and performs comprehensive validation including CRC verification.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing the loaded primary DDT table. </td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address to decode (adjusted for negative sectors). </td></tr>
|
||
<tr><td class="paramname">negative</td><td>Indicates if the sector address is negative. </td></tr>
|
||
<tr><td class="paramname">offset</td><td>Pointer to store the resulting sector offset within the block. </td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Pointer to store the resulting block offset in the image. </td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Pointer to store the sector status (dumped, not dumped, etc.).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully decoded the DDT entry. This is returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The tableShift validation passes (must be > 0)</li>
|
||
<li>The DDT size type is recognized (SmallDdtSizeType or BigDdtSizeType)</li>
|
||
<li>Secondary DDT table is successfully loaded (from cache or file)</li>
|
||
<li>Secondary DDT decompression succeeds (if needed)</li>
|
||
<li>Secondary DDT CRC validation passes</li>
|
||
<li>The DDT entry is successfully extracted and decoded</li>
|
||
<li>All output parameters are properly populated with decoded values</li>
|
||
<li>Zero DDT entries are handled (indicates sector not dumped)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context or image stream is invalid (NULL pointers).</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_BLOCK</td><td>(-7) Configuration, validation, or file access errors. This occurs when:<ul>
|
||
<li>The tableShift is zero (should use single-level decoding instead)</li>
|
||
<li>The DDT size type is unknown/unsupported (not SmallDdtSizeType or BigDdtSizeType)</li>
|
||
<li>Cannot read the secondary DDT header from the image stream</li>
|
||
<li>Secondary DDT header validation fails (wrong identifier or type)</li>
|
||
<li>Cannot read uncompressed secondary DDT data from the image stream</li>
|
||
<li>CRC64 context initialization fails (internal error)</li>
|
||
<li>Memory allocation fails for secondary DDT data (critical failure)</li>
|
||
<li>Unknown compression type encountered in secondary DDT</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</td><td>(-17) LZMA decompression failed for secondary DDT. This occurs when:<ul>
|
||
<li>Memory allocation fails for compressed data or decompression buffer</li>
|
||
<li>Cannot read LZMA properties from the image stream</li>
|
||
<li>Cannot read compressed secondary DDT data from the image stream</li>
|
||
<li>The LZMA decoder returns a non-zero error code during decompression</li>
|
||
<li>The decompressed data size doesn't match the expected secondary DDT length</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_INVALID_BLOCK_CRC</td><td>(-18) CRC64 validation failed for secondary DDT. This occurs when:<ul>
|
||
<li>Calculated CRC64 doesn't match the expected CRC64 in the secondary DDT header</li>
|
||
<li>Data corruption is detected in the secondary DDT data</li>
|
||
<li>This applies to both compressed and uncompressed secondary DDT blocks</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Multi-level DDT Navigation:<ul>
|
||
<li>Uses tableShift to calculate items per DDT entry (2^tableShift)</li>
|
||
<li>Calculates DDT position by dividing sector address by items per entry</li>
|
||
<li>Retrieves secondary DDT offset from primary table at calculated position</li>
|
||
<li>Converts block offset to file offset using blockAlignmentShift</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Secondary DDT Caching:<ul>
|
||
<li>Maintains a single cached secondary DDT in memory (ctx->cachedSecondaryDdtSmall/Big)</li>
|
||
<li>Compares requested offset with cached offset (ctx->cachedDdtOffset)</li>
|
||
<li>Only loads from disk if the requested secondary DDT is not currently cached</li>
|
||
<li>Caching improves performance for sequential sector access patterns</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Secondary DDT Processing:<ul>
|
||
<li>Supports both LZMA compression and uncompressed formats</li>
|
||
<li>Performs full CRC64 validation of secondary DDT data</li>
|
||
<li>Same bit manipulation as single-level DDT for final entry decoding</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Error Handling Strategy:<ul>
|
||
<li>Memory allocation failures for secondary DDT loading are treated as critical errors</li>
|
||
<li>File I/O errors and validation failures cause immediate function termination</li>
|
||
<li>Unknown compression types are treated as errors (unlike the processing functions)</li>
|
||
<li>All allocated memory is cleaned up on error conditions</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>This function should only be called when tableShift > 0. Calling it with tableShift = 0 will result in AARUF_ERROR_CANNOT_READ_BLOCK.</dd>
|
||
<dd>
|
||
The function assumes the primary DDT table has been properly loaded and is accessible via ctx->userDataDdtMini or ctx->userDataDdtBig depending on size type.</dd>
|
||
<dd>
|
||
Secondary DDT caching means that memory usage can increase during operation. The cached secondary DDT is replaced when a different secondary table is needed.</dd>
|
||
<dd>
|
||
No bounds checking is performed on sector_address or calculated DDT positions. Accessing beyond table boundaries will result in undefined behavior. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l00724">724</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00141">aaruf_crc64_final()</a>, <a class="el" href="crc64_8c_source.html#l00032">aaruf_crc64_init()</a>, <a class="el" href="crc64_8c_source.html#l00055">aaruf_crc64_update()</a>, <a class="el" href="errors_8h_source.html#l00056">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00046">AARUF_ERROR_CANNOT_READ_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00057">AARUF_ERROR_INVALID_BLOCK_CRC</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="lzma_8c_source.html#l00039">aaruf_lzma_decode_buffer()</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="ddt_8h_source.html#l00154">DdtHeader2::blockAlignmentShift</a>, <a class="el" href="context_8h_source.html#l00190">aaruformat_context::cached_ddt_offset</a>, <a class="el" href="context_8h_source.html#l00188">aaruformat_context::cached_secondary_ddt2</a>, <a class="el" href="ddt_8h_source.html#l00159">DdtHeader2::cmpLength</a>, <a class="el" href="ddt_8h_source.html#l00145">DdtHeader2::compression</a>, <a class="el" href="ddt_8h_source.html#l00162">DdtHeader2::crc64</a>, <a class="el" href="ddt_8h_source.html#l00155">DdtHeader2::dataShift</a>, <a class="el" href="enums_8h_source.html#l00144">DeDuplicationTableSecondary</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="ddt_8h_source.html#l00143">DdtHeader2::identifier</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="ddt_8h_source.html#l00160">DdtHeader2::length</a>, <a class="el" href="enums_8h_source.html#l00034">Lzma</a>, <a class="el" href="consts_8h_source.html#l00082">LZMA_PROPERTIES_LENGTH</a>, <a class="el" href="ddt_8h_source.html#l00149">DdtHeader2::negative</a>, <a class="el" href="enums_8h_source.html#l00033">None</a>, <a class="el" href="enums_8h_source.html#l00230">SectorStatusNotDumped</a>, <a class="el" href="ddt_8h_source.html#l00156">DdtHeader2::tableShift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="ddt_8h_source.html#l00144">DdtHeader2::type</a>, <a class="el" href="context_8h_source.html#l00187">aaruformat_context::user_data_ddt2</a>, <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>, and <a class="el" href="enums_8h_source.html#l00046">UserData</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="ddt__v2_8c_source.html#l00507">decode_ddt_entry_v2()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a40c571bc4778040f22ac211cea670db1" name="a40c571bc4778040f22ac211cea670db1"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a40c571bc4778040f22ac211cea670db1">◆ </a></span>decode_ddt_single_level_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t decode_ddt_single_level_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>negative</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint8_t *</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Decodes a single-level DDT v2 entry for a given sector address. </p>
|
||
<p>Used when the DDT table does not use multi-level indirection (tableShift = 0). This function performs direct lookup in the primary DDT table to extract sector offset, block offset, and sector status information. It performs bit manipulation to decode the packed DDT entry values.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing the loaded DDT table. </td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address to decode (adjusted for negative sectors). </td></tr>
|
||
<tr><td class="paramname">negative</td><td>Indicates if the sector address is negative. </td></tr>
|
||
<tr><td class="paramname">offset</td><td>Pointer to store the resulting sector offset within the block. </td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Pointer to store the resulting block offset in the image. </td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Pointer to store the sector status (dumped, not dumped, etc.).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully decoded the DDT entry. This is always returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The tableShift validation passes (must be 0)</li>
|
||
<li>The DDT size type is recognized (SmallDdtSizeType or BigDdtSizeType)</li>
|
||
<li>The DDT entry is successfully extracted and decoded</li>
|
||
<li>All output parameters are properly populated with decoded values</li>
|
||
<li>Zero DDT entries are handled (indicates sector not dumped)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context or image stream is invalid (NULL pointers).</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_BLOCK</td><td>(-7) Configuration or validation errors. This occurs when:<ul>
|
||
<li>The tableShift is not zero (should use multi-level decoding instead)</li>
|
||
<li>The DDT size type is unknown/unsupported (not SmallDdtSizeType or BigDdtSizeType)</li>
|
||
<li>Internal consistency checks fail</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>DDT Entry Decoding<ul>
|
||
<li>Bits 63-61: Sector status (4 bits)</li>
|
||
<li>Bits 60-0: Combined offset and block index (60 bits)</li>
|
||
<li>Offset mask: Derived from dataShift parameter</li>
|
||
<li>Block offset: Calculated using blockAlignmentShift parameter</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Negative Sector Handling:<ul>
|
||
<li>Sector address is automatically adjusted by adding ctx->userDataDdtHeader.negative</li>
|
||
<li>This allows proper indexing into the DDT table for negative sector addresses</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Zero Entry Handling:<ul>
|
||
<li>A zero DDT entry indicates the sector was not dumped</li>
|
||
<li>Sets sector_status to SectorStatusNotDumped and zeros offset/block_offset</li>
|
||
<li>This is a normal condition and not an error</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The function assumes the DDT table has been properly loaded and is accessible via ctx->userDataDdtMini or ctx->userDataDdtBig depending on size type.</dd>
|
||
<dd>
|
||
No bounds checking is performed on sector_address. Accessing beyond the DDT table boundaries will result in undefined behavior.</dd>
|
||
<dd>
|
||
This function should only be called when tableShift is 0. Calling it with tableShift > 0 will result in AARUF_ERROR_CANNOT_READ_BLOCK. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l00581">581</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="errors_8h_source.html#l00046">AARUF_ERROR_CANNOT_READ_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="ddt_8h_source.html#l00154">DdtHeader2::blockAlignmentShift</a>, <a class="el" href="ddt_8h_source.html#l00155">DdtHeader2::dataShift</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="ddt_8h_source.html#l00149">DdtHeader2::negative</a>, <a class="el" href="enums_8h_source.html#l00230">SectorStatusNotDumped</a>, <a class="el" href="ddt_8h_source.html#l00156">DdtHeader2::tableShift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="context_8h_source.html#l00187">aaruformat_context::user_data_ddt2</a>, and <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="ddt__v2_8c_source.html#l00507">decode_ddt_entry_v2()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a7db9f44b931877b306de9cf7cd1deed2" name="a7db9f44b931877b306de9cf7cd1deed2"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a7db9f44b931877b306de9cf7cd1deed2">◆ </a></span>generate_random_bytes()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void generate_random_bytes </td>
|
||
<td>(</td>
|
||
<td class="paramtype">uint8_t *</td> <td class="paramname"><span class="paramname"><em>buffer</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>length</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Generates cryptographically strong random bytes. </p>
|
||
<p>This function fills the provided buffer with random bytes using platform-appropriate cryptographic random number generators. On Unix-like systems (including macOS and Linux), it reads from /dev/urandom. On Windows, it uses CryptGenRandom. If the platform-specific methods fail, it falls back to a time-seeded pseudo-random generator.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">buffer</td><td>Pointer to the buffer to fill with random bytes. </td></tr>
|
||
<tr><td class="paramname">length</td><td>Number of random bytes to generate. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="helpers_8c_source.html#l00480">480</a> of file <a class="el" href="helpers_8c_source.html">helpers.c</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="create_8c_source.html#l00279">aaruf_create()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a36c1cca0e4cea9c2e0dffb582b836f6f" name="a36c1cca0e4cea9c2e0dffb582b836f6f"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a36c1cca0e4cea9c2e0dffb582b836f6f">◆ </a></span>get_filetime_uint64()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">uint64_t get_filetime_uint64 </td>
|
||
<td>(</td>
|
||
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Gets the current time as a 64-bit FILETIME value. </p>
|
||
<p>Returns the current system time as a 64-bit value compatible with Windows FILETIME (number of 100-nanosecond intervals since January 1, 1601 UTC).</p>
|
||
<dl class="section return"><dt>Returns</dt><dd>The current time as a 64-bit FILETIME value. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="time_8c_source.html#l00045">45</a> of file <a class="el" href="time_8c_source.html">time.c</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="create_8c_source.html#l00279">aaruf_create()</a>, and <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="aaae42bff244df727b6c029f58d4957df" name="aaae42bff244df727b6c029f58d4957df"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#aaae42bff244df727b6c029f58d4957df">◆ </a></span>parse_options()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname"><a class="el" href="structaaru__options.html">aaru_options</a> parse_options </td>
|
||
<td>(</td>
|
||
<td class="paramtype">const char *</td> <td class="paramname"><span class="paramname"><em>options</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Parses the options string for AaruFormat image creation/opening. </p>
|
||
<p>Parses the options string and returns a struct with the parsed options for image creation or opening.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">options</td><td>String with options to parse (may be NULL). </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Parsed options as an <a class="el" href="structaaru__options.html" title="Parsed user-specified tunables controlling compression, deduplication, hashing and DDT geometry.">aaru_options</a> struct. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="options_8c_source.html#l00038">38</a> of file <a class="el" href="options_8c_source.html">options.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="options_8h_source.html#l00228">aaru_options::blake3</a>, <a class="el" href="options_8h_source.html#l00224">aaru_options::block_alignment</a>, <a class="el" href="options_8h_source.html#l00218">aaru_options::compress</a>, <a class="el" href="options_8h_source.html#l00223">aaru_options::data_shift</a>, <a class="el" href="options_8h_source.html#l00219">aaru_options::deduplicate</a>, <a class="el" href="options_8h_source.html#l00221">aaru_options::dictionary</a>, <a class="el" href="options_8h_source.html#l00225">aaru_options::md5</a>, <a class="el" href="options_8h_source.html#l00226">aaru_options::sha1</a>, <a class="el" href="options_8h_source.html#l00227">aaru_options::sha256</a>, <a class="el" href="options_8h_source.html#l00229">aaru_options::spamsum</a>, <a class="el" href="options_8h_source.html#l00222">aaru_options::table_shift</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="create_8c_source.html#l00279">aaruf_create()</a>, and <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a84003ec881425a7b28ec24cb48d19f02" name="a84003ec881425a7b28ec24cb48d19f02"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a84003ec881425a7b28ec24cb48d19f02">◆ </a></span>process_aaru_metadata_json_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_aaru_metadata_json_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes an Aaru metadata JSON block from the image stream during image opening. </p>
|
||
<p>Reads an Aaru metadata JSON block from the image file and loads its contents into the context for subsequent retrieval. The Aaru metadata JSON format is a structured representation of comprehensive image metadata including media information, imaging session details, hardware configuration, optical disc tracks and sessions, checksums, and preservation metadata. The JSON payload is stored in its original form without parsing or interpretation by this function, allowing higher-level code to process the structured data as needed.</p>
|
||
<p>This function is called during the image opening process (aaruf_open) when an index entry indicates the presence of an AaruMetadataJsonBlock. The function is non-critical; if reading fails or memory allocation fails, the error is logged but the image opening continues. This allows images without JSON metadata or with corrupted JSON blocks to still be opened for data access.</p>
|
||
<p><b>Processing sequence:</b></p><ol type="1">
|
||
<li>Validate context and image stream</li>
|
||
<li>Seek to the block offset specified by the index entry</li>
|
||
<li>Read the <a class="el" href="structAaruMetadataJsonBlockHeader.html" title="Header for an Aaru metadata JSON block (identifier == BlockType::AaruMetadataJsonBlock).">AaruMetadataJsonBlockHeader</a> (8 bytes: identifier + length)</li>
|
||
<li>Validate the block identifier matches AaruMetadataJsonBlock</li>
|
||
<li>Allocate memory for the JSON payload</li>
|
||
<li>Read the JSON data from the file stream</li>
|
||
<li>Store header and data pointer in the context for later retrieval</li>
|
||
</ol>
|
||
<p><b>Memory allocation:</b> The function allocates memory (via malloc) sized to hold the entire JSON payload as specified by ctx->jsonBlockHeader.length. This memory remains allocated for the lifetime of the context and is freed during <a class="el" href="decls_8h.html#a6823e139f81a9dfd08efcb0e9b213a49" title="Close an Aaru image context, flushing pending data structures and releasing resources.">aaruf_close()</a>. If allocation fails, the function returns gracefully without the JSON metadata, allowing the image to still be opened.</p>
|
||
<p><b>Image size tracking:</b> The function increments ctx->imageInfo.ImageSize by the length of the JSON payload to track the total size of metadata and structural blocks in the image.</p>
|
||
<p><b>Error handling:</b> All errors are non-fatal and handled gracefully:</p><ul>
|
||
<li>Seek failures: logged and function returns early</li>
|
||
<li>Header read failures: header zeroed, function returns</li>
|
||
<li>Identifier mismatches: header zeroed, processing continues but data is not loaded</li>
|
||
<li>Memory allocation failures: header zeroed, function returns</li>
|
||
<li>Data read failures: header zeroed, allocated memory freed, function returns</li>
|
||
</ul>
|
||
<p>In all error cases, the ctx->jsonBlockHeader is zeroed (memset to 0) to indicate that no valid JSON metadata is available, and any allocated memory is properly freed.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to an initialized aaruformatContext being populated during image opening. Must not be NULL. ctx->imageStream must be open and readable. On success, ctx->jsonBlockHeader will contain the block header and ctx->jsonBlock will point to the allocated JSON data. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> that specifies the file offset where the AaruMetadataJsonBlock begins. Must not be NULL. entry->offset indicates the position of the block header in the file.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>JSON Format and Encoding:<ul>
|
||
<li>The JSON payload is stored in UTF-8 encoding</li>
|
||
<li>The payload may or may not be null-terminated</li>
|
||
<li>This function treats the JSON as opaque binary data</li>
|
||
<li>No JSON parsing, interpretation, or validation is performed during loading</li>
|
||
<li>JSON schema validation is the responsibility of code that retrieves the metadata</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Aaru Metadata JSON Purpose:<ul>
|
||
<li>Provides machine-readable structured metadata about the image</li>
|
||
<li>Includes comprehensive information about media, sessions, tracks, and checksums</li>
|
||
<li>Enables programmatic access to metadata without XML parsing overhead</li>
|
||
<li>Complements CICM XML with a more modern, structured format</li>
|
||
<li>Used by Aaru and compatible tools for metadata exchange</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Non-Critical Nature:<ul>
|
||
<li>JSON metadata is optional and supplementary to core image data</li>
|
||
<li>Failures reading this block do not prevent image opening</li>
|
||
<li>The image remains fully functional for sector data access without JSON metadata</li>
|
||
<li>Higher-level code should check if ctx->jsonBlock is non-NULL before use</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Distinction from CICM XML:<ul>
|
||
<li>Both CICM and Aaru JSON blocks can coexist in the same image</li>
|
||
<li>CICM XML follows the Canary Islands Computer Museum schema</li>
|
||
<li>Aaru JSON follows the Aaru-specific metadata schema</li>
|
||
<li>Different tools may prefer one format over the other</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>Memory allocated for ctx->jsonBlock persists for the context lifetime and must be freed during context cleanup (aaruf_close).</dd>
|
||
<dd>
|
||
This function does not validate JSON syntax or schema. Corrupted JSON data will be loaded successfully and errors will only be detected when attempting to parse.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="structAaruMetadataJsonBlockHeader.html" title="Header for an Aaru metadata JSON block (identifier == BlockType::AaruMetadataJsonBlock).">AaruMetadataJsonBlockHeader</a> for the on-disk structure definition. </dd>
|
||
<dd>
|
||
<a class="el" href="blocks_2metadata_8c.html#a5e0397faed8aea27c5a6a3881875de54" title="Processes a CICM XML metadata block from the image stream.">process_cicm_block()</a> for processing CICM XML metadata blocks. </dd>
|
||
<dd>
|
||
<a class="el" href="decls_8h.html#aefe69fae905b957bb4349ac59fad9bc7">aaruf_open()</a> for the overall image opening sequence. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="blocks_2metadata_8c_source.html#l00470">470</a> of file <a class="el" href="blocks_2metadata_8c_source.html">metadata.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="enums_8h_source.html#l00159">AaruMetadataJsonBlock</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="metadata_8h_source.html#l00121">AaruMetadataJsonBlockHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00215">aaruformat_context::json_block</a>, <a class="el" href="context_8h_source.html#l00233">aaruformat_context::json_block_header</a>, <a class="el" href="metadata_8h_source.html#l00122">AaruMetadataJsonBlockHeader::length</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a565eace88f86c500249be1f2a89a1c60" name="a565eace88f86c500249be1f2a89a1c60"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a565eace88f86c500249be1f2a89a1c60">◆ </a></span>process_checksum_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_checksum_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a checksum block from the image stream. </p>
|
||
<p>Reads a checksum block, parses its entries, and stores the checksums (MD5, SHA1, SHA256, SpamSum) in the context.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the checksum block. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="checksum_8c_source.html#l00039">39</a> of file <a class="el" href="checksum_8c_source.html">checksum.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="enums_8h_source.html#l00152">ChecksumBlock</a>, <a class="el" href="context_8h_source.html#l00269">aaruformat_context::checksums</a>, <a class="el" href="checksum_8h_source.html#l00077">ChecksumHeader::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00101">Checksums::hasMd5</a>, <a class="el" href="context_8h_source.html#l00102">Checksums::hasSha1</a>, <a class="el" href="context_8h_source.html#l00103">Checksums::hasSha256</a>, <a class="el" href="context_8h_source.html#l00105">Checksums::hasSpamSum</a>, <a class="el" href="checksum_8h_source.html#l00075">ChecksumHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="checksum_8h_source.html#l00093">ChecksumEntry::length</a>, <a class="el" href="checksum_8h_source.html#l00076">ChecksumHeader::length</a>, <a class="el" href="enums_8h_source.html#l00169">Md5</a>, <a class="el" href="context_8h_source.html#l00106">Checksums::md5</a>, <a class="el" href="context_8h_source.html#l00069">MD5_DIGEST_LENGTH</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="enums_8h_source.html#l00170">Sha1</a>, <a class="el" href="context_8h_source.html#l00107">Checksums::sha1</a>, <a class="el" href="sha1_8h_source.html#l00039">SHA1_DIGEST_LENGTH</a>, <a class="el" href="enums_8h_source.html#l00171">Sha256</a>, <a class="el" href="context_8h_source.html#l00108">Checksums::sha256</a>, <a class="el" href="sha256_8h_source.html#l00038">SHA256_DIGEST_LENGTH</a>, <a class="el" href="enums_8h_source.html#l00172">SpamSum</a>, <a class="el" href="context_8h_source.html#l00110">Checksums::spamsum</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, and <a class="el" href="checksum_8h_source.html#l00092">ChecksumEntry::type</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a5e0397faed8aea27c5a6a3881875de54" name="a5e0397faed8aea27c5a6a3881875de54"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a5e0397faed8aea27c5a6a3881875de54">◆ </a></span>process_cicm_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_cicm_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a CICM XML metadata block from the image stream. </p>
|
||
<p>Reads a CICM XML metadata block from the image and updates the context with its contents.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the CICM block. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="blocks_2metadata_8c_source.html#l00306">306</a> of file <a class="el" href="blocks_2metadata_8c_source.html">metadata.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="context_8h_source.html#l00214">aaruformat_context::cicm_block</a>, <a class="el" href="context_8h_source.html#l00231">aaruformat_context::cicm_block_header</a>, <a class="el" href="enums_8h_source.html#l00151">CicmBlock</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="metadata_8h_source.html#l00109">CicmMetadataBlock::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="metadata_8h_source.html#l00110">CicmMetadataBlock::length</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a28d844a06cecbbf436d825a3c99ff0eb" name="a28d844a06cecbbf436d825a3c99ff0eb"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a28d844a06cecbbf436d825a3c99ff0eb">◆ </a></span>process_data_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t process_data_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype"><a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a data block from the image stream. </p>
|
||
<p>Reads a data block from the image, decompresses if needed, and updates the context with its contents. This function handles various types of data blocks including compressed (LZMA) and uncompressed data, performs CRC validation, and stores the processed data in the appropriate context fields.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the data block.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully processed the data block. This is returned when:<ul>
|
||
<li>The block is processed successfully and all validations pass</li>
|
||
<li>A NoData block type is encountered (these are skipped)</li>
|
||
<li>A UserData block type is encountered (these update sector size but are otherwise skipped)</li>
|
||
<li>Block validation fails but processing continues (non-fatal errors like CRC mismatches)</li>
|
||
<li>Memory allocation failures occur (processing continues with other blocks)</li>
|
||
<li>Block reading failures occur (processing continues with other blocks)</li>
|
||
<li>Unknown compression types are encountered (block is skipped)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context or image stream is invalid (NULL pointers).</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_BLOCK</td><td>(-7) Failed to seek to the block position in the image stream. This occurs when fseek() fails or the file position doesn't match the expected offset.</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</td><td>(-17) LZMA decompression failed. This can happen when:<ul>
|
||
<li>The LZMA decoder returns an error code</li>
|
||
<li>The decompressed data size doesn't match the expected block length</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Most validation and reading errors are treated as non-fatal and result in AARUF_STATUS_OK being returned while the problematic block is skipped. This allows processing to continue with other blocks in the image.</dd>
|
||
<dd>
|
||
The function performs the following validations:<ul>
|
||
<li>Block identifier matches the expected block type</li>
|
||
<li>Block data type matches the expected data type</li>
|
||
<li>CRC64 checksum validation (with version-specific byte order handling)</li>
|
||
<li>Proper decompression for LZMA-compressed blocks</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>Memory allocated for block data is stored in the context and should be freed when the context is destroyed. The function may replace existing data in the context. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="data_8c_source.html#l00071">71</a> of file <a class="el" href="data_8c_source.html">data.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="cst_8c_source.html#l00193">aaruf_cst_untransform()</a>, <a class="el" href="errors_8h_source.html#l00056">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00046">AARUF_ERROR_CANNOT_READ_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="helpers_8c_source.html#l00039">aaruf_get_media_tag_type_for_datatype()</a>, <a class="el" href="lzma_8c_source.html#l00039">aaruf_lzma_decode_buffer()</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="consts_8h_source.html#l00071">AARUF_VERSION_V1</a>, <a class="el" href="enums_8h_source.html#l00117">AppleProfileTag</a>, <a class="el" href="aaru_8h_source.html#l00916">AppleProfileTagAaru</a>, <a class="el" href="enums_8h_source.html#l00118">AppleSonyTag</a>, <a class="el" href="aaru_8h_source.html#l00896">AppleSonyTagAaru</a>, <a class="el" href="index_8h_source.html#l00110">IndexEntry::blockType</a>, <a class="el" href="endian_8h_source.html#l00081">bswap_64</a>, <a class="el" href="aaru_8h_source.html#l00903">CdSectorEcc</a>, <a class="el" href="aaru_8h_source.html#l00901">CdSectorEccP</a>, <a class="el" href="aaru_8h_source.html#l00902">CdSectorEccQ</a>, <a class="el" href="aaru_8h_source.html#l00900">CdSectorEdc</a>, <a class="el" href="aaru_8h_source.html#l00898">CdSectorHeader</a>, <a class="el" href="enums_8h_source.html#l00114">CdSectorPrefix</a>, <a class="el" href="enums_8h_source.html#l00121">CdSectorPrefixCorrected</a>, <a class="el" href="enums_8h_source.html#l00116">CdSectorSubchannel</a>, <a class="el" href="aaru_8h_source.html#l00904">CdSectorSubchannelAaru</a>, <a class="el" href="aaru_8h_source.html#l00899">CdSectorSubHeader</a>, <a class="el" href="enums_8h_source.html#l00115">CdSectorSuffix</a>, <a class="el" href="enums_8h_source.html#l00122">CdSectorSuffixCorrected</a>, <a class="el" href="aaru_8h_source.html#l00897">CdSectorSync</a>, <a class="el" href="data_8h_source.html#l00076">BlockHeader::cmpLength</a>, <a class="el" href="enums_8h_source.html#l00123">CompactDiscMode2Subheader</a>, <a class="el" href="data_8h_source.html#l00074">BlockHeader::compression</a>, <a class="el" href="data_8h_source.html#l00079">BlockHeader::crc64</a>, <a class="el" href="context_8h_source.html#l00120">mediaTagEntry::data</a>, <a class="el" href="index_8h_source.html#l00111">IndexEntry::dataType</a>, <a class="el" href="aaru_8h_source.html#l00908">DvdCmi</a>, <a class="el" href="enums_8h_source.html#l00126">DvdSectorCprMai</a>, <a class="el" href="enums_8h_source.html#l00130">DvdSectorEdc</a>, <a class="el" href="aaru_8h_source.html#l00915">DvdSectorEdcAaru</a>, <a class="el" href="enums_8h_source.html#l00128">DvdSectorId</a>, <a class="el" href="enums_8h_source.html#l00129">DvdSectorIed</a>, <a class="el" href="aaru_8h_source.html#l00914">DvdSectorIedAaru</a>, <a class="el" href="aaru_8h_source.html#l00912">DvdSectorInformation</a>, <a class="el" href="aaru_8h_source.html#l00913">DvdSectorNumber</a>, <a class="el" href="enums_8h_source.html#l00127">DvdSectorTitleKeyDecrypted</a>, <a class="el" href="aaru_8h_source.html#l00911">DvdTitleKeyDecrypted</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="data_8h_source.html#l00072">BlockHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="header_8h_source.html#l00110">AaruHeaderV2::imageMajorVersion</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="data_8h_source.html#l00077">BlockHeader::length</a>, <a class="el" href="context_8h_source.html#l00122">mediaTagEntry::length</a>, <a class="el" href="enums_8h_source.html#l00034">Lzma</a>, <a class="el" href="consts_8h_source.html#l00082">LZMA_PROPERTIES_LENGTH</a>, <a class="el" href="enums_8h_source.html#l00036">LzmaClauniaSubchannelTransform</a>, <a class="el" href="context_8h_source.html#l00264">aaruformat_context::mediaTags</a>, <a class="el" href="context_8h_source.html#l00204">aaruformat_context::mode2_subheaders</a>, <a class="el" href="enums_8h_source.html#l00045">NoData</a>, <a class="el" href="enums_8h_source.html#l00033">None</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="enums_8h_source.html#l00119">PriamDataTowerTag</a>, <a class="el" href="aaru_8h_source.html#l00917">PriamDataTowerTagAaru</a>, <a class="el" href="context_8h_source.html#l00263">aaruformat_context::readableSectorTags</a>, <a class="el" href="context_8h_source.html#l00207">aaruformat_context::sector_cpr_mai</a>, <a class="el" href="context_8h_source.html#l00209">aaruformat_context::sector_decrypted_title_key</a>, <a class="el" href="context_8h_source.html#l00208">aaruformat_context::sector_edc</a>, <a class="el" href="context_8h_source.html#l00205">aaruformat_context::sector_id</a>, <a class="el" href="context_8h_source.html#l00206">aaruformat_context::sector_ied</a>, <a class="el" href="context_8h_source.html#l00199">aaruformat_context::sector_prefix</a>, <a class="el" href="context_8h_source.html#l00200">aaruformat_context::sector_prefix_corrected</a>, <a class="el" href="context_8h_source.html#l00203">aaruformat_context::sector_subchannel</a>, <a class="el" href="context_8h_source.html#l00201">aaruformat_context::sector_suffix</a>, <a class="el" href="context_8h_source.html#l00202">aaruformat_context::sector_suffix_corrected</a>, <a class="el" href="aaru_8h_source.html#l00875">ImageInfo::SectorSize</a>, <a class="el" href="data_8h_source.html#l00075">BlockHeader::sectorSize</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="data_8h_source.html#l00073">BlockHeader::type</a>, <a class="el" href="context_8h_source.html#l00121">mediaTagEntry::type</a>, and <a class="el" href="enums_8h_source.html#l00046">UserData</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="abaf38090f967423898b99e0455751c07" name="abaf38090f967423898b99e0455751c07"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#abaf38090f967423898b99e0455751c07">◆ </a></span>process_ddt_v1()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t process_ddt_v1 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype"><a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool *</td> <td class="paramname"><span class="paramname"><em>found_user_data_ddt</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a DDT v1 block from the image stream. </p>
|
||
<p>Reads and decompresses (if needed) a DDT v1 block, verifies its integrity, and loads it into memory or maps it. This function handles both user data DDT blocks and CD sector prefix/suffix corrected DDT blocks, supporting both LZMA compression and uncompressed formats. On Linux, uncompressed blocks can be memory-mapped for improved performance.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the DDT block. </td></tr>
|
||
<tr><td class="paramname">found_user_data_ddt</td><td>Pointer to a boolean that will be set to true if a user data DDT was found and loaded.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully processed the DDT block. This is returned when:<ul>
|
||
<li>The DDT block is successfully read, decompressed (if needed), and loaded into memory</li>
|
||
<li>Memory mapping of uncompressed DDT succeeds on Linux systems</li>
|
||
<li>CD sector prefix/suffix corrected DDT blocks are processed successfully</li>
|
||
<li>Memory allocation failures occur for non-critical operations (processing continues)</li>
|
||
<li>File reading errors occur for compressed data or LZMA properties (processing continues)</li>
|
||
<li>Unknown compression types are encountered (block is skipped)</li>
|
||
<li>Memory mapping fails on Linux (sets found_user_data_ddt to false but continues)</li>
|
||
<li>Uncompressed DDT is encountered on non-Linux systems (not yet implemented, continues)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context or image stream is invalid (NULL pointers).</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_BLOCK</td><td>(-7) Failed to access the DDT block in the image stream. This occurs when:<ul>
|
||
<li>fseek() fails to position at the DDT block offset</li>
|
||
<li>The file position doesn't match the expected offset after seeking</li>
|
||
<li>Failed to read the DDT header from the image stream</li>
|
||
<li>The number of bytes read for the DDT header is insufficient</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</td><td>(-17) LZMA decompression failed. This can happen when:<ul>
|
||
<li>The LZMA decoder returns a non-zero error code during decompression</li>
|
||
<li>The decompressed data size doesn't match the expected DDT block length</li>
|
||
<li>This error causes immediate function termination and memory cleanup</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>The function exhibits different error handling strategies depending on the operation:<ul>
|
||
<li>Critical errors (seek failures, header read failures, decompression failures) cause immediate return</li>
|
||
<li>Non-critical errors (memory allocation failures, unknown compression types) allow processing to continue</li>
|
||
<li>The found_user_data_ddt flag is updated to reflect the success of user data DDT loading</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Allocated DDT data is stored in the context (ctx->userDataDdt, ctx->sectorPrefixDdt, ctx->sectorSuffixDdt)</li>
|
||
<li>On Linux, uncompressed DDTs may be memory-mapped instead of allocated</li>
|
||
<li>Memory is automatically cleaned up on decompression errors</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Platform-specific behavior:<ul>
|
||
<li>Linux: Supports memory mapping of uncompressed DDT blocks for better performance</li>
|
||
<li>Non-Linux: Uncompressed DDT processing is not yet implemented</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The function modifies context state including sector count, shift value, and DDT version. Ensure proper context cleanup when the function completes. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v1_8c_source.html#l00085">85</a> of file <a class="el" href="ddt__v1_8c_source.html">ddt_v1.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="errors_8h_source.html#l00056">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00046">AARUF_ERROR_CANNOT_READ_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="lzma_8c_source.html#l00039">aaruf_lzma_decode_buffer()</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="enums_8h_source.html#l00121">CdSectorPrefixCorrected</a>, <a class="el" href="enums_8h_source.html#l00122">CdSectorSuffixCorrected</a>, <a class="el" href="ddt_8h_source.html#l00072">DdtHeader::cmpLength</a>, <a class="el" href="ddt_8h_source.html#l00069">DdtHeader::compression</a>, <a class="el" href="index_8h_source.html#l00111">IndexEntry::dataType</a>, <a class="el" href="context_8h_source.html#l00194">aaruformat_context::ddt_version</a>, <a class="el" href="ddt_8h_source.html#l00071">DdtHeader::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00196">aaruformat_context::in_memory_ddt</a>, <a class="el" href="ddt_8h_source.html#l00073">DdtHeader::length</a>, <a class="el" href="enums_8h_source.html#l00034">Lzma</a>, <a class="el" href="consts_8h_source.html#l00082">LZMA_PROPERTIES_LENGTH</a>, <a class="el" href="context_8h_source.html#l00193">aaruformat_context::mapped_memory_ddt_size</a>, <a class="el" href="enums_8h_source.html#l00033">None</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="context_8h_source.html#l00183">aaruformat_context::sector_prefix_ddt</a>, <a class="el" href="context_8h_source.html#l00184">aaruformat_context::sector_suffix_ddt</a>, <a class="el" href="aaru_8h_source.html#l00874">ImageInfo::Sectors</a>, <a class="el" href="context_8h_source.html#l00195">aaruformat_context::shift</a>, <a class="el" href="ddt_8h_source.html#l00070">DdtHeader::shift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="context_8h_source.html#l00181">aaruformat_context::user_data_ddt</a>, and <a class="el" href="enums_8h_source.html#l00046">UserData</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a1caeae710ee5e1dd356e43b3b659e9c0" name="a1caeae710ee5e1dd356e43b3b659e9c0"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a1caeae710ee5e1dd356e43b3b659e9c0">◆ </a></span>process_ddt_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t process_ddt_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype"><a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool *</td> <td class="paramname"><span class="paramname"><em>found_user_data_ddt</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a DDT v2 block from the image stream. </p>
|
||
<p>Reads and decompresses (if needed) a DDT v2 block, verifies its CRC, and loads it into memory. This function handles both user data DDT blocks and CD sector prefix/suffix corrected DDT blocks, supporting both LZMA compression and uncompressed formats. It performs CRC64 validation and stores the processed DDT data in the appropriate context fields based on size type (small/big).</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the DDT block. </td></tr>
|
||
<tr><td class="paramname">found_user_data_ddt</td><td>Pointer to a boolean that will be set to true if a user data DDT was found and loaded.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully processed the DDT block. This is returned when:<ul>
|
||
<li>The DDT block is successfully read, decompressed (if needed), and loaded into memory</li>
|
||
<li>CRC64 validation passes for the DDT data</li>
|
||
<li>User data DDT blocks are processed and context is properly updated</li>
|
||
<li>CD sector prefix/suffix corrected DDT blocks are processed successfully</li>
|
||
<li>Memory allocation failures occur for non-critical operations (processing continues)</li>
|
||
<li>File reading errors occur for compressed data or LZMA properties (processing continues)</li>
|
||
<li>Unknown compression types are encountered (block is skipped)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) The context or image stream is invalid (NULL pointers).</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_BLOCK</td><td>(-7) Failed to access the DDT block in the image stream. This occurs when:<ul>
|
||
<li>fseek() fails to position at the DDT block offset</li>
|
||
<li>The file position doesn't match the expected offset after seeking</li>
|
||
<li>Failed to read the DDT header from the image stream</li>
|
||
<li>The number of bytes read for the DDT header is insufficient</li>
|
||
<li>CRC64 context initialization fails (internal error)</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</td><td>(-17) LZMA decompression failed. This can happen when:<ul>
|
||
<li>The LZMA decoder returns a non-zero error code during decompression</li>
|
||
<li>The decompressed data size doesn't match the expected DDT block length</li>
|
||
<li>This error causes immediate function termination and memory cleanup</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_INVALID_BLOCK_CRC</td><td>(-18) CRC64 validation failed. This occurs when:<ul>
|
||
<li>Calculated CRC64 doesn't match the expected CRC64 in the DDT header</li>
|
||
<li>Data corruption is detected in the DDT block</li>
|
||
<li>This applies to both compressed and uncompressed DDT blocks</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Error Handling Strategy:<ul>
|
||
<li>Critical errors (seek failures, header read failures, decompression failures, CRC failures) cause immediate return</li>
|
||
<li>Non-critical errors (memory allocation failures, unknown compression types) allow processing to continue</li>
|
||
<li>The found_user_data_ddt flag is updated to reflect the success of user data DDT loading</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
DDT v2 Features:<ul>
|
||
<li>Handles multi-level DDT hierarchies with tableShift parameter</li>
|
||
<li>Updates context with sector counts, DDT version, and primary DDT offset</li>
|
||
<li>Stores DDT data in size-appropriate context fields (userDataDdtMini/Big, sectorPrefixDdt, etc.)</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Allocated DDT data is stored in the context and becomes part of the context lifecycle</li>
|
||
<li>Memory is automatically cleaned up on decompression or CRC validation errors</li>
|
||
<li>Buffer memory is reused for the final DDT data storage (no double allocation)</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
CRC Validation:<ul>
|
||
<li>All DDT blocks undergo CRC64 validation regardless of compression type</li>
|
||
<li>CRC is calculated on the final decompressed data</li>
|
||
<li>Uses standard CRC64 calculation (no version-specific endianness conversion like v1)</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The function modifies context state including sector count, DDT version, and primary DDT offset. Ensure proper context cleanup when the function completes.</dd>
|
||
<dd>
|
||
Memory allocated for DDT data becomes part of the context and should not be freed separately. The context cleanup functions will handle DDT memory deallocation. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l00096">96</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00141">aaruf_crc64_final()</a>, <a class="el" href="crc64_8c_source.html#l00032">aaruf_crc64_init()</a>, <a class="el" href="crc64_8c_source.html#l00055">aaruf_crc64_update()</a>, <a class="el" href="errors_8h_source.html#l00056">AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00046">AARUF_ERROR_CANNOT_READ_BLOCK</a>, <a class="el" href="errors_8h_source.html#l00057">AARUF_ERROR_INVALID_BLOCK_CRC</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="lzma_8c_source.html#l00039">aaruf_lzma_decode_buffer()</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="ddt_8h_source.html#l00150">DdtHeader2::blocks</a>, <a class="el" href="enums_8h_source.html#l00114">CdSectorPrefix</a>, <a class="el" href="enums_8h_source.html#l00115">CdSectorSuffix</a>, <a class="el" href="ddt_8h_source.html#l00159">DdtHeader2::cmpLength</a>, <a class="el" href="ddt_8h_source.html#l00145">DdtHeader2::compression</a>, <a class="el" href="ddt_8h_source.html#l00162">DdtHeader2::crc64</a>, <a class="el" href="index_8h_source.html#l00111">IndexEntry::dataType</a>, <a class="el" href="context_8h_source.html#l00194">aaruformat_context::ddt_version</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00196">aaruformat_context::in_memory_ddt</a>, <a class="el" href="ddt_8h_source.html#l00160">DdtHeader2::length</a>, <a class="el" href="enums_8h_source.html#l00034">Lzma</a>, <a class="el" href="consts_8h_source.html#l00082">LZMA_PROPERTIES_LENGTH</a>, <a class="el" href="ddt_8h_source.html#l00149">DdtHeader2::negative</a>, <a class="el" href="enums_8h_source.html#l00033">None</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="ddt_8h_source.html#l00151">DdtHeader2::overflow</a>, <a class="el" href="context_8h_source.html#l00192">aaruformat_context::primary_ddt_offset</a>, <a class="el" href="context_8h_source.html#l00185">aaruformat_context::sector_prefix_ddt2</a>, <a class="el" href="context_8h_source.html#l00186">aaruformat_context::sector_suffix_ddt2</a>, <a class="el" href="aaru_8h_source.html#l00874">ImageInfo::Sectors</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="context_8h_source.html#l00187">aaruformat_context::user_data_ddt2</a>, <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>, and <a class="el" href="enums_8h_source.html#l00046">UserData</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a0e2cfc858c0551bc9bef11d5bdb85aac" name="a0e2cfc858c0551bc9bef11d5bdb85aac"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a0e2cfc858c0551bc9bef11d5bdb85aac">◆ </a></span>process_dumphw_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_dumphw_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a dump hardware block from the image stream. </p>
|
||
<p>Reads a dump hardware block from the image and updates the context with its contents.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the dump hardware block. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="blocks_2dump_8c_source.html#l00107">107</a> of file <a class="el" href="blocks_2dump_8c_source.html">dump.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="consts_8h_source.html#l00071">AARUF_VERSION_V1</a>, <a class="el" href="index_8h_source.html#l00110">IndexEntry::blockType</a>, <a class="el" href="endian_8h_source.html#l00081">bswap_64</a>, <a class="el" href="helpers_8c_source.html#l00459">compare_extents()</a>, <a class="el" href="dump_8h_source.html#l00095">DumpHardwareHeader::crc64</a>, <a class="el" href="context_8h_source.html#l00212">aaruformat_context::dump_hardware_entries_with_data</a>, <a class="el" href="context_8h_source.html#l00232">aaruformat_context::dump_hardware_header</a>, <a class="el" href="enums_8h_source.html#l00156">DumpHardwareBlock</a>, <a class="el" href="dump_8h_source.html#l00093">DumpHardwareHeader::entries</a>, <a class="el" href="context_8h_source.html#l00316">DumpHardwareEntriesWithData::entry</a>, <a class="el" href="context_8h_source.html#l00317">DumpHardwareEntriesWithData::extents</a>, <a class="el" href="dump_8h_source.html#l00122">DumpHardwareEntry::extents</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00321">DumpHardwareEntriesWithData::firmware</a>, <a class="el" href="dump_8h_source.html#l00117">DumpHardwareEntry::firmwareLength</a>, <a class="el" href="blocks_2dump_8c_source.html#l00036">free_dump_hardware_entries_array()</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="dump_8h_source.html#l00092">DumpHardwareHeader::identifier</a>, <a class="el" href="header_8h_source.html#l00110">AaruHeaderV2::imageMajorVersion</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="dump_8h_source.html#l00094">DumpHardwareHeader::length</a>, <a class="el" href="context_8h_source.html#l00318">DumpHardwareEntriesWithData::manufacturer</a>, <a class="el" href="dump_8h_source.html#l00114">DumpHardwareEntry::manufacturerLength</a>, <a class="el" href="context_8h_source.html#l00319">DumpHardwareEntriesWithData::model</a>, <a class="el" href="dump_8h_source.html#l00115">DumpHardwareEntry::modelLength</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="blocks_2dump_8c_source.html#l00064">read_dump_string()</a>, <a class="el" href="blocks_2dump_8c_source.html#l00054">reset_dump_hardware_context()</a>, <a class="el" href="context_8h_source.html#l00320">DumpHardwareEntriesWithData::revision</a>, <a class="el" href="dump_8h_source.html#l00116">DumpHardwareEntry::revisionLength</a>, <a class="el" href="context_8h_source.html#l00322">DumpHardwareEntriesWithData::serial</a>, <a class="el" href="dump_8h_source.html#l00118">DumpHardwareEntry::serialLength</a>, <a class="el" href="context_8h_source.html#l00323">DumpHardwareEntriesWithData::softwareName</a>, <a class="el" href="dump_8h_source.html#l00119">DumpHardwareEntry::softwareNameLength</a>, <a class="el" href="context_8h_source.html#l00325">DumpHardwareEntriesWithData::softwareOperatingSystem</a>, <a class="el" href="dump_8h_source.html#l00121">DumpHardwareEntry::softwareOperatingSystemLength</a>, <a class="el" href="context_8h_source.html#l00324">DumpHardwareEntriesWithData::softwareVersion</a>, <a class="el" href="dump_8h_source.html#l00120">DumpHardwareEntry::softwareVersionLength</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a81d410de6727d95a85b827067e1a8bc6" name="a81d410de6727d95a85b827067e1a8bc6"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a81d410de6727d95a85b827067e1a8bc6">◆ </a></span>process_geometry_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_geometry_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a logical geometry block from the image stream. </p>
|
||
<p>Reads a logical geometry block from the image and updates the context with its contents.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the geometry block. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="blocks_2metadata_8c_source.html#l00246">246</a> of file <a class="el" href="blocks_2metadata_8c_source.html">metadata.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="context_8h_source.html#l00234">aaruformat_context::cylinders</a>, <a class="el" href="data_8h_source.html#l00093">GeometryBlockHeader::cylinders</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00229">aaruformat_context::geometry_block</a>, <a class="el" href="enums_8h_source.html#l00148">GeometryBlock</a>, <a class="el" href="context_8h_source.html#l00235">aaruformat_context::heads</a>, <a class="el" href="data_8h_source.html#l00094">GeometryBlockHeader::heads</a>, <a class="el" href="data_8h_source.html#l00092">GeometryBlockHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="context_8h_source.html#l00236">aaruformat_context::sectors_per_track</a>, <a class="el" href="data_8h_source.html#l00095">GeometryBlockHeader::sectorsPerTrack</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a5d3b1092abc36a27a441a01a8a0b3b48" name="a5d3b1092abc36a27a441a01a8a0b3b48"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a5d3b1092abc36a27a441a01a8a0b3b48">◆ </a></span>process_index_v1()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">UT_array * process_index_v1 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes an index block (version 1) from the image stream. </p>
|
||
<p>Reads and parses an index block (version 1) from the image, returning an array of index entries. This function handles the legacy index format used in early AaruFormat versions, providing compatibility with older image files. It reads the <a class="el" href="structIndexHeader.html" title="Index header (version 1) for legacy images (identifier == IndexBlock).">IndexHeader</a> structure followed by a sequential list of <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> structures, validating the index identifier for format correctness.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing the image stream and header information.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following values: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">UT_array*</td><td>Successfully processed the index block. This is returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The index header is successfully read from the position specified in ctx->header.indexOffset</li>
|
||
<li>The index identifier matches IndexBlock (legacy format identifier)</li>
|
||
<li>All index entries are successfully read and stored in the UT_array</li>
|
||
<li>Memory allocation for the index entries array succeeds</li>
|
||
<li>The returned array contains all index entries from the version 1 index block</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">NULL</td><td>Index processing failed. This occurs when:<ul>
|
||
<li>The context parameter is NULL</li>
|
||
<li>The image stream (ctx->imageStream) is NULL or invalid</li>
|
||
<li>Cannot read the <a class="el" href="structIndexHeader.html" title="Index header (version 1) for legacy images (identifier == IndexBlock).">IndexHeader</a> structure from the image stream</li>
|
||
<li>The index identifier doesn't match IndexBlock (incorrect format or corruption)</li>
|
||
<li>Memory allocation fails for the UT_array structure</li>
|
||
<li>File I/O errors occur while reading index entries</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Index Structure (Version 1):<ul>
|
||
<li><a class="el" href="structIndexHeader.html" title="Index header (version 1) for legacy images (identifier == IndexBlock).">IndexHeader</a>: Contains identifier (IndexBlock), entry count, and metadata</li>
|
||
<li><a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> array: Sequential list of entries describing block locations and types</li>
|
||
<li>No CRC validation is performed during processing (use verify_index_v1 for validation)</li>
|
||
<li>No compression support in version 1 index format</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Returns a newly allocated UT_array that must be freed by the caller using utarray_free()</li>
|
||
<li>On error, any partially allocated memory is cleaned up before returning NULL</li>
|
||
<li>Each <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> is copied into the array (no reference to original stream data)</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Version Compatibility:<ul>
|
||
<li>Supports only legacy IndexBlock format (not IndexBlock2 or IndexBlock3)</li>
|
||
<li>Compatible with early AaruFormat and DiscImageChef image files</li>
|
||
<li>Does not handle subindex or hierarchical index structures</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The caller is responsible for freeing the returned UT_array using utarray_free(). Failure to free the array will result in memory leaks.</dd>
|
||
<dd>
|
||
This function does not validate the CRC integrity of the index data. Use <a class="el" href="index__v1_8c.html#a89ed93d216c4dce0ae5e2acccf8cc2b4" title="Verifies the integrity of an index block (version 1) in the image stream.">verify_index_v1()</a> to ensure index integrity before processing.</dd>
|
||
<dd>
|
||
The function assumes ctx->header.indexOffset points to a valid index block. Invalid offsets may cause file access errors or reading incorrect data. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="index__v1_8c_source.html#l00079">79</a> of file <a class="el" href="index__v1_8c_source.html">index_v1.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="index_8h_source.html#l00069">IndexHeader::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="index_8h_source.html#l00068">IndexHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="enums_8h_source.html#l00145">IndexBlock</a>, <a class="el" href="header_8h_source.html#l00115">AaruHeaderV2::indexOffset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>, and <a class="el" href="verify_8c_source.html#l00130">aaruf_verify_image()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a1baad6508d1cde5a712794e956fb3d3c" name="a1baad6508d1cde5a712794e956fb3d3c"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a1baad6508d1cde5a712794e956fb3d3c">◆ </a></span>process_index_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">UT_array * process_index_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes an index block (version 2) from the image stream. </p>
|
||
<p>Reads and parses an index block (version 2) from the image, returning an array of index entries. This function handles the intermediate index format used in mid-generation AaruFormat versions, providing compatibility with version 2 image files. It reads the <a class="el" href="structIndexHeader2.html" title="Index header (version 2) with 64‑bit entry counter (identifier == IndexBlock2).">IndexHeader2</a> structure followed by a sequential list of <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> structures, validating the index identifier for format correctness.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing the image stream and header information.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following values: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">UT_array*</td><td>Successfully processed the index block. This is returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The index header is successfully read from the position specified in ctx->header.indexOffset</li>
|
||
<li>The index identifier matches IndexBlock2 (version 2 format identifier)</li>
|
||
<li>All index entries are successfully read and stored in the UT_array</li>
|
||
<li>Memory allocation for the index entries array succeeds</li>
|
||
<li>The returned array contains all index entries from the version 2 index block</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">NULL</td><td>Index processing failed. This occurs when:<ul>
|
||
<li>The context parameter is NULL</li>
|
||
<li>The image stream (ctx->imageStream) is NULL or invalid</li>
|
||
<li>Cannot read the <a class="el" href="structIndexHeader2.html" title="Index header (version 2) with 64‑bit entry counter (identifier == IndexBlock2).">IndexHeader2</a> structure from the image stream</li>
|
||
<li>The index identifier doesn't match IndexBlock2 (incorrect format or corruption)</li>
|
||
<li>Memory allocation fails for the UT_array structure</li>
|
||
<li>File I/O errors occur while reading index entries</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Index Structure (Version 2):<ul>
|
||
<li><a class="el" href="structIndexHeader2.html" title="Index header (version 2) with 64‑bit entry counter (identifier == IndexBlock2).">IndexHeader2</a>: Contains identifier (IndexBlock2), entry count, and enhanced metadata</li>
|
||
<li><a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> array: Sequential list of entries describing block locations and types</li>
|
||
<li>No CRC validation is performed during processing (use verify_index_v2 for validation)</li>
|
||
<li>No compression support in version 2 index format</li>
|
||
<li>Compatible with mid-generation AaruFormat improvements</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Returns a newly allocated UT_array that must be freed by the caller using utarray_free()</li>
|
||
<li>On error, any partially allocated memory is cleaned up before returning NULL</li>
|
||
<li>Each <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> is copied into the array (no reference to original stream data)</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Version Compatibility:<ul>
|
||
<li>Supports only IndexBlock2 format (not IndexBlock or IndexBlock3)</li>
|
||
<li>Compatible with intermediate AaruFormat image files</li>
|
||
<li>Does not handle subindex or hierarchical index structures (introduced in v3)</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The caller is responsible for freeing the returned UT_array using utarray_free(). Failure to free the array will result in memory leaks.</dd>
|
||
<dd>
|
||
This function does not validate the CRC integrity of the index data. Use <a class="el" href="index__v2_8c.html#ae234e22b16b085d18614110630034db5" title="Verifies the integrity of an index block (version 2) in the image stream.">verify_index_v2()</a> to ensure index integrity before processing.</dd>
|
||
<dd>
|
||
The function assumes ctx->header.indexOffset points to a valid index block. Invalid offsets may cause file access errors or reading incorrect data. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="index__v2_8c_source.html#l00081">81</a> of file <a class="el" href="index__v2_8c_source.html">index_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="index_8h_source.html#l00081">IndexHeader2::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="index_8h_source.html#l00080">IndexHeader2::identifier</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="enums_8h_source.html#l00146">IndexBlock2</a>, <a class="el" href="header_8h_source.html#l00115">AaruHeaderV2::indexOffset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>, and <a class="el" href="verify_8c_source.html#l00130">aaruf_verify_image()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="aff88fae9938d5f56318bfd7a455d5e94" name="aff88fae9938d5f56318bfd7a455d5e94"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#aff88fae9938d5f56318bfd7a455d5e94">◆ </a></span>process_index_v3()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">UT_array * process_index_v3 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes an index block (version 3) from the image stream. </p>
|
||
<p>Reads and parses an index block (version 3) from the image, returning an array of index entries. This function handles the advanced index format used in current AaruFormat versions, supporting hierarchical subindex structures for improved scalability. It reads the <a class="el" href="structIndexHeader3.html" title="Index header (version 3) adding hierarchical chaining (identifier == IndexBlock3).">IndexHeader3</a> structure followed by index entries, recursively processing any subindex blocks encountered to create a flattened array of all index entries.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing the image stream and header information.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following values: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">UT_array*</td><td>Successfully processed the index block and all subindexes. This is returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The index header is successfully read from the position specified in ctx->header.indexOffset</li>
|
||
<li>The index identifier matches IndexBlock3 (version 3 format identifier)</li>
|
||
<li>All index entries are successfully read and stored in the UT_array</li>
|
||
<li>Any subindex blocks (IndexBlock3 entries) are recursively processed via <a class="el" href="index__v3_8c.html#ac85ad03ba0f06b8799d7fe056b87a18e" title="Adds entries from a subindex block (version 3) to the main index entries array.">add_subindex_entries()</a></li>
|
||
<li>Memory allocation for the index entries array succeeds</li>
|
||
<li>The returned array contains all index entries from the main index and all subindexes</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">NULL</td><td>Index processing failed. This occurs when:<ul>
|
||
<li>The context parameter is NULL</li>
|
||
<li>The image stream (ctx->imageStream) is NULL or invalid</li>
|
||
<li>Cannot read the <a class="el" href="structIndexHeader3.html" title="Index header (version 3) adding hierarchical chaining (identifier == IndexBlock3).">IndexHeader3</a> structure from the image stream</li>
|
||
<li>The index identifier doesn't match IndexBlock3 (incorrect format or corruption)</li>
|
||
<li>Memory allocation fails for the UT_array structure</li>
|
||
<li>File I/O errors occur while reading index entries</li>
|
||
<li>Recursive subindex processing fails (errors in <a class="el" href="index__v3_8c.html#ac85ad03ba0f06b8799d7fe056b87a18e" title="Adds entries from a subindex block (version 3) to the main index entries array.">add_subindex_entries()</a>)</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>Index Structure (Version 3):<ul>
|
||
<li><a class="el" href="structIndexHeader3.html" title="Index header (version 3) adding hierarchical chaining (identifier == IndexBlock3).">IndexHeader3</a>: Contains identifier (IndexBlock3), entry count, and advanced metadata</li>
|
||
<li><a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> array: May contain regular entries and subindex references (IndexBlock3 type)</li>
|
||
<li>Hierarchical support: Subindex entries are recursively processed to flatten the structure</li>
|
||
<li>No CRC validation is performed during processing (use verify_index_v3 for validation)</li>
|
||
<li>Supports scalable index organization for large image files</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Subindex Processing:<ul>
|
||
<li>When an <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> has blockType == IndexBlock3, it references a subindex</li>
|
||
<li>Subindexes are recursively processed using <a class="el" href="index__v3_8c.html#ac85ad03ba0f06b8799d7fe056b87a18e" title="Adds entries from a subindex block (version 3) to the main index entries array.">add_subindex_entries()</a></li>
|
||
<li>All entries from subindexes are flattened into the main index entries array</li>
|
||
<li>Supports arbitrary nesting depth of subindexes</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Returns a newly allocated UT_array that must be freed by the caller using utarray_free()</li>
|
||
<li>On error, any partially allocated memory is cleaned up before returning NULL</li>
|
||
<li>Each <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> is copied into the array (no reference to original stream data)</li>
|
||
<li>Memory usage scales with total entries across all subindexes</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Version Compatibility:<ul>
|
||
<li>Supports only IndexBlock3 format (not IndexBlock or IndexBlock2)</li>
|
||
<li>Compatible with current generation AaruFormat image files</li>
|
||
<li>Backward compatible with images that don't use subindexes</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The caller is responsible for freeing the returned UT_array using utarray_free(). Failure to free the array will result in memory leaks.</dd>
|
||
<dd>
|
||
This function does not validate the CRC integrity of the index data. Use <a class="el" href="index__v3_8c.html#ad7ed9250463c320c7bc8d83689bcfefb" title="Verifies the integrity of an index block (version 3) in the image stream.">verify_index_v3()</a> to ensure index integrity before processing.</dd>
|
||
<dd>
|
||
Recursive subindex processing may cause significant memory usage and processing time for images with deeply nested or numerous subindexes.</dd>
|
||
<dd>
|
||
The function assumes ctx->header.indexOffset points to a valid index block. Invalid offsets may cause file access errors or reading incorrect data. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="index__v3_8c_source.html#l00098">98</a> of file <a class="el" href="index__v3_8c_source.html">index_v3.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="index__v3_8c_source.html#l00247">add_subindex_entries()</a>, <a class="el" href="index_8h_source.html#l00110">IndexEntry::blockType</a>, <a class="el" href="index_8h_source.html#l00095">IndexHeader3::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="index_8h_source.html#l00094">IndexHeader3::identifier</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="enums_8h_source.html#l00147">IndexBlock3</a>, <a class="el" href="header_8h_source.html#l00115">AaruHeaderV2::indexOffset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>, and <a class="el" href="verify_8c_source.html#l00130">aaruf_verify_image()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a43974d4c183240be30d49ff09ef7b8c2" name="a43974d4c183240be30d49ff09ef7b8c2"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a43974d4c183240be30d49ff09ef7b8c2">◆ </a></span>process_metadata_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_metadata_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a metadata block from the image stream. </p>
|
||
<p>Reads a metadata block from the image and updates the context with its contents.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the metadata block. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="blocks_2metadata_8c_source.html#l00035">35</a> of file <a class="el" href="blocks_2metadata_8c_source.html">metadata.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="metadata_8h_source.html#l00071">MetadataBlockHeader::blockSize</a>, <a class="el" href="index_8h_source.html#l00110">IndexEntry::blockType</a>, <a class="el" href="context_8h_source.html#l00218">aaruformat_context::comments</a>, <a class="el" href="metadata_8h_source.html#l00078">MetadataBlockHeader::commentsLength</a>, <a class="el" href="metadata_8h_source.html#l00077">MetadataBlockHeader::commentsOffset</a>, <a class="el" href="context_8h_source.html#l00216">aaruformat_context::creator</a>, <a class="el" href="metadata_8h_source.html#l00076">MetadataBlockHeader::creatorLength</a>, <a class="el" href="metadata_8h_source.html#l00075">MetadataBlockHeader::creatorOffset</a>, <a class="el" href="context_8h_source.html#l00228">aaruformat_context::drive_firmware_revision</a>, <a class="el" href="context_8h_source.html#l00224">aaruformat_context::drive_manufacturer</a>, <a class="el" href="context_8h_source.html#l00225">aaruformat_context::drive_model</a>, <a class="el" href="context_8h_source.html#l00226">aaruformat_context::drive_serial_number</a>, <a class="el" href="metadata_8h_source.html#l00098">MetadataBlockHeader::driveFirmwareRevisionLength</a>, <a class="el" href="metadata_8h_source.html#l00097">MetadataBlockHeader::driveFirmwareRevisionOffset</a>, <a class="el" href="metadata_8h_source.html#l00092">MetadataBlockHeader::driveManufacturerLength</a>, <a class="el" href="metadata_8h_source.html#l00091">MetadataBlockHeader::driveManufacturerOffset</a>, <a class="el" href="metadata_8h_source.html#l00094">MetadataBlockHeader::driveModelLength</a>, <a class="el" href="metadata_8h_source.html#l00093">MetadataBlockHeader::driveModelOffset</a>, <a class="el" href="metadata_8h_source.html#l00096">MetadataBlockHeader::driveSerialNumberLength</a>, <a class="el" href="metadata_8h_source.html#l00095">MetadataBlockHeader::driveSerialNumberOffset</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="metadata_8h_source.html#l00070">MetadataBlockHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00239">aaruformat_context::last_media_sequence</a>, <a class="el" href="metadata_8h_source.html#l00074">MetadataBlockHeader::lastMediaSequence</a>, <a class="el" href="context_8h_source.html#l00222">aaruformat_context::media_barcode</a>, <a class="el" href="context_8h_source.html#l00219">aaruformat_context::media_manufacturer</a>, <a class="el" href="context_8h_source.html#l00220">aaruformat_context::media_model</a>, <a class="el" href="context_8h_source.html#l00223">aaruformat_context::media_part_number</a>, <a class="el" href="context_8h_source.html#l00238">aaruformat_context::media_sequence</a>, <a class="el" href="context_8h_source.html#l00221">aaruformat_context::media_serial_number</a>, <a class="el" href="context_8h_source.html#l00217">aaruformat_context::media_title</a>, <a class="el" href="metadata_8h_source.html#l00088">MetadataBlockHeader::mediaBarcodeLength</a>, <a class="el" href="metadata_8h_source.html#l00087">MetadataBlockHeader::mediaBarcodeOffset</a>, <a class="el" href="metadata_8h_source.html#l00082">MetadataBlockHeader::mediaManufacturerLength</a>, <a class="el" href="metadata_8h_source.html#l00081">MetadataBlockHeader::mediaManufacturerOffset</a>, <a class="el" href="metadata_8h_source.html#l00084">MetadataBlockHeader::mediaModelLength</a>, <a class="el" href="metadata_8h_source.html#l00083">MetadataBlockHeader::mediaModelOffset</a>, <a class="el" href="metadata_8h_source.html#l00090">MetadataBlockHeader::mediaPartNumberLength</a>, <a class="el" href="metadata_8h_source.html#l00089">MetadataBlockHeader::mediaPartNumberOffset</a>, <a class="el" href="metadata_8h_source.html#l00072">MetadataBlockHeader::mediaSequence</a>, <a class="el" href="metadata_8h_source.html#l00086">MetadataBlockHeader::mediaSerialNumberLength</a>, <a class="el" href="metadata_8h_source.html#l00085">MetadataBlockHeader::mediaSerialNumberOffset</a>, <a class="el" href="metadata_8h_source.html#l00080">MetadataBlockHeader::mediaTitleLength</a>, <a class="el" href="metadata_8h_source.html#l00079">MetadataBlockHeader::mediaTitleOffset</a>, <a class="el" href="context_8h_source.html#l00213">aaruformat_context::metadata_block</a>, <a class="el" href="context_8h_source.html#l00230">aaruformat_context::metadata_block_header</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a829bbac3c17b60efd8f93188a8de8278" name="a829bbac3c17b60efd8f93188a8de8278"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a829bbac3c17b60efd8f93188a8de8278">◆ </a></span>process_tape_files_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_tape_files_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a tape file metadata block from the image stream. </p>
|
||
<p>Reads and parses a TapeFileBlock from the Aaru image, validates its integrity, and populates the context's tape file hash table with file layout information. Each tape file entry defines a logical file on the tape medium by specifying its partition, file number, and block range (FirstBlock to LastBlock inclusive).</p>
|
||
<p>The function performs the following operations:</p><ol type="1">
|
||
<li>Seeks to the block position indicated by the index entry</li>
|
||
<li>Reads and validates the <a class="el" href="structTapeFileHeader.html" title="Header for a tape file metadata block containing file layout information.">TapeFileHeader</a> structure</li>
|
||
<li>Allocates and reads the array of <a class="el" href="structTapeFileEntry.html" title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures</li>
|
||
<li>Validates data integrity using CRC64-ECMA checksum</li>
|
||
<li>Inserts each file entry into the context's UTHASH table with a composite key</li>
|
||
<li>Updates image size statistics</li>
|
||
</ol>
|
||
<p><b>Composite Key Construction:</b> Each tape file is uniquely identified by a 64-bit composite key: key = (partition << 32) | file_number This allows files with the same file number in different partitions to coexist in the hash table without conflicts.</p>
|
||
<p><b>Hash Table Management:</b> The function uses HASH_REPLACE to insert entries, which automatically:</p><ul>
|
||
<li>Adds new entries if the key doesn't exist</li>
|
||
<li>Replaces existing entries if the key is found (freeing the old entry) This ensures that duplicate entries (same partition/file combination) are properly handled by keeping only the most recent definition.</li>
|
||
</ul>
|
||
<p><b>Error Handling:</b> The function treats most errors as non-fatal and continues processing:</p><ul>
|
||
<li>Invalid context or stream: Returns immediately (FATAL log)</li>
|
||
<li>Seek failures: Returns immediately (FATAL log)</li>
|
||
<li>Header read failures: Returns early (TRACE log)</li>
|
||
<li>Incorrect block identifier: Logs warning but continues</li>
|
||
<li>Memory allocation failures: Logs error and returns</li>
|
||
<li>Entry read failures: Frees buffer and returns</li>
|
||
<li>CRC64 mismatch: Logs warning, frees buffer, and returns</li>
|
||
<li>Per-entry allocation failures: Logs error and skips that entry</li>
|
||
</ul>
|
||
<p><b>Block Structure:</b> The tape file block consists of: </p><div class="fragment"><div class="line">+-------------------------+</div>
|
||
<div class="line">| <a class="code hl_typedef" href="tape_8h.html#a0ce39d637f56346a0d859f94b8fc1f40">TapeFileHeader</a> (24 B) | <- identifier, entries, length, crc64</div>
|
||
<div class="line">+-------------------------+</div>
|
||
<div class="line">| <a class="code hl_struct" href="structTapeFileEntry.html">TapeFileEntry</a> 0 (21 B) | <- File, Partition, FirstBlock, LastBlock</div>
|
||
<div class="line">| <a class="code hl_struct" href="structTapeFileEntry.html">TapeFileEntry</a> 1 (21 B) |</div>
|
||
<div class="line">| ... |</div>
|
||
<div class="line">| <a class="code hl_typedef" href="tape_8h.html#ade8125364d763d57d167c0b521beaf64">TapeFileEntry</a> (n-1) |</div>
|
||
<div class="line">+-------------------------+</div>
|
||
<div class="ttc" id="astructTapeFileEntry_html"><div class="ttname"><a href="structTapeFileEntry.html">TapeFileEntry</a></div><div class="ttdoc">Describes a single logical file on a tape medium.</div><div class="ttdef"><b>Definition</b> <a href="tape_8h_source.html#l00133">tape.h:134</a></div></div>
|
||
<div class="ttc" id="atape_8h_html_a0ce39d637f56346a0d859f94b8fc1f40"><div class="ttname"><a href="tape_8h.html#a0ce39d637f56346a0d859f94b8fc1f40">TapeFileHeader</a></div><div class="ttdeci">struct TapeFileHeader TapeFileHeader</div></div>
|
||
<div class="ttc" id="atape_8h_html_ade8125364d763d57d167c0b521beaf64"><div class="ttname"><a href="tape_8h.html#ade8125364d763d57d167c0b521beaf64">TapeFileEntry</a></div><div class="ttdeci">struct TapeFileEntry TapeFileEntry</div></div>
|
||
</div><!-- fragment --><p><b>CRC64 Validation:</b> The CRC64 checksum in the header is computed over the entire array of <a class="el" href="structTapeFileEntry.html" title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures (excluding the header itself). This provides integrity verification to detect corruption in the file table.</p>
|
||
<p><b>Memory Management:</b></p><ul>
|
||
<li>Allocates a temporary buffer to read all file entries</li>
|
||
<li>Allocates individual hash table entries for each file</li>
|
||
<li>Frees the temporary buffer before returning</li>
|
||
<li>Frees replaced hash entries automatically</li>
|
||
<li>Hash table entries remain in context until cleanup</li>
|
||
</ul>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. Must not be NULL. The context must have a valid imageStream open for reading. The ctx->tapeFiles hash table will be populated with file entries. The ctx->imageInfo.ImageSize will be updated with the block size.</td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the tape file block. Must not be NULL. The entry->offset field indicates the file position where the <a class="el" href="structTapeFileHeader.html" title="Header for a tape file metadata block containing file layout information.">TapeFileHeader</a> begins.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This function does not return a status code. All errors are handled internally with appropriate logging and the function returns early on fatal errors.</dd>
|
||
<dd>
|
||
The tape file hash table (ctx->tapeFiles) must be initialized to NULL before the first call to this function. UTHASH will manage the table automatically as entries are added.</dd>
|
||
<dd>
|
||
Files are ordered in the hash table by their composite key value, not by insertion order. To iterate files in partition/file number order, use HASH_SORT with an appropriate comparison function.</dd>
|
||
<dd>
|
||
The function updates ctx->imageInfo.ImageSize by adding the size of all file entries (entries × sizeof(TapeFileEntry)). This contributes to the total reported image size but does not include the header size.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The context and imageStream must be valid. Passing NULL pointers will result in immediate return with a FATAL log message.</dd>
|
||
<dd>
|
||
If the CRC64 checksum validation fails, all entries in the block are discarded. The function does not attempt partial recovery.</dd>
|
||
<dd>
|
||
If memory allocation fails for a hash entry, that specific file entry is skipped but processing continues with remaining entries.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="structTapeFileHeader.html" title="Header for a tape file metadata block containing file layout information.">TapeFileHeader</a> for the block header structure </dd>
|
||
<dd>
|
||
<a class="el" href="structTapeFileEntry.html" title="Describes a single logical file on a tape medium.">TapeFileEntry</a> for individual file entry structure </dd>
|
||
<dd>
|
||
<a class="el" href="context_8h.html#a5ba965cb003bc2d68a9f9e1c11225494">tapeFileHashEntry</a> for the hash table entry structure </dd>
|
||
<dd>
|
||
process_tape_partition_block() for partition metadata processing </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="tape_8c_source.html#l00126">126</a> of file <a class="el" href="tape_8c_source.html">tape.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="tape_8h_source.html#l00245">TapeFileHeader::crc64</a>, <a class="el" href="tape_8h_source.html#l00241">TapeFileHeader::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00129">TapeFileHashEntry::fileEntry</a>, <a class="el" href="tape_8h_source.html#l00239">TapeFileHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00128">TapeFileHashEntry::key</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="context_8h_source.html#l00303">aaruformat_context::tape_files</a>, <a class="el" href="enums_8h_source.html#l00157">TapeFileBlock</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="aa76718b0402b1a28be3d563d5e62028e" name="aa76718b0402b1a28be3d563d5e62028e"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#aa76718b0402b1a28be3d563d5e62028e">◆ </a></span>process_tape_partitions_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_tape_partitions_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Processes a tape partition metadata block from the image stream. </p>
|
||
<p>Reads and parses a TapePartitionBlock from the Aaru image, validates its integrity, and populates the context's tape partition hash table with partition layout information. Each tape partition entry defines a physical division of the tape medium by specifying its partition number and block range (FirstBlock to LastBlock inclusive).</p>
|
||
<p>The function performs the following operations:</p><ol type="1">
|
||
<li>Seeks to the block position indicated by the index entry</li>
|
||
<li>Reads and validates the <a class="el" href="structTapePartitionHeader.html" title="Header for a tape partition metadata block containing partition layout information.">TapePartitionHeader</a> structure</li>
|
||
<li>Allocates and reads the array of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures</li>
|
||
<li>Validates data integrity using CRC64-ECMA checksum</li>
|
||
<li>Inserts each partition entry into the context's UTHASH table with partition number as key</li>
|
||
<li>Updates image size statistics</li>
|
||
</ol>
|
||
<p><b>Partition Identification:</b> Each tape partition is uniquely identified by its partition number (0-255). This number serves as the hash table key for fast lookup operations. Most tapes have a single partition (partition 0), but multi-partition formats like LTO, DLT, and AIT support multiple partitions with independent block address spaces.</p>
|
||
<p><b>Hash Table Management:</b> The function uses HASH_REPLACE to insert entries, which automatically:</p><ul>
|
||
<li>Adds new entries if the partition number doesn't exist</li>
|
||
<li>Replaces existing entries if the partition number is found (freeing the old entry) This ensures that duplicate partition definitions are properly handled by keeping only the most recent definition.</li>
|
||
</ul>
|
||
<p><b>Error Handling:</b> The function treats most errors as non-fatal and continues processing:</p><ul>
|
||
<li>Invalid context or stream: Returns immediately (FATAL log)</li>
|
||
<li>Seek failures: Returns immediately (FATAL log)</li>
|
||
<li>Header read failures: Returns early (TRACE log)</li>
|
||
<li>Incorrect block identifier: Logs warning but continues</li>
|
||
<li>Memory allocation failures: Logs error and returns</li>
|
||
<li>Entry read failures: Frees buffer and returns</li>
|
||
<li>CRC64 mismatch: Logs warning, frees buffer, and returns</li>
|
||
<li>Per-entry allocation failures: Logs error and skips that entry</li>
|
||
</ul>
|
||
<p><b>Block Structure:</b> The tape partition block consists of: </p><div class="fragment"><div class="line">+-----------------------------+</div>
|
||
<div class="line">| <a class="code hl_typedef" href="tape_8h.html#a4f28f93bd2166f390ec24f1c3525584f">TapePartitionHeader</a> (24 B) | <- identifier, entries, length, crc64</div>
|
||
<div class="line">+-----------------------------+</div>
|
||
<div class="line">| <a class="code hl_struct" href="structTapePartitionEntry.html">TapePartitionEntry</a> 0 (17 B) | <- Number, FirstBlock, LastBlock</div>
|
||
<div class="line">| <a class="code hl_struct" href="structTapePartitionEntry.html">TapePartitionEntry</a> 1 (17 B) |</div>
|
||
<div class="line">| ... |</div>
|
||
<div class="line">| <a class="code hl_typedef" href="tape_8h.html#af947dbe92eb87a6bba23183f14686539">TapePartitionEntry</a> (n-1) |</div>
|
||
<div class="line">+-----------------------------+</div>
|
||
<div class="ttc" id="astructTapePartitionEntry_html"><div class="ttname"><a href="structTapePartitionEntry.html">TapePartitionEntry</a></div><div class="ttdoc">Describes a single physical partition on a tape medium.</div><div class="ttdef"><b>Definition</b> <a href="tape_8h_source.html#l00319">tape.h:320</a></div></div>
|
||
<div class="ttc" id="atape_8h_html_a4f28f93bd2166f390ec24f1c3525584f"><div class="ttname"><a href="tape_8h.html#a4f28f93bd2166f390ec24f1c3525584f">TapePartitionHeader</a></div><div class="ttdeci">struct TapePartitionHeader TapePartitionHeader</div></div>
|
||
<div class="ttc" id="atape_8h_html_af947dbe92eb87a6bba23183f14686539"><div class="ttname"><a href="tape_8h.html#af947dbe92eb87a6bba23183f14686539">TapePartitionEntry</a></div><div class="ttdeci">struct TapePartitionEntry TapePartitionEntry</div></div>
|
||
</div><!-- fragment --><p><b>CRC64 Validation:</b> The CRC64 checksum in the header is computed over the entire array of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures (excluding the header itself). This provides integrity verification to detect corruption in the partition table.</p>
|
||
<p><b>Partition Block Ranges:</b> Each partition defines a block address space:</p><ul>
|
||
<li>FirstBlock: Starting block address (often 0, but format-dependent)</li>
|
||
<li>LastBlock: Ending block address (inclusive)</li>
|
||
<li>Block count: (LastBlock - FirstBlock + 1)</li>
|
||
</ul>
|
||
<p>Block addresses are local to each partition. Different partitions may have overlapping logical block numbers (e.g., both partition 0 and partition 1 can have blocks numbered 0-1000).</p>
|
||
<p><b>Memory Management:</b></p><ul>
|
||
<li>Allocates a temporary buffer to read all partition entries</li>
|
||
<li>Allocates individual hash table entries for each partition</li>
|
||
<li>Frees the temporary buffer before returning</li>
|
||
<li>Frees replaced hash entries automatically</li>
|
||
<li>Hash table entries remain in context until cleanup</li>
|
||
</ul>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. Must not be NULL. The context must have a valid imageStream open for reading. The ctx->tapePartitions hash table will be populated with partition entries. The ctx->imageInfo.ImageSize will be updated with the block size.</td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing the tape partition block. Must not be NULL. The entry->offset field indicates the file position where the <a class="el" href="structTapePartitionHeader.html" title="Header for a tape partition metadata block containing partition layout information.">TapePartitionHeader</a> begins.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This function does not return a status code. All errors are handled internally with appropriate logging and the function returns early on fatal errors.</dd>
|
||
<dd>
|
||
The tape partition hash table (ctx->tapePartitions) must be initialized to NULL before the first call to this function. UTHASH will manage the table automatically as entries are added.</dd>
|
||
<dd>
|
||
Partitions are ordered in the hash table by their partition number, not by insertion order. To iterate partitions in numerical order, use HASH_SORT with an appropriate comparison function.</dd>
|
||
<dd>
|
||
The function updates ctx->imageInfo.ImageSize by adding the size of all partition entries (entries × sizeof(TapePartitionEntry)). This contributes to the total reported image size but does not include the header size.</dd>
|
||
<dd>
|
||
The partition metadata is essential for correctly interpreting tape file locations, as files reference partition numbers in their definitions. Without partition metadata, tape file block ranges may be ambiguous.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The context and imageStream must be valid. Passing NULL pointers will result in immediate return with a FATAL log message.</dd>
|
||
<dd>
|
||
If the CRC64 checksum validation fails, all entries in the block are discarded. The function does not attempt partial recovery.</dd>
|
||
<dd>
|
||
If memory allocation fails for a hash entry, that specific partition entry is skipped but processing continues with remaining entries.</dd>
|
||
<dd>
|
||
If multiple partition entries have the same Number field, only the last occurrence is retained. This should not occur in valid images.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="structTapePartitionHeader.html" title="Header for a tape partition metadata block containing partition layout information.">TapePartitionHeader</a> for the block header structure </dd>
|
||
<dd>
|
||
<a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> for individual partition entry structure </dd>
|
||
<dd>
|
||
<a class="el" href="structTapePartitionHashEntry.html">TapePartitionHashEntry</a> for the hash table entry structure </dd>
|
||
<dd>
|
||
<a class="el" href="tape_8c.html#a829bbac3c17b60efd8f93188a8de8278" title="Processes a tape file metadata block from the image stream.">process_tape_files_block()</a> for tape file metadata processing </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="tape_8c_source.html#l00346">346</a> of file <a class="el" href="tape_8c_source.html">tape.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="tape_8h_source.html#l00448">TapePartitionHeader::crc64</a>, <a class="el" href="tape_8h_source.html#l00444">TapePartitionHeader::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="tape_8h_source.html#l00442">TapePartitionHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00135">TapePartitionHashEntry::key</a>, <a class="el" href="tape_8h_source.html#l00321">TapePartitionEntry::Number</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="context_8h_source.html#l00136">TapePartitionHashEntry::partitionEntry</a>, <a class="el" href="context_8h_source.html#l00304">aaruformat_context::tape_partitions</a>, <a class="el" href="enums_8h_source.html#l00158">TapePartitionBlock</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a375a516fdf6f81e997365d93b21f6708" name="a375a516fdf6f81e997365d93b21f6708"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a375a516fdf6f81e997365d93b21f6708">◆ </a></span>process_tracks_block()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">void process_tracks_block </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const <a class="el" href="structIndexEntry.html">IndexEntry</a> *</td> <td class="paramname"><span class="paramname"><em>entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Parse and integrate a Tracks block from the image stream into the context. </p>
|
||
<p>This function seeks to the byte offset specified by the supplied <code class="param">entry</code>, reads a <a class="el" href="structTracksHeader.html" title="Header for an optical tracks block listing track entries.">TracksHeader</a> followed by the declared number of <a class="el" href="structTrackEntry.html" title="Single optical disc track descriptor (sequence, type, LBAs, session, ISRC, flags).">TrackEntry</a> records, validates the block through its CRC64, and populates multiple fields in the provided <code class="param">ctx:</code> </p>
|
||
<ul>
|
||
<li>ctx->tracksHeader (identifier, entries, crc64)</li>
|
||
<li>ctx->trackEntries (raw array with ALL tracks in on-disk order)</li>
|
||
<li>ctx->dataTracks (array filtered to data track sequences in [1..99])</li>
|
||
<li>ctx->numberOfDataTracks</li>
|
||
<li>ctx->imageInfo.ImageSize (incremented by sizeof(TrackEntry) * entries)</li>
|
||
<li>ctx->imageInfo.HasPartitions / HasSessions (both set true unconditionally on success path before filtering)</li>
|
||
</ul>
|
||
<p>It also performs a legacy endian correction of the computed CRC for images whose major version is <= AARUF_VERSION_V1 (historical writer quirk).</p>
|
||
<p>The function is intended for internal library use during image opening / indexing and is NOT part of the stable public API (no versioning guarantees). Callers outside the library should use the higher-level image open helpers that trigger this parsing implicitly.</p>
|
||
<p>Error & early-return behavior (no exception mechanism, all via logging + early return):</p><ul>
|
||
<li>NULL <code class="param">ctx</code> or NULL ctx->imageStream: Logs FATAL and returns immediately; context left untouched.</li>
|
||
<li>Seek failure: FATAL + return; context left untouched.</li>
|
||
<li><a class="el" href="structTracksHeader.html" title="Header for an optical tracks block listing track entries.">TracksHeader</a> read short: tracksHeader zeroed, TRACE logged, return.</li>
|
||
<li>Identifier mismatch: tracksHeader zeroed, TRACE logged, return.</li>
|
||
<li>Allocation failure for trackEntries: tracksHeader zeroed, FATAL logged, return.</li>
|
||
<li>Short read of <a class="el" href="structTrackEntry.html" title="Single optical disc track descriptor (sequence, type, LBAs, session, ISRC, flags).">TrackEntry</a> array: tracksHeader zeroed, allocated trackEntries freed, FATAL logged, return.</li>
|
||
<li>CRC mismatch: TRACE logged and return; (NOTE: at this point trackEntries remain allocated and tracksHeader retains the just-read values, but caller receives no explicit status.)</li>
|
||
</ul>
|
||
<p>Memory management:</p><ul>
|
||
<li>Allocates ctx->trackEntries with malloc() sized to entries * sizeof(TrackEntry).</li>
|
||
<li>Allocates ctx->dataTracks only if at least one filtered data track is found; otherwise sets it to NULL.</li>
|
||
<li>On certain failure paths (short reads) allocated memory is freed; on CRC mismatch memory is kept.</li>
|
||
<li>Pre-existing ctx->trackEntries or ctx->dataTracks are NOT freed before overwriting pointers, so repeated calls without prior cleanup will leak memory. The function is therefore expected to be called exactly once per context lifetime. This constraint should be observed by library code.</li>
|
||
</ul>
|
||
<p>Filtering rule for ctx->dataTracks:</p><ul>
|
||
<li>Any <a class="el" href="structTrackEntry.html" title="Single optical disc track descriptor (sequence, type, LBAs, session, ISRC, flags).">TrackEntry</a> with sequence in inclusive range [1, 99] is considered a data track (historical convention in format) and copied into ctx->dataTracks preserving original order.</li>
|
||
</ul>
|
||
<p>Thread safety:</p><ul>
|
||
<li>Not thread-safe: mutates shared state in <code class="param">ctx</code> without synchronization.</li>
|
||
<li>Must not be called concurrently with readers/writers referencing the same context.</li>
|
||
</ul>
|
||
<p>Preconditions (</p><dl class="section pre"><dt>Precondition</dt><dd>):<ul>
|
||
<li><code class="param">ctx</code> != NULL</li>
|
||
<li><code class="param">ctx->imageStream</code> is a valid FILE* opened for reading at least up to the block region.</li>
|
||
<li><code class="param">entry</code> != NULL and entry->offset points to the start of a well-formed Tracks block.</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<p>Postconditions (</p><dl class="section post"><dt>Postcondition</dt><dd>) on success (CRC valid):<ul>
|
||
<li>ctx->tracksHeader.identifier == TracksBlock</li>
|
||
<li>ctx->tracksHeader.entries > 0 implies ctx->trackEntries != NULL</li>
|
||
<li>ctx->dataTracks != NULL iff numberOfDataTracks > 0</li>
|
||
<li>numberOfDataTracks <= tracksHeader.entries</li>
|
||
<li>imageInfo flags (HasPartitions, HasSessions) set true</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<p>Limitations / Caveats:</p><ul>
|
||
<li>No explicit status code: callers infer success by inspecting ctx->tracksHeader.entries and presence of ctx->trackEntries after invocation.</li>
|
||
<li>In case of CRC mismatch trackEntries are retained though not guaranteed trustworthy; caller may wish to discard them or trigger re-read.</li>
|
||
<li>Potential memory leak if invoked multiple times without freeing previous arrays.</li>
|
||
</ul>
|
||
<p>Logging strategy:</p><ul>
|
||
<li>FATAL used for unrecoverable structural or resource errors.</li>
|
||
<li>TRACE used for informational / soft failures (e.g., CRC mismatch, identifier mismatch, short read).</li>
|
||
</ul>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Mutable pointer to an aaruformatContext receiving parsed track metadata. </td></tr>
|
||
<tr><td class="paramname">entry</td><td>Pointer to the index entry describing this Tracks block (offset required; size not strictly used beyond informational logging and sequential reading).</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>void This function does not return a status code; errors are reported via logging side effects.</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>Not idempotent and not leak-safe if called more than once for a context. </dd>
|
||
<dd>
|
||
Absence of a returned status requires defensive post-call validation by the caller. </dd>
|
||
<dd>
|
||
CRC mismatch leaves possibly invalid data in ctx->trackEntries.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="optical_8c.html#a2ce65757ca5209f17d467c51ba7d445d" title="Retrieve the array of track descriptors contained in an opened AaruFormat image.">aaruf_get_tracks()</a> </dd>
|
||
<dd>
|
||
<a class="el" href="optical_8c.html#a518d8d68debf1b9a24af3eb6bc2f9e49" title="Replace (or clear) the in-memory track table for an AaruFormat image context.">aaruf_set_tracks()</a> </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="optical_8c_source.html#l00111">111</a> of file <a class="el" href="optical_8c_source.html">optical.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="consts_8h_source.html#l00071">AARUF_VERSION_V1</a>, <a class="el" href="endian_8h_source.html#l00081">bswap_64</a>, <a class="el" href="optical_8h_source.html#l00065">TracksHeader::crc64</a>, <a class="el" href="context_8h_source.html#l00243">aaruformat_context::data_tracks</a>, <a class="el" href="optical_8h_source.html#l00064">TracksHeader::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="aaru_8h_source.html#l00871">ImageInfo::HasPartitions</a>, <a class="el" href="aaru_8h_source.html#l00872">ImageInfo::HasSessions</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="optical_8h_source.html#l00063">TracksHeader::identifier</a>, <a class="el" href="context_8h_source.html#l00260">aaruformat_context::image_info</a>, <a class="el" href="header_8h_source.html#l00110">AaruHeaderV2::imageMajorVersion</a>, <a class="el" href="aaru_8h_source.html#l00873">ImageInfo::ImageSize</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00245">aaruformat_context::number_of_data_tracks</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="optical_8h_source.html#l00073">TrackEntry::sequence</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="context_8h_source.html#l00242">aaruformat_context::track_entries</a>, <a class="el" href="context_8h_source.html#l00244">aaruformat_context::tracks_header</a>, and <a class="el" href="enums_8h_source.html#l00150">TracksBlock</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="open_8c_source.html#l00223">aaruf_open()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a1906cbcaef9f44b8ac4360beb70a0120" name="a1906cbcaef9f44b8ac4360beb70a0120"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a1906cbcaef9f44b8ac4360beb70a0120">◆ </a></span>set_ddt_entry_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">bool set_ddt_entry_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>negative</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint8_t</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>ddt_entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Sets a DDT v2 entry for a given sector address. </p>
|
||
<p>Updates the DDT v2 table(s) with the specified offset, block offset, and sector status for a sector.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address to set. </td></tr>
|
||
<tr><td class="paramname">negative</td><td>Indicates if the sector address is negative. </td></tr>
|
||
<tr><td class="paramname">offset</td><td>Offset to set for the sector. </td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Block offset to set for the sector. </td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Status to set for the sector. </td></tr>
|
||
<tr><td class="paramname">ddt_entry</td><td>Existing DDT entry or 0 to create a new one. If 0, a new entry is returned.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">true</td><td>if the entry was set successfully, false otherwise. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l00988">988</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="ddt__v2_8c_source.html#l01092">set_ddt_multi_level_v2()</a>, <a class="el" href="ddt__v2_8c_source.html#l01023">set_ddt_single_level_v2()</a>, <a class="el" href="ddt_8h_source.html#l00156">DdtHeader2::tableShift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, and <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="write_8c_source.html#l00098">aaruf_write_sector()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a69ff2e68fe4d92a2d2d469ac69f41d82" name="a69ff2e68fe4d92a2d2d469ac69f41d82"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a69ff2e68fe4d92a2d2d469ac69f41d82">◆ </a></span>set_ddt_multi_level_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">bool set_ddt_multi_level_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>negative</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint8_t</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>ddt_entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Sets a multi-level DDT v2 entry for a given sector address. </p>
|
||
<p>Used when the DDT table uses multi-level indirection (tableShift > 0).</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address to set. </td></tr>
|
||
<tr><td class="paramname">negative</td><td>Indicates if the sector address is negative. </td></tr>
|
||
<tr><td class="paramname">offset</td><td>Offset to set for the sector. </td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Block offset to set for the sector. </td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Status to set for the sector. </td></tr>
|
||
<tr><td class="paramname">ddt_entry</td><td>Existing DDT entry or 0 to create a new one. If 0, a new entry is returned.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">true</td><td>if the entry was set successfully, false otherwise. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l01092">1092</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="write_8c_source.html#l01403">aaruf_close_current_block()</a>, <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="crc64_8c_source.html#l00141">aaruf_crc64_final()</a>, <a class="el" href="crc64_8c_source.html#l00032">aaruf_crc64_init()</a>, <a class="el" href="crc64_8c_source.html#l00055">aaruf_crc64_update()</a>, <a class="el" href="errors_8h_source.html#l00048">AARUF_ERROR_NOT_ENOUGH_MEMORY</a>, <a class="el" href="lzma_8c_source.html#l00065">aaruf_lzma_encode_buffer()</a>, <a class="el" href="ddt_8h_source.html#l00154">DdtHeader2::blockAlignmentShift</a>, <a class="el" href="ddt_8h_source.html#l00150">DdtHeader2::blocks</a>, <a class="el" href="index_8h_source.html#l00110">IndexEntry::blockType</a>, <a class="el" href="context_8h_source.html#l00190">aaruformat_context::cached_ddt_offset</a>, <a class="el" href="context_8h_source.html#l00191">aaruformat_context::cached_ddt_position</a>, <a class="el" href="context_8h_source.html#l00188">aaruformat_context::cached_secondary_ddt2</a>, <a class="el" href="ddt_8h_source.html#l00161">DdtHeader2::cmpCrc64</a>, <a class="el" href="ddt_8h_source.html#l00159">DdtHeader2::cmpLength</a>, <a class="el" href="ddt_8h_source.html#l00145">DdtHeader2::compression</a>, <a class="el" href="context_8h_source.html#l00300">aaruformat_context::compression_enabled</a>, <a class="el" href="ddt_8h_source.html#l00162">DdtHeader2::crc64</a>, <a class="el" href="ddt_8h_source.html#l00155">DdtHeader2::dataShift</a>, <a class="el" href="index_8h_source.html#l00111">IndexEntry::dataType</a>, <a class="el" href="enums_8h_source.html#l00143">DeDuplicationTable2</a>, <a class="el" href="enums_8h_source.html#l00144">DeDuplicationTableSecondary</a>, <a class="el" href="ddt_8h_source.html#l00158">DdtHeader2::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="ddt_8h_source.html#l00143">DdtHeader2::identifier</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00252">aaruformat_context::index_entries</a>, <a class="el" href="ddt_8h_source.html#l00160">DdtHeader2::length</a>, <a class="el" href="ddt_8h_source.html#l00146">DdtHeader2::levels</a>, <a class="el" href="enums_8h_source.html#l00034">Lzma</a>, <a class="el" href="context_8h_source.html#l00298">aaruformat_context::lzma_dict_size</a>, <a class="el" href="consts_8h_source.html#l00082">LZMA_PROPERTIES_LENGTH</a>, <a class="el" href="ddt_8h_source.html#l00149">DdtHeader2::negative</a>, <a class="el" href="context_8h_source.html#l00282">aaruformat_context::next_block_position</a>, <a class="el" href="enums_8h_source.html#l00033">None</a>, <a class="el" href="index_8h_source.html#l00112">IndexEntry::offset</a>, <a class="el" href="ddt_8h_source.html#l00151">DdtHeader2::overflow</a>, <a class="el" href="ddt_8h_source.html#l00148">DdtHeader2::previousLevelOffset</a>, <a class="el" href="context_8h_source.html#l00192">aaruformat_context::primary_ddt_offset</a>, <a class="el" href="ddt_8h_source.html#l00153">DdtHeader2::start</a>, <a class="el" href="ddt_8h_source.html#l00147">DdtHeader2::tableLevel</a>, <a class="el" href="ddt_8h_source.html#l00156">DdtHeader2::tableShift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="ddt_8h_source.html#l00144">DdtHeader2::type</a>, <a class="el" href="context_8h_source.html#l00187">aaruformat_context::user_data_ddt2</a>, <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>, <a class="el" href="enums_8h_source.html#l00046">UserData</a>, and <a class="el" href="context_8h_source.html#l00280">aaruformat_context::writing_buffer</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="ddt__v2_8c_source.html#l00988">set_ddt_entry_v2()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a7471ae33a70bae7e3aa93a52f8e519ca" name="a7471ae33a70bae7e3aa93a52f8e519ca"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a7471ae33a70bae7e3aa93a52f8e519ca">◆ </a></span>set_ddt_single_level_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">bool set_ddt_single_level_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const bool</td> <td class="paramname"><span class="paramname"><em>negative</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint8_t</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>ddt_entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Sets a single-level DDT v2 entry for a given sector address. </p>
|
||
<p>Used when the DDT table does not use multi-level indirection.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. </td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address to set. </td></tr>
|
||
<tr><td class="paramname">negative</td><td>Indicates if the sector address is negative. </td></tr>
|
||
<tr><td class="paramname">offset</td><td>Offset to set for the sector. </td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Block offset to set for the sector. </td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Status to set for the sector. </td></tr>
|
||
<tr><td class="paramname">ddt_entry</td><td>Existing DDT entry or 0 to create a new one. If 0, a new entry is returned.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">true</td><td>if the entry was set successfully, false otherwise. </td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l01023">1023</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="ddt_8h_source.html#l00154">DdtHeader2::blockAlignmentShift</a>, <a class="el" href="ddt_8h_source.html#l00155">DdtHeader2::dataShift</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="ddt_8h_source.html#l00149">DdtHeader2::negative</a>, <a class="el" href="ddt_8h_source.html#l00156">DdtHeader2::tableShift</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="context_8h_source.html#l00187">aaruformat_context::user_data_ddt2</a>, and <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="ddt__v2_8c_source.html#l00988">set_ddt_entry_v2()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a8241636367dc185ee88d1dc5af9caf59" name="a8241636367dc185ee88d1dc5af9caf59"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a8241636367dc185ee88d1dc5af9caf59">◆ </a></span>set_ddt_tape()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">bool set_ddt_tape </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>sector_address</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint64_t</td> <td class="paramname"><span class="paramname"><em>block_offset</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">const uint8_t</td> <td class="paramname"><span class="paramname"><em>sector_status</em></span>, </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="paramkey"></td>
|
||
<td></td>
|
||
<td class="paramtype">uint64_t *</td> <td class="paramname"><span class="paramname"><em>ddt_entry</em></span> )</td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Sets a DDT entry for tape media using a hash-based lookup table. </p>
|
||
<p>This function is specifically designed for tape media images where sectors are accessed non-sequentially and the traditional DDT array structure is inefficient. Instead of using a large contiguous array, it uses a hash table (UTHASH) to store only the sectors that have been written, providing sparse storage for tape media.</p>
|
||
<p>The function performs the following operations:</p><ol type="1">
|
||
<li>Validates the context and verifies it's a tape image</li>
|
||
<li>Constructs a DDT entry encoding offset, block alignment, and sector status</li>
|
||
<li>Creates a hash table entry with the sector address as the key</li>
|
||
<li>Inserts or replaces the entry in the tape DDT hash table</li>
|
||
</ol>
|
||
<p><b>DDT Entry Format:</b> The DDT entry is a 64-bit value with the following bit layout: </p><div class="fragment"><div class="line">Bits 0-(dataShift-1): Sector offset within block (masked by dataShift)</div>
|
||
<div class="line">Bits dataShift-27: Block index (block_offset >> blockAlignmentShift)</div>
|
||
<div class="line">Bits 28-31: Sector status (4 bits for status flags)</div>
|
||
<div class="line">Bits 32-63: Unused (reserved for future use)</div>
|
||
</div><!-- fragment --><p><b>Hash Table Management:</b> Uses HASH_REPLACE macro from UTHASH library which:</p><ul>
|
||
<li>Adds new entries if the key (sector_address) doesn't exist</li>
|
||
<li>Replaces existing entries if the key is found (automatically frees old entry)</li>
|
||
<li>Maintains O(1) average lookup time for sector address resolution</li>
|
||
</ul>
|
||
<p><b>Overflow Detection:</b> The function checks if the constructed DDT entry exceeds 28 bits (0xFFFFFFF). This limit ensures the sector status can fit in the upper 4 bits while leaving room for future extensions in the upper 32 bits.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context. Must not be NULL. The context must have a valid imageStream and is_tape must be true. The ctx->tapeDdt hash table will be updated with the new entry. The ctx->userDataDdtHeader contains alignment and shift parameters.</td></tr>
|
||
<tr><td class="paramname">sector_address</td><td>Logical sector address on the tape to set. This serves as the unique key in the hash table. Multiple calls with the same sector_address will replace the previous entry.</td></tr>
|
||
<tr><td class="paramname">offset</td><td>Byte offset within the aligned block where the sector data begins. This value is masked by (1 << dataShift) - 1 to extract only the lower bits representing the offset within the block.</td></tr>
|
||
<tr><td class="paramname">block_offset</td><td>Absolute byte offset in the image file where the data block starts. This is right-shifted by blockAlignmentShift to get the block index, which is stored in the DDT entry's middle bits.</td></tr>
|
||
<tr><td class="paramname">sector_status</td><td>Status flags for the sector (4 bits). Common values include:<ul>
|
||
<li>0x0 (SectorStatusNotDumped): Sector not yet acquired during image dumping</li>
|
||
<li>0x1 (SectorStatusDumped): Sector successfully dumped without error</li>
|
||
<li>0x2 (SectorStatusErrored): Error during dumping; data may be incomplete or corrupt</li>
|
||
<li>0x3 (SectorStatusMode1Correct): Valid MODE 1 data with regenerable suffix/prefix</li>
|
||
<li>0x4 (SectorStatusMode2Form1Ok): Suffix verified/regenerable for MODE 2 Form 1</li>
|
||
<li>0x5 (SectorStatusMode2Form2Ok): Suffix matches MODE 2 Form 2 with valid CRC</li>
|
||
<li>0x6 (SectorStatusMode2Form2NoCrc): Suffix matches MODE 2 Form 2 but CRC empty/missing</li>
|
||
<li>0x7 (SectorStatusTwin): Pointer references a twin sector table</li>
|
||
<li>0x8 (SectorStatusUnrecorded): Sector physically unrecorded; repeated reads non-deterministic</li>
|
||
<li>0x9 (SectorStatusEncrypted): Content encrypted and stored encrypted in image</li>
|
||
<li>0xA (SectorStatusUnencrypted): Content originally encrypted but stored decrypted in image See <a class="el" href="enums_8h.html#a74e216af87b18a5fbf0204a52dd1bba0" title="Acquisition / content status for one or more sectors.">SectorStatus</a> enum for complete list of defined values</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">ddt_entry</td><td>Pointer to a 64-bit value that will receive the constructed DDT entry.<ul>
|
||
<li>If *ddt_entry is 0: A new entry is constructed from the provided parameters</li>
|
||
<li>If *ddt_entry is non-zero: The existing value is used directly The constructed or provided value is stored in the hash table.</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">true</td><td>Successfully created and inserted the DDT entry. This occurs when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The image is confirmed to be a tape image (is_tape == true)</li>
|
||
<li>The DDT entry fits within the 28-bit limit (< 0xFFFFFFF)</li>
|
||
<li>Memory allocation for the hash entry succeeds</li>
|
||
<li>The entry is successfully inserted or replaced in the hash table</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">false</td><td>Failed to set the DDT entry. This can happen when:<ul>
|
||
<li>ctx is NULL or ctx->imageStream is NULL (invalid context)</li>
|
||
<li>ctx->is_tape is false (wrong function called for non-tape media)</li>
|
||
<li>The DDT entry exceeds 0xFFFFFFF (media too large for big DDT)</li>
|
||
<li>Memory allocation fails for the new hash table entry (out of memory)</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>This function is only for tape images. For disk images, use <a class="el" href="ddt__v2_8c.html#a9583b5975c5c0b81902681c07d6f737f" title="Sets a single-level DDT v2 entry for a given sector address.">set_ddt_single_level_v2()</a> or <a class="el" href="ddt__v2_8c.html#a69ff2e68fe4d92a2d2d469ac69f41d82" title="Sets a multi-level DDT v2 entry for a given sector address.">set_ddt_multi_level_v2()</a> instead, which use array-based DDT structures.</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Allocates a new <a class="el" href="structTapeDdtHashEntry.html">TapeDdtHashEntry</a> for each sector</li>
|
||
<li>HASH_REPLACE automatically frees replaced entries</li>
|
||
<li>All hash entries remain in context until cleanup</li>
|
||
<li>The tapeDdt hash table must be freed during context destruction</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Tape Media Characteristics:<ul>
|
||
<li>Tape sectors are typically accessed sequentially during streaming</li>
|
||
<li>File marks and partition boundaries create sparse address spaces</li>
|
||
<li>Hash table provides efficient storage for sparse sector maps</li>
|
||
<li>Supports variable block sizes common in tape formats</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Error Handling:<ul>
|
||
<li>All errors are logged with FATAL level messages</li>
|
||
<li>Function returns false immediately on any error condition</li>
|
||
<li>TRACE logging marks entry/exit points for debugging</li>
|
||
<li>No partial state changes occur on failure</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>The DDT entry overflow check at 0xFFFFFFF (28 bits) is critical. Exceeding this limit indicates the media is too large to fit in the current DDT format, and continuing would cause data corruption.</dd>
|
||
<dd>
|
||
This function modifies the shared tapeDdt hash table. In multi-threaded environments, external synchronization is required to prevent race conditions.</dd></dl>
|
||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="structTapeDdtHashEntry.html">TapeDdtHashEntry</a> for the hash table entry structure </dd>
|
||
<dd>
|
||
<a class="el" href="ddt__v2_8c.html#aa36e08ed9b99bf6e6e022e810c1a3ad1" title="Sets a DDT v2 entry for a given sector address.">set_ddt_entry_v2()</a> for the main DDT entry point that dispatches to this function </dd>
|
||
<dd>
|
||
get_ddt_tape() for retrieving tape DDT entries from the hash table </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="ddt__v2_8c_source.html#l01768">1768</a> of file <a class="el" href="ddt__v2_8c_source.html">ddt_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="ddt_8h_source.html#l00154">DdtHeader2::blockAlignmentShift</a>, <a class="el" href="ddt_8h_source.html#l00155">DdtHeader2::dataShift</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="context_8h_source.html#l00305">aaruformat_context::is_tape</a>, <a class="el" href="context_8h_source.html#l00142">TapeDdtHashEntry::key</a>, <a class="el" href="context_8h_source.html#l00182">aaruformat_context::tape_ddt</a>, <a class="el" href="log_8h_source.html#l00025">TRACE</a>, <a class="el" href="context_8h_source.html#l00189">aaruformat_context::user_data_ddt_header</a>, and <a class="el" href="context_8h_source.html#l00143">TapeDdtHashEntry::value</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="a89ed93d216c4dce0ae5e2acccf8cc2b4" name="a89ed93d216c4dce0ae5e2acccf8cc2b4"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#a89ed93d216c4dce0ae5e2acccf8cc2b4">◆ </a></span>verify_index_v1()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t verify_index_v1 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Verifies the integrity of an index block (version 1) in the image stream. </p>
|
||
<p>Checks the CRC64 of the index block without decompressing it. This function performs comprehensive validation of the index structure including header validation, data integrity verification, and version-specific CRC calculation. It ensures the index block is valid and uncorrupted before the image can be safely used for data access.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing image stream and header information.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully verified index integrity. This is returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The index header is successfully read from ctx->header.indexOffset</li>
|
||
<li>The index identifier matches IndexBlock (version 1 format)</li>
|
||
<li>Memory allocation for index entries succeeds</li>
|
||
<li>All index entries are successfully read from the image stream</li>
|
||
<li>CRC64 calculation completes successfully with version-specific endianness handling</li>
|
||
<li>The calculated CRC64 matches the expected CRC64 in the index header</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) Invalid context or stream. This occurs when:<ul>
|
||
<li>The context parameter is NULL</li>
|
||
<li>The image stream (ctx->imageStream) is NULL or invalid</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_HEADER</td><td>(-6) Index header reading failed. This occurs when:<ul>
|
||
<li>Cannot read the complete <a class="el" href="structIndexHeader.html" title="Index header (version 1) for legacy images (identifier == IndexBlock).">IndexHeader</a> structure from the image stream</li>
|
||
<li>File I/O errors prevent accessing the header at ctx->header.indexOffset</li>
|
||
<li>Insufficient data available at the specified index offset</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_INDEX</td><td>(-19) Index format or data access errors. This occurs when:<ul>
|
||
<li>The index identifier doesn't match IndexBlock (wrong format or corruption)</li>
|
||
<li>Cannot read all index entries from the image stream</li>
|
||
<li>File I/O errors during index entry reading</li>
|
||
<li>Index structure is corrupted or truncated</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_ENOUGH_MEMORY</td><td>(-9) Memory allocation failed. This occurs when:<ul>
|
||
<li>Cannot allocate memory for the index entries array</li>
|
||
<li>System memory exhaustion prevents loading index data for verification</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_INVALID_BLOCK_CRC</td><td>(-18) CRC64 validation failed. This occurs when:<ul>
|
||
<li>The calculated CRC64 doesn't match the expected CRC64 in the index header</li>
|
||
<li>Index data corruption is detected</li>
|
||
<li>Data integrity verification fails indicating potential file damage</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>CRC64 Validation Process:<ul>
|
||
<li>Reads all index entries into memory for CRC calculation</li>
|
||
<li>Calculates CRC64 over the complete index entries array</li>
|
||
<li>Applies version-specific endianness conversion for compatibility</li>
|
||
<li>For imageMajorVersion <= AARUF_VERSION_V1: Uses <a class="el" href="endian_8h.html#a0c0b427a2547aa727e2c5262a174e26b">bswap_64()</a> for byte order correction</li>
|
||
<li>Compares calculated CRC64 with the value stored in the index header</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Version Compatibility:<ul>
|
||
<li>Handles legacy byte order differences from original C# implementation</li>
|
||
<li>Supports IndexBlock format (version 1 only)</li>
|
||
<li>Does not support IndexBlock2 or IndexBlock3 formats</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Allocates temporary memory for index entries during verification</li>
|
||
<li>Automatically frees allocated memory on both success and error conditions</li>
|
||
<li>Memory usage is proportional to the number of index entries</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Verification Scope:<ul>
|
||
<li>Validates index header structure and identifier</li>
|
||
<li>Verifies data integrity through CRC64 calculation</li>
|
||
<li>Does not validate individual index entry contents or block references</li>
|
||
<li>Does not check for logical consistency of referenced blocks</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>This function reads the entire index into memory for CRC calculation. Large indexes may require significant memory allocation.</dd>
|
||
<dd>
|
||
The function assumes ctx->header.indexOffset points to a valid index location. Invalid offsets will cause file access errors or incorrect validation.</dd>
|
||
<dd>
|
||
CRC validation failure indicates potential data corruption and may suggest the image file is damaged or has been modified outside of library control. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="index__v1_8c_source.html#l00225">225</a> of file <a class="el" href="index__v1_8c_source.html">index_v1.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00160">aaruf_crc64_data()</a>, <a class="el" href="errors_8h_source.html#l00045">AARUF_ERROR_CANNOT_READ_HEADER</a>, <a class="el" href="errors_8h_source.html#l00043">AARUF_ERROR_CANNOT_READ_INDEX</a>, <a class="el" href="errors_8h_source.html#l00057">AARUF_ERROR_INVALID_BLOCK_CRC</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="errors_8h_source.html#l00048">AARUF_ERROR_NOT_ENOUGH_MEMORY</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="consts_8h_source.html#l00071">AARUF_VERSION_V1</a>, <a class="el" href="endian_8h_source.html#l00081">bswap_64</a>, <a class="el" href="index_8h_source.html#l00070">IndexHeader::crc64</a>, <a class="el" href="index_8h_source.html#l00069">IndexHeader::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="index_8h_source.html#l00068">IndexHeader::identifier</a>, <a class="el" href="header_8h_source.html#l00110">AaruHeaderV2::imageMajorVersion</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="enums_8h_source.html#l00145">IndexBlock</a>, <a class="el" href="header_8h_source.html#l00115">AaruHeaderV2::indexOffset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="verify_8c_source.html#l00130">aaruf_verify_image()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="ae234e22b16b085d18614110630034db5" name="ae234e22b16b085d18614110630034db5"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#ae234e22b16b085d18614110630034db5">◆ </a></span>verify_index_v2()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t verify_index_v2 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Verifies the integrity of an index block (version 2) in the image stream. </p>
|
||
<p>Checks the CRC64 of the index block without decompressing it. This function performs comprehensive validation of the version 2 index structure including header validation, data integrity verification, and version-specific CRC calculation. It ensures the index block is valid and uncorrupted before the image can be safely used for data access.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing image stream and header information.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully verified index integrity. This is returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The index header is successfully read from ctx->header.indexOffset</li>
|
||
<li>The index identifier matches IndexBlock2 (version 2 format)</li>
|
||
<li>Memory allocation for index entries succeeds</li>
|
||
<li>All index entries are successfully read from the image stream</li>
|
||
<li>CRC64 calculation completes successfully with version-specific endianness handling</li>
|
||
<li>The calculated CRC64 matches the expected CRC64 in the index header</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) Invalid context or stream. This occurs when:<ul>
|
||
<li>The context parameter is NULL</li>
|
||
<li>The image stream (ctx->imageStream) is NULL or invalid</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_HEADER</td><td>(-6) Index header reading failed. This occurs when:<ul>
|
||
<li>Cannot read the complete <a class="el" href="structIndexHeader2.html" title="Index header (version 2) with 64‑bit entry counter (identifier == IndexBlock2).">IndexHeader2</a> structure from the image stream</li>
|
||
<li>File I/O errors prevent accessing the header at ctx->header.indexOffset</li>
|
||
<li>Insufficient data available at the specified index offset</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_INDEX</td><td>(-19) Index format or data access errors. This occurs when:<ul>
|
||
<li>The index identifier doesn't match IndexBlock2 (wrong format or corruption)</li>
|
||
<li>Cannot read all index entries from the image stream</li>
|
||
<li>File I/O errors during index entry reading</li>
|
||
<li>Index structure is corrupted or truncated</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_ENOUGH_MEMORY</td><td>(-9) Memory allocation failed. This occurs when:<ul>
|
||
<li>Cannot allocate memory for the index entries array</li>
|
||
<li>System memory exhaustion prevents loading index data for verification</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_INVALID_BLOCK_CRC</td><td>(-18) CRC64 validation failed. This occurs when:<ul>
|
||
<li>The calculated CRC64 doesn't match the expected CRC64 in the index header</li>
|
||
<li>Index data corruption is detected</li>
|
||
<li>Data integrity verification fails indicating potential file damage</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>CRC64 Validation Process:<ul>
|
||
<li>Reads all index entries into memory for CRC calculation</li>
|
||
<li>Calculates CRC64 over the complete index entries array</li>
|
||
<li>Applies version-specific endianness conversion for compatibility</li>
|
||
<li>For imageMajorVersion <= AARUF_VERSION_V1: Uses <a class="el" href="endian_8h.html#a0c0b427a2547aa727e2c5262a174e26b">bswap_64()</a> for byte order correction</li>
|
||
<li>Compares calculated CRC64 with the value stored in the <a class="el" href="structIndexHeader2.html" title="Index header (version 2) with 64‑bit entry counter (identifier == IndexBlock2).">IndexHeader2</a></li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Version 2 Enhancements:<ul>
|
||
<li>Uses <a class="el" href="structIndexHeader2.html" title="Index header (version 2) with 64‑bit entry counter (identifier == IndexBlock2).">IndexHeader2</a> structure with enhanced metadata support</li>
|
||
<li>Maintains compatibility with legacy endianness handling</li>
|
||
<li>Supports improved index entry organization compared to version 1</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Allocates temporary memory for index entries during verification</li>
|
||
<li>Automatically frees allocated memory on both success and error conditions</li>
|
||
<li>Memory usage is proportional to the number of index entries</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Verification Scope:<ul>
|
||
<li>Validates index header structure and identifier</li>
|
||
<li>Verifies data integrity through CRC64 calculation</li>
|
||
<li>Does not validate individual index entry contents or block references</li>
|
||
<li>Does not check for logical consistency of referenced blocks</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>This function reads the entire index into memory for CRC calculation. Large indexes may require significant memory allocation.</dd>
|
||
<dd>
|
||
The function assumes ctx->header.indexOffset points to a valid index location. Invalid offsets will cause file access errors or incorrect validation.</dd>
|
||
<dd>
|
||
CRC validation failure indicates potential data corruption and may suggest the image file is damaged or has been modified outside of library control. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="index__v2_8c_source.html#l00227">227</a> of file <a class="el" href="index__v2_8c_source.html">index_v2.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00141">aaruf_crc64_final()</a>, <a class="el" href="crc64_8c_source.html#l00155">aaruf_crc64_free()</a>, <a class="el" href="crc64_8c_source.html#l00032">aaruf_crc64_init()</a>, <a class="el" href="crc64_8c_source.html#l00055">aaruf_crc64_update()</a>, <a class="el" href="errors_8h_source.html#l00045">AARUF_ERROR_CANNOT_READ_HEADER</a>, <a class="el" href="errors_8h_source.html#l00043">AARUF_ERROR_CANNOT_READ_INDEX</a>, <a class="el" href="errors_8h_source.html#l00057">AARUF_ERROR_INVALID_BLOCK_CRC</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="errors_8h_source.html#l00048">AARUF_ERROR_NOT_ENOUGH_MEMORY</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="consts_8h_source.html#l00071">AARUF_VERSION_V1</a>, <a class="el" href="endian_8h_source.html#l00081">bswap_64</a>, <a class="el" href="index_8h_source.html#l00082">IndexHeader2::crc64</a>, <a class="el" href="index_8h_source.html#l00081">IndexHeader2::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="index_8h_source.html#l00080">IndexHeader2::identifier</a>, <a class="el" href="header_8h_source.html#l00110">AaruHeaderV2::imageMajorVersion</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="enums_8h_source.html#l00146">IndexBlock2</a>, <a class="el" href="header_8h_source.html#l00115">AaruHeaderV2::indexOffset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="verify_8c_source.html#l00130">aaruf_verify_image()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
<a id="ad7ed9250463c320c7bc8d83689bcfefb" name="ad7ed9250463c320c7bc8d83689bcfefb"></a>
|
||
<h2 class="memtitle"><span class="permalink"><a href="#ad7ed9250463c320c7bc8d83689bcfefb">◆ </a></span>verify_index_v3()</h2>
|
||
|
||
<div class="memitem">
|
||
<div class="memproto">
|
||
<table class="memname">
|
||
<tr>
|
||
<td class="memname">int32_t verify_index_v3 </td>
|
||
<td>(</td>
|
||
<td class="paramtype"><a class="el" href="structaaruformat__context.html">aaruformat_context</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
|
||
<td></td>
|
||
</tr>
|
||
</table>
|
||
</div><div class="memdoc">
|
||
|
||
<p>Verifies the integrity of an index block (version 3) in the image stream. </p>
|
||
<p>Checks the CRC64 of the index block and all subindexes without decompressing them. This function performs comprehensive validation of the advanced version 3 index structure including header validation, data integrity verification, and version-specific CRC calculation. Note that this function validates only the main index block's CRC and does not recursively validate subindex CRCs, focusing on the primary index structure integrity.</p>
|
||
<dl class="params"><dt>Parameters</dt><dd>
|
||
<table class="params">
|
||
<tr><td class="paramname">ctx</td><td>Pointer to the aaruformat context containing image stream and header information.</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following status codes: </dd></dl>
|
||
<dl class="retval"><dt>Return values</dt><dd>
|
||
<table class="retval">
|
||
<tr><td class="paramname">AARUF_STATUS_OK</td><td>(0) Successfully verified index integrity. This is returned when:<ul>
|
||
<li>The context and image stream are valid</li>
|
||
<li>The index header is successfully read from ctx->header.indexOffset</li>
|
||
<li>The index identifier matches IndexBlock3 (version 3 format)</li>
|
||
<li>Memory allocation for index entries succeeds</li>
|
||
<li>All index entries are successfully read from the image stream</li>
|
||
<li>CRC64 calculation completes successfully with version-specific endianness handling</li>
|
||
<li>The calculated CRC64 matches the expected CRC64 in the index header</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_AARUFORMAT</td><td>(-1) Invalid context or stream. This occurs when:<ul>
|
||
<li>The context parameter is NULL</li>
|
||
<li>The image stream (ctx->imageStream) is NULL or invalid</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_HEADER</td><td>(-6) Index header reading failed. This occurs when:<ul>
|
||
<li>Cannot read the complete <a class="el" href="structIndexHeader3.html" title="Index header (version 3) adding hierarchical chaining (identifier == IndexBlock3).">IndexHeader3</a> structure from the image stream</li>
|
||
<li>File I/O errors prevent accessing the header at ctx->header.indexOffset</li>
|
||
<li>Insufficient data available at the specified index offset</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_CANNOT_READ_INDEX</td><td>(-19) Index format or data access errors. This occurs when:<ul>
|
||
<li>The index identifier doesn't match IndexBlock3 (wrong format or corruption)</li>
|
||
<li>Cannot read all index entries from the image stream</li>
|
||
<li>File I/O errors during index entry reading</li>
|
||
<li>Index structure is corrupted or truncated</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_NOT_ENOUGH_MEMORY</td><td>(-9) Memory allocation failed. This occurs when:<ul>
|
||
<li>Cannot allocate memory for the index entries array</li>
|
||
<li>System memory exhaustion prevents loading index data for verification</li>
|
||
</ul>
|
||
</td></tr>
|
||
<tr><td class="paramname">AARUF_ERROR_INVALID_BLOCK_CRC</td><td>(-18) CRC64 validation failed. This occurs when:<ul>
|
||
<li>The calculated CRC64 doesn't match the expected CRC64 in the index header</li>
|
||
<li>Index data corruption is detected</li>
|
||
<li>Data integrity verification fails indicating potential file damage</li>
|
||
</ul>
|
||
</td></tr>
|
||
</table>
|
||
</dd>
|
||
</dl>
|
||
<dl class="section note"><dt>Note</dt><dd>CRC64 Validation Process:<ul>
|
||
<li>Reads all main index entries into memory for CRC calculation</li>
|
||
<li>Calculates CRC64 over the complete main index entries array</li>
|
||
<li>Applies version-specific endianness conversion for compatibility</li>
|
||
<li>For imageMajorVersion <= AARUF_VERSION_V1: Uses <a class="el" href="endian_8h.html#a0c0b427a2547aa727e2c5262a174e26b">bswap_64()</a> for byte order correction</li>
|
||
<li>Compares calculated CRC64 with the value stored in the <a class="el" href="structIndexHeader3.html" title="Index header (version 3) adding hierarchical chaining (identifier == IndexBlock3).">IndexHeader3</a></li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Version 3 Specific Features:<ul>
|
||
<li>Uses <a class="el" href="structIndexHeader3.html" title="Index header (version 3) adding hierarchical chaining (identifier == IndexBlock3).">IndexHeader3</a> structure with hierarchical subindex support</li>
|
||
<li>Maintains compatibility with legacy endianness handling</li>
|
||
<li>Supports advanced index entry organization with subindex references</li>
|
||
<li>Only validates the main index block CRC - subindex CRCs are not recursively checked</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Validation Scope:<ul>
|
||
<li>Validates main index header structure and identifier</li>
|
||
<li>Verifies data integrity of the primary index entries through CRC64 calculation</li>
|
||
<li>Does not validate individual <a class="el" href="structIndexEntry.html" title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> contents or block references</li>
|
||
<li>Does not check for logical consistency of referenced blocks</li>
|
||
<li>Does not recursively validate subindex blocks (unlike hierarchical processing)</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Memory Management:<ul>
|
||
<li>Allocates temporary memory for index entries during verification</li>
|
||
<li>Automatically frees allocated memory on both success and error conditions</li>
|
||
<li>Memory usage is proportional to the number of entries in the main index only</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
Subindex Validation Limitation:<ul>
|
||
<li>This function does not recursively validate subindex CRCs</li>
|
||
<li>Each subindex block contains its own CRC that would need separate validation</li>
|
||
<li>For complete integrity verification, subindex blocks should be validated individually</li>
|
||
<li>The main index CRC only covers the primary index entries, not the subindex content</li>
|
||
</ul>
|
||
</dd></dl>
|
||
<dl class="section warning"><dt>Warning</dt><dd>This function reads only the main index into memory for CRC calculation. Subindex blocks are not loaded or validated by this function.</dd>
|
||
<dd>
|
||
The function assumes ctx->header.indexOffset points to a valid index location. Invalid offsets will cause file access errors or incorrect validation.</dd>
|
||
<dd>
|
||
CRC validation failure indicates potential data corruption in the main index and may suggest the image file is damaged or has been modified outside of library control.</dd>
|
||
<dd>
|
||
For complete integrity verification of hierarchical indexes, additional validation of subindex blocks may be required beyond this function's scope. </dd></dl>
|
||
|
||
<p class="definition">Definition at line <a class="el" href="index__v3_8c_source.html#l00408">408</a> of file <a class="el" href="index__v3_8c_source.html">index_v3.c</a>.</p>
|
||
|
||
<p class="reference">References <a class="el" href="crc64_8c_source.html#l00141">aaruf_crc64_final()</a>, <a class="el" href="crc64_8c_source.html#l00155">aaruf_crc64_free()</a>, <a class="el" href="crc64_8c_source.html#l00032">aaruf_crc64_init()</a>, <a class="el" href="crc64_8c_source.html#l00055">aaruf_crc64_update()</a>, <a class="el" href="errors_8h_source.html#l00045">AARUF_ERROR_CANNOT_READ_HEADER</a>, <a class="el" href="errors_8h_source.html#l00043">AARUF_ERROR_CANNOT_READ_INDEX</a>, <a class="el" href="errors_8h_source.html#l00057">AARUF_ERROR_INVALID_BLOCK_CRC</a>, <a class="el" href="errors_8h_source.html#l00040">AARUF_ERROR_NOT_AARUFORMAT</a>, <a class="el" href="errors_8h_source.html#l00048">AARUF_ERROR_NOT_ENOUGH_MEMORY</a>, <a class="el" href="errors_8h_source.html#l00075">AARUF_STATUS_OK</a>, <a class="el" href="consts_8h_source.html#l00071">AARUF_VERSION_V1</a>, <a class="el" href="endian_8h_source.html#l00081">bswap_64</a>, <a class="el" href="index_8h_source.html#l00096">IndexHeader3::crc64</a>, <a class="el" href="index_8h_source.html#l00095">IndexHeader3::entries</a>, <a class="el" href="log_8h_source.html#l00040">FATAL</a>, <a class="el" href="context_8h_source.html#l00175">aaruformat_context::header</a>, <a class="el" href="index_8h_source.html#l00094">IndexHeader3::identifier</a>, <a class="el" href="header_8h_source.html#l00110">AaruHeaderV2::imageMajorVersion</a>, <a class="el" href="context_8h_source.html#l00176">aaruformat_context::imageStream</a>, <a class="el" href="enums_8h_source.html#l00147">IndexBlock3</a>, <a class="el" href="header_8h_source.html#l00115">AaruHeaderV2::indexOffset</a>, and <a class="el" href="log_8h_source.html#l00025">TRACE</a>.</p>
|
||
|
||
<p class="reference">Referenced by <a class="el" href="verify_8c_source.html#l00130">aaruf_verify_image()</a>.</p>
|
||
|
||
</div>
|
||
</div>
|
||
</div><!-- contents -->
|
||
</div><!-- doc-content -->
|
||
<div id="page-nav" class="page-nav-panel">
|
||
<div id="page-nav-resize-handle"></div>
|
||
<div id="page-nav-tree">
|
||
<div id="page-nav-contents">
|
||
</div><!-- page-nav-contents -->
|
||
</div><!-- page-nav-tree -->
|
||
</div><!-- page-nav -->
|
||
</div><!-- container -->
|
||
<!-- start footer part -->
|
||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||
<ul>
|
||
<li class="navelem"><a href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a href="internal_8h.html">internal.h</a></li>
|
||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
|
||
</ul>
|
||
</div>
|
||
</body>
|
||
</html>
|