Rev 3675 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3675 | Rev 4377 | ||
|---|---|---|---|
| Line 45... | Line 45... | ||
| 45 | 45 | ||
| 46 | #define FAT_ATTR_RDONLY (1 << 0) |
46 | #define FAT_ATTR_RDONLY (1 << 0) |
| 47 | #define FAT_ATTR_VOLLABEL (1 << 3) |
47 | #define FAT_ATTR_VOLLABEL (1 << 3) |
| 48 | #define FAT_ATTR_SUBDIR (1 << 4) |
48 | #define FAT_ATTR_SUBDIR (1 << 4) |
| 49 | 49 | ||
| - | 50 | #define FAT_LCASE_LOWER_NAME 0x08 |
|
| - | 51 | #define FAT_LCASE_LOWER_EXT 0x10 |
|
| - | 52 | ||
| 50 | #define FAT_PAD ' ' |
53 | #define FAT_PAD ' ' |
| 51 | 54 | ||
| 52 | #define FAT_DENTRY_UNUSED 0x00 |
55 | #define FAT_DENTRY_UNUSED 0x00 |
| 53 | #define FAT_DENTRY_E5_ESC 0x05 |
56 | #define FAT_DENTRY_E5_ESC 0x05 |
| 54 | #define FAT_DENTRY_DOT 0x2e |
57 | #define FAT_DENTRY_DOT 0x2e |
| Line 63... | Line 66... | ||
| 63 | 66 | ||
| 64 | typedef struct { |
67 | typedef struct { |
| 65 | uint8_t name[8]; |
68 | uint8_t name[8]; |
| 66 | uint8_t ext[3]; |
69 | uint8_t ext[3]; |
| 67 | uint8_t attr; |
70 | uint8_t attr; |
| 68 | uint8_t reserved; |
71 | uint8_t lcase; |
| 69 | uint8_t ctime_fine; |
72 | uint8_t ctime_fine; |
| 70 | uint16_t ctime; |
73 | uint16_t ctime; |
| 71 | uint16_t cdate; |
74 | uint16_t cdate; |
| 72 | uint16_t adate; |
75 | uint16_t adate; |
| 73 | union { |
76 | union { |
| 74 | uint16_t eaidx; /* FAT12/FAT16 */ |
77 | uint16_t eaidx; /* FAT12/FAT16 */ |
| 75 | uint16_t firstc_hi; /* FAT32 */ |
78 | uint16_t firstc_hi; /* FAT32 */ |
| 76 | }; |
79 | } __attribute__ ((packed)); |
| 77 | uint16_t mtime; |
80 | uint16_t mtime; |
| 78 | uint16_t mdate; |
81 | uint16_t mdate; |
| 79 | union { |
82 | union { |
| 80 | uint16_t firstc; /* FAT12/FAT16 */ |
83 | uint16_t firstc; /* FAT12/FAT16 */ |
| 81 | uint16_t firstc_lo; /* FAT32 */ |
84 | uint16_t firstc_lo; /* FAT32 */ |
| 82 | }; |
85 | } __attribute__ ((packed)); |
| 83 | uint32_t size; |
86 | uint32_t size; |
| 84 | } __attribute__ ((packed)) fat_dentry_t; |
87 | } __attribute__ ((packed)) fat_dentry_t; |
| 85 | 88 | ||
| 86 | extern int fat_dentry_namecmp(char *, const char *); |
89 | extern int fat_dentry_namecmp(char *, const char *); |
| 87 | extern bool fat_dentry_name_verify(const char *); |
90 | extern bool fat_dentry_name_verify(const char *); |