Mac OS 9
HFSVolumes.h File Reference

On-disk data structures for HFS and HFS Plus volumes. More...

#include <MacTypes.h>
#include <Files.h>
#include <Finder.h>

Go to the source code of this file.

Data Structures

struct  HFSExtentKey
 
struct  HFSPlusExtentKey
 
struct  HFSExtentDescriptor
 
struct  HFSPlusExtentDescriptor
 
struct  HFSPlusForkData
 
struct  HFSPlusPermissions
 
struct  HFSCatalogKey
 
struct  HFSPlusCatalogKey
 
struct  HFSCatalogFolder
 
struct  HFSPlusCatalogFolder
 
struct  HFSCatalogFile
 
struct  HFSPlusCatalogFile
 
struct  HFSCatalogThread
 
struct  HFSPlusCatalogThread
 
struct  HFSPlusAttrInlineData
 
struct  HFSPlusAttrForkData
 
struct  HFSPlusAttrExtents
 
union  HFSPlusAttrRecord
 
struct  HFSMasterDirectoryBlock
 
struct  HFSPlusVolumeHeader
 
struct  BTNodeDescriptor
 
struct  BTHeaderRec
 

Typedefs

typedef UInt32 HFSCatalogNodeID
 
typedef struct HFSExtentKey HFSExtentKey
 
typedef struct HFSPlusExtentKey HFSPlusExtentKey
 
typedef struct HFSExtentDescriptor HFSExtentDescriptor
 
typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor
 
typedef HFSExtentDescriptor HFSExtentRecord[3]
 
typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]
 
typedef struct HFSPlusForkData HFSPlusForkData
 
typedef struct HFSPlusPermissions HFSPlusPermissions
 
typedef struct HFSCatalogKey HFSCatalogKey
 
typedef struct HFSPlusCatalogKey HFSPlusCatalogKey
 
typedef struct HFSCatalogFolder HFSCatalogFolder
 
typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder
 
typedef struct HFSCatalogFile HFSCatalogFile
 
typedef struct HFSPlusCatalogFile HFSPlusCatalogFile
 
typedef struct HFSCatalogThread HFSCatalogThread
 
typedef struct HFSPlusCatalogThread HFSPlusCatalogThread
 
typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData
 
typedef struct HFSPlusAttrForkData HFSPlusAttrForkData
 
typedef struct HFSPlusAttrExtents HFSPlusAttrExtents
 
typedef union HFSPlusAttrRecord HFSPlusAttrRecord
 
typedef struct HFSMasterDirectoryBlock HFSMasterDirectoryBlock
 
typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader
 
typedef struct BTNodeDescriptor BTNodeDescriptor
 
typedef struct BTHeaderRec BTHeaderRec
 

Enumerations

enum  { kHFSSigWord = 0x4244 , kHFSPlusSigWord = 0x482B , kHFSPlusVersion = 0x0004 , kHFSPlusMountVersion }
 
enum  { kHFSMaxVolumeNameChars = 27 , kHFSMaxFileNameChars = 31 , kHFSPlusMaxFileNameChars = 255 }
 
enum  { kHFSExtentDensity = 3 , kHFSPlusExtentDensity = 8 }
 
enum  {
  kHFSRootParentID = 1 , kHFSRootFolderID = 2 , kHFSExtentsFileID = 3 , kHFSCatalogFileID = 4 ,
  kHFSBadBlockFileID = 5 , kHFSAllocationFileID , kHFSStartupFileID = 7 , kHFSAttributesFileID = 8 ,
  kHFSBogusExtentFileID = 15 , kHFSFirstUserCatalogNodeID = 16
}
 
enum  {
  kHFSFolderRecord = 0x0100 , kHFSFileRecord = 0x0200 , kHFSFolderThreadRecord = 0x0300 , kHFSFileThreadRecord = 0x0400 ,
  kHFSPlusFolderRecord = 1 , kHFSPlusFileRecord = 2 , kHFSPlusFolderThreadRecord = 3 , kHFSPlusFileThreadRecord = 4
}
 
enum  { kHFSFileLockedBit = 0x0000 , kHFSFileLockedMask = 0x0001 , kHFSThreadExistsBit = 0x0001 , kHFSThreadExistsMask = 0x0002 }
 
enum  { kHFSPlusAttrInlineData = 0x10 , kHFSPlusAttrForkData = 0x20 , kHFSPlusAttrExtents = 0x30 }
 
enum  {
  kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(UInt16) , kHFSExtentKeyMaximumLength = sizeof(HFSExtentKey) - sizeof(UInt8) , kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(UInt16) , kHFSPlusCatalogKeyMinimumLength ,
  kHFSCatalogKeyMaximumLength = sizeof(HFSCatalogKey) - sizeof(UInt8) , kHFSCatalogKeyMinimumLength , kHFSPlusCatalogMinNodeSize = 4096 , kHFSPlusExtentMinNodeSize = 512 ,
  kHFSPlusAttrMinNodeSize = 4096
}
 
