"Fossies" - the Fresh Open Source Software Archive 
Member "dosfstools-4.2/src/device_info.h" (31 Jan 2021, 1274 Bytes) of package /linux/misc/dosfstools-4.2.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "device_info.h" see the
Fossies "Dox" file reference documentation and the latest
Fossies "Diffs" side-by-side code changes report:
4.1_vs_4.2.
1 #ifndef DEVICE_INFO_H
2 #define DEVICE_INFO_H
3
4 enum device_type {
5 TYPE_UNKNOWN, /* type could not be determined */
6 TYPE_BAD, /* neither file nor block device */
7 TYPE_FILE, /* image file rather than device */
8 TYPE_VIRTUAL, /* block devices like LVM or RAID volumes */
9 TYPE_REMOVABLE, /* removable disk device */
10 TYPE_FIXED /* fixed disk device */
11 };
12
13 struct device_info {
14 enum device_type type;
15
16 /*
17 * partition number if detected
18 * 0 = whole disk device (including unpartitioned image file)
19 * -1 = could not be determined
20 */
21 int partition;
22
23 /*
24 * whether partitions or device mapper devices or any other kind of
25 * children use this device
26 * 1 = yes
27 * 0 = no
28 * -1 = could not be determined
29 */
30 int has_children;
31
32 /*
33 * detected geometry, or -1 if unknown
34 */
35 int geom_heads;
36 int geom_sectors;
37 long long geom_start;
38 long long geom_size;
39
40 /*
41 * detected sector size or -1 if unknown
42 */
43 int sector_size;
44
45 /*
46 * size in bytes, or -1 if unknown
47 */
48 long long size;
49 };
50
51
52 extern int device_info_verbose;
53
54 int get_device_info(int fd, struct device_info *info);
55 int is_device_mounted(const char *path);
56
57 #endif