-static bool storage_cb(int id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
-{
- int* tmp = (int*)user_data;
- if (type == STORAGE_TYPE_INTERNAL)
- {
- *tmp = id;
- return false;
- }
-
- return true;
-}
-
-static void setSpecialFolder(storage_directory_e type, const char* key)
-{
- int error;
- char* path = NULL;
- static int __storageId = -1;
-
- if (__storageId < 0) {
- error = storage_foreach_device_supported(storage_cb, &__storageId);
- if (error != STORAGE_ERROR_NONE) {
- return;
- }
- }
-
- error = storage_get_directory(__storageId, type, &path);
- if (error == STORAGE_ERROR_NONE && path != NULL) {
- setenv(key, const_cast<char *>(path), 1);
- free(path);
- }
-}
-