File: fdisk.h

package info (click to toggle)
mac-fdisk 0.1-18
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 372 kB
  • ctags: 870
  • sloc: ansic: 5,880; makefile: 151; sh: 35
file content (51 lines) | stat: -rw-r--r-- 1,274 bytes parent folder | download | duplicates (8)
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
44
45
46
47
48
49
50
51
/*
   fdisk.h
*/

#define SECTOR_SIZE	512
#define NETBSD_PARTITION 0xa5
#define cround(n)	(((n) + display_factor * unit_flag) / display_factor)

#if defined(__GNUC__) || defined(HAS_LONG_LONG)
typedef long long ext2_loff_t;
#else
typedef long      ext2_loff_t;
#endif

#if BYTE_ORDER == BIG_ENDIAN
#define SWAP16(x) __swap16(x)
#define SWAP32(x) __swap32(x)
#else
#define SWAP16(x) ((__u16)x)
#define SWAP32(x) ((__u32)x)
#endif

enum failure {usage, unable_to_open, unable_to_read, unable_to_seek,
	unable_to_write, out_of_memory};

enum offset {ignore, lower, deflt, upper};

struct systypes {
  unsigned char index;
  char *name;
};

/* prototypes for fdisk.c */
extern char *disk_device,
            *line_ptr;
extern int fd,
           partitions;
extern uint unit_flag,
            display_factor;
extern struct partition *part_table[];
extern void fatal(enum failure why);
extern int  get_partition(int warn, int max);
extern void list_types(struct systypes *sys, int size);
extern int read_line (void);
extern char read_char(char *mesg);
extern int read_hex(struct systypes *sys, int size);
uint read_int(uint low, uint dflt, uint high, enum offset base, char *mesg);
extern char *const str_units(void);

/* prototypes for fdisklabel.c */
extern void bselect(void);