summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-06-20 16:34:29 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-06-20 16:34:29 +0000
commit74eb64257ace75c290e7eb504774a39764529d1d (patch)
tree6ccbbedbe447f53450a70c0135f8722cae5ef888
parent4b6e00d4c9dd886011b64cb18684cb4916b89a13 (diff)
downloadrockbox-74eb64257ace75c290e7eb504774a39764529d1d.tar.gz
rockbox-74eb64257ace75c290e7eb504774a39764529d1d.zip
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
-rw-r--r--apps/tree.c1
-rw-r--r--apps/tree.h1
-rw-r--r--firmware/common/dir.c2
-rw-r--r--firmware/include/dir.h2
-rw-r--r--uisimulator/common/io.c2
5 files changed, 8 insertions, 0 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 8aa7eb0815..09391b31b6 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -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;
diff --git a/apps/tree.h b/apps/tree.h
index 367a4fad00..a0015b6e76 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -23,6 +23,7 @@
struct entry {
short attr; /* FAT attributes + file type flags */
+ unsigned long time_write; /* Last write time */
char *name;
};
diff --git a/firmware/common/dir.c b/firmware/common/dir.c
index 27666d26e9..1bad9327f6 100644
--- a/firmware/common/dir.c
+++ b/firmware/common/dir.c
@@ -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;
}
diff --git a/firmware/include/dir.h b/firmware/include/dir.h
index ae0aa29cff..00c6664872 100644
--- a/firmware/include/dir.h
+++ b/firmware/include/dir.h
@@ -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
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index b691af972a..e5b2f9228d 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -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;
}