blob: cba12d789f17754149b3d7a2e4574c6b69be32c3 [file] [log] [blame]
srs5694e7b4ff92009-08-18 13:16:10 -04001#include <stdint.h>
2#include <unistd.h>
3#include <stdlib.h>
4
5#ifdef __APPLE__
6// Darwin (Mac OS) only: disk IOCTLs are different, and there is no lseek64
7#include <sys/disk.h>
8#define lseek64 lseek
9#else
10
11// Linux only....
12#include <linux/fs.h>
13#endif
14
15#include <string>
16
17#ifndef __GPTSUPPORT
18#define __GPTSUPPORT
19
20// Set this as a default
21#define SECTOR_SIZE UINT32_C(512)
22
23using namespace std;
24
25// a GUID
26struct GUIDData {
27 uint64_t data1;
28 uint64_t data2;
29}; // struct GUIDData
30
31int GetNumber(int low, int high, int def, const char prompt[]);
32char GetYN(void);
33uint64_t GetLastSector(uint64_t low, uint64_t high, char prompt[]);
34char* BytesToSI(uint64_t size, char theValue[]);
35int GetBlockSize(int fd);
36char* GUIDToStr(struct GUIDData theGUID, char* theString);
37GUIDData GetGUID(void);
38uint64_t PowerOf2(int value);
39
40uint64_t disksize(int fd, int* err);
41
42#endif