blob: 3cacf616738cb43b1545d207455b491d8fd80ad7 [file] [log] [blame]
srs5694e7b4ff92009-08-18 13:16:10 -04001/* mbr.h -- MBR data structure definitions, types, and functions */
2
Roderick W. Smithe3ee7332013-09-24 12:56:11 -04003/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed
srs5694221e0872009-08-29 15:00:31 -04004 under the terms of the GNU GPL version 2, as detailed in the COPYING file. */
5
srs5694e7b4ff92009-08-18 13:16:10 -04006#include <stdint.h>
7#include <sys/types.h>
srs5694221e0872009-08-29 15:00:31 -04008#include "gptpart.h"
srs569464cbd172011-03-01 22:03:54 -05009//#include "partnotes.h"
srs5694546a9c72010-01-26 16:00:26 -050010#include "diskio.h"
srs569464cbd172011-03-01 22:03:54 -050011#include "basicmbr.h"
srs5694e7b4ff92009-08-18 13:16:10 -040012
13#ifndef __MBRSTRUCTS
14#define __MBRSTRUCTS
15
srs5694e7b4ff92009-08-18 13:16:10 -040016using namespace std;
17
18/****************************************
19 * *
20 * MBRData class and related structures *
21 * *
22 ****************************************/
23
srs5694e7b4ff92009-08-18 13:16:10 -040024// Full data in tweaked MBR format
srs569464cbd172011-03-01 22:03:54 -050025class MBRData : public BasicMBRData {
srs5694e7b4ff92009-08-18 13:16:10 -040026protected:
srs5694e7b4ff92009-08-18 13:16:10 -040027public:
srs569464cbd172011-03-01 22:03:54 -050028 MBRData(void) {}
29 MBRData(string deviceFilename) : BasicMBRData(deviceFilename) {}
srs5694bf8950c2011-03-12 01:23:12 -050030 MBRData & operator=(const BasicMBRData & orig);
srs5694978041c2009-09-21 20:51:47 -040031
32 // Functions to create, delete, or change partitions
33 // Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact
srs5694978041c2009-09-21 20:51:47 -040034 void MakeProtectiveMBR(int clearBoot = 0);
srs5694e4ac11e2009-08-31 10:13:04 -040035 void OptimizeEESize(void);
srs569464cbd172011-03-01 22:03:54 -050036 int DeleteByLocation(uint64_t start64, uint64_t length64);
srs5694e7b4ff92009-08-18 13:16:10 -040037
38 // Functions to extract data on specific partitions....
srs5694221e0872009-08-29 15:00:31 -040039 GPTPart AsGPT(int i);
srs5694e7b4ff92009-08-18 13:16:10 -040040}; // struct MBRData
41
42#endif