blob: 35dfddc882173b2e14953746fa4d542656fdccab [file] [log] [blame]
srs5694e7b4ff92009-08-18 13:16:10 -04001/* mbr.h -- MBR data structure definitions, types, and functions */
2
srs5694221e0872009-08-29 15:00:31 -04003/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed
4 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
srs569464cbd172011-03-01 22:03:54 -050018// class PartNotes;
srs569455d92612010-03-07 22:16:07 -050019
srs5694e7b4ff92009-08-18 13:16:10 -040020/****************************************
21 * *
22 * MBRData class and related structures *
23 * *
24 ****************************************/
25
srs5694e7b4ff92009-08-18 13:16:10 -040026// Full data in tweaked MBR format
srs569464cbd172011-03-01 22:03:54 -050027class MBRData : public BasicMBRData {
srs5694e7b4ff92009-08-18 13:16:10 -040028protected:
srs569464cbd172011-03-01 22:03:54 -050029 int foo;
srs5694e7b4ff92009-08-18 13:16:10 -040030public:
srs569464cbd172011-03-01 22:03:54 -050031 MBRData(void) {}
32 MBRData(string deviceFilename) : BasicMBRData(deviceFilename) {}
33 MBRData & operator=(const MBRData & orig);
srs5694978041c2009-09-21 20:51:47 -040034
35 // Functions to create, delete, or change partitions
36 // Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact
srs5694978041c2009-09-21 20:51:47 -040037 void MakeProtectiveMBR(int clearBoot = 0);
srs5694e4ac11e2009-08-31 10:13:04 -040038 void OptimizeEESize(void);
srs569464cbd172011-03-01 22:03:54 -050039 int DeleteByLocation(uint64_t start64, uint64_t length64);
srs5694e7b4ff92009-08-18 13:16:10 -040040
41 // Functions to extract data on specific partitions....
srs5694221e0872009-08-29 15:00:31 -040042 GPTPart AsGPT(int i);
srs5694e7b4ff92009-08-18 13:16:10 -040043}; // struct MBRData
44
45#endif