-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdir.rs
More file actions
70 lines (56 loc) · 2.17 KB
/
dir.rs
File metadata and controls
70 lines (56 loc) · 2.17 KB
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
62
63
64
65
66
67
68
69
70
//! Directory related types
// ============================================================================
// Imports
// ============================================================================
// None
// ============================================================================
// Constants
// ============================================================================
// None
// ============================================================================
// Types
// ============================================================================
/// Represents an open directory
#[repr(C)]
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub struct Handle(u8);
impl Handle {
/// Construct a new `Handle` from an integer.
///
/// Only the OS should call this - applications should not be constructing
/// their own dir handles! But if you do, you probably can't harm anything
/// and it's no worse that C just using `int`.
pub const fn new(value: u8) -> Handle {
Handle(value)
}
/// Get the numeric value of this Directory Handle
pub const fn value(&self) -> u8 {
self.0
}
}
/// Describes an entry in a directory.
///
/// This is set up for 8.3 filenames on MS-DOS FAT32 partitions currently.
#[repr(C)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Entry {
/// The name and extension of the file.
///
/// The name and extension are separated by a single '.'.
///
/// The filename will be in ASCII. Unicode filenames are not supported.
pub name: [u8; crate::MAX_FILENAME_LEN],
/// The properties for the file/directory this entry represents.
pub properties: crate::file::Stat,
}
// ============================================================================
// Functions
// ============================================================================
// None
// ============================================================================
// Tests
// ============================================================================
// None
// ============================================================================
// End of File
// ============================================================================