• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* mbr.h -- MBR data structure definitions, types, and functions */
2 
3 /* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed
4   under the terms of the GNU GPL version 2, as detailed in the COPYING file. */
5 
6 #ifndef __MBRSTRUCTS
7 #define __MBRSTRUCTS
8 
9 #include <stdint.h>
10 #include <sys/types.h>
11 #include "gptpart.h"
12 //#include "partnotes.h"
13 #include "diskio.h"
14 #include "basicmbr.h"
15 
16 /****************************************
17  *                                      *
18  * MBRData class and related structures *
19  *                                      *
20  ****************************************/
21 
22 // Full data in tweaked MBR format
23 class MBRData : public BasicMBRData {
24 protected:
25 public:
MBRData(void)26    MBRData(void) {}
MBRData(std::string deviceFilename)27    MBRData(std::string deviceFilename) : BasicMBRData(deviceFilename) {}
28    MBRData & operator=(const BasicMBRData & orig);
29    ~MBRData(void);
30 
31    // Functions to create, delete, or change partitions
32    // Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact
33    void MakeProtectiveMBR(int clearBoot = 0);
34    void OptimizeEESize(void);
35    int DeleteByLocation(uint64_t start64, uint64_t length64);
36 
37    // Functions to extract data on specific partitions....
38    GPTPart AsGPT(int i);
39 }; // struct MBRData
40 
41 #endif
42