Lines 35-41
Link Here
|
35 |
#include <time.h> |
35 |
#include <time.h> |
36 |
#include "missing.h" |
36 |
#include "missing.h" |
37 |
#endif |
37 |
#endif |
38 |
#include <sys/errno.h> |
|
|
39 |
#include <sys/stat.h> |
38 |
#include <sys/stat.h> |
40 |
#if !LINUX |
39 |
#if !LINUX |
41 |
#include <sys/sysctl.h> |
40 |
#include <sys/sysctl.h> |
Lines 90-151
struct filefork {
Link Here
|
90 |
struct filefork gDTDBFork, gSystemFork, gReadMeFork; |
89 |
struct filefork gDTDBFork, gSystemFork, gReadMeFork; |
91 |
|
90 |
|
92 |
|
91 |
|
93 |
static void WriteMDB __P((const DriveInfo *driveInfo, HFS_MDB *mdbp)); |
92 |
static void WriteMDB (const DriveInfo *driveInfo, HFS_MDB *mdbp); |
94 |
static void InitMDB __P((hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp)); |
93 |
static void InitMDB (hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp); |
95 |
|
94 |
|
96 |
static void WriteVH __P((const DriveInfo *driveInfo, HFSPlusVolumeHeader *hp)); |
95 |
static void WriteVH (const DriveInfo *driveInfo, HFSPlusVolumeHeader *hp); |
97 |
static void InitVH __P((hfsparams_t *defaults, UInt64 sectors, |
96 |
static void InitVH (hfsparams_t *defaults, UInt64 sectors, |
98 |
HFSPlusVolumeHeader *header)); |
97 |
HFSPlusVolumeHeader *header); |
99 |
|
98 |
|
100 |
static void WriteBitmap __P((const DriveInfo *dip, UInt32 startingSector, |
99 |
static void WriteBitmap (const DriveInfo *dip, UInt32 startingSector, |
101 |
UInt32 alBlksUsed, UInt8 *buffer)); |
100 |
UInt32 alBlksUsed, UInt8 *buffer); |
102 |
|
101 |
|
103 |
static void WriteExtentsFile __P((const DriveInfo *dip, UInt32 startingSector, |
102 |
static void WriteExtentsFile (const DriveInfo *dip, UInt32 startingSector, |
104 |
const hfsparams_t *dp, HFSExtentDescriptor *bbextp, void *buffer, |
103 |
const hfsparams_t *dp, HFSExtentDescriptor *bbextp, void *buffer, |
105 |
UInt32 *bytesUsed, UInt32 *mapNodes)); |
104 |
UInt32 *bytesUsed, UInt32 *mapNodes); |
106 |
static void InitExtentsRoot __P((UInt16 btNodeSize, HFSExtentDescriptor *bbextp, |
105 |
static void InitExtentsRoot (UInt16 btNodeSize, HFSExtentDescriptor *bbextp, |
107 |
void *buffer)); |
106 |
void *buffer); |
108 |
|
107 |
|
109 |
static void WriteCatalogFile __P((const DriveInfo *dip, UInt32 startingSector, |
108 |
static void WriteCatalogFile (const DriveInfo *dip, UInt32 startingSector, |
110 |
const hfsparams_t *dp, HFSPlusVolumeHeader *header, void *buffer, |
109 |
const hfsparams_t *dp, HFSPlusVolumeHeader *header, void *buffer, |
111 |
UInt32 *bytesUsed, UInt32 *mapNodes)); |
110 |
UInt32 *bytesUsed, UInt32 *mapNodes); |
112 |
static void WriteJournalInfo(const DriveInfo *driveInfo, UInt32 startingSector, |
111 |
static void WriteJournalInfo(const DriveInfo *driveInfo, UInt32 startingSector, |
113 |
const hfsparams_t *dp, HFSPlusVolumeHeader *header, |
112 |
const hfsparams_t *dp, HFSPlusVolumeHeader *header, |
114 |
void *buffer); |
113 |
void *buffer); |
115 |
static void InitCatalogRoot_HFSPlus __P((const hfsparams_t *dp, const HFSPlusVolumeHeader *header, void * buffer)); |
114 |
static void InitCatalogRoot_HFSPlus (const hfsparams_t *dp, const HFSPlusVolumeHeader *header, void * buffer); |
116 |
static void InitCatalogRoot_HFS __P((const hfsparams_t *dp, void * buffer)); |
115 |
static void InitCatalogRoot_HFS (const hfsparams_t *dp, void * buffer); |
117 |
static void InitFirstCatalogLeaf __P((const hfsparams_t *dp, void * buffer, |
116 |
static void InitFirstCatalogLeaf (const hfsparams_t *dp, void * buffer, |
118 |
int wrapper)); |
117 |
int wrapper); |
119 |
static void InitSecondCatalogLeaf __P((const hfsparams_t *dp, void *buffer)); |
118 |
static void InitSecondCatalogLeaf (const hfsparams_t *dp, void *buffer); |
120 |
|
119 |
|
121 |
static void WriteDesktopDB(const hfsparams_t *dp, const DriveInfo *driveInfo, |
120 |
static void WriteDesktopDB(const hfsparams_t *dp, const DriveInfo *driveInfo, |
122 |
UInt32 startingSector, void *buffer, UInt32 *mapNodes); |
121 |
UInt32 startingSector, void *buffer, UInt32 *mapNodes); |
123 |
|
122 |
|
124 |
static void ClearDisk __P((const DriveInfo *driveInfo, UInt64 startingSector, |
123 |
static void ClearDisk (const DriveInfo *driveInfo, UInt64 startingSector, |
125 |
UInt32 numberOfSectors)); |
124 |
UInt32 numberOfSectors); |
126 |
static void WriteSystemFile __P((const DriveInfo *dip, UInt32 startingSector, |
125 |
static void WriteSystemFile (const DriveInfo *dip, UInt32 startingSector, |
127 |
UInt32 *filesize)); |
126 |
UInt32 *filesize); |
128 |
static void WriteReadMeFile __P((const DriveInfo *dip, UInt32 startingSector, |
127 |
static void WriteReadMeFile (const DriveInfo *dip, UInt32 startingSector, |
129 |
UInt32 *filesize)); |
128 |
UInt32 *filesize); |
130 |
static void WriteMapNodes __P((const DriveInfo *driveInfo, UInt32 diskStart, |
129 |
static void WriteMapNodes (const DriveInfo *driveInfo, UInt32 diskStart, |
131 |
UInt32 firstMapNode, UInt32 mapNodes, UInt16 btNodeSize, void *buffer)); |
130 |
UInt32 firstMapNode, UInt32 mapNodes, UInt16 btNodeSize, void *buffer); |
132 |
static void WriteBuffer __P((const DriveInfo *driveInfo, UInt64 startingSector, |
131 |
static void WriteBuffer (const DriveInfo *driveInfo, UInt64 startingSector, |
133 |
UInt32 byteCount, const void *buffer)); |
132 |
UInt32 byteCount, const void *buffer); |
134 |
static UInt32 Largest __P((UInt32 a, UInt32 b, UInt32 c, UInt32 d )); |
133 |
static UInt32 Largest (UInt32 a, UInt32 b, UInt32 c, UInt32 d ); |
135 |
|
134 |
|
136 |
static void MarkBitInAllocationBuffer __P((HFSPlusVolumeHeader *header, |
135 |
static void MarkBitInAllocationBuffer (HFSPlusVolumeHeader *header, |
137 |
UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector)); |
136 |
UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector); |
138 |
|
137 |
|
139 |
#if !LINUX |
138 |
#if !LINUX |
140 |
static UInt32 GetDefaultEncoding(); |
139 |
static UInt32 GetDefaultEncoding(); |
141 |
#endif |
140 |
#endif |
142 |
|
141 |
|
143 |
static UInt32 UTCToLocal __P((UInt32 utcTime)); |
142 |
static UInt32 UTCToLocal (UInt32 utcTime); |
144 |
|
143 |
|
145 |
static UInt32 DivideAndRoundUp __P((UInt32 numerator, UInt32 denominator)); |
144 |
static UInt32 DivideAndRoundUp (UInt32 numerator, UInt32 denominator); |
146 |
|
145 |
|
147 |
static int ConvertUTF8toUnicode __P((const UInt8* source, UInt32 bufsize, |
146 |
static int ConvertUTF8toUnicode (const UInt8* source, UInt32 bufsize, |
148 |
UniChar* unibuf, UInt16 *charcount)); |
147 |
UniChar* unibuf, UInt16 *charcount); |
149 |
|
148 |
|
150 |
static int getencodinghint(unsigned char *name); |
149 |
static int getencodinghint(unsigned char *name); |
151 |
|
150 |
|