Changeset 39b0a51 in mainline for uspace/srv/fs/fat/fat_dentry.c


Ignore:
Timestamp:
2017-06-28T16:05:37Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ee50130
Parents:
30eab78
Message:

FAT decoding of volume label.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_dentry.c

    r30eab78 r39b0a51  
    180180}
    181181
     182void fat_dentry_vollabel_get(const fat_dentry_t *d, char *buf)
     183{
     184        unsigned int i;
     185       
     186        for (i = 0; i < FAT_NAME_LEN; i++) {
     187                if (d->name[i] == FAT_PAD)
     188                        break;
     189               
     190                if (d->name[i] == FAT_DENTRY_E5_ESC)
     191                        *buf++ = 0xe5;
     192                else
     193                        *buf++ = d->name[i];
     194        }
     195       
     196        for (i = 0; i < FAT_EXT_LEN; i++) {
     197                if (d->ext[i] == FAT_PAD) {
     198                        *buf = '\0';
     199                        return;
     200                }
     201               
     202                if (d->ext[i] == FAT_DENTRY_E5_ESC)
     203                        *buf++ = 0xe5;
     204                else
     205                        *buf++ = d->ext[i];
     206        }
     207       
     208        *buf = '\0';
     209}
     210
    182211fat_dentry_clsf_t fat_classify_dentry(const fat_dentry_t *d)
    183212{
     
    191220        if (d->attr & FAT_ATTR_VOLLABEL) {
    192221                /* volume label entry */
    193                 return FAT_DENTRY_SKIP;
     222                return FAT_DENTRY_VOLLABEL;
    194223        }
    195224        if (d->name[0] == FAT_DENTRY_ERASED) {
Note: See TracChangeset for help on using the changeset viewer.