#include <string.h>
#include <errno.h>
#include <vconf.h>
+#include <tzplatform_config.h>
#include "common.h"
#include "list.h"
#include "log.h"
#include "storage-external.h"
-const char *dir_path[STORAGE_DIRECTORY_MAX] = {
- [STORAGE_DIRECTORY_IMAGES] = "Images",
- [STORAGE_DIRECTORY_SOUNDS] = "Sounds",
- [STORAGE_DIRECTORY_VIDEOS] = "Videos",
- [STORAGE_DIRECTORY_CAMERA] = "DCIM",
- [STORAGE_DIRECTORY_DOWNLOADS] = "Downloads",
- [STORAGE_DIRECTORY_MUSIC] = "Music",
- [STORAGE_DIRECTORY_DOCUMENTS] = "Documents",
- [STORAGE_DIRECTORY_OTHERS] = "Others",
- [STORAGE_DIRECTORY_SYSTEM_RINGTONES] = "",
+const char *dir_path[STORAGE_DIRECTORY_MAX];
+
+const int tz_id[STORAGE_DIRECTORY_MAX] = {
+ [STORAGE_DIRECTORY_IMAGES] = TZ_USER_IMAGES,
+ [STORAGE_DIRECTORY_SOUNDS] = TZ_USER_SOUNDS,
+ [STORAGE_DIRECTORY_VIDEOS] = TZ_USER_VIDEOS,
+ [STORAGE_DIRECTORY_CAMERA] = TZ_USER_CAMERA,
+ [STORAGE_DIRECTORY_DOWNLOADS] = TZ_USER_DOWNLOADS,
+ [STORAGE_DIRECTORY_MUSIC] = TZ_USER_MUSIC,
+ [STORAGE_DIRECTORY_DOCUMENTS] = TZ_USER_DOCUMENTS,
+ [STORAGE_DIRECTORY_OTHERS] = TZ_USER_OTHERS,
};
static dd_list *st_int_head; /* Internal storage list */
return STORAGE_ERROR_NONE;
}
+
+static void __CONSTRUCTOR__ init(void)
+{
+ const char *tmp;
+ char *token;
+ int i;
+
+ for (i = 0 ; i <= STORAGE_DIRECTORY_OTHERS ; i++) {
+ tmp = tzplatform_getenv(tz_id[i]);
+ if (tmp != NULL) {
+ token = rindex(tmp, '/');
+ if (token != NULL) {
+ token++;
+ dir_path[i] = strdup(token);
+ }
+ }
+ }
+}