1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! On-disk constants defined by PCF v1.0.
//!
//! Every value here is normative and corresponds directly to a figure in the
//! specification (see Appendix A, "Field Layout Summary").
/// File signature, 8 bytes: `0x89 'K' 'P' 'R' 'T' 0x0D 0x0A 0x1A`.
pub const MAGIC: = ;
/// Major format version implemented by this crate.
pub const VERSION_MAJOR: u16 = 1;
/// Minor format version implemented by this crate.
pub const VERSION_MINOR: u16 = 0;
/// Fixed size of the file header, in bytes.
pub const HEADER_SIZE: u64 = 20;
/// Fixed size of a table-block header, in bytes.
pub const TABLE_HEADER_SIZE: u64 = 74;
/// Fixed size of a single partition entry, in bytes.
pub const ENTRY_SIZE: u64 = 141;
/// Size of every hash field, in bytes (large enough for the widest digest).
pub const HASH_FIELD_SIZE: usize = 64;
/// Size of the partition label field, in bytes.
pub const LABEL_SIZE: usize = 32;
/// Size of the partition UID field, in bytes.
pub const UID_SIZE: usize = 16;
/// Reserved partition type: invalid / uninitialised. MUST NOT label a live
/// partition.
pub const TYPE_RESERVED: u32 = 0x0000_0000;
/// Reserved partition type: raw / blob, interpreted entirely by the
/// application.
pub const TYPE_RAW: u32 = 0xFFFF_FFFF;
/// The NIL UID (all zero). MUST NOT label a live partition.
pub const NIL_UID: = ;
/// Maximum number of entries a single table block can hold (`partition_count`
/// is a `u8`).
pub const MAX_ENTRIES_PER_BLOCK: u32 = 255;