parsing of /etc/DIR_COLORS

This commit is contained in:
nova
2025-05-10 21:51:09 +02:00
parent 5a7a4baf9b
commit d4a4f5ebb2
4 changed files with 190 additions and 16 deletions

View File

@ -16,22 +16,29 @@
#define FILE_MODIFIERS_SORT_REVERSE 64
/*FILE_MODIFIERS_SORT_NATURAL is when bitmask is 0*/
#define COLOR_REGULAR 0
#define FILE_STATUS_HOVER 1
#define FILE_STATUS_SELECTED 2;
#define FILE_STATUS_IS_REGULAR_FILE 4
#define COLOR_DIR 1
#define COLOR_BLOCK 2
#define COLOR_CHARDEV 3
#define COLOR_EXEC 2
#define COLOR_REGULAR 3
#define COLOR_SYMLINK 4
#define COLOR_FIFO 5
#define COLOR_SOCK 6
#define COLOR_PATH
#define COLOR_BLOCK 5
#define COLOR_CHARDEV 6
#define COLOR_FIFO 0
#define COLOR_SOCK 8
#define COLOR_PATH 9
#ifndef GUARD
#define GUARD
/* complex types are good actually */
typedef struct File {
char status;
char *file_name;
unsigned char file_type;
unsigned short color_pair;
unsigned long file_name_width;
unsigned long file_size_bytes;
} file;