diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-12-06 22:26:31 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-12-06 22:26:31 +0000 |
commit | 2c2416094f426972c9e2e96d25058311bbe82f97 (patch) | |
tree | 449b4e12e01c3c5c4afa2ae6a8cd396df82b5a38 /firmware/export | |
parent | c35b43b0f54bd607d38908544446caaa02f148a3 (diff) | |
download | rockbox-2c2416094f426972c9e2e96d25058311bbe82f97.tar.gz rockbox-2c2416094f426972c9e2e96d25058311bbe82f97.zip |
Get rid of get_user_file_path and do the path handling in wrappers for open() and friends.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/rbpaths.h | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/firmware/export/rbpaths.h b/firmware/export/rbpaths.h index cd87888cef..6c5d769ed8 100644 --- a/firmware/export/rbpaths.h +++ b/firmware/export/rbpaths.h | |||
@@ -26,17 +26,6 @@ | |||
26 | #include "autoconf.h" | 26 | #include "autoconf.h" |
27 | #include "string-extra.h" | 27 | #include "string-extra.h" |
28 | 28 | ||
29 | /* flags for get_user_file_path() */ | ||
30 | /* whether you need write access to that file/dir, especially true | ||
31 | * for runtime generated files (config.cfg) */ | ||
32 | #define NEED_WRITE (1<<0) | ||
33 | /* file or directory? */ | ||
34 | #define IS_FILE (1<<1) | ||
35 | /* make sure the path is copied into the passed buffer (it may return | ||
36 | * the passed path directly otherwise, e.g. always on target builds) */ | ||
37 | #define FORCE_BUFFER_COPY (1<<2) | ||
38 | |||
39 | |||
40 | 29 | ||
41 | /* name of directory where configuration, fonts and other data | 30 | /* name of directory where configuration, fonts and other data |
42 | * files are stored */ | 31 | * files are stored */ |
@@ -67,35 +56,17 @@ | |||
67 | #define REC_BASE_DIR "/" | 56 | #define REC_BASE_DIR "/" |
68 | #define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists" | 57 | #define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists" |
69 | 58 | ||
70 | #ifndef PLUGIN | ||
71 | static inline __attribute__((always_inline)) const char* get_user_file_path(const char *path, | ||
72 | unsigned flags, | ||
73 | char* buf, | ||
74 | const size_t bufsize) | ||
75 | { | ||
76 | if (flags & FORCE_BUFFER_COPY) | ||
77 | { | ||
78 | strlcpy(buf, path, bufsize); | ||
79 | return buf; | ||
80 | } | ||
81 | return path; | ||
82 | } | ||
83 | #endif | ||
84 | |||
85 | #define paths_init() | 59 | #define paths_init() |
86 | #else /* application */ | 60 | #else /* application */ |
87 | 61 | ||
88 | #define PLUGIN_DIR ROCKBOX_LIBRARY_PATH "/rockbox/rocks" | 62 | #define PLUGIN_DIR ROCKBOX_LIBRARY_PATH "/rocks" |
89 | #define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs" | 63 | #define CODECS_DIR ROCKBOX_LIBRARY_PATH "/codecs" |
90 | 64 | ||
91 | #define REC_BASE_DIR ROCKBOX_DIR "/" | 65 | #define REC_BASE_DIR ROCKBOX_DIR "/" |
92 | #define PLAYLIST_CATALOG_DEFAULT_DIR ROCKBOX_DIR "/Playlists" | 66 | #define PLAYLIST_CATALOG_DEFAULT_DIR ROCKBOX_DIR "/Playlists" |
93 | 67 | ||
94 | extern void paths_init(void); | 68 | extern void paths_init(void); |
95 | extern const char* get_user_file_path(const char *path, | 69 | |
96 | unsigned flags, | ||
97 | char* buf, | ||
98 | const size_t bufsize); | ||
99 | #endif /* APPLICATION */ | 70 | #endif /* APPLICATION */ |
100 | 71 | ||
101 | #define LANG_DIR ROCKBOX_DIR "/langs" | 72 | #define LANG_DIR ROCKBOX_DIR "/langs" |