Skip to main content

libblkid_rs/
consts.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5use libc::c_int;
6
7consts_enum_conv!(
8    /// Flags for blockdev cache operations
9    BlkidDevFlag <=> c_int,
10    #[allow(missing_docs)]
11    Find => libblkid_rs_sys::BLKID_DEV_FIND as c_int,
12    #[allow(missing_docs)]
13    Create => libblkid_rs_sys::BLKID_DEV_CREATE as c_int,
14    #[allow(missing_docs)]
15    Verify => libblkid_rs_sys::BLKID_DEV_VERIFY as c_int,
16    #[allow(missing_docs)]
17    Normal => libblkid_rs_sys::BLKID_DEV_NORMAL as c_int
18);
19
20flags!(
21    /// Set of flags of type `BlkidDevFlag`
22    BlkidDevFlags <=> c_int,
23    BlkidDevFlag
24);
25
26consts_enum_conv!(
27    /// Flags for blockdev usage
28    BlkidUsageFlag <=> c_int,
29    #[allow(missing_docs)]
30    Filesystem => libblkid_rs_sys::BLKID_USAGE_FILESYSTEM as c_int,
31    #[allow(missing_docs)]
32    Raid => libblkid_rs_sys::BLKID_USAGE_RAID as c_int,
33    #[allow(missing_docs)]
34    Crypto => libblkid_rs_sys::BLKID_USAGE_CRYPTO as c_int,
35    #[allow(missing_docs)]
36    Other => libblkid_rs_sys::BLKID_USAGE_OTHER as c_int
37);
38
39flags!(
40    /// Set of flags of type `BlkidDevFlag`
41    BlkidUsageFlags <=> c_int,
42    BlkidUsageFlag
43);
44
45consts_enum_conv!(
46    /// Flags for superblock probing
47    BlkidSublks <=> c_int,
48    /// Read label from superblock
49    Label => libblkid_rs_sys::BLKID_SUBLKS_LABEL as c_int,
50    /// Read label from superblock and define `LABEL_RAW` value
51    Labelraw => libblkid_rs_sys::BLKID_SUBLKS_LABELRAW as c_int,
52    /// Read UUID from superblock
53    Uuid => libblkid_rs_sys::BLKID_SUBLKS_UUID as c_int,
54    /// Read UUID from superblock and define `UUID_RAW` value
55    Uuidraw => libblkid_rs_sys::BLKID_SUBLKS_UUID as c_int,
56    /// Read type from superblock and define `TYPE` value
57    Type => libblkid_rs_sys::BLKID_SUBLKS_TYPE as c_int,
58    /// Read compatible filesystem type from superblock
59    Sectype => libblkid_rs_sys::BLKID_SUBLKS_SECTYPE as c_int,
60    /// Read usage from superblock and define `USAGE` value
61    Usage => libblkid_rs_sys::BLKID_SUBLKS_USAGE as c_int,
62    /// Read filesystem version from superblock
63    Version => libblkid_rs_sys::BLKID_SUBLKS_VERSION as c_int,
64    /// Read superblock magic number and define `SBMAGIC` and `SBMAGIC_OFFSET`
65    Magic => libblkid_rs_sys::BLKID_SUBLKS_MAGIC as c_int,
66    /// Allow a bad checksum
67    Badcsum => libblkid_rs_sys::BLKID_SUBLKS_BADCSUM as c_int,
68    /// Default flags
69    Default => libblkid_rs_sys::BLKID_SUBLKS_DEFAULT as c_int
70);
71
72flags!(
73    /// Set of `BlkidSublks` flags
74    BlkidSublksFlags <=> c_int,
75    BlkidSublks
76);
77
78consts_enum_conv!(
79    /// Constants for probing superblock type.
80    BlkidFltr <=> c_int,
81    /// Probe for all names that are not in the list that was provided.
82    Notin => libblkid_rs_sys::BLKID_FLTR_NOTIN as c_int,
83    /// Probe for all names that are in the list that was provided.
84    Onlyin => libblkid_rs_sys::BLKID_FLTR_ONLYIN as c_int
85);
86
87consts_enum_conv!(
88    /// Low level tag probing return value
89    BlkidProbeRet <=> c_int,
90    /// Successful probe
91    Success => 0,
92    /// Done probing
93    Done => 1
94);
95
96consts_enum_conv!(
97    /// Low level tag probing return value
98    BlkidSafeprobeRet <=> c_int,
99    /// Successful probe
100    Success => 0,
101    /// Nothing detected
102    None => 1,
103    /// Ambiguous result detected
104    Ambiguous => -2
105);
106
107consts_enum_conv!(
108    /// Low level tag probing return value
109    BlkidFullprobeRet <=> c_int,
110    /// Successful probe
111    Success => 0,
112    /// Nothing detected
113    None => 1
114);
115
116consts_enum_conv!(
117    /// Probe request flags
118    BlkidProbreqFlag <=> c_int,
119    #[allow(missing_docs)]
120    Label => libblkid_rs_sys::BLKID_PROBREQ_LABEL as i32,
121    #[allow(missing_docs)]
122    Labelraw => libblkid_rs_sys::BLKID_PROBREQ_LABELRAW as i32,
123    #[allow(missing_docs)]
124    Uuid => libblkid_rs_sys::BLKID_PROBREQ_UUID as i32,
125    #[allow(missing_docs)]
126    Uuidraw => libblkid_rs_sys::BLKID_PROBREQ_UUIDRAW as i32,
127    #[allow(missing_docs)]
128    Type => libblkid_rs_sys::BLKID_PROBREQ_TYPE as i32,
129    #[allow(missing_docs)]
130    Sectype => libblkid_rs_sys::BLKID_PROBREQ_SECTYPE as i32,
131    #[allow(missing_docs)]
132    Usage => libblkid_rs_sys::BLKID_PROBREQ_USAGE as i32,
133    #[allow(missing_docs)]
134    Version => libblkid_rs_sys::BLKID_PROBREQ_VERSION as i32
135);
136
137flags!(
138    /// Set of flags of type `BlkidProbreqFlag`
139    BlkidProbreqFlags <=> c_int,
140    BlkidProbreqFlag
141);