#include "media-util-db.h"
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-
#define MS_SAFE_FREE(src) { if (src) {free(src); src = NULL; } }
#define MS_MALLOC(src, size) { if (size > SIZE_MAX || size <= 0) src = NULL; \
else { src = malloc(size); if (src) memset(src, 0x0, size); } }
} ms_stg_info_s;
typedef enum {
- MS_NOTI_SWITCH_ON = 0,
- MS_NOTI_SWITCH_OFF = 1,
-} ms_noti_switch_e;
-
-typedef enum {
MS_ITEM_INSERT = 0,
MS_ITEM_DELETE = 1,
MS_ITEM_UPDATE = 2,
} ms_noti_type_e;
typedef int (*CLEANUP_DB)(sqlite3*, uid_t);
-typedef int (*INSERT_ITEM_BEGIN)(int, int, int);
+typedef int (*INSERT_ITEM_BEGIN)(int, bool, int);
typedef int (*INSERT_ITEM_END)(uid_t);
typedef int (*SET_ITEM_VALIDITY_BEGIN)(int);
typedef int (*SET_ITEM_VALIDITY_END)(uid_t);
bool ms_check_support_media_type(const char *path);
/* FOR BULK COMMIT */
-void ms_register_start(ms_noti_switch_e noti_status, int pid);
+void ms_register_start(bool noti_status, int pid);
void ms_register_end(uid_t uid);
void ms_validate_start();
void ms_validate_end(uid_t uid);
}
/* FOR BULK COMMIT */
-void ms_register_start(ms_noti_switch_e noti_status, int pid)
+void ms_register_start(bool noti_status, int pid)
{
int lib_index;
int ret = MS_MEDIA_ERR_NONE;
}
ms_bacth_commit_disable(TRUE, TRUE, uid);
- ms_bacth_commit_enable(TRUE, TRUE, MS_NOTI_SWITCH_OFF, pid);
+ ms_bacth_commit_enable(TRUE, TRUE, FALSE, pid);
/* get the current path from directory array */
current_path = g_array_index(dir_array , char*, 0);
g_array_remove_index(dir_array, 0);
goto STOP_SCAN;
/*ms_bacth_commit_disable(handle, TRUE, TRUE, uid);*/
- ms_bacth_commit_enable(TRUE, TRUE, MS_NOTI_SWITCH_OFF, pid);
+ ms_bacth_commit_enable(TRUE, TRUE, FALSE, pid);
/* get the current path from directory array */
current_path = g_array_index(dir_array , char*, 0);
MS_DBG_ERR("error : %d", err);
/*call for bundle commit*/
- ms_bacth_commit_enable(TRUE, TRUE, MS_NOTI_SWITCH_OFF, 0);
+ ms_bacth_commit_enable(TRUE, TRUE, FALSE, 0);
if (strcmp(scan_data->msg, MEDIA_ROOT_PATH_DISC) == 0) {
MS_DBG("[DATA DISC]");
valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL || MS_MSG_STORAGE_ALL == scan_type) ? TRUE : FALSE;
if (scan_type != MS_MSG_STORAGE_INVALID)
- ms_bacth_commit_enable(TRUE, valid_status, MS_NOTI_SWITCH_OFF, 0);
+ ms_bacth_commit_enable(TRUE, valid_status, FALSE, 0);
if (scan_type == MS_MSG_STORAGE_ALL) {
/* Delete all data before full scanning */
/*start db updating */
/*call for bundle commit*/
- ms_bacth_commit_enable(TRUE, FALSE, MS_NOTI_SWITCH_ON, pid);
+ ms_bacth_commit_enable(TRUE, FALSE, TRUE, pid);
MS_DBG_WARN("BULK REGISTER START");
}
start_path = g_strdup(scan_data->msg);
- ms_bacth_commit_enable(TRUE, TRUE, MS_NOTI_SWITCH_OFF, 0);
+ ms_bacth_commit_enable(TRUE, TRUE, FALSE, 0);
if (noti_type == MS_ITEM_INSERT)
ret = __msc_dir_scan(handle, storage_id, start_path, false, is_recursive, scan_data->uid);
ms_set_db_status(MS_DB_UPDATING, storage_type);
valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL) ? TRUE : FALSE;
- ms_bacth_commit_enable(TRUE, valid_status, MS_NOTI_SWITCH_OFF, 0);
+ ms_bacth_commit_enable(TRUE, valid_status, FALSE, 0);
if (scan_type == MS_MSG_STORAGE_PARTIAL) {
ret = ms_validity_change_all_items(handle, storage_id, false, scan_data->uid);
/*start db updating */
/*call for bundle commit*/
- ms_bacth_commit_enable(TRUE, FALSE, MS_NOTI_SWITCH_ON, pid);
+ ms_bacth_commit_enable(TRUE, FALSE, TRUE, pid);
MS_DBG_WARN("BULK REGISTER START[%d]", pid);