summaryrefslogtreecommitdiff
path: root/apps/plugin.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-09-01 21:29:34 +0000
committerThomas Martitz <kugel@rockbox.org>2010-09-01 21:29:34 +0000
commit6eaab4d00446c070c655f0e6c9a872532a776b6f (patch)
tree69610996dd0a6092459b14e164d4e48e03b1e5bb /apps/plugin.c
parent8e0a0babc57db3e9edc06f3e269fb47c27292ed5 (diff)
downloadrockbox-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/plugin.c')
-rw-r--r--apps/plugin.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index e0455c51a2..9e08951828 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -59,7 +59,7 @@
59#include "usbstack/usb_hid.h" 59#include "usbstack/usb_hid.h"
60#endif 60#endif
61 61
62#if (CONFIG_PLATFORM & PLATFORM_HOSTED) 62#if (CONFIG_PLATFORM & PLATFORM_SDL)
63#define PREFIX(_x_) sim_ ## _x_ 63#define PREFIX(_x_) sim_ ## _x_
64#else 64#else
65#define PREFIX 65#define PREFIX
@@ -349,7 +349,7 @@ static const struct plugin_api rockbox_api = {
349#if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE 349#if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE
350 __div0, 350 __div0,
351#endif 351#endif
352 PREFIX(sleep), 352 sleep,
353 yield, 353 yield,
354 &current_tick, 354 &current_tick,
355 default_event_handler, 355 default_event_handler,
@@ -529,7 +529,7 @@ static const struct plugin_api rockbox_api = {
529 playlist_insert_track, 529 playlist_insert_track,
530 playlist_insert_directory, 530 playlist_insert_directory,
531 playlist_shuffle, 531 playlist_shuffle,
532 PREFIX(audio_play), 532 audio_play,
533 audio_stop, 533 audio_stop,
534 audio_pause, 534 audio_pause,
535 audio_resume, 535 audio_resume,
@@ -722,6 +722,7 @@ static const struct plugin_api rockbox_api = {
722 722
723 /* new stuff at the end, sort into place next time 723 /* new stuff at the end, sort into place next time
724 the API gets incompatible */ 724 the API gets incompatible */
725 dir_get_info,
725}; 726};
726 727
727int plugin_load(const char* plugin, const void* parameter) 728int plugin_load(const char* plugin, const void* parameter)
@@ -940,11 +941,11 @@ static int open_wrapper(const char* pathname, int flags, ...)
940 { 941 {
941 va_list ap; 942 va_list ap;
942 va_start(ap, flags); 943 va_start(ap, flags);
943 fd = sim_open(pathname, flags, va_arg(ap, unsigned int)); 944 fd = open(pathname, flags, va_arg(ap, unsigned int));
944 va_end(ap); 945 va_end(ap);
945 } 946 }
946 else 947 else
947 fd = sim_open(pathname, flags); 948 fd = open(pathname, flags);
948#else 949#else
949 fd = file_open(pathname,flags); 950 fd = file_open(pathname,flags);
950#endif 951#endif