enum  {
  kHFSVolumeHardwareLockBit = 7 , kHFSVolumeUnmountedBit = 8 , kHFSVolumeSparedBlocksBit = 9 , kHFSVolumeNoCacheRequiredBit ,
  kHFSBootVolumeInconsistentBit , kHFSVolumeSoftwareLockBit = 15 , kHFSVolumeHardwareLockMask = 1 << kHFSVolumeHardwareLockBit , kHFSVolumeUnmountedMask = 1 << kHFSVolumeUnmountedBit ,
  kHFSVolumeSparedBlocksMask = 1 << kHFSVolumeSparedBlocksBit , kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit , kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit , kHFSVolumeSoftwareLockMask = 1 << kHFSVolumeSoftwareLockBit ,
  kHFSMDBAttributesMask = 0x8380
}
 
enum  { kHFSCatalogNodeIDsReusedBit = 12 , kHFSCatalogNodeIDsReusedMask = 1 << kHFSCatalogNodeIDsReusedBit }
 
enum  { kBTLeafNode = -1 , kBTIndexNode = 0 , kBTHeaderNode = 1 , kBTMapNode = 2 }
 
enum  { kBTBadCloseMask = 0x00000001 , kBTBigKeysMask = 0x00000002 , kBTVariableIndexKeysMask }
 

Detailed Description

On-disk data structures for HFS and HFS Plus volumes.

Introduced In: Mac OS 8.1
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1984-2001 by Apple Computer, Inc. All rights reserved.

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Typedef Documentation

◆ HFSCatalogNodeID

typedef UInt32 HFSCatalogNodeID

CatalogNodeID is used to track catalog objects

◆ HFSExtentRecord

typedef HFSExtentDescriptor HFSExtentRecord[3]

HFS extent record

◆ HFSPlusExtentRecord

typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]

HFS Plus extent record

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Signatures used to differentiate between HFS and HFS Plus volumes

Enumerator
kHFSPlusSigWord 

'BD' in ASCII

kHFSPlusVersion 

'H+' in ASCII

kHFSPlusMountVersion 

will change as format changes (version 4 shipped with Mac OS 8.1)

◆ anonymous enum

anonymous enum

Number of extent descriptors per extent record

◆ anonymous enum

anonymous enum

Catalog file data structures

Enumerator
kHFSRootFolderID 

Parent ID of the root folder

kHFSExtentsFileID 

Folder ID of the root folder

kHFSCatalogFileID 

File ID of the extents file

kHFSBadBlockFileID 

File ID of the catalog file

kHFSAllocationFileID 

File ID of the bad allocation block file

kHFSStartupFileID 

File ID of the allocation file (HFS Plus only)

kHFSAttributesFileID 

File ID of the startup file (HFS Plus only)

kHFSBogusExtentFileID 

File ID of the attribute file (HFS Plus only)

kHFSFirstUserCatalogNodeID 

Used for exchanging extents in extents file

◆ anonymous enum

anonymous enum

Catalog record types

Enumerator
kHFSFolderRecord 

HFS Catalog Records

kHFSFileRecord 

Folder record

kHFSFolderThreadRecord 

File record

kHFSFileThreadRecord 

Folder thread record

kHFSPlusFolderRecord 

File thread record HFS Plus Catalog Records

kHFSPlusFileRecord 

Folder record

kHFSPlusFolderThreadRecord 

File record

kHFSPlusFileThreadRecord 

Folder thread record

◆ anonymous enum

anonymous enum

Catalog file record flags

Enumerator
kHFSFileLockedMask 

file is locked and cannot be written to

kHFSThreadExistsMask 

a file thread record exists for this file

◆ anonymous enum

anonymous enum

These are the types of records in the attribute B-tree. The values were chosen so that they wouldn't conflict with the catalog record types.

Enumerator
kHFSPlusAttrForkData 

if size < kAttrOverflowSize

kHFSPlusAttrExtents 

if size >= kAttrOverflowSize

◆ anonymous enum

anonymous enum

Key and node lengths

◆ anonymous enum

anonymous enum

HFS and HFS Plus volume attribute bits

Enumerator
kHFSVolumeHardwareLockBit 

Bits 0-6 are reserved (always cleared by MountVol call)

kHFSVolumeUnmountedBit 

volume is locked by hardware

kHFSVolumeSparedBlocksBit 

volume was successfully unmounted

kHFSVolumeNoCacheRequiredBit 

volume has bad blocks spared

kHFSBootVolumeInconsistentBit 

don't cache volume blocks (i.e. RAM or ROM disk)

kHFSVolumeSoftwareLockBit 

boot volume is inconsistent (System 7.6 and later) Bits 12-14 are reserved for future use

kHFSVolumeHardwareLockMask 

volume is locked by software

◆ anonymous enum

anonymous enum
Enumerator
kHFSCatalogNodeIDsReusedMask 

nextCatalogID wrapped around

◆ anonymous enum

anonymous enum

Constants for BTNodeDescriptor kind

◆ anonymous enum

anonymous enum

Constants for BTHeaderRec attributes

Enumerator
kBTBigKeysMask 

reserved

kBTVariableIndexKeysMask 

key length field is 16 bits