diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-09-01 21:29:34 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-09-01 21:29:34 +0000 |
commit | 6eaab4d00446c070c655f0e6c9a872532a776b6f (patch) | |
tree | 69610996dd0a6092459b14e164d4e48e03b1e5bb /apps/onplay.c | |
parent | 8e0a0babc57db3e9edc06f3e269fb47c27292ed5 (diff) | |
download | rockbox-6eaab4d00446c070c655f0e6c9a872532a776b6f.tar.gz rockbox-6eaab4d00446c070c655f0e6c9a872532a776b6f.zip |
Ged rid of uisimulator/common/io.c for android builds.
Use host's functions for file i/o directly (open(), close() ,etc.), not the sim_* variants.
Some dir functions need to be wrapped still because we need to cache the parents dir's path (host's dirent doesn't let us know).
For the same reason (incompatibility) with host's dirent) detach some members from Rockbox' dirent struct and put it into an extra one,
the values can be retrieved via the new dir_get_info().
Get rid of the sim_ prefix for sleep as well and change the signature to unix sleep().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27968 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 72912579f9..f5b8476492 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include "debug.h" | 27 | #include "debug.h" |
28 | #include "lcd.h" | 28 | #include "lcd.h" |
29 | #include "dir.h" | ||
30 | #include "file.h" | 29 | #include "file.h" |
31 | #include "audio.h" | 30 | #include "audio.h" |
32 | #include "menu.h" | 31 | #include "menu.h" |
@@ -63,6 +62,7 @@ | |||
63 | #include "statusbar-skinned.h" | 62 | #include "statusbar-skinned.h" |
64 | #include "pitchscreen.h" | 63 | #include "pitchscreen.h" |
65 | #include "viewport.h" | 64 | #include "viewport.h" |
65 | #include "filefuncs.h" | ||
66 | 66 | ||
67 | static int context; | 67 | static int context; |
68 | static char* selected_file = NULL; | 68 | static char* selected_file = NULL; |
@@ -484,14 +484,14 @@ static int remove_dir(char* dirname, int len) | |||
484 | entry = readdir(dir); | 484 | entry = readdir(dir); |
485 | if (!entry) | 485 | if (!entry) |
486 | break; | 486 | break; |
487 | 487 | struct dirinfo info = dir_get_info(dir, entry); | |
488 | dirname[dirlen] ='\0'; | 488 | dirname[dirlen] ='\0'; |
489 | /* inform the user which dir we're deleting */ | 489 | /* inform the user which dir we're deleting */ |
490 | splash(0, dirname); | 490 | splash(0, dirname); |
491 | 491 | ||
492 | /* append name to current directory */ | 492 | /* append name to current directory */ |
493 | snprintf(dirname+dirlen, len-dirlen, "/%s", entry->d_name); | 493 | snprintf(dirname+dirlen, len-dirlen, "/%s", entry->d_name); |
494 | if (entry->attribute & ATTR_DIRECTORY) | 494 | if (info.attribute & ATTR_DIRECTORY) |
495 | { /* remove a subdirectory */ | 495 | { /* remove a subdirectory */ |
496 | if (!strcmp((char *)entry->d_name, ".") || | 496 | if (!strcmp((char *)entry->d_name, ".") || |
497 | !strcmp((char *)entry->d_name, "..")) | 497 | !strcmp((char *)entry->d_name, "..")) |
@@ -783,6 +783,7 @@ static bool clipboard_pastedirectory(char *src, int srclen, char *target, | |||
783 | if (!entry) | 783 | if (!entry) |
784 | break; | 784 | break; |
785 | 785 | ||
786 | struct dirinfo info = dir_get_info(srcdir, entry); | ||
786 | /* append name to current directory */ | 787 | /* append name to current directory */ |
787 | snprintf(src+srcdirlen, srclen-srcdirlen, "/%s", entry->d_name); | 788 | snprintf(src+srcdirlen, srclen-srcdirlen, "/%s", entry->d_name); |
788 | snprintf(target+targetdirlen, targetlen-targetdirlen, "/%s", | 789 | snprintf(target+targetdirlen, targetlen-targetdirlen, "/%s", |
@@ -790,7 +791,7 @@ static bool clipboard_pastedirectory(char *src, int srclen, char *target, | |||
790 | 791 | ||
791 | DEBUGF("Copy %s to %s\n", src, target); | 792 | DEBUGF("Copy %s to %s\n", src, target); |
792 | 793 | ||
793 | if (entry->attribute & ATTR_DIRECTORY) | 794 | if (info.attribute & ATTR_DIRECTORY) |
794 | { /* copy/move a subdirectory */ | 795 | { /* copy/move a subdirectory */ |
795 | if (!strcmp((char *)entry->d_name, ".") || | 796 | if (!strcmp((char *)entry->d_name, ".") || |
796 | !strcmp((char *)entry->d_name, "..")) | 797 | !strcmp((char *)entry->d_name, "..")) |