20#define kOpenHeFSVersion (0x0104)
21#define kOpenHeFSMagic "OpenHeFS"
22#define kOpenHeFSMagicLen (9U)
24#define kOpenHeFSBlockLen (512U)
25#define kOpenHeFSFileNameLen (256U)
26#define kOpenHeFSPartNameLen (128U)
28#define kOpenHeFSMinimumDiskSize (gib_cast(128))
30#define kOpenHeFSDefaultVolumeName u8"OpenHeFS Volume"
32#define kOpenHeFSINDStartOffset (sizeof(HEFS_BOOT_NODE))
33#define kOpenHeFSINStartOffset (sizeof(HEFS_INDEX_NODE_DIRECTORY))
35#define kOpenHeFSRootDirectory "/"
36#define kOpenHeFSRootDirectoryU8 u8"/"
38#define kOpenHeFSSeparator '/'
39#define kOpenHeFSUpDir ".."
41#define kOpenHeFSRootDirectoryLen (2U)
43#define kOpenHeFSSearchAllStr u8"*"
238 return (raw_atime) >> 32;
246 return (raw_atime) >> 24;
254 return (raw_atime) >> 16;
262 return (raw_atime) >> 8;
270 return (raw_atime) & 0xFF;
299 return "Solid State Drive";
301 return "Optical Drive";
303 return "Mass Storage Device";
305 return "SCSI/SAS Drive";
307 return "Flash Drive";
342 return "Regular File";
346 return "Block Device";
348 return "Character Device";
354 return "Symbolic Link";
#define _Output
Definition CompilerHint.h:15
#define _Input
Definition CompilerHint.h:14
_Output Bool CreateINode(_Input DriveTrait *drive, _Input const Int32 flags, const Utf8Char *dir, const Utf8Char *name, const UInt8 kind)
_Output Bool INodeDirectoryCtlManip(_Input DriveTrait *drive, _Input const Int32 flags, const Utf8Char *dir, const BOOL delete_or_create)
_Output Bool INodeManip(_Input DriveTrait *drive, VoidPtr block, SizeT block_sz, const Utf8Char *dir, const Utf8Char *name, const UInt8 kind, const BOOL input)
HeFileSystemParser & operator=(const HeFileSystemParser &)=delete
_Output Bool Format(_Input _Output DriveTrait *drive, _Input const Int32 flags, const Utf8Char *part_name)
Make a EPM+OpenHeFS drive out of the disk.
_Output Bool RemoveINodeDirectory(_Input DriveTrait *drive, _Input const Int32 flags, const Utf8Char *dir)
_Output Bool CreateINodeDirectory(_Input DriveTrait *drive, _Input const Int32 flags, const Utf8Char *dir)
_Output Bool INodeCtlManip(_Input DriveTrait *drive, _Input const Int32 flags, const Utf8Char *dir, const Utf8Char *name, const BOOL delete_or_create, const UInt8 kind)
~HeFileSystemParser()=default
HeFileSystemParser & operator=(HeFileSystemParser &&)=delete
_Output Bool DeleteINode(_Input DriveTrait *drive, _Input const Int32 flags, const Utf8Char *dir, const Utf8Char *name, const UInt8 kind)
HeFileSystemParser(HeFileSystemParser &&)=delete
HeFileSystemParser(const HeFileSystemParser &)=delete
HeFileSystemParser()=default
Implementation details namespace.
Definition OpenHeFS.h:232
UInt32 hefs_day_get(ATime raw_atime)
OpenHeFS get day from ATime.
Definition OpenHeFS.h:253
const Char * hefs_file_kind_to_string(UInt16 kind)
Definition OpenHeFS.h:339
constexpr UInt32 kOpenHeFSBaseMonth
Definition OpenHeFS.h:274
constexpr UInt32 kOpenHeFSBaseYear
Definition OpenHeFS.h:273
UInt32 hefs_minute_get(ATime raw_atime)
OpenHeFS get minute from ATime.
Definition OpenHeFS.h:269
UInt32 hefs_month_get(ATime raw_atime)
OpenHeFS get month from ATime.
Definition OpenHeFS.h:245
const Char * hefs_file_flags_to_string(UInt32 flags)
Definition OpenHeFS.h:361
const Char * hefs_status_to_string(UInt16 status)
Definition OpenHeFS.h:279
const Char * hefs_drive_kind_to_string(UInt8 kind)
Definition OpenHeFS.h:294
constexpr UInt32 kOpenHeFSBaseDay
Definition OpenHeFS.h:275
constexpr UInt32 kOpenHeFSBaseHour
Definition OpenHeFS.h:276
const Char * hefs_encoding_to_string(UInt8 encoding)
Definition OpenHeFS.h:314
constexpr UInt32 kOpenHeFSBaseMinute
Definition OpenHeFS.h:277
UInt32 hefs_year_get(ATime raw_atime)
OpenHeFS get year from ATime.
Definition OpenHeFS.h:237
UInt32 hefs_hour_get(ATime raw_atime)
OpenHeFS get hour from ATime.
Definition OpenHeFS.h:261
Definition OpenHeFS.h:428
Boolean fs_init_openhefs(Void)
Initialize OpenHeFS inside the main disk.
UPS inline definitions.
Definition Device.h:12
char Char
Definition Config.h:51
void Void
Definition Config.h:87
UInt64 ATime
Access time type.
Definition OpenHeFS.h:110
__UINT16_TYPE__ UInt16
Definition Config.h:40
UInt64 Lba
Definition Config.h:90
constexpr ATime kOpenHeFSTimeMax
Definition OpenHeFS.h:143
__SIZE_TYPE__ SizeT
Definition Config.h:60
@ kOpenHeFSInvalidColor
Definition OpenHeFS.h:197
@ kOpenHeFSBlack
Definition OpenHeFS.h:199
@ kOpenHeFSRed
Definition OpenHeFS.h:198
@ kOpenHeFSColorCount
Definition OpenHeFS.h:200
constexpr ATime kOpenHeFSTimeInvalid
Definition OpenHeFS.h:142
__UINT8_TYPE__ UInt8
Definition Config.h:55
__UINT32_TYPE__ UInt32
Definition Config.h:44
void * VoidPtr
Definition Config.h:33
__INT32_TYPE__ Int32
Definition Config.h:38
HeFSJournalKind
This enum defines the opcode of the journal, here mentioned as 'kinds'.
Definition OpenHeFS.h:159
@ kJournalKindInvalid
Definition OpenHeFS.h:160
@ kJournalKindFlagEdit
Definition OpenHeFS.h:164
@ kJournalKindCreate
Definition OpenHeFS.h:165
@ kJournalKindWrite
Definition OpenHeFS.h:161
@ kJournalKindRename
Definition OpenHeFS.h:162
@ kJournalKindCount
Definition OpenHeFS.h:166
@ kJournalKindDelete
Definition OpenHeFS.h:163
char8_t Utf8Char
Definition Config.h:75
bool Boolean
Definition Config.h:49
__UINT64_TYPE__ UInt64
Definition Config.h:48
bool Bool
Definition Config.h:50
constexpr UInt16 kOpenHeFSFileKindDirectory
Definition OpenHeFS.h:91
constexpr UInt16 kOpenHeFSFileKindRegular
Definition OpenHeFS.h:90
constexpr UInt16 kOpenHeFSSliceCount
OpenHeFS blocks are array containing sparse blocks of data.
Definition OpenHeFS.h:103
@ kOpenHeFSSolidStateDrive
Definition OpenHeFS.h:52
@ kOpenHeFSDriveCount
Definition OpenHeFS.h:58
@ kOpenHeFSFlashDrive
Definition OpenHeFS.h:56
@ kOpenHeFSScsiDrive
Definition OpenHeFS.h:55
@ kOpenHeFSUnknown
Definition OpenHeFS.h:57
@ kOpenHeFSOpticalDrive
Definition OpenHeFS.h:53
@ kOpenHeFSMassStorageDevice
Definition OpenHeFS.h:54
@ kOpenHeFSHardDrive
Definition OpenHeFS.h:51
@ kOpenHeFSStatusCount
Definition OpenHeFS.h:66
@ kOpenHeFSStatusInvalid
Definition OpenHeFS.h:65
@ kOpenHeFSStatusLocked
Definition OpenHeFS.h:63
@ kOpenHeFSStatusError
Definition OpenHeFS.h:64
@ kOpenHeFSStatusUnlocked
Definition OpenHeFS.h:62
constexpr UInt16 kOpenHeFSFileKindSymbolicLink
Definition OpenHeFS.h:96
constexpr UInt16 kOpenHeFSFileKindCharacter
Definition OpenHeFS.h:93
constexpr UInt16 kOpenHeFSFileKindCount
Definition OpenHeFS.h:98
constexpr UInt16 kOpenHeFSFileKindSocket
Definition OpenHeFS.h:95
constexpr UInt16 kOpenHeFSFileKindBlock
Definition OpenHeFS.h:92
@ kOpenHeFSFlagsSystem
Definition OpenHeFS.h:84
@ kOpenHeFSFlagsReadOnly
Definition OpenHeFS.h:82
@ kOpenHeFSEncodingFlagsUTF32LE
Definition OpenHeFS.h:76
@ kOpenHeFSFlagsDevice
Definition OpenHeFS.h:86
@ kOpenHeFSEncodingFlagsBinary
Definition OpenHeFS.h:79
@ kOpenHeFSEncodingFlagsUTF16
Definition OpenHeFS.h:71
@ kOpenHeFSFlagsArchive
Definition OpenHeFS.h:85
@ kOpenHeFSEncodingFlagsUTF8
Definition OpenHeFS.h:70
@ kOpenHeFSEncodingFlagsUTF16BE
Definition OpenHeFS.h:73
@ kOpenHeFSEncodingFlagsCount
Definition OpenHeFS.h:80
@ kOpenHeFSFlagsHidden
Definition OpenHeFS.h:83
@ kOpenHeFSEncodingFlagsUTF32BE
Definition OpenHeFS.h:75
@ kOpenHeFSEncodingFlagsUTF16LE
Definition OpenHeFS.h:74
@ kOpenHeFSFlagsNone
Definition OpenHeFS.h:81
@ kOpenHeFSFlagsCount
Definition OpenHeFS.h:87
@ kOpenHeFSEncodingFlagsUTF8BE
Definition OpenHeFS.h:77
@ kOpenHeFSEncodingFlagsUTF32
Definition OpenHeFS.h:72
@ kOpenHeFSEncodingFlagsUTF8LE
Definition OpenHeFS.h:78
constexpr UInt16 kOpenHeFSFileKindUnknown
Definition OpenHeFS.h:97
#define kOpenHeFSPartNameLen
Definition OpenHeFS.h:26
constexpr UInt16 kOpenHeFSFileKindFIFO
Definition OpenHeFS.h:94
constexpr UInt16 kOpenHeFSInvalidVID
Definition OpenHeFS.h:105
#define kOpenHeFSMagicLen
Definition OpenHeFS.h:22
Media drive trait type.
Definition DriveMgr.h:54
OpenHeFS Boot node.
Definition OpenHeFS.h:115
UInt64 fEndBlock
Start Blocks range.
Definition OpenHeFS.h:137
UInt32 fVersion
Volume name.
Definition OpenHeFS.h:118
UInt8 fEncoding
Kind of the drive. (Hard Drive, Solid State Drive, Optical Drive, etc).
Definition OpenHeFS.h:125
UInt64 fStartIND
Encoding of the filesystem. (UTF-8, UTF-16, etc).
Definition OpenHeFS.h:126
UInt64 fStartIN
Virtual Identification Number within an EPM disk. (0xFFFF if not used).
Definition OpenHeFS.h:134
UInt16 fVID
Flags of the disk. (read-only, read-write, etc).
Definition OpenHeFS.h:133
Char fPad[264]
Boot Node's COW journal LBA.
Definition OpenHeFS.h:139
UInt64 fSectorSize
Number of sectors in the filesystem.
Definition OpenHeFS.h:121
UInt32 fChecksum
Size of the sector.
Definition OpenHeFS.h:122
UInt16 fDiskStatus
Size of the disk. (Could be a virtual size, that is not the real size of the disk....
Definition OpenHeFS.h:131
UInt64 fJournalLBA
End Blocks range.
Definition OpenHeFS.h:138
UInt64 fSectorCount
Number of bad sectors in the filesystem.
Definition OpenHeFS.h:120
UInt64 fINDCount
End of the INode directory tree.
Definition OpenHeFS.h:128
Utf8Char fVolName[kOpenHeFSPartNameLen]
Magic number of the filesystem.
Definition OpenHeFS.h:117
UInt64 fEndIN
Start INodes range.
Definition OpenHeFS.h:135
UInt64 fBadSectors
Version of the filesystem.
Definition OpenHeFS.h:119
Char fMagic[kOpenHeFSMagicLen]
Definition OpenHeFS.h:116
UInt16 fDiskFlags
Status of the disk. (locked, unlocked, error, invalid).
Definition OpenHeFS.h:132
UInt64 fDiskSize
Number of leafs in the INode tree.
Definition OpenHeFS.h:129
UInt64 fEndIND
Start of the INode directory tree.
Definition OpenHeFS.h:127
UInt64 fStartBlock
End INodes range.
Definition OpenHeFS.h:136
UInt8 fDiskKind
Checksum of the boot node.
Definition OpenHeFS.h:123
OpenHeFS directory node.
Definition OpenHeFS.h:206
Lba fNext
Color of the node. (Red or Black).
Definition OpenHeFS.h:226
UInt8 fColor
Start of the index node.
Definition OpenHeFS.h:225
UInt64 fINSlices[kOpenHeFSSliceCount]
File mode. (read, write, execute, etc).
Definition OpenHeFS.h:223
UInt32 fEntryCount
Definition OpenHeFS.h:211
UInt32 fMode
User ID and Group ID of the file.
Definition OpenHeFS.h:217
UInt16 fReserved
File flags.
Definition OpenHeFS.h:210
Lba fParent
Definition OpenHeFS.h:226
ATime fModified
Definition OpenHeFS.h:214
ATime fAccessed
Definition OpenHeFS.h:214
UInt32 fFlags
Directory path as FNV hash.
Definition OpenHeFS.h:209
Char fPad[285]
Red-black tree pointers.
Definition OpenHeFS.h:228
ATime fCreated
Checksum of the file, index node checksum.
Definition OpenHeFS.h:214
UInt64 fHashPath
Definition OpenHeFS.h:207
UInt32 fChecksum
Entry Count of this directory inode.
Definition OpenHeFS.h:212
Lba fChild
Definition OpenHeFS.h:226
Lba fPrev
Definition OpenHeFS.h:226
ATime fDeleted
Definition OpenHeFS.h:215
UInt32 fGID
Definition OpenHeFS.h:216
UInt32 fUID
File timestamps and allocation status.
Definition OpenHeFS.h:216
OpenHeFS index node.
Definition OpenHeFS.h:173
UInt32 fChecksum
File size.
Definition OpenHeFS.h:179
ATime fModified
Definition OpenHeFS.h:184
UInt32 fUID
File timestamps.
Definition OpenHeFS.h:185
UInt32 fOffsetSliceHigh
Definition OpenHeFS.h:191
UInt32 fGID
Definition OpenHeFS.h:185
ATime fCreated
Is this a symbolic link? (if yes, the fName is the path to the file and blocklinkstart and end contai...
Definition OpenHeFS.h:184
ATime fAccessed
Definition OpenHeFS.h:184
Boolean fSymLink
Checksum.
Definition OpenHeFS.h:181
UInt32 fOffsetSliceLow
File mode. (read, write, execute, etc).
Definition OpenHeFS.h:190
UInt32 fSize
File kind. (Regular, Directory, Block, Character, FIFO, Socket, Symbolic Link, Unknown).
Definition OpenHeFS.h:178
ATime fDeleted
Definition OpenHeFS.h:184
UInt32 fFlags
File name.
Definition OpenHeFS.h:175
UInt64 fHashPath
Definition OpenHeFS.h:174
UInt32 fMode
User ID and Group ID of the file.
Definition OpenHeFS.h:186
UInt16 fKind
File flags.
Definition OpenHeFS.h:176
Char fPad[437]
Definition OpenHeFS.h:193
Journal Node structure.
Definition OpenHeFS.h:150
UInt64 fStatus
Definition OpenHeFS.h:152
UInt64 fHashPath
Definition OpenHeFS.h:151
UInt8 fPad[487]
Definition OpenHeFS.h:155
UInt64 fCopyElem
Definition OpenHeFS.h:153
UInt8 fCopyKind
Definition OpenHeFS.h:154