1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Thomas Martitz
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 #include "string-extra.h"
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)
41 /* name of directory where configuration, fonts and other data
45 #undef ROCKBOX_DIR_LEN
47 #define ROCKBOX_DIR "."
48 #define ROCKBOX_DIR_LEN 1
51 /* ROCKBOX_DIR is now defined in autoconf.h for flexible build types */
53 #error ROCKBOX_DIR not defined (should be in autoconf.h)
55 #define ROCKBOX_DIR_LEN (sizeof(ROCKBOX_DIR)-1)
56 #endif /* def __PCTOOL__ */
60 /* make sure both are the same for native builds */
61 #undef ROCKBOX_LIBRARY_PATH
62 #define ROCKBOX_LIBRARY_PATH ROCKBOX_DIR
64 #define PLUGIN_DIR ROCKBOX_DIR "/rocks"
65 #define CODECS_DIR ROCKBOX_DIR "/codecs"
67 #define REC_BASE_DIR "/"
68 #define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists"
71 static inline __attribute__((always_inline
)) const char* get_user_file_path(const char *path
,
76 if (flags
& FORCE_BUFFER_COPY
)
78 strlcpy(buf
, path
, bufsize
);
86 #else /* application */
88 #define PLUGIN_DIR ROCKBOX_LIBRARY_PATH "/rockbox/rocks"
89 #define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs"
91 #define REC_BASE_DIR ROCKBOX_DIR "/"
92 #define PLAYLIST_CATALOG_DEFAULT_DIR ROCKBOX_DIR "/Playlists"
94 extern void paths_init(void);
95 extern const char* get_user_file_path(const char *path
,
98 const size_t bufsize
);
99 #endif /* APPLICATION */
101 #define LANG_DIR ROCKBOX_DIR "/langs"
103 #define PLUGIN_GAMES_DIR PLUGIN_DIR "/games"
104 #define PLUGIN_APPS_DIR PLUGIN_DIR "/apps"
105 #define PLUGIN_DEMOS_DIR PLUGIN_DIR "/demos"
106 #define VIEWERS_DIR PLUGIN_DIR "/viewers"
109 #define WPS_DIR ROCKBOX_DIR "/wps"
110 #define SBS_DIR WPS_DIR
111 #define THEME_DIR ROCKBOX_DIR "/themes"
112 #define FONT_DIR ROCKBOX_DIR "/fonts"
113 #define ICON_DIR ROCKBOX_DIR "/icons"
115 #define BACKDROP_DIR ROCKBOX_DIR "/backdrops"
116 #define EQS_DIR ROCKBOX_DIR "/eqs"
118 /* need to fix this once the application gets record/radio abilities */
119 #define RECPRESETS_DIR ROCKBOX_DIR "/recpresets"
120 #define FMPRESET_PATH ROCKBOX_DIR "/fmpresets"
122 #define DIRCACHE_FILE ROCKBOX_DIR "/dircache.dat"
123 #define CODEPAGE_DIR ROCKBOX_DIR "/codepages"
125 #define VIEWERS_CONFIG ROCKBOX_DIR "/viewers.config"
126 #define CONFIGFILE ROCKBOX_DIR "/config.cfg"
127 #define FIXEDSETTINGSFILE ROCKBOX_DIR "/fixed.cfg"
129 #define PLAYLIST_CONTROL_FILE ROCKBOX_DIR "/.playlist_control"
130 #define NVRAM_FILE ROCKBOX_DIR "/nvram.bin"
131 #define GLYPH_CACHE_FILE ROCKBOX_DIR "/.glyphcache"
132 #endif /* __PATHS_H__ */