summaryrefslogtreecommitdiffstats
path: root/firmware/include
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-02-11 15:27:23 +0100
committerThomas Martitz <kugel@rockbox.org>2014-02-23 20:23:52 +0100
commit0f928f87850153a38c7e6cfafd283ce4f52a0666 (patch)
tree55bbb19b5a17cd6e30a29bb3c2446a6e4c02738a /firmware/include
parentcbc57af0f3192093177d90861df72c4074566cf8 (diff)
downloadrockbox-0f928f87850153a38c7e6cfafd283ce4f52a0666.tar.gz
rockbox-0f928f87850153a38c7e6cfafd283ce4f52a0666.tar.bz2
rockbox-0f928f87850153a38c7e6cfafd283ce4f52a0666.zip
RaaA: Move directory related stuff from filesystem-unix.c into rbpaths.c.
Part of this change is to align sdlapp builds to other application targets in that the sim_* wrappers are not used anymore (except for sim_read/write). Path mangling is now done in rbpaths.c as well. Change-Id: I9726da73b50a83d9e1a1840288de16ec01ea029d
Diffstat (limited to 'firmware/include')
-rw-r--r--firmware/include/dir_uncached.h32
-rw-r--r--firmware/include/file.h42
2 files changed, 31 insertions, 43 deletions
diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h
index 1f9b8c1a4e..6443d5ba97 100644
--- a/firmware/include/dir_uncached.h
+++ b/firmware/include/dir_uncached.h
@@ -33,7 +33,7 @@ struct dirinfo {
#include <stdbool.h>
#include "file.h"
-#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) || defined(__PCTOOL__)
+#if defined(SIMULATOR) || defined(__PCTOOL__)
# define dirent_uncached sim_dirent
# define DIR_UNCACHED SIM_DIR
# define opendir_uncached sim_opendir
@@ -41,10 +41,21 @@ struct dirinfo {
# define closedir_uncached sim_closedir
# define mkdir_uncached sim_mkdir
# define rmdir_uncached sim_rmdir
+#elif defined(APPLICATION)
+# include "rbpaths.h"
+# define DIRENT_DEFINED
+# define DIR_DEFINED
+# define dirent_uncached dirent
+# define DIR_UNCACHED DIR
+# define opendir_uncached app_opendir
+# define readdir_uncached app_readdir
+# define closedir_uncached app_closedir
+# define mkdir_uncached app_mkdir
+# define rmdir_uncached app_rmdir
#endif
-#ifndef DIRENT_DEFINED
+#ifndef DIRENT_DEFINED
struct dirent_uncached {
unsigned char d_name[MAX_PATH];
struct dirinfo info;
@@ -72,23 +83,6 @@ typedef struct {
} DIR_UNCACHED CACHEALIGN_ATTR;
#endif
-
-#if defined(APPLICATION) && !defined(__PCTOOL__)
-#if (CONFIG_PLATFORM & PLATFORM_ANDROID) || defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1)
-#include "dir-target.h"
-#endif
-# undef opendir_uncached
-# define opendir_uncached app_opendir
-# undef mkdir_uncached
-# define mkdir_uncached app_mkdir
-# undef rmdir_uncached
-# define rmdir_uncached app_rmdir
-/* defined in rbpaths.c */
-extern DIR_UNCACHED* app_opendir(const char* name);
-extern int app_rmdir(const char* name);
-extern int app_mkdir(const char* name);
-#endif
-
#ifdef HAVE_HOTSWAP
char *get_volume_name(int volume);
#endif
diff --git a/firmware/include/file.h b/firmware/include/file.h
index 4ba9c503b4..9b7f123999 100644
--- a/firmware/include/file.h
+++ b/firmware/include/file.h
@@ -38,33 +38,27 @@
#if !defined(PLUGIN) && !defined(CODEC)
#if defined(APPLICATION) && !defined(__PCTOOL__)
-# define open(x, ...) app_open(x, __VA_ARGS__)
-# define creat(x,m) app_creat(x, m)
-# define remove(x) app_remove(x)
-# define rename(x,y) app_rename(x,y)
-extern int app_open(const char *name, int o, ...);
-extern int app_creat(const char *name, mode_t mode);
-extern int app_remove(const char* pathname);
-extern int app_rename(const char* path, const char* newname);
+#include "rbpaths.h"
+# define open(x, ...) app_open(x, __VA_ARGS__)
+# define creat(x,m) app_creat(x, m)
+# define remove(x) app_remove(x)
+# define rename(x,y) app_rename(x,y)
# if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA))
-# define fsync(x) sim_fsync(x)
-# define ftruncate(x,y) sim_ftruncate(x,y)
-# define lseek(x,y,z) sim_lseek(x,y,z)
-# define read(x,y,z) sim_read(x,y,z)
-# define write(x,y,z) sim_write(x,y,z)
-# define close(x) sim_close(x)
+/* SDL overrides a few more */
+# define read(x,y,z) sim_read(x,y,z)
+# define write(x,y,z) sim_write(x,y,z)
# endif
#elif defined(SIMULATOR) || defined(DBTOOL)
-# define open(x, ...) sim_open(x, __VA_ARGS__)
-# define creat(x,m) sim_creat(x,m)
-# define remove(x) sim_remove(x)
-# define rename(x,y) sim_rename(x,y)
-# define fsync(x) sim_fsync(x)
-# define ftruncate(x,y) sim_ftruncate(x,y)
-# define lseek(x,y,z) sim_lseek(x,y,z)
-# define read(x,y,z) sim_read(x,y,z)
-# define write(x,y,z) sim_write(x,y,z)
-# define close(x) sim_close(x)
+# define open(x, ...) sim_open(x, __VA_ARGS__)
+# define creat(x,m) sim_creat(x,m)
+# define remove(x) sim_remove(x)
+# define rename(x,y) sim_rename(x,y)
+# define fsync(x) sim_fsync(x)
+# define ftruncate(x,y) sim_ftruncate(x,y)
+# define lseek(x,y,z) sim_lseek(x,y,z)
+# define read(x,y,z) sim_read(x,y,z)
+# define write(x,y,z) sim_write(x,y,z)
+# define close(x) sim_close(x)
extern int sim_open(const char *name, int o, ...);
extern int sim_creat(const char *name, mode_t mode);
#endif