File: mbr.h

package info (click to toggle)
gdisk 1.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 940 kB
  • sloc: cpp: 8,692; sh: 244; makefile: 48
file content (43 lines) | stat: -rw-r--r-- 1,275 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* mbr.h -- MBR data structure definitions, types, and functions */

/* This program is copyright (c) 2009-2013 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 "gptpart.h"
//#include "partnotes.h"
#include "diskio.h"
#include "basicmbr.h"

#ifndef __MBRSTRUCTS
#define __MBRSTRUCTS

using namespace std;

/****************************************
 *                                      *
 * MBRData class and related structures *
 *                                      *
 ****************************************/

// Full data in tweaked MBR format
class MBRData : public BasicMBRData {
protected:
public:
   MBRData(void) {}
   MBRData(string deviceFilename) : BasicMBRData(deviceFilename) {}
   MBRData & operator=(const BasicMBRData & orig);
   ~MBRData(void);

   // Functions to create, delete, or change partitions
   // Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact
   void MakeProtectiveMBR(int clearBoot = 0);
   void OptimizeEESize(void);
   int DeleteByLocation(uint64_t start64, uint64_t length64);

   // Functions to extract data on specific partitions....
   GPTPart AsGPT(int i);
}; // struct MBRData

#endif