<trclass="memdesc:a85cd855dac694aa7cf12177844d8b43e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Number of partition entries following this header. <br/></td></tr>
<trclass="memdesc:a698bbe76b7612e2461f97f819e3830b7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Size of entry data in bytes (excluding this header). <br/></td></tr>
<trclass="memdesc:a172a09251507f59bf607e4e2680f1bfc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">CRC64-ECMA checksum of the entry data. <br/></td></tr>
<divclass="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 <aclass="el"href="structTapePartitionEntry.html"title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> structures (one per partition).</p>
<divclass="ttc"id="astructTapePartitionEntry_html"><divclass="ttname"><ahref="structTapePartitionEntry.html">TapePartitionEntry</a></div><divclass="ttdoc">Describes a single physical partition on a tape medium.</div><divclass="ttdef"><b>Definition</b><ahref="tape_8h_source.html#l00319">tape.h:320</a></div></div>
<divclass="ttc"id="astructTapePartitionHeader_html"><divclass="ttname"><ahref="structTapePartitionHeader.html">TapePartitionHeader</a></div><divclass="ttdoc">Header for a tape partition metadata block containing partition layout information.</div><divclass="ttdef"><b>Definition</b><ahref="tape_8h_source.html#l00440">tape.h:441</a></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 <aclass="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>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 <aclass="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 <aclass="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 <aclass="el"href="structIndexEntry.html"title="Single index entry describing a block'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><aclass="el"href="structTapePartitionHeader.html"title="Header for a tape partition metadata block containing partition layout information.">TapePartitionHeader</a> should be written before <aclass="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 <aclass="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>
<dlclass="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>
<dlclass="section warning"><dt>Warning</dt><dd>The entries count must accurately reflect the number of <aclass="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 <aclass="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>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="structTapePartitionEntry.html"title="Describes a single physical partition on a tape medium.">TapePartitionEntry</a> for the structure of individual partition <aclass="el"href="#a85cd855dac694aa7cf12177844d8b43e"title="Number of partition entries following this header.">entries</a></dd>
<dd>
<aclass="el"href="structTapeFileHeader.html"title="Header for a tape file metadata block containing file layout information.">TapeFileHeader</a> for file structure metadata </dd>
<dd>
<aclass="el"href="enums_8h.html#a54420623f26ab6bb61042b41cccf37a3"title="List of known block types contained in an Aaru image.">BlockType</a> for block type <aclass="el"href="#ace597fc284e2191b65e69eb0be9f99f6"title="Block type identifier.">identifier</a> constants </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00440">440</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<p>Computed over the array of <aclass="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>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00448">448</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="tape_8c_source.html#l00346">process_tape_partitions_block()</a>, and <aclass="el"href="close_8c_source.html#l02903">write_tape_partition_block()</a>.</p>
<p>Number of partition entries following this header. </p>
<p>Specifies how many <aclass="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>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00444">444</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="tape_8c_source.html#l00346">process_tape_partitions_block()</a>.</p>
<p>Must be set to BlockType::TapePartitionBlock. This magic value allows parsers to identify the block type. </p>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00442">442</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="tape_8c_source.html#l00346">process_tape_partitions_block()</a>, and <aclass="el"href="close_8c_source.html#l02903">write_tape_partition_block()</a>.</p>
<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>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00446">446</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.14.0 </li>