Changeset 5d95f02 in mainline for uspace/srv/fs/fat/fat_dentry.h
- Timestamp:
- 2011-08-26T23:04:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4bf6895
- Parents:
- 0dbe5ac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_dentry.h
r0dbe5ac r5d95f02 71 71 #define FAT_LFN_ERASED 0x80 72 72 73 #define FAT_LFN_ORDER(d) ( d->lfn.order)73 #define FAT_LFN_ORDER(d) ((d)->lfn.order) 74 74 #define FAT_IS_LFN(d) \ 75 ((FAT_LFN_ORDER( d) & FAT_LFN_LAST) == FAT_LFN_LAST)75 ((FAT_LFN_ORDER((d)) & FAT_LFN_LAST) == FAT_LFN_LAST) 76 76 #define FAT_LFN_COUNT(d) \ 77 (FAT_LFN_ORDER( d) ^ FAT_LFN_LAST)78 #define FAT_LFN_PART1(d) ( d->lfn.part1)79 #define FAT_LFN_PART2(d) ( d->lfn.part2)80 #define FAT_LFN_PART3(d) ( d->lfn.part3)81 #define FAT_LFN_ATTR(d) ( d->lfn.attr)82 #define FAT_LFN_CHKSUM(d) ( d->lfn.check_sum)77 (FAT_LFN_ORDER((d)) ^ FAT_LFN_LAST) 78 #define FAT_LFN_PART1(d) ((d)->lfn.part1) 79 #define FAT_LFN_PART2(d) ((d)->lfn.part2) 80 #define FAT_LFN_PART3(d) ((d)->lfn.part3) 81 #define FAT_LFN_ATTR(d) ((d)->lfn.attr) 82 #define FAT_LFN_CHKSUM(d) ((d)->lfn.check_sum) 83 83 84 84 #define FAT_LFN_NAME_SIZE 260 … … 98 98 } fat_dentry_clsf_t; 99 99 100 typedef struct { 101 union { 102 struct { 103 uint8_t name[8]; 104 uint8_t ext[3]; 105 uint8_t attr; 106 uint8_t lcase; 107 uint8_t ctime_fine; 108 uint16_t ctime; 109 uint16_t cdate; 110 uint16_t adate; 111 union { 112 uint16_t eaidx; /* FAT12/FAT16 */ 113 uint16_t firstc_hi; /* FAT32 */ 114 } __attribute__ ((packed)); 115 uint16_t mtime; 116 uint16_t mdate; 117 union { 118 uint16_t firstc; /* FAT12/FAT16 */ 119 uint16_t firstc_lo; /* FAT32 */ 120 } __attribute__ ((packed)); 121 uint32_t size; 100 typedef union { 101 struct { 102 uint8_t name[8]; 103 uint8_t ext[3]; 104 uint8_t attr; 105 uint8_t lcase; 106 uint8_t ctime_fine; 107 uint16_t ctime; 108 uint16_t cdate; 109 uint16_t adate; 110 union { 111 uint16_t eaidx; /* FAT12/FAT16 */ 112 uint16_t firstc_hi; /* FAT32 */ 122 113 } __attribute__ ((packed)); 123 struct { 124 uint8_t order; 125 uint16_t part1[FAT_LFN_PART1_SIZE]; 126 uint8_t attr; 127 uint8_t type; 128 uint8_t check_sum; 129 uint16_t part2[FAT_LFN_PART2_SIZE]; 130 uint16_t firstc_lo; /* MUST be 0 */ 131 uint16_t part3[FAT_LFN_PART3_SIZE]; 132 } __attribute__ ((packed)) lfn; 133 }; 114 uint16_t mtime; 115 uint16_t mdate; 116 union { 117 uint16_t firstc; /* FAT12/FAT16 */ 118 uint16_t firstc_lo; /* FAT32 */ 119 } __attribute__ ((packed)); 120 uint32_t size; 121 } __attribute__ ((packed)); 122 struct { 123 uint8_t order; 124 uint16_t part1[FAT_LFN_PART1_SIZE]; 125 uint8_t attr; 126 uint8_t type; 127 uint8_t check_sum; 128 uint16_t part2[FAT_LFN_PART2_SIZE]; 129 uint16_t firstc_lo; /* MUST be 0 */ 130 uint16_t part3[FAT_LFN_PART3_SIZE]; 131 } __attribute__ ((packed)) lfn; 134 132 } __attribute__ ((packed)) fat_dentry_t; 135 133 … … 144 142 extern size_t fat_lfn_size(const fat_dentry_t *); 145 143 extern size_t fat_lfn_get_entry(const fat_dentry_t *, uint16_t *, size_t *); 146 extern size_t fat_lfn_set_entry(const uint16_t *, size_t *, size_t, fat_dentry_t *); 144 extern size_t fat_lfn_set_entry(const uint16_t *, size_t *, size_t, 145 fat_dentry_t *); 147 146 148 extern void str_to_ascii(char * dst, const char *src, size_t count, uint8_t pad);149 extern size_t utf16_length(const uint16_t * wstr);147 extern void str_to_ascii(char *, const char *, size_t, uint8_t); 148 extern size_t utf16_length(const uint16_t *); 150 149 151 extern bool fat_valid_name(const char *name); 152 extern bool fat_valid_short_name(const char *name); 153 150 extern bool fat_valid_name(const char *); 151 extern bool fat_valid_short_name(const char *); 154 152 155 153 #endif
Note:
See TracChangeset
for help on using the changeset viewer.