#![allow(non_camel_case_types)]
#![allow(clippy::struct_excessive_bools)]
pub type blkcnt_t = u64;
pub type gid_t = u32;
pub type ino_t = u64;
pub type nlink_t = u64;
pub type time_t = i64;
pub type uid_t = u32;
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone)]
pub enum Type {
Directory,
File,
Link,
Pipe,
Socket,
CharDevice,
BlockDevice,
Special,
}
impl Type {
pub fn is_regular_file(self) -> bool {
matches!(self, Self::File)
}
}
#[derive(Copy, Clone)]
pub struct Permissions {
pub user_read: bool,
pub user_write: bool,
pub user_execute: bool,
pub group_read: bool,
pub group_write: bool,
pub group_execute: bool,
pub other_read: bool,
pub other_write: bool,
pub other_execute: bool,
pub sticky: bool,
pub setgid: bool,
pub setuid: bool,
}
#[derive(Copy, Clone)]
pub struct PermissionsPlus {
pub file_type: Type,
pub permissions: Permissions,
pub xattrs: bool,
}
#[derive(Copy, Clone)]
pub struct OctalPermissions {
pub permissions: Permissions,
}
#[derive(Copy, Clone)]
pub struct Links {
pub count: nlink_t,
pub multiple: bool,
}
#[derive(Copy, Clone)]
pub struct Inode(pub ino_t);
#[derive(Copy, Clone)]
pub enum Blocks {
Some(blkcnt_t),
None,
}
#[derive(Copy, Clone)]
pub struct User(pub uid_t);
#[derive(Copy, Clone)]
pub struct Group(pub gid_t);
#[derive(Copy, Clone)]
pub enum Size {
Some(u64),
None,
DeviceIDs(DeviceIDs),
}
#[derive(Copy, Clone)]
pub struct DeviceIDs {
pub major: u8,
pub minor: u8,
}
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Time {
pub seconds: time_t,
pub nanoseconds: time_t,
}
#[derive(PartialEq, Copy, Clone)]
pub enum GitStatus {
NotModified,
New,
Modified,
Deleted,
Renamed,
TypeChange,
Ignored,
Conflicted,
}
#[derive(Copy, Clone)]
pub struct Git {
pub staged: GitStatus,
pub unstaged: GitStatus,
}
impl Default for Git {
fn default() -> Self {
Self {
staged: GitStatus::NotModified,
unstaged: GitStatus::NotModified,
}
}
}