04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * IPRT - Hierarchical File System (HFS).
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * Copyright (C) 2009-2013 Oracle Corporation
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * available from http://www.virtualbox.org. This file is free software;
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * you can redistribute it and/or modify it under the terms of the GNU
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * General Public License (GPL) as published by the Free Software
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * The contents of this file may alternatively be used under the terms
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * of the Common Development and Distribution License Version 1.0
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * VirtualBox OSE distribution, in which case the provisions of the
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * CDDL are applicable instead of those of the GPL.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * You may elect to license modified versions of this file under the
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * terms and conditions of either the GPL or the CDDL or both.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @defgroup grp_rt_fmt_hfs HFS - Hierarchical File System.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name HFS signature words (HFSPlusVolumeHeader::signature)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name HFS version numbers (HFSPlusVolumeHeader::version).
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name HFS mount version numbers (HFSPlusVolumeHeader::lastMountedVersion).
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Hard link file creators & types.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Symlink file creators & types.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Name limits.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Extent descriptor record densities
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name File IDs (various fileID members).
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSAttributeDataFileID UINT32_C(0x0000000c)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSRepairCatalogFileID UINT32_C(0x0000000e)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSFirstUserCatalogNodeID UINT32_C(0x00000010)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync/** @name Catalog record types.
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync/** @name File record bits and masks.
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSFileLockedMask RT_BIT(kHFSFileLockedBit)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSThreadExistsMask RT_BIT(kHFSThreadExistsBit)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSHasAttributesMask RT_BIT(kHFSHasAttributesBit)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSHasSecurityMask RT_BIT(kHFSHasSecurityBit)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSHasFolderCountMask RT_BIT(kHFSHasFolderCountBit)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSHasLinkChainMask RT_BIT(kHFSHasLinkChainBit)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSHasChildLinkMask RT_BIT(kHFSHasChildLinkBit)
3b6c75a220781d6589147e6a9e3987ea65fbb912vboxsync#define kHFSHasDateAddedMask RT_BIT(kHFSHasDateAddedBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Key and node lengths.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSPlusAttrKeyMaximumLength ( sizeof(HFSPlusAttrKey) - sizeof(uint16_t) )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSPlusAttrKeyMinimumLength ( kHFSPlusAttrKeyMaximumLength - (kHFSMaxAttrNameLen * sizeof(uint16_t)) )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSPlusExtentKeyMaximumLength ( sizeof(HFSPlusExtentKey) - sizeof(uint16_t),
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSExtentKeyMaximumLength ( sizeof(HFSExtentKey) - sizeof(uint8_t) )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSPlusCatalogKeyMaximumLength ( sizeof(HFSPlusCatalogKey) - sizeof(uint16_t) )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSPlusCatalogKeyMinimumLength ( kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(uint16_t) )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSCatalogKeyMaximumLength ( sizeof(HFSCatalogKey) - sizeof(uint8_t) )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSCatalogKeyMinimumLength ( kHFSCatalogKeyMaximumLength - kHFSMaxFileNameChars - 1 + sizeof(uint8_t) )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Volume Attribute bits and masks.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync * @remarks HFS has only 16-bit wide field, HFS+ has 32-bit.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSVolumeHardwareLockMask RT_BIT(kHFSVolumeHardwareLockBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSVolumeUnmountedMask RT_BIT(kHFSVolumeUnmountedBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSVolumeSparedBlocksMask RT_BIT(kHFSVolumeSparedBlocksBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSVolumeNoCacheRequiredMask RT_BIT(kHFSVolumeNoCacheRequiredBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSBootVolumeInconsistentMask RT_BIT(kHFSBootVolumeInconsistentBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSCatalogNodeIDsReusedMask RT_BIT(kHFSCatalogNodeIDsReusedBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSVolumeJournaledMask RT_BIT(kHFSVolumeJournaledBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSVolumeInconsistentMask RT_BIT(kHFSVolumeInconsistentBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSVolumeSoftwareLockMask RT_BIT(kHFSVolumeSoftwareLockBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSUnusedNodeFixMask RT_BIT(kHFSUnusedNodeFixBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define kHFSContentProtectionMask RT_BIT(kHFSContentProtectionBit)
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Misc
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define HFSPLUSMETADATAFOLDER "\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80HFS+ Private Data"
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define HFSPLUS_DIR_METADATA_FOLDER ".HFS+ Private Directory Data\xd"
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define FIRST_LINK_XATTR_NAME "com.apple.system.hfs.firstlink"
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define FIRST_LINK_XATTR_REC_SIZE ( sizeof(HFSPlusAttrData) + 10 )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/* {b3e20f39-f292-11d6-97a4-00306543ecac} */
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define HFS_UUID_NAMESPACE_ID "\xB3\xE2\x0F\x39\xF2\x92\x11\xD6\x97\xA4\x00\x30\x65\x43\xEC\xAC"
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define SET_HFS_TEXT_ENCODING(a_uHint) (UINT32_C(0x656e6300) | (uint8_t)(a_uHint))
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define GET_HFS_TEXT_ENCODING(a_uHint) ( ((a_uHint) & UINT32_C(0xffffff00)) == UINT32_C(0x656e6300) \
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name B-tree stuff.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name B-tree compare types (BTHeaderRec::keyCompareType) */
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync/** @name Journal stuff.
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define JIB_RESERVED_SIZE ( sizeof(uint32_t) * 32 - 85 )
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync#define EXTJNL_CONTENT_TYPE_UUID "4a6f7572-6e61-11aa-aa11-00306543ecac"
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsynctypedef const HFSUniStr255 * ConstHFSUniStr255Param;
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsynctypedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8];
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsyncAssertCompileMemberAlignment(HFSPlusCatalogFile, dataFork, 8);
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync uint8_t attrData[2]; /**< Causes misaligned struct size. */
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync uint8_t userData[2]; /**< Causes misaligned struct size. */
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsyncAssertCompileMemberAlignment(HFSPlusVolumeHeader, nextCatalogID, 8);
04e99ab06175db8adcd8ddaf15976588f22327cfvboxsync uint16_t reserved; /**< Causes struct size misalignment. */