diff options
Diffstat (limited to 'firmware/include')
-rw-r--r-- | firmware/include/dir_uncached.h | 32 | ||||
-rw-r--r-- | firmware/include/file.h | 42 |
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 { | |||
33 | #include <stdbool.h> | 33 | #include <stdbool.h> |
34 | #include "file.h" | 34 | #include "file.h" |
35 | 35 | ||
36 | #if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) || defined(__PCTOOL__) | 36 | #if defined(SIMULATOR) || defined(__PCTOOL__) |
37 | # define dirent_uncached sim_dirent | 37 | # define dirent_uncached sim_dirent |
38 | # define DIR_UNCACHED SIM_DIR | 38 | # define DIR_UNCACHED SIM_DIR |
39 | # define opendir_uncached sim_opendir | 39 | # define opendir_uncached sim_opendir |
@@ -41,10 +41,21 @@ struct dirinfo { | |||
41 | # define closedir_uncached sim_closedir | 41 | # define closedir_uncached sim_closedir |
42 | # define mkdir_uncached sim_mkdir | 42 | # define mkdir_uncached sim_mkdir |
43 | # define rmdir_uncached sim_rmdir | 43 | # define rmdir_uncached sim_rmdir |
44 | #elif defined(APPLICATION) | ||
45 | # include "rbpaths.h" | ||
46 | # define DIRENT_DEFINED | ||
47 | # define DIR_DEFINED | ||
48 | # define dirent_uncached dirent | ||
49 | # define DIR_UNCACHED DIR | ||
50 | # define opendir_uncached app_opendir | ||
51 | # define readdir_uncached app_readdir | ||
52 | # define closedir_uncached app_closedir | ||
53 | # define mkdir_uncached app_mkdir | ||
54 | # define rmdir_uncached app_rmdir | ||
44 | #endif | 55 | #endif |
45 | 56 | ||
46 | #ifndef DIRENT_DEFINED | ||
47 | 57 | ||
58 | #ifndef DIRENT_DEFINED | ||
48 | struct dirent_uncached { | 59 | struct dirent_uncached { |
49 | unsigned char d_name[MAX_PATH]; | 60 | unsigned char d_name[MAX_PATH]; |
50 | struct dirinfo info; | 61 | struct dirinfo info; |
@@ -72,23 +83,6 @@ typedef struct { | |||
72 | } DIR_UNCACHED CACHEALIGN_ATTR; | 83 | } DIR_UNCACHED CACHEALIGN_ATTR; |
73 | #endif | 84 | #endif |
74 | 85 | ||
75 | |||
76 | #if defined(APPLICATION) && !defined(__PCTOOL__) | ||
77 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) || defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) | ||
78 | #include "dir-target.h" | ||
79 | #endif | ||
80 | # undef opendir_uncached | ||
81 | # define opendir_uncached app_opendir | ||
82 | # undef mkdir_uncached | ||
83 | # define mkdir_uncached app_mkdir | ||
84 | # undef rmdir_uncached | ||
85 | # define rmdir_uncached app_rmdir | ||
86 | /* defined in rbpaths.c */ | ||
87 | extern DIR_UNCACHED* app_opendir(const char* name); | ||
88 | extern int app_rmdir(const char* name); | ||
89 | extern int app_mkdir(const char* name); | ||
90 | #endif | ||
91 | |||
92 | #ifdef HAVE_HOTSWAP | 86 | #ifdef HAVE_HOTSWAP |
93 | char *get_volume_name(int volume); | 87 | char *get_volume_name(int volume); |
94 | #endif | 88 | #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 @@ | |||
38 | 38 | ||
39 | #if !defined(PLUGIN) && !defined(CODEC) | 39 | #if !defined(PLUGIN) && !defined(CODEC) |
40 | #if defined(APPLICATION) && !defined(__PCTOOL__) | 40 | #if defined(APPLICATION) && !defined(__PCTOOL__) |
41 | # define open(x, ...) app_open(x, __VA_ARGS__) | 41 | #include "rbpaths.h" |
42 | # define creat(x,m) app_creat(x, m) | 42 | # define open(x, ...) app_open(x, __VA_ARGS__) |
43 | # define remove(x) app_remove(x) | 43 | # define creat(x,m) app_creat(x, m) |
44 | # define rename(x,y) app_rename(x,y) | 44 | # define remove(x) app_remove(x) |
45 | extern int app_open(const char *name, int o, ...); | 45 | # define rename(x,y) app_rename(x,y) |
46 | extern int app_creat(const char *name, mode_t mode); | ||
47 | extern int app_remove(const char* pathname); | ||
48 | extern int app_rename(const char* path, const char* newname); | ||
49 | # if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) | 46 | # if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) |
50 | # define fsync(x) sim_fsync(x) | 47 | /* SDL overrides a few more */ |
51 | # define ftruncate(x,y) sim_ftruncate(x,y) | 48 | # define read(x,y,z) sim_read(x,y,z) |
52 | # define lseek(x,y,z) sim_lseek(x,y,z) | 49 | # define write(x,y,z) sim_write(x,y,z) |
53 | # define read(x,y,z) sim_read(x,y,z) | ||
54 | # define write(x,y,z) sim_write(x,y,z) | ||
55 | # define close(x) sim_close(x) | ||
56 | # endif | 50 | # endif |
57 | #elif defined(SIMULATOR) || defined(DBTOOL) | 51 | #elif defined(SIMULATOR) || defined(DBTOOL) |
58 | # define open(x, ...) sim_open(x, __VA_ARGS__) | 52 | # define open(x, ...) sim_open(x, __VA_ARGS__) |
59 | # define creat(x,m) sim_creat(x,m) | 53 | # define creat(x,m) sim_creat(x,m) |
60 | # define remove(x) sim_remove(x) | 54 | # define remove(x) sim_remove(x) |
61 | # define rename(x,y) sim_rename(x,y) | 55 | # define rename(x,y) sim_rename(x,y) |
62 | # define fsync(x) sim_fsync(x) | 56 | # define fsync(x) sim_fsync(x) |
63 | # define ftruncate(x,y) sim_ftruncate(x,y) | 57 | # define ftruncate(x,y) sim_ftruncate(x,y) |
64 | # define lseek(x,y,z) sim_lseek(x,y,z) | 58 | # define lseek(x,y,z) sim_lseek(x,y,z) |
65 | # define read(x,y,z) sim_read(x,y,z) | 59 | # define read(x,y,z) sim_read(x,y,z) |
66 | # define write(x,y,z) sim_write(x,y,z) | 60 | # define write(x,y,z) sim_write(x,y,z) |
67 | # define close(x) sim_close(x) | 61 | # define close(x) sim_close(x) |
68 | extern int sim_open(const char *name, int o, ...); | 62 | extern int sim_open(const char *name, int o, ...); |
69 | extern int sim_creat(const char *name, mode_t mode); | 63 | extern int sim_creat(const char *name, mode_t mode); |
70 | #endif | 64 | #endif |