New release: 0.4.0

This version adds support for FreeBSD and big-endian systems. It also
adds support for BSD disklabels and an assortment of other changes,
improvements, and bug fixes.
diff --git a/mbr.h b/mbr.h
index 95ff4df..45159c1 100644
--- a/mbr.h
+++ b/mbr.h
@@ -1,8 +1,12 @@
 /* mbr.h -- MBR data structure definitions, types, and functions */
 
+/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed
+  under the terms of the GNU GPL version 2, as detailed in the COPYING file. */
+
 #include <stdint.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
+#include "gptpart.h"
 
 #ifndef __MBRSTRUCTS
 #define __MBRSTRUCTS
@@ -32,6 +36,17 @@
    uint32_t lengthLBA;
 }; // struct MBRRecord
 
+// Create a 512-byte data structure into which the MBR can be loaded in one
+// go, for the benefit of FreeBSD which seems to flake out when loading
+// from block devices in multiples other than the block size....
+struct TempMBR {
+   uint8_t code[440];
+   uint32_t diskSignature;
+   uint16_t nulls;
+   struct MBRRecord partitions[4];
+   uint16_t MBRSignature;
+}; // struct TempMBR
+
 // Extended Boot Record (EBR) data, used to hold one logical partition's
 // data within an extended partition. Includes pointer to next record for
 // in-memory linked-list access. This is similar to MBRData, but with a
@@ -75,7 +90,7 @@
    void EmptyMBR(int clearBootloader = 1);
    void SetDiskSize(uint64_t ds) {diskSize = ds;}
    int ReadMBRData(char* deviceFilename);
-   void ReadMBRData(int fd);
+   void ReadMBRData(int fd, int checkBlockSize = 1);
    int WriteMBRData(void);
    void WriteMBRData(int fd);
    // ReadLogicalPart() returns last partition # read to logicals[] array,
@@ -83,8 +98,9 @@
    int ReadLogicalPart(int fd, uint32_t extendedStart, uint32_t diskOffset,
                        int partNum);
    void DisplayMBRData(void);
-   void MakeProtectiveMBR(void);
+   void MakeProtectiveMBR(int clearBoot = 0);
    MBRValidity GetValidity(void) {return state;}
+   void ShowValidity(void);
    void ShowState(void);
    void MakePart(int num, uint32_t startLBA, uint32_t lengthLBA, int type = 0x07,
                  int bootable = 0);
@@ -99,6 +115,7 @@
    uint8_t GetType(int i);
    uint32_t GetFirstSector(int i);
    uint32_t GetLength(int i);
+   GPTPart AsGPT(int i);
 }; // struct MBRData
 
 #endif