diff options
Diffstat (limited to 'firmware/common')
-rw-r--r-- | firmware/common/rbpaths.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/firmware/common/rbpaths.c b/firmware/common/rbpaths.c index ed413eb03e..95bff3341f 100644 --- a/firmware/common/rbpaths.c +++ b/firmware/common/rbpaths.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <stdio.h> /* snprintf */ | 23 | #include <stdio.h> /* snprintf */ |
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include <stdarg.h> | 25 | #include <stdarg.h> |
26 | #include "config.h" | ||
26 | #include "rbpaths.h" | 27 | #include "rbpaths.h" |
27 | #include "file.h" /* MAX_PATH */ | 28 | #include "file.h" /* MAX_PATH */ |
28 | #include "logf.h" | 29 | #include "logf.h" |
@@ -38,11 +39,17 @@ | |||
38 | #undef mkdir | 39 | #undef mkdir |
39 | #undef rmdir | 40 | #undef rmdir |
40 | 41 | ||
42 | |||
41 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) | 43 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) |
42 | #include "dir-target.h" | 44 | #include "dir-target.h" |
43 | #define opendir opendir_android | 45 | #define opendir opendir_android |
44 | #define mkdir mkdir_android | 46 | #define mkdir mkdir_android |
45 | #define rmdir rmdir_android | 47 | #define rmdir rmdir_android |
48 | #elif defined(SAMSUNG_YPR0) | ||
49 | #include "dir-target.h" | ||
50 | #define opendir opendir_ypr0 | ||
51 | #define mkdir mkdir_ypr0 | ||
52 | #define rmdir rmdir_ypr0 | ||
46 | #elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) | 53 | #elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) |
47 | #define open sim_open | 54 | #define open sim_open |
48 | #define remove sim_remove | 55 | #define remove sim_remove |
@@ -59,6 +66,8 @@ extern int sim_rmdir(const char* name); | |||
59 | const char *rbhome; | 66 | const char *rbhome; |
60 | #endif | 67 | #endif |
61 | 68 | ||
69 | #if !defined(SAMSUNG_YPR0) | ||
70 | |||
62 | /* flags for get_user_file_path() */ | 71 | /* flags for get_user_file_path() */ |
63 | /* whether you need write access to that file/dir, especially true | 72 | /* whether you need write access to that file/dir, especially true |
64 | * for runtime generated files (config.cfg) */ | 73 | * for runtime generated files (config.cfg) */ |
@@ -238,3 +247,28 @@ int app_rmdir(const char* name) | |||
238 | } | 247 | } |
239 | return rmdir(fname); | 248 | return rmdir(fname); |
240 | } | 249 | } |
250 | |||
251 | #else | ||
252 | |||
253 | int app_open(const char *name, int o, ...) | ||
254 | { | ||
255 | if (o & O_CREAT) | ||
256 | { | ||
257 | int ret; | ||
258 | va_list ap; | ||
259 | va_start(ap, o); | ||
260 | ret = open(name, o, va_arg(ap, mode_t)); | ||
261 | va_end(ap); | ||
262 | return ret; | ||
263 | } | ||
264 | return open(name, o); | ||
265 | } | ||
266 | |||
267 | int app_creat(const char* name, mode_t mode) { return creat(name, mode); } | ||
268 | int app_remove(const char *name) { return remove(name); } | ||
269 | int app_rename(const char *old, const char *new) { return rename(old,new); } | ||
270 | DIR *app_opendir(const char *name) { return opendir(name); } | ||
271 | int app_mkdir(const char* name) { return mkdir(name); } | ||
272 | int app_rmdir(const char* name) { return rmdir(name); } | ||
273 | |||
274 | #endif | ||