2 * Creation Date: <2000/09/03 23:04:27 samuel>
3 * Time-stamp: <2000/09/04 01:23:55 samuel>
7 * HFS Master Directory Block (MDB)
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation
18 typedef unsigned char hfs_char_t
;
19 typedef unsigned char hfs_ushort_t
[2];
20 typedef unsigned char hfs_uint_t
[4];
22 #define hfs_get_ushort(addr) (*((unsigned short*)(addr)))
23 #define hfs_get_uint(addr) (*((unsigned int*)(addr)))
26 * The HFS Master Directory Block (MDB).
28 * Also known as the Volume Information Block (VIB), this structure is
29 * the HFS equivalent of a superblock.
31 * Reference: _Inside Macintosh: Files_ pages 2-59 through 2-62
33 * modified for HFS Extended
36 typedef struct hfs_mdb
{
37 hfs_ushort_t drSigWord
; /* Signature word indicating fs type */
38 hfs_uint_t drCrDate
; /* fs creation date/time */
39 hfs_uint_t drLsMod
; /* fs modification date/time */
40 hfs_ushort_t drAtrb
; /* fs attributes */
41 hfs_ushort_t drNmFls
; /* number of files in root directory */
42 hfs_ushort_t drVBMSt
; /* location (in 512-byte blocks)
43 of the volume bitmap */
44 hfs_ushort_t drAllocPtr
; /* location (in allocation blocks)
45 to begin next allocation search */
46 hfs_ushort_t drNmAlBlks
; /* number of allocation blocks */
47 hfs_uint_t drAlBlkSiz
; /* bytes in an allocation block */
48 hfs_uint_t drClpSiz
; /* clumpsize, the number of bytes to
49 allocate when extending a file */
50 hfs_ushort_t drAlBlSt
; /* location (in 512-byte blocks)
51 of the first allocation block */
52 hfs_uint_t drNxtCNID
; /* CNID to assign to the next
53 file or directory created */
54 hfs_ushort_t drFreeBks
; /* number of free allocation blocks */
55 hfs_char_t drVN
[28]; /* the volume label */
56 hfs_uint_t drVolBkUp
; /* fs backup date/time */
57 hfs_ushort_t drVSeqNum
; /* backup sequence number */
58 hfs_uint_t drWrCnt
; /* fs write count */
59 hfs_uint_t drXTClpSiz
; /* clumpsize for the extents B-tree */
60 hfs_uint_t drCTClpSiz
; /* clumpsize for the catalog B-tree */
61 hfs_ushort_t drNmRtDirs
; /* number of directories in
63 hfs_uint_t drFilCnt
; /* number of files in the fs */
64 hfs_uint_t drDirCnt
; /* number of directories in the fs */
65 hfs_char_t drFndrInfo
[32]; /* data used by the Finder */
66 hfs_ushort_t drEmbedSigWord
; /* embedded volume signature */
67 hfs_uint_t drEmbedExtent
; /* starting block number (xdrStABN)
68 and number of allocation blocks
69 (xdrNumABlks) occupied by embedded
71 hfs_uint_t drXTFlSize
; /* bytes in the extents B-tree */
72 hfs_char_t drXTExtRec
[12]; /* extents B-tree's first 3 extents */
73 hfs_uint_t drCTFlSize
; /* bytes in the catalog B-tree */
74 hfs_char_t drCTExtRec
[12]; /* catalog B-tree's first 3 extents */
77 #define HFS_PLUS_SIGNATURE 0x482b /* 'H+' */
78 #define HFS_SIGNATURE 0x4244 /* HFS / embedded HFS+ */
81 typedef struct hfs_plus_mdb
86 uint lastMountedVersion
;
105 /* ... there are more fields here ... */
109 #endif /* _H_HFS_MDB */