Added support for big-endian architectures.

New support seems OK so far for me, but I want to test it a bit more
before making an official 0.3.5 release....
This commit is contained in:
srs5694
2009-08-26 00:48:01 -04:00
parent e19ba095c0
commit 2a9f5da3c3
8 changed files with 316 additions and 79 deletions

5
gpt.h
View File

@@ -12,6 +12,9 @@
#define __GPTSTRUCTS
#define GPT_SIGNATURE UINT64_C(0x5452415020494645)
// Signatures for Apple (APM) disks, multiplied by 0x100000000
#define APM_SIGNATURE1 UINT64_C(0x00004D5000000000)
#define APM_SIGNATURE2 UINT64_C(0x0000535400000000)
/* Number and size of GPT entries... */
#define NUM_GPT_ENTRIES 128
@@ -132,6 +135,8 @@ public:
int SaveGPTBackup(char* filename);
int LoadGPTBackup(char* filename);
int DestroyGPT(void); // Returns 1 if user proceeds
void ReverseHeaderBytes(struct GPTHeader* header); // for endianness
void ReversePartitionBytes(); // for endianness
// Return data about the GPT structures....
uint32_t GetNumParts(void) {return mainHeader.numParts;}