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
52
53
54
55
56
57
58
59
60
61
pub mod cache;
pub mod dev;
pub mod error;
pub mod part_list;
pub mod part_table;
pub mod partition;
pub mod prober;
pub mod tag;
pub mod topology;
use bitflags::bitflags;
use std::{ffi::CString, path::Path};
pub use error::{BlkIdError, BlkIdResult};
pub(crate) fn path_to_cstring<P: AsRef<Path>>(path: P) -> BlkIdResult<CString> {
Ok(CString::new(path.as_ref().to_string_lossy().as_ref())?)
}
bitflags! {
pub struct SuperblocksFlags: i32 {
const LABEL = 1 << 1;
const LABELRAW = 1 << 2;
const UUID = 1 << 3;
const UUIDRAW = 1 << 4;
const TYPE = 1 << 5;
const SECTYPE = 1 << 6;
const USAGE = 1 << 7;
const VERSION = 1 << 8;
const MAGIC = 1 << 9;
#[cfg(blkid = "2.24")]
const BADCSUM = 1 << 10;
const DEFAULT = Self::LABEL.bits | Self::UUID.bits | Self::TYPE.bits | Self::SECTYPE.bits;
}
pub struct PartitionsFlags: i32 {
const FORCE_GPT = 1 << 1;
const ENTRY_DETAILS = 1 << 2;
const MAGIC = 1 << 3;
}
}
impl Default for SuperblocksFlags {
fn default() -> Self {
Self::DEFAULT
}
}