srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 1 | /* mbr.h -- MBR data structure definitions, types, and functions */ |
| 2 | |
srs5694 | 221e087 | 2009-08-29 15:00:31 -0400 | [diff] [blame] | 3 | /* 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 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 6 | #include <stdint.h> |
| 7 | #include <sys/types.h> |
srs5694 | 221e087 | 2009-08-29 15:00:31 -0400 | [diff] [blame] | 8 | #include "gptpart.h" |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame^] | 9 | //#include "partnotes.h" |
srs5694 | 546a9c7 | 2010-01-26 16:00:26 -0500 | [diff] [blame] | 10 | #include "diskio.h" |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame^] | 11 | #include "basicmbr.h" |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 12 | |
| 13 | #ifndef __MBRSTRUCTS |
| 14 | #define __MBRSTRUCTS |
| 15 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 16 | using namespace std; |
| 17 | |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame^] | 18 | // class PartNotes; |
srs5694 | 55d9261 | 2010-03-07 22:16:07 -0500 | [diff] [blame] | 19 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 20 | /**************************************** |
| 21 | * * |
| 22 | * MBRData class and related structures * |
| 23 | * * |
| 24 | ****************************************/ |
| 25 | |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 26 | // Full data in tweaked MBR format |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame^] | 27 | class MBRData : public BasicMBRData { |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 28 | protected: |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame^] | 29 | int foo; |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 30 | public: |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame^] | 31 | MBRData(void) {} |
| 32 | MBRData(string deviceFilename) : BasicMBRData(deviceFilename) {} |
| 33 | MBRData & operator=(const MBRData & orig); |
srs5694 | 978041c | 2009-09-21 20:51:47 -0400 | [diff] [blame] | 34 | |
| 35 | // Functions to create, delete, or change partitions |
| 36 | // Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact |
srs5694 | 978041c | 2009-09-21 20:51:47 -0400 | [diff] [blame] | 37 | void MakeProtectiveMBR(int clearBoot = 0); |
srs5694 | e4ac11e | 2009-08-31 10:13:04 -0400 | [diff] [blame] | 38 | void OptimizeEESize(void); |
srs5694 | 64cbd17 | 2011-03-01 22:03:54 -0500 | [diff] [blame^] | 39 | int DeleteByLocation(uint64_t start64, uint64_t length64); |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 40 | |
| 41 | // Functions to extract data on specific partitions.... |
srs5694 | 221e087 | 2009-08-29 15:00:31 -0400 | [diff] [blame] | 42 | GPTPart AsGPT(int i); |
srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame] | 43 | }; // struct MBRData |
| 44 | |
| 45 | #endif |