summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/rbpaths.h35
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
71static 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
94extern void paths_init(void); 68extern void paths_init(void);
95extern 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"