forked from len0rd/rockbox
infrastructure for sorting by date+time, now we "only" need to decide on the UI
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4778 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4b6e00d4c9
commit
74eb64257a
5 changed files with 8 additions and 0 deletions
|
|
@ -391,6 +391,7 @@ struct entry* load_and_sort_directory(char *dirname, int *dirfilter,
|
|||
break;
|
||||
}
|
||||
dptr->name = &name_buffer[name_buffer_length];
|
||||
dptr->time_write = entry->wrtdate<<16 | entry->wrttime; /* in one # */
|
||||
strcpy(dptr->name,entry->d_name);
|
||||
name_buffer_length += len + 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
struct entry {
|
||||
short attr; /* FAT attributes + file type flags */
|
||||
unsigned long time_write; /* Last write time */
|
||||
char *name;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ struct dirent* readdir(DIR* dir)
|
|||
theent->attribute = entry.attr;
|
||||
theent->size = entry.filesize;
|
||||
theent->startcluster = entry.firstcluster;
|
||||
theent->wrtdate = entry.wrtdate;
|
||||
theent->wrttime = entry.wrttime;
|
||||
|
||||
return theent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ struct dirent {
|
|||
int attribute;
|
||||
int size;
|
||||
int startcluster;
|
||||
unsigned short wrtdate; /* Last write date */
|
||||
unsigned short wrttime; /* Last write time */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,8 @@ struct sim_dirent *sim_readdir(MYDIR *dir)
|
|||
|
||||
secret.attribute = S_ISDIR(s.st_mode)?ATTR_DIRECTORY:0;
|
||||
secret.size = s.st_size;
|
||||
secret.wrtdate = (unsigned short)(s.st_mtime >> 16);
|
||||
secret.wrttime = (unsigned short)(s.st_mtime & 0xFFFF);
|
||||
|
||||
return &secret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue