typedef int (*DELETE_ITEM)(void *, const char *, const char *, uid_t, char **);
typedef int (*DELETE_ALL_ITEMS_IN_STORAGE)(void *, const char *, int, uid_t, char **);
typedef int (*DELETE_ALL_INVALID_ITMES_IN_STORAGE)(void *, const char *, int, uid_t, char **);
-typedef int (*DELETE_ALL_INVALID_ITEMS_IN_FOLDER)(void *, const char *, const char *, bool, uid_t, char**);
-typedef int (*COUNT_DELETE_ITEMS_IN_FOLDER)(void *, const char *, const char *, int *, char **);
-typedef int (*GET_FOLDER_LIST)(void *, const char *, char *, char ***, int **, int *, char **);
typedef int (*UPDATE_FOLDER_TIME)(void *, const char *, const char *, uid_t, char **);
typedef int (*GET_STORAGE_ID)(void *, const char *, char *, uid_t uid, char **);
typedef int (*SET_STORAGE_SCAN_STATUS)(void *, const char *, int, uid_t, char **);
typedef int (*UPDATE_ITEM_BEGIN)(void *, int, char **);
typedef int (*UPDATE_ITEM_END)(void *, uid_t, char **);
-typedef int (*DELETE_INVALID_FOLDER_BY_PATH)(void *, const char *, const char *, uid_t, int *, char **);
typedef int (*CHECK_FOLDER_EXIST)(void*, const char*, const char*, char **);
-typedef int (*COUNT_SUBFOLDER)(void*, const char*, const char*, int *, char **);
typedef int (*GET_FOLDER_ID)(void *, const char *, const char *, char *, char **);
typedef int (*GET_EXTRACT_LIST)(void*, const char*, int, int, const char*, int, uid_t, void*, char**);
typedef int (*UPDATE_ONE_EXTRACT_ITEM)(void*, const char*, int, void*, int, char**);
int ms_validaty_change_all_items(void **handle, const char *storage_id, ms_storage_type_t storage_type, bool validity, uid_t uid);
bool ms_delete_invalid_items(void **handle, const char *storage_id, ms_storage_type_t storage_type, uid_t uid);
int ms_set_folder_item_validity(void **handle, const char *storage_id, const char *path, int validity, int recursive, uid_t uid);
-int ms_delete_invalid_items_in_folder(void **handle, const char *storage_id, const char *path, bool is_recursive, uid_t uid);
int ms_send_dir_update_noti(void **handle, const char *storage_id, const char *path, const char *folder_id, ms_noti_type_e noti_type, int pid);
-int ms_count_delete_items_in_folder(void **handle, const char *storage_id, const char *path, int *count);
-int ms_get_folder_list(void **handle, const char *storage_id, char *start_path, GArray **dir_array);
int ms_update_folder_time(void **handle, const char *storage_id, char *folder_path, uid_t uid);
int ms_get_storage_id(void **handle, const char *path, char *storage_id, uid_t uid);
int ms_set_storage_scan_status(void **handle, char *storage_id, media_scan_status_e scan_status, uid_t uid);
int ms_set_storage_validity(void **handle, const char *storage_id, int validity, uid_t uid);
int ms_set_all_storage_validity(void **handle, int validity, uid_t uid);
int ms_update_meta_batch(void **handle, const char *path, const char *storage_id, uid_t uid);
-int ms_delete_invalid_folder_by_path(void **handle, const char *storage_id, const char *folder_path, uid_t uid, int *delete_count);
int ms_check_folder_exist(void **handle, const char *storage_id, const char *folder_path);
-int ms_check_subfolder_count(void **handle, const char *storage_id, const char *folder_path, int *count);
int ms_get_folder_id(void **handle, const char *storage_id, const char *path, char **folder_id);
int ms_get_media_type(void **handle, const char *path, int *media_type);
eDELETE_ALL,
eDELETE_INVALID_ITEMS,
eSET_FOLDER_ITEM_VALIDITY,
- eDELETE_FOLDER,
eINSERT_BURST,
eSEND_DIR_UPDATE_NOTI,
- eCOUNT_DELETE_ITEMS_IN_FOLDER,
eDELETE_ITEM,
- eGET_FOLDER_LIST,
eUPDATE_FOLDER_TIME,
eGET_STORAGE_ID,
eSET_STORAGE_SCAN_STATUS,
eUPDATE_ITEM_META,
eUPDATE_ITEM_BEGIN,
eUPDATE_ITEM_END,
- eDELETE_INVALID_FOLDER_BY_PATH,
eCHECK_FOLDER_EXIST,
- eCOUNT_SUBFOLDER,
eGET_FOLDER_ID,
eGET_MEDIA_TYPE,
eGET_EXTRACT_LIST,
"delete_all_items_in_storage",
"delete_all_invalid_items_in_storage",
"set_folder_item_validity",
- "delete_all_invalid_items_in_folder",
"insert_burst_item",
"send_dir_update_noti",
- "count_delete_items_in_folder",
"delete_item",
- "get_folder_list",
"update_folder_time",
"get_storage_id",
"set_storage_scan_status",
"update_item_meta",
"update_item_begin",
"update_item_end",
- "delete_invalid_folder_by_path",
"check_folder_exist",
- "count_subfolder",
"get_folder_id",
"get_media_type",
"get_extract_list",
return MS_MEDIA_ERR_NONE;
}
-int ms_delete_invalid_items_in_folder(void **handle, const char* storage_id, const char*path, bool is_recursive, uid_t uid)
-{
- int lib_index;
- int ret;
- char *err_msg = NULL;
-
- for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((DELETE_ALL_INVALID_ITEMS_IN_FOLDER)func_array[lib_index][eDELETE_FOLDER])(handle[lib_index], storage_id, path, is_recursive, uid, &err_msg); /*dlopen*/
- if (ret != 0) {
- MS_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg);
- MS_SAFE_FREE(err_msg);
- return MS_MEDIA_ERR_DB_UPDATE_FAIL;
- }
- }
-
- return MS_MEDIA_ERR_NONE;
-}
-
int ms_send_dir_update_noti(void **handle, const char* storage_id, const char*path, const char*folder_id, ms_noti_type_e noti_type, int pid)
{
int lib_index;
return MS_MEDIA_ERR_NONE;
}
-int ms_count_delete_items_in_folder(void **handle, const char *storage_id, const char*path, int *count)
-{
- int lib_index;
- int ret;
- char *err_msg = NULL;
-
- for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((COUNT_DELETE_ITEMS_IN_FOLDER)func_array[lib_index][eCOUNT_DELETE_ITEMS_IN_FOLDER])(handle[lib_index], storage_id, path, count, &err_msg); /*dlopen*/
- if (ret != 0) {
- MS_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg);
- MS_SAFE_FREE(err_msg);
- return MS_MEDIA_ERR_INTERNAL;
- }
- }
-
- return MS_MEDIA_ERR_NONE;
-}
-
-int ms_get_folder_list(void **handle, const char* storage_id, char* start_path, GArray **dir_array)
-{
- int lib_index;
- int ret;
- char *err_msg = NULL;
-
- char **folder_list = NULL;
- int *modified_time_list = NULL;
- int count = 0;
- int i = 0;
-
- ms_dir_info_s* dir_info = NULL;
- MS_DBG("start path: %s", start_path);
-
- for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((GET_FOLDER_LIST)func_array[lib_index][eGET_FOLDER_LIST])(handle[lib_index], storage_id, start_path, &folder_list, &modified_time_list, &count, &err_msg); /*dlopen*/
- if (ret != 0) {
- MS_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg);
- MS_SAFE_FREE(err_msg);
- return MS_MEDIA_ERR_INTERNAL;
- }
- }
-
- *dir_array = g_array_new(FALSE, FALSE, sizeof(ms_dir_info_s*));
- if (count != 0) {
- for (i = 0; i < count; i++) {
- dir_info = malloc(sizeof(ms_dir_info_s));
- if (dir_info != NULL) {
- dir_info->dir_path = strdup(folder_list[i]);
- dir_info->modified_time = modified_time_list[i];
- g_array_append_val(*dir_array, dir_info);
- } else {
- MS_DBG_ERR("malloc failed");
- ret = MS_MEDIA_ERR_OUT_OF_MEMORY;
- goto ERROR;
- }
- }
- }
-
- for (i = 0; i < count; i++) {
- MS_SAFE_FREE(folder_list[i]);
- }
-
- MS_SAFE_FREE(folder_list);
- MS_SAFE_FREE(modified_time_list);
-
- return MS_MEDIA_ERR_NONE;
-ERROR:
-
- if (*dir_array) {
- while ((*dir_array)->len != 0) {
- ms_dir_info_s *data = NULL;
- data = g_array_index(*dir_array , ms_dir_info_s*, 0);
- g_array_remove_index(*dir_array, 0);
- MS_SAFE_FREE(data->dir_path);
- }
- g_array_free(*dir_array, FALSE);
- *dir_array = NULL;
- }
-
- for (i = 0; i < count; i++) {
- MS_SAFE_FREE(folder_list[i]);
- }
-
- MS_SAFE_FREE(folder_list);
- MS_SAFE_FREE(modified_time_list);
-
- return ret;
-}
-
int ms_update_folder_time(void **handle, const char *storage_id, char *folder_path, uid_t uid)
{
int lib_index;
return res;
}
-int ms_delete_invalid_folder_by_path(void **handle, const char *storage_id, const char *folder_path, uid_t uid, int *delete_count)
-{
- int lib_index;
- int res = MS_MEDIA_ERR_NONE;
- int ret;
- char *err_msg = NULL;
-
- for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((DELETE_INVALID_FOLDER_BY_PATH)func_array[lib_index][eDELETE_INVALID_FOLDER_BY_PATH])(handle[lib_index], storage_id, folder_path, uid, delete_count, &err_msg); /*dlopen*/
- if (ret != 0) {
- MS_DBG_ERR("error : %s [%s] %s", g_array_index(so_array, char*, lib_index), err_msg, storage_id);
- MS_SAFE_FREE(err_msg);
- res = MS_MEDIA_ERR_DB_INSERT_FAIL;
- }
- }
-
- return res;
-}
-
int ms_check_folder_exist(void **handle, const char *storage_id, const char *folder_path)
{
int lib_index;
return res;
}
-int ms_check_subfolder_count(void **handle, const char *storage_id, const char *folder_path, int *count)
-{
- int lib_index;
- int res = MS_MEDIA_ERR_NONE;
- int ret;
- int cnt = 0;
- char *err_msg = NULL;
-
- for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((COUNT_SUBFOLDER)func_array[lib_index][eCOUNT_SUBFOLDER])(handle[lib_index], storage_id, folder_path, &cnt, &err_msg); /*dlopen*/
- if (ret != 0) {
- MS_DBG_ERR("error : %s [%s] %s", g_array_index(so_array, char*, lib_index), err_msg, storage_id);
- MS_SAFE_FREE(err_msg);
- res = MS_MEDIA_ERR_DB_INSERT_FAIL;
- }
- }
-
- *count = cnt;
-
- return res;
-}
-
int ms_get_folder_id(void **handle, const char *storage_id, const char *path, char **folder_id)
{
int lib_index;