Files
libaaruformat/docs/html/structTapePartitionHeader.html

279 lines
19 KiB
HTML
Raw Normal View History

2025-10-11 01:35:43 +01:00
<!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: TapePartitionHeader Struct 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">&#160;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('structTapePartitionHeader.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">TapePartitionHeader Struct Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Header for a tape partition metadata block containing partition layout information.
<a href="#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="tape_8h_source.html">aaruformat/structs/tape.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-pub-attribs" class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:ace597fc284e2191b65e69eb0be9f99f6" id="r_ace597fc284e2191b65e69eb0be9f99f6"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ace597fc284e2191b65e69eb0be9f99f6">identifier</a></td></tr>
<tr class="memdesc:ace597fc284e2191b65e69eb0be9f99f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block type identifier. <br /></td></tr>
<tr class="memitem:a85cd855dac694aa7cf12177844d8b43e" id="r_a85cd855dac694aa7cf12177844d8b43e"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a85cd855dac694aa7cf12177844d8b43e">entries</a></td></tr>
<tr class="memdesc:a85cd855dac694aa7cf12177844d8b43e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of partition entries following this header. <br /></td></tr>
<tr class="memitem:a698bbe76b7612e2461f97f819e3830b7" id="r_a698bbe76b7612e2461f97f819e3830b7"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a698bbe76b7612e2461f97f819e3830b7">length</a></td></tr>
<tr class="memdesc:a698bbe76b7612e2461f97f819e3830b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of entry data in bytes (excluding this header). <br /></td></tr>
<tr class="memitem:a172a09251507f59bf607e4e2680f1bfc" id="r_a172a09251507f59bf607e4e2680f1bfc"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a172a09251507f59bf607e4e2680f1bfc">crc64</a></td></tr>
<tr class="memdesc:a172a09251507f59bf607e4e2680f1bfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">CRC64-ECMA checksum of the entry data. <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Header for a tape partition metadata block containing partition layout information. </p>
<p>This structure serves as the header for a TapePartitionBlock, which documents the physical partitioning of the tape medium. The block consists of this fixed-size header followed by a variable-length array of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures (one per partition).</p>
<p><b>Block Structure:</b> </p><div class="fragment"><div class="line">+---------------------------+</div>
<div class="line">| <a class="code hl_struct" href="structTapePartitionHeader.html">TapePartitionHeader</a> | &lt;- Fixed 21-<span class="keywordtype">byte</span> header</div>
<div class="line">+---------------------------+</div>
<div class="line">| <a class="code hl_struct" href="structTapePartitionEntry.html">TapePartitionEntry</a> 0 | &lt;- First partition entry</div>
<div class="line">+---------------------------+</div>
<div class="line">| <a class="code hl_struct" href="structTapePartitionEntry.html">TapePartitionEntry</a> 1 | &lt;- Second partition entry</div>
<div class="line">+---------------------------+</div>
<div class="line">| ... |</div>
<div class="line">+---------------------------+</div>
<div class="line">| <a class="code hl_typedef" href="tape_8h.html#af947dbe92eb87a6bba23183f14686539">TapePartitionEntry</a> (n-1) | &lt;- Last partition entry</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="astructTapePartitionHeader_html"><div class="ttname"><a href="structTapePartitionHeader.html">TapePartitionHeader</a></div><div class="ttdoc">Header for a tape partition metadata block containing partition layout information.</div><div class="ttdef"><b>Definition</b> <a href="tape_8h_source.html#l00440">tape.h:441</a></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>Purpose:</b> The tape partition block enables:</p><ul>
<li>Quick identification of partition boundaries</li>
<li>Validation of partition organization</li>
<li>Understanding of tape physical layout</li>
<li>Support for multi-partition tape formats</li>
<li>Preservation of original partitioning scheme</li>
<li>Correct interpretation of file locations (files reference partition numbers)</li>
</ul>
<p><b>Identifier Field:</b> The identifier field must be set to BlockType::TapePartitionBlock to indicate this block type. This allows the Aaru format parser to recognize and correctly interpret the block during image loading.</p>
<p><b>Entry Count:</b> The entries field specifies the number of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures that follow the header. Valid range is 0-255 (uint8_t), though most tapes have 1-4 partitions:</p><ul>
<li>entries=0: No partitions (unusual, possibly empty tape)</li>
<li>entries=1: Single partition (most common)</li>
<li>entries&gt;1: Multi-partition tape</li>
</ul>
<p><b>Block Length:</b> The length field contains the size in bytes of the data following this header (i.e., the array of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures). This is calculated as: length = entries × sizeof(TapePartitionEntry)</p>
<p>The header itself is NOT included in the length value. Total block size is: total_size = sizeof(TapePartitionHeader) + length</p>
<p><b>CRC64 Checksum:</b> The crc64 field contains a CRC64-ECMA checksum computed over the entry data (the array of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures, excluding this header). This provides integrity verification to detect corruption in the partition table. The CRC is calculated using the ECMA polynomial.</p>
<p><b>Partition Order:</b> Entries should be ordered by partition number (ascending). This matches the typical physical organization of tape partitions and facilitates efficient lookup operations.</p>
<p><b>Alignment:</b> When written to the Aaru image, this block is aligned to the image's block alignment boundary (typically 2^blockAlignmentShift bytes). Padding may be inserted before the block to achieve proper alignment.</p>
<p><b>Index Integration:</b> After writing this block to the image file, an <a class="el" href="structIndexEntry.html" title="Single index entry describing a block&#39;s type, (optional) data classification, and file offset.">IndexEntry</a> is created with:</p><ul>
<li>blockType = TapePartitionBlock</li>
<li>dataType = 0 (tape partition blocks have no subtype)</li>
<li>offset = file position where this header was written</li>
</ul>
<p><b>Relationship to Files:</b> <a class="el" href="structTapePartitionHeader.html" title="Header for a tape partition metadata block containing partition layout information.">TapePartitionHeader</a> should be written before <a class="el" href="structTapeFileHeader.html" title="Header for a tape file metadata block containing file layout information.">TapeFileHeader</a>, as files reference partitions by number. Readers should parse the partition block first to validate partition numbers in file entries.</p>
<p><b>Single-Partition Tapes:</b> Even for single-partition tapes, this block should be present with entries=1, containing one <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> for partition 0. This provides consistency and avoids special-case handling in readers.</p>
<dl class="section note"><dt>Note</dt><dd>This block is optional but highly recommended for tape images. Without it, partition information must be inferred from file entries or tape format specifications.</dd>
<dd>
The sum of all partition sizes (in blocks) represents the total tape capacity, assuming partitions are contiguous and non-overlapping.</dd>
<dd>
Some tape formats allow dynamic repartitioning (changing partition boundaries). The Aaru image captures the partition layout at imaging time.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>The entries count must accurately reflect the number of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures in the block. Mismatches will cause parsing errors.</dd>
<dd>
The CRC64 must be recalculated any time the entry data changes. Stale CRC values will cause integrity check failures.</dd>
<dd>
Partition numbers referenced in <a class="el" href="structTapeFileEntry.html" title="Describes a single logical file on a tape medium.">TapeFileEntry</a> must exist in this partition table. Orphaned file entries (referencing non-existent partitions) indicate a corrupt or incomplete image.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> for the structure of individual partition <a class="el" href="#a85cd855dac694aa7cf12177844d8b43e" title="Number of partition entries following this header.">entries</a> </dd>
<dd>
<a class="el" href="structTapeFileHeader.html" title="Header for a tape file metadata block containing file layout information.">TapeFileHeader</a> for file structure metadata </dd>
<dd>
<a class="el" href="enums_8h.html#a54420623f26ab6bb61042b41cccf37a3" title="List of known block types contained in an Aaru image.">BlockType</a> for block type <a class="el" href="#ace597fc284e2191b65e69eb0be9f99f6" title="Block type identifier.">identifier</a> constants </dd></dl>
<p class="definition">Definition at line <a class="el" href="tape_8h_source.html#l00440">440</a> of file <a class="el" href="tape_8h_source.html">tape.h</a>.</p>
</div><a name="doc-variable-members" id="doc-variable-members"></a><h2 id="header-doc-variable-members" class="groupheader">Field Documentation</h2>
<a id="a172a09251507f59bf607e4e2680f1bfc" name="a172a09251507f59bf607e4e2680f1bfc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a172a09251507f59bf607e4e2680f1bfc">&#9670;&#160;</a></span>crc64</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint64_t TapePartitionHeader::crc64</td>
</tr>
</table>
</div><div class="memdoc">
<p>CRC64-ECMA checksum of the entry data. </p>
<p>Computed over the array of <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures only. Does NOT include this header. Used for integrity verification. </p>
<p class="definition">Definition at line <a class="el" href="tape_8h_source.html#l00448">448</a> of file <a class="el" href="tape_8h_source.html">tape.h</a>.</p>
2025-10-21 14:23:35 +01:00
<p class="reference">Referenced by <a class="el" href="tape_8c_source.html#l00346">process_tape_partitions_block()</a>, and <a class="el" href="close_8c_source.html#l02903">write_tape_partition_block()</a>.</p>
2025-10-11 01:35:43 +01:00
</div>
</div>
<a id="a85cd855dac694aa7cf12177844d8b43e" name="a85cd855dac694aa7cf12177844d8b43e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85cd855dac694aa7cf12177844d8b43e">&#9670;&#160;</a></span>entries</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t TapePartitionHeader::entries</td>
</tr>
</table>
</div><div class="memdoc">
<p>Number of partition entries following this header. </p>
<p>Specifies how many <a class="el" href="structTapePartitionEntry.html" title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures are in this block. Valid range: 0-255. Most tapes have 1-4 partitions. </p>
<p class="definition">Definition at line <a class="el" href="tape_8h_source.html#l00444">444</a> of file <a class="el" href="tape_8h_source.html">tape.h</a>.</p>
<p class="reference">Referenced by <a class="el" href="tape_8c_source.html#l00346">process_tape_partitions_block()</a>.</p>
</div>
</div>
<a id="ace597fc284e2191b65e69eb0be9f99f6" name="ace597fc284e2191b65e69eb0be9f99f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace597fc284e2191b65e69eb0be9f99f6">&#9670;&#160;</a></span>identifier</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t TapePartitionHeader::identifier</td>
</tr>
</table>
</div><div class="memdoc">
<p>Block type identifier. </p>
<p>Must be set to BlockType::TapePartitionBlock. This magic value allows parsers to identify the block type. </p>
<p class="definition">Definition at line <a class="el" href="tape_8h_source.html#l00442">442</a> of file <a class="el" href="tape_8h_source.html">tape.h</a>.</p>
2025-10-21 14:23:35 +01:00
<p class="reference">Referenced by <a class="el" href="tape_8c_source.html#l00346">process_tape_partitions_block()</a>, and <a class="el" href="close_8c_source.html#l02903">write_tape_partition_block()</a>.</p>
2025-10-11 01:35:43 +01:00
</div>
</div>
<a id="a698bbe76b7612e2461f97f819e3830b7" name="a698bbe76b7612e2461f97f819e3830b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a698bbe76b7612e2461f97f819e3830b7">&#9670;&#160;</a></span>length</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint64_t TapePartitionHeader::length</td>
</tr>
</table>
</div><div class="memdoc">
<p>Size of entry data in bytes (excluding this header). </p>
<p>Calculated as: entries × sizeof(TapePartitionEntry). This is the number of bytes following the header. </p>
<p class="definition">Definition at line <a class="el" href="tape_8h_source.html#l00446">446</a> of file <a class="el" href="tape_8h_source.html">tape.h</a>.</p>
2025-10-21 14:23:35 +01:00
<p class="reference">Referenced by <a class="el" href="close_8c_source.html#l02903">write_tape_partition_block()</a>.</p>
2025-10-11 01:35:43 +01:00
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/aaruformat/structs/<a class="el" href="tape_8h_source.html">tape.h</a></li>
</ul>
</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="structTapePartitionHeader.html">TapePartitionHeader</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>