Remove unused plugin APIs 44/146944/1 submit/tizen/20170831.083004 submit/tizen_4.0/20170831.090918 submit/tizen_4.0/20170831.092908
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 31 Aug 2017 08:23:10 +0000 (17:23 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 31 Aug 2017 08:23:10 +0000 (17:23 +0900)
Removed API list

count_subfolder
delete_invalid_folder_by_path
get_folder_list
count_delete_items_in_folder
delete_all_invalid_items_in_folder

Change-Id: Ic15b9756c7f6da82ee55656fbeb9263994051972
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/include/media-common-db-svc.h
src/common/media-common-db-svc.c

index df0bf35..2ea9692 100755 (executable)
@@ -69,9 +69,6 @@ typedef int (*SET_ITEM_VALIDITY)(void *, const char *, const char *, int, int, u
 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 **);
@@ -102,9 +99,7 @@ typedef int (*UPDATE_ITEM_META)(void *, const char *, const char *, int, uid_t,
 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**);
@@ -124,10 +119,7 @@ bool ms_delete_all_items(void **handle, const char *storage_id, ms_storage_type_
 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);
@@ -153,9 +145,7 @@ int ms_delete_storage(void **handle, const char *storage_id, 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);
 
index 3484d1b..8e0bc62 100755 (executable)
@@ -56,12 +56,9 @@ enum func_list {
        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,
@@ -88,9 +85,7 @@ enum func_list {
        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,
@@ -169,12 +164,9 @@ int ms_load_functions(void)
                "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",
@@ -201,9 +193,7 @@ int ms_load_functions(void)
                "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",
@@ -686,24 +676,6 @@ int ms_set_folder_item_validity(void **handle, const char *storage_id, const cha
        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;
@@ -722,94 +694,6 @@ int ms_send_dir_update_noti(void **handle, const char* storage_id, const char*pa
        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;
@@ -1205,25 +1089,6 @@ int ms_update_meta_batch(void **handle, const char *path, const char *storage_id
        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;
@@ -1243,28 +1108,6 @@ int ms_check_folder_exist(void **handle, const char *storage_id, const char *fol
        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;