Ignore:
Timestamp:
2011-07-16T18:56:58Z (13 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1f78546
Parents:
27678a0
Message:

exFAT: exfat_directory_read_file function for rading file names from
exFAT directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/exfat/exfat_directory.c

    r27678a0 r73b1218  
    179179}
    180180
     181
     182int exfat_directory_read_file(exfat_directory_t *di, char *name, exfat_file_dentry_t *df, exfat_stream_dentry_t *ds)
     183{
     184        uint16_t wname[EXFAT_FILENAME_LEN+1];
     185        exfat_dentry_t *d = NULL;
     186        int rc, i;
     187        size_t offset = 0;
     188       
     189        rc = exfat_directory_find(di, EXFAT_DENTRY_FILE, &d);
     190        if (rc != EOK)
     191                return rc;
     192        *df = d->file;
     193
     194        rc = exfat_directory_next(di);
     195        if (rc != EOK)
     196                return rc;
     197        rc = exfat_directory_get(di, &d);
     198        if (rc != EOK)
     199                return rc;
     200        if (exfat_classify_dentry(d) != EXFAT_DENTRY_STREAM)
     201                return ENOENT;
     202        *ds  = d->stream;
     203/*     
     204        if (ds->name_size > EXFAT_FILENAME_LEN)
     205                return EOVERFLOW;
     206*/
     207        for (i=0; i<df->count-1; i++) {
     208                rc = exfat_directory_next(di);
     209                if (rc != EOK)
     210                        return rc;
     211                rc = exfat_directory_get(di, &d);
     212                if (rc != EOK)
     213                        return rc;
     214                if (exfat_classify_dentry(d) != EXFAT_DENTRY_NAME)
     215                        return ENOENT;
     216                exfat_dentry_get_name(&d->name, ds->name_size, wname, &offset);
     217        }
     218        rc = utf16_to_str(name, EXFAT_FILENAME_LEN, wname);
     219        if (rc != EOK)
     220                return rc;
     221
     222        return EOK;
     223}
     224
     225
    181226/**
    182227 * @}
Note: See TracChangeset for help on using the changeset viewer.