mod boot;
mod csum;
mod dirent;
mod table;
mod time;
mod upcase;
pub use boot::{
BACKUP_BOOT_REGION_SECTOR, BOOT_CODE_LEN, BOOT_REGION_SECTORS, BOOT_SIGNATURE, CHECKSUM_SECTOR,
EXTENDED_BOOT_FIRST_SECTOR, EXTENDED_BOOT_SECTORS, EXTENDED_BOOT_SIGNATURE,
FILE_SYSTEM_MAJOR_REVISION, FILE_SYSTEM_MINOR_REVISION, FILE_SYSTEM_NAME, FILE_SYSTEM_REVISION,
MAIN_BOOT_REGION_SECTOR, MAX_CLUSTER_SHIFT, MUST_BE_ZERO_RANGE, MainBootSector,
OEM_PARAMETERS_SECTOR, PERCENT_IN_USE_MAX, PERCENT_IN_USE_UNKNOWN, RESERVED_SECTOR,
VOLUME_FLAG_ACTIVE_FAT, VOLUME_FLAG_CLEAR_TO_ZERO, VOLUME_FLAG_MEDIA_FAILURE,
VOLUME_FLAG_VOLUME_DIRTY, checksum_sector_value, extended_boot_signature, percent_in_use,
write_checksum_sector, write_extended_boot_sector,
};
pub use csum::{
BOOT_CHECKSUM_SKIPS, SET_CHECKSUM_SKIPS, boot_checksum, entry_set_checksum, name_hash,
upcase_checksum,
};
pub use dirent::{
AllocationBitmapEntry, BITMAP_IDENTIFIER, DIR_ENTRY_SIZE, DirEntry, EntryType, FileAttributes,
FileEntry, FileNameEntry, MAX_LABEL_UNITS, MAX_NAME_ENTRIES, MAX_NAME_UNITS,
MAX_SECONDARY_COUNT, NAME_UNITS_PER_ENTRY, SECONDARY_ALLOCATION_POSSIBLE,
SECONDARY_NO_FAT_CHAIN, StreamExtensionEntry, UpcaseTableEntry, VolumeLabelEntry,
};
pub use table::{BAD_CLUSTER, END_OF_CHAIN, FAT_ENTRY_MEDIA, FAT_ENTRY_RESERVED};
pub use time::{
UTC_OFFSET, UTC_OFFSET_VALID, pack_timestamp, unpack_timestamp, utc_offset_minutes,
};
pub use upcase::{
RECOMMENDED_UPCASE_BYTES, RECOMMENDED_UPCASE_CHECKSUM, RECOMMENDED_UPCASE_TABLE,
UPCASE_IDENTITY_RUN, UpcaseTable, write_upcase_table,
};
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
#[non_exhaustive]
pub enum ParseError {
#[error("{structure}: need {need} bytes, got {got}")]
#[non_exhaustive]
TooShort {
structure: &'static str,
need: usize,
got: usize,
},
#[error("{structure}: bad signature {found:#010x}, expected {expected:#010x}")]
#[non_exhaustive]
BadMagic {
structure: &'static str,
found: u32,
expected: u32,
},
}