else { src = malloc(size); if (src) memset(src, 0x0, size); } }
#define MS_SQL_SAFE_FREE(x) {if (x != NULL) {sqlite3_free(x); x = NULL; } }
-#define MS_STRING_VALID(str) ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
+#define MS_STRING_VALID(str) ((str != NULL && strlen(str) > 0) ? true : false)
#define SAFE_STRLCPY(dst, src, n) g_strlcpy(dst, src, n);
int media_db_update_db(sqlite3 *handle, const char *query_str);
if ((strcmp(iface, MS_MEDIA_DBUS_INTERFACE) == 0) && (strcmp(signal, MS_MEDIA_DBUS_NAME_INTERNAL) == 0))
return TRUE;
- return FALSE;
+ return false;
}
static void __get_message_internal(GVariant *message, db_update_cb user_cb, void *userdata)
ret = _check_dir_path(directory_path, uid);
MSAPI_RETV_IF(ret != MS_MEDIA_ERR_NONE, ret);
- if (recursive_on == TRUE)
+ if (recursive_on)
ret = __media_db_request_update_async(MS_MSG_DIRECTORY_SCANNING, storage_id, directory_path, user_callback, user_data, uid);
else
ret = __media_db_request_update_async(MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE, storage_id, directory_path, user_callback, user_data, uid);
#define MS_MALLOC(src, size) { if (size > SIZE_MAX || size <= 0) src = NULL; \
else { src = malloc(size); if (src) memset(src, 0x0, size); } }
#define MS_STRING_VALID(str) \
- ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
+ ((str != NULL && strlen(str) > 0) ? true : false)
#define SAFE_STRLCPY(dst, src, n) g_strlcpy(dst, src, n);
#define SAFE_STRLCAT(dst, src, n) g_strlcat(dst, src, n);
memset(&st, 0, sizeof(struct stat));
if (stat(path, &st) == 0) {
if ((st.st_mtime != modified_time) || (st.st_size != file_size))
- *modified = TRUE;
+ *modified = true;
else
- *modified = FALSE;
+ *modified = false;
}
}
{
int lib_index;
int ret = MS_MEDIA_ERR_NONE;
- bool modified = FALSE;
+ bool modified = false;
for (lib_index = 0; lib_index < lib_num; lib_index++) {
/*check exist in Media DB, If file is not exist, insert data in DB. */
if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
ret = ms_insert_item_batch(handle, storage_id, path, uid);
} else if (ret == MS_MEDIA_ERR_NONE) {
- if (modified == FALSE) {
+ if (!modified) {
/*if meta data of file exist, change valid field to "1" */
ret = ((SET_ITEM_VALIDITY)func_array[lib_index][eSET_VALIDITY])(storage_id, path, true, true, uid); /*dlopen*/
MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Error : %s [%s]", g_array_index(so_array, char*, lib_index), path);
{
int lib_index;
int ret = MS_MEDIA_ERR_NONE;
- bool modified = FALSE;
+ bool modified = false;
for (lib_index = 0; lib_index < lib_num; lib_index++) {
/*check exist in Media DB, If file is not exist, insert data in DB. */
if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
ret = ms_scan_item_batch(handle, storage_id, path, uid);
} else if (ret == MS_MEDIA_ERR_NONE) {
- if (modified == FALSE) {
+ if (!modified) {
/*if meta data of file exist, change valid field to "1" */
ret = ((SET_ITEM_VALIDITY)func_array[lib_index][eSET_VALIDITY])(storage_id, path, true, true, uid); /*dlopen*/
MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Error : %s [%s]", g_array_index(so_array, char*, lib_index), path);
else
strncpy(req_path, argv1, len);
}
- ret = dir_scan(req_path, FALSE);
+ ret = dir_scan(req_path, false);
if (ret != 0) {
printf("error : %d\n", ret);
exit(0);
strncpy(req_path, argv2, len);
}
- ret = dir_scan(req_path, TRUE);
+ ret = dir_scan(req_path, true);
if (ret != 0) {
printf("error : %d\n", ret);
exit(0);
int update_status = -1;
int remain_request = 0;
- bool status = FALSE;
+ bool status = false;
if (!ms_config_get_int(VCONFKEY_FILEMANAGER_DB_STATUS, &update_status))
MS_DBG_ERR("ms_config_get_int[VCONFKEY_FILEMANAGER_DB_STATUS]");
if (msc_get_dir_scan_status(&status) == MS_MEDIA_ERR_NONE) {
- if (status == TRUE)
+ if (status)
MS_DBG_WARN("Doing directory scanning");
- status = FALSE;
+ status = false;
}
if (msc_get_remain_extract_request(MS_EXTRACT_STORAGE, &remain_request) == MS_MEDIA_ERR_NONE) {
}
if (msc_get_dir_scan_status(&status) == MS_MEDIA_ERR_NONE) {
- if (status == true) {
+ if (status) {
MS_DBG_WARN("Doing directory extracting. Set cancel path");
msc_set_extract_cancel_path(mount_path);
}
- status = FALSE;
+ status = false;
}
return;
msc_remove_extract_request(extract_data);
goto STOP_DISC;
}
- if (extract_data->result == TRUE) {
- MS_DBG_WARN("extract_data->result == TRUE, MS_STORAGE_SCAN_COMPLETE");
+ if (extract_data->result) {
+ MS_DBG_WARN("extract_data->result is true, MS_STORAGE_SCAN_COMPLETE");
msc_del_extract_blocked_path(update_path);
ms_set_storage_scan_status(handle, extract_data->storage_id, MEDIA_EXTRACT_COMPLETE, uid);
__msc_set_storage_extract_status(MS_STORAGE_SCAN_COMPLETE);
goto STOP_SCAN;
}
- ms_batch_commit_disable(TRUE, TRUE, uid);
- ms_batch_commit_enable(TRUE, TRUE, FALSE, pid);
+ ms_batch_commit_disable(true, true, uid);
+ ms_batch_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);
//MS_DBG_ERR("storage_id = [%s]", storage_id);
ret = __msc_check_stop_status(scan_type, new_start_path, pid);
if (ret == MS_MEDIA_ERR_NONE) {
- msc_insert_exactor_request(scan_type, FALSE, storage_id, current_path, pid, uid, MS_ITEM_UPDATE);
+ msc_insert_exactor_request(scan_type, false, storage_id, current_path, pid, uid, MS_ITEM_UPDATE);
} else {
if (is_recursive == true)
ms_change_validity_item_batch(handle, storage_id, new_start_path, 1, 2, uid);
__msc_clear_file_list(dir_array);
- ms_batch_commit_disable(TRUE, TRUE, uid);
+ ms_batch_commit_disable(true, true, uid);
if (ret != MS_MEDIA_ERR_NONE) MS_DBG_INFO("ret : %d", ret);
scan_function = (scan_type == MS_MSG_STORAGE_ALL) ? ms_scan_item_batch : ms_scan_validate_item;
- ms_batch_commit_disable(TRUE, TRUE, uid);
+ ms_batch_commit_disable(true, true, uid);
/*start db update. the number of element in the array , db update is complete.*/
while (dir_array->len != 0) {
/*check poweroff status*/
if (ret != MS_MEDIA_ERR_NONE)
goto STOP_SCAN;
- /*ms_batch_commit_disable(handle, TRUE, TRUE, uid);*/
- ms_batch_commit_enable(TRUE, TRUE, FALSE, pid);
+ /*ms_batch_commit_disable(true, true, uid);*/
+ ms_batch_commit_enable(true, true, false, pid);
/* get the current path from directory array */
current_path = g_array_index(dir_array , char*, 0);
if (scan_count >= MAX_SCAN_COUNT) {
scan_count = 0;
//MS_DBG_ERR("storage_id = [%s]", storage_id);
- msc_insert_exactor_request(scan_type, FALSE, storage_id, current_path, 0, uid, MS_ITEM_UPDATE);
+ msc_insert_exactor_request(scan_type, false, storage_id, current_path, 0, uid, MS_ITEM_UPDATE);
}
}
} else if (d->d_type == DT_DIR) {
ms_insert_folder_end(uid);
/*commit to db before set scan done, fix timing issue storage scan, then folder scan for same folder*/
- ms_batch_commit_disable(TRUE, TRUE, uid);
+ ms_batch_commit_disable(true, true, uid);
ms_set_folder_scan_status(handle, storage_id, current_path, MS_DIR_SCAN_DONE, uid);
if (fd != -1) {
__msc_set_storage_scan_cur_path(NULL);
__msc_clear_file_list(dir_array);
- ms_batch_commit_disable(TRUE, TRUE, uid);
+ ms_batch_commit_disable(true, true, uid);
if (ret != MS_MEDIA_ERR_NONE) MS_DBG_INFO("ret : %d", ret);
sqlite3 *handle = NULL;
int scan_type;
char *storage_id = NULL;
- bool modified = FALSE;
+ bool modified = false;
ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
ms_dir_scan_status_e scan_status = MS_DIR_SCAN_NONE;
ms_noti_type_e noti_type = MS_ITEM_INSERT;
g_directory_scan_processing2 = DIR_SCAN_NON_RECURSIVE;
ms_check_folder_modified(handle, scan_data->msg, storage_id, &modified);
- if (modified == FALSE) {
+ if (!modified) {
MS_DBG_WARN("check [%.*s] has not been modified !!", MAX_MSG_SIZE, scan_data->msg);
ms_get_folder_scan_status(handle, storage_id, scan_data->msg, (int*)&scan_status);
MS_DBG_WARN("folder scan status = [%d]", scan_status);
MS_DBG_ERR("error : %d", err);
/*call for bundle commit*/
- ms_batch_commit_enable(TRUE, TRUE, FALSE, 0);
+ ms_batch_commit_enable(true, true, false, 0);
if (strcmp(scan_data->msg, MEDIA_ROOT_PATH_DISC) == 0) {
MS_DBG("[DATA DISC]");
ret = __msc_db_update(handle, storage_id, scan_data);
/*call for bundle commit*/
- ms_batch_commit_disable(TRUE, TRUE, uid);
+ ms_batch_commit_disable(true, true, uid);
MS_DBG_WARN("folder scan done, sent cb event path = [%.*s]", MAX_MSG_SIZE, scan_data->msg);
__msc_call_dir_scan_cb();
if (noti_type == MS_ITEM_DELETE) {
ms_send_dir_update_noti(scan_data->msg, folder_uuid, noti_type, scan_data->pid);
}
- msc_insert_exactor_request(scan_data->msg_type, TRUE, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, noti_type);
+ msc_insert_exactor_request(scan_data->msg_type, true, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, noti_type);
}
if (power_off2) {
MS_DBG_ERR("power off");
sqlite3 *handle = NULL;
ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
int scan_type;
- bool valid_status = TRUE;
+ bool valid_status = true;
char *update_path = NULL;
uid_t uid = MEDIA_DEFAULT_UID;
if (ret != MS_MEDIA_ERR_NONE) {
ms_set_storage_scan_status(handle, scan_data->storage_id, MEDIA_SCAN_STOP, uid);
MS_DBG_ERR("storage_id = [%s]", scan_data->storage_id);
- msc_insert_exactor_request(scan_type, TRUE, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
+ msc_insert_exactor_request(scan_type, true, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
goto NEXT;
}
msc_set_disc_stg_scan_status(true);
}
- valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL || MS_MSG_STORAGE_ALL == scan_type) ? TRUE : FALSE;
+ valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL || MS_MSG_STORAGE_ALL == scan_type) ? true : false;
if (scan_type != MS_MSG_STORAGE_INVALID)
- ms_batch_commit_enable(TRUE, valid_status, FALSE, 0);
+ ms_batch_commit_enable(true, valid_status, false, 0);
if (scan_type == MS_MSG_STORAGE_ALL) {
/* Delete all data before full scanning */
/*call for bundle commit*/
if (scan_type != MS_MSG_STORAGE_INVALID)
- ms_batch_commit_disable(TRUE, valid_status, uid);
+ ms_batch_commit_disable(true, valid_status, uid);
if (scan_type == MS_MSG_STORAGE_PARTIAL && ret == MS_MEDIA_ERR_NONE) {
/*delete invalid folder first, then delete invalid item, avoid to folder was deleted but item not when unmount*/
}
MS_DBG_WARN("storage_id = [%s]", scan_data->storage_id);
- msc_insert_exactor_request(scan_type, TRUE, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
+ msc_insert_exactor_request(scan_type, true, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, MS_ITEM_UPDATE);
NEXT:
msc_del_blocked_path();
sqlite3 *handle = NULL;
char *insert_path = NULL;
char storage_id[MS_UUID_SIZE] = {0,};
- bool power_off_status = FALSE;
+ bool power_off_status = false;
/* connect to media db, if conneting is failed, db updating is stopped */
err = ms_connect_db(&handle, uid);
/*start db updating */
/*call for bundle commit*/
- ms_batch_commit_enable(TRUE, FALSE, TRUE, pid);
+ ms_batch_commit_enable(true, false, true, pid);
MS_DBG_WARN("BULK REGISTER START");
}
/*call for bundle commit*/
- ms_batch_commit_disable(TRUE, FALSE, uid);
+ ms_batch_commit_disable(true, false, uid);
/*disconnect form media db*/
if (handle) ms_disconnect_db(handle);
{
ms_comm_msg_s *data = NULL;
- msc_set_power_status(TRUE);
+ msc_set_power_status(true);
if (scan_queue2) {
/*notify to scannig thread*/
extern GMutex scan_req_mutex2;
extern int g_directory_scan_processing2;
extern bool g_directory_extract_processing;
-bool power_off2; /*If this is TRUE, poweroff notification received*/
+bool power_off2; /*If this is true, poweroff notification received*/
static GMainLoop *scanner_mainloop2 = NULL;
if (err != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("error : %d", err);
- ms_set_folder_validity(handle, storage_id, start_path, 0, TRUE, scan_data->uid);
+ ms_set_folder_validity(handle, storage_id, start_path, 0, true, scan_data->uid);
MS_SAFE_FREE(start_path);
}
}
start_path = g_strdup(scan_data->msg);
- ms_batch_commit_enable(TRUE, TRUE, FALSE, 0);
+ ms_batch_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);
else
ret = __msc_dir_scan(handle, storage_id, start_path, true, is_recursive, scan_data->uid);
- ms_batch_commit_disable(TRUE, TRUE, scan_data->uid);
+ ms_batch_commit_disable(true, true, scan_data->uid);
if (!ms_delete_invalid_items(handle, storage_id, scan_data->uid))
MS_DBG_ERR("deleting invalid items in storage failed");
sqlite3 *handle = NULL;
ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
int scan_type;
- bool valid_status = TRUE;
+ bool valid_status = true;
char *update_path = NULL;
char *storage_id = NULL;
/*start db updating */
ms_set_db_status(MS_DB_UPDATING, storage_type);
- valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL) ? TRUE : FALSE;
- ms_batch_commit_enable(TRUE, valid_status, FALSE, 0);
+ valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL) ? true : false;
+ ms_batch_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);
ret = __msc_db_update(handle, storage_id, scan_data);
/*call for bundle commit*/
- ms_batch_commit_disable(TRUE, valid_status, scan_data->uid);
+ ms_batch_commit_disable(true, valid_status, scan_data->uid);
if (scan_type == MS_MSG_STORAGE_PARTIAL && ret == MS_MEDIA_ERR_NONE) {
if (!ms_delete_invalid_items(handle, storage_id, scan_data->uid))
/*start db updating */
/*call for bundle commit*/
- ms_batch_commit_enable(TRUE, FALSE, TRUE, pid);
+ ms_batch_commit_enable(true, false, true, pid);
MS_DBG_WARN("BULK REGISTER START[%d]", pid);
}
/*call for bundle commit*/
- ms_batch_commit_disable(TRUE, FALSE, uid);
+ ms_batch_commit_disable(true, false, uid);
/*disconnect form media db*/
if (handle) ms_disconnect_db(handle);
MS_DBG_ERR("THE SIZE OF MEDIA DB REACH THE LIMIT. RESET MEDIA DB.");
MS_DBG_ERR("[DB SIZE : %lf] [LIMIT1 : %lf] [LIMIT2 : %lf]", db_size, MEDIA_DB_SIZE_LIMIT_1, MEDIA_DB_SIZE_LIMIT_2);
__ms_remake_mediadb(uid);
- *is_reset = TRUE;
+ *is_reset = true;
}
return MS_MEDIA_ERR_NONE;
ms_sys_get_uid(&uid);
- if (media_db_connect(&db_handle, uid, FALSE) != MS_MEDIA_ERR_NONE) {
+ if (media_db_connect(&db_handle, uid, false) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("Failed to connect DB");
return MS_MEDIA_ERR_DB_CONNECT_FAIL;
}
#include "media-server-db.h"
static GMainLoop *g_db_mainloop = NULL;
-static bool db_thread_ready = FALSE;
+static bool db_thread_ready = false;
GMainLoop *ms_db_get_mainloop(void)
{
g_main_context_push_thread_default(context);
MS_DBG_INFO("Media Server DB thread is running");
- db_thread_ready = TRUE;
+ db_thread_ready = true;
g_main_loop_run(g_db_mainloop);
MS_DBG_INFO("Media Server DB thread is shutting down");
- db_thread_ready = FALSE;
+ db_thread_ready = false;
g_io_channel_shutdown(channel, FALSE, NULL);
g_io_channel_unref(channel);
/* update storage_id table set validity=0 first */
ms_validity_change_all_items(handle, mount_uuid, false, uid);
/*update folder table set validity = 0*/
- ms_set_folder_validity(handle, mount_uuid, storage_path, MS_INVALID, TRUE, uid);
+ ms_set_folder_validity(handle, mount_uuid, storage_path, MS_INVALID, true, uid);
/* update folder table set scan_status=0 first */
ms_set_folder_scan_status(handle, mount_uuid, NULL, MS_DIR_SCAN_NONE, uid);
MS_DBG_WARN("init storage data in DB end");
/* update storage_id table set validity=0 first */
ms_validity_change_all_items(handle, storage_id, false, uid);
/* update folder table set validity=0 first */
- ms_set_folder_validity(handle, storage_id, mount_path, MS_INVALID, TRUE, uid);
+ ms_set_folder_validity(handle, storage_id, mount_path, MS_INVALID, true, uid);
/* update folder table set scan_status=0 first */
ms_set_folder_scan_status(handle, storage_id, NULL, MS_DIR_SCAN_NONE, uid);
if (ms_validity_change_all_items(handle, device_id, false, uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("ms_validity_change_all_items failed");
/* folder validity set 0 under the start_path in folder table*/
- if (ms_set_folder_validity(handle, device_id, mount_path, MS_INVALID, TRUE, uid) != MS_MEDIA_ERR_NONE)
+ if (ms_set_folder_validity(handle, device_id, mount_path, MS_INVALID, true, uid) != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("set_folder_validity failed");
if (ms_get_scanner_status()) {
void ms_device_block_changed_cb(usb_device_h usb_device, char *action, void *user_data)
{
char *mount_path = NULL;
- bool is_reset = FALSE;
+ bool is_reset = false;
uid_t uid = MEDIA_DEFAULT_UID;
MS_DBG_WARN("usb_event_callback BEGIN[%s]", action);
ms_set_storage_validity(handle, storage_id, 1, uid);
/* update storage_id table set validity=0 first */
ms_validity_change_all_items(handle, storage_id, false, uid);
- ms_set_folder_validity(handle, storage_id, mounted_path, MS_INVALID, TRUE, uid);
+ ms_set_folder_validity(handle, storage_id, mounted_path, MS_INVALID, true, uid);
/* update folder table set scan_status=0 first */
ms_set_folder_scan_status(handle, storage_id, NULL, MS_DIR_SCAN_NONE, uid);
extern GMutex scanner_mutex;
GMainLoop *mainloop = NULL;
-bool power_off; /*If this is TRUE, poweroff notification received*/
+bool power_off; /*If this is true, poweroff notification received*/
#define SMARTHUB_RESET_VCONF "db/smarthub/reset/firstscreen"
bool smarthub_reset_start;
int thumb_pid = 0;
uid_t uid = MEDIA_DEFAULT_UID;
- if (power_off == FALSE) {
+ if (!power_off) {
if (!ms_config_get_int(SMARTHUB_RESET_VCONF, &status))
MS_DBG_ERR("Get VCONFKEY_SYSMAN_MMC_STATUS failed.");
MS_DBG_ERR("CURRENT STATUS OF SMARTHUB_RESET_VCONF[%d]", status);
- smarthub_reset = TRUE;
+ smarthub_reset = true;
if (status == 0) {
scanner_pid = ms_get_scanner_pid();
__ms_check_mediadb();
ms_config_set_int(MS_DB_RESET, 0);
MS_DBG_ERR("END SMART HUB RESET");
- smarthub_reset = FALSE;
+ smarthub_reset = false;
}
}
/* update storage_id table set validity=0 first */
ms_validity_change_all_items(handle, DATADISC_STORAGE_ID, false, uid);
/*update folder table set validity = 0*/
- ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, TRUE, uid);
+ ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, true, uid);
/* update folder table set scan_status=0 first */
ms_set_folder_scan_status(handle, DATADISC_STORAGE_ID, NULL, MS_DIR_SCAN_NONE, uid);
MS_DBG_WARN("init storage data in DB end");
GIOChannel *channel = (GIOChannel *)data;
- power_off = TRUE;
+ power_off = true;
/*Quit Thumbnail Thread*/
GMainLoop *thumb_mainloop = ms_get_thumb_thread_mainloop();
const char *chi = "zh";
const char *jpn = "ja";
const char *kor = "ko";
- bool need_update = FALSE;
+ bool need_update = false;
if (!ms_config_get_str(VCONFKEY_LANGSET, &lang)) {
MS_DBG_ERR("Get VCONFKEY_LANGSET failed.");
if (MS_STRING_VALID(priv_lang) && MS_STRING_VALID(lang)) {
if (strcmp(priv_lang, lang) == 0) {
- need_update = FALSE;
+ need_update = false;
} else if ((strncmp(lang, eng, strlen(eng)) == 0) ||
(strncmp(lang, chi, strlen(chi)) == 0) ||
(strncmp(lang, jpn, strlen(jpn)) == 0) ||
(strncmp(lang, kor, strlen(kor)) == 0)) {
- need_update = TRUE;
+ need_update = true;
} else {
if ((strncmp(priv_lang, eng, strlen(eng)) == 0) ||
(strncmp(priv_lang, chi, strlen(chi)) == 0) ||
(strncmp(priv_lang, jpn, strlen(jpn)) == 0) ||
(strncmp(priv_lang, kor, strlen(kor)) == 0)) {
- need_update = TRUE;
+ need_update = true;
}
}
} else {
- need_update = TRUE;
+ need_update = true;
}
- if (need_update == TRUE) {
+ if (need_update) {
uid_t uid = MEDIA_DEFAULT_UID;
ms_sys_get_uid(&uid);
ms_send_storage_scan_request(NULL, INTERNAL_STORAGE_ID, MS_SCAN_META, uid);
GThread *dcm_thread = NULL;
GIOChannel *channel = NULL;
bool is_dcm_supported = __ms_is_dcm_supported();
- power_off = FALSE;
+ power_off = false;
#ifdef _USE_TVPD_MODE
uid_t uid = MEDIA_DEFAULT_UID;
/* update storage_id table set validity=0 first */
ms_validity_change_all_items(handle, DATADISC_STORAGE_ID, false, uid);
/*update folder table set validity = 0*/
- ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, TRUE, uid);
+ ms_set_folder_validity(handle, DATADISC_STORAGE_ID, mnt_path, MS_INVALID, true, uid);
/* update folder table set scan_status=0 first */
ms_set_folder_scan_status(handle, DATADISC_STORAGE_ID, NULL, MS_DIR_SCAN_NONE, uid);
MS_DBG_WARN("init storage data in DB end");
static bool __ms_is_dcm_supported()
{
- bool isFaceRecognitionSupported = FALSE; /* face_recognition feature supported */
+ bool isFaceRecognitionSupported = false; /* face_recognition feature supported */
int dcm_service_mode = -1; /* media-content-config:dcm_activation */
const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.face_recognition", &isFaceRecognitionSupported);
if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
MS_DBG_ERR("SYSTEM_INFO_ERROR: vision.face_recognition [%d]", nRetVal);
- return FALSE;
+ return false;
}
dictionary *dict = NULL;
dict = iniparser_load(MS_INI_DEFAULT_PATH);
if (!dict) {
MS_DBG_ERR("%s load failed", MS_INI_DEFAULT_PATH);
- return -1;
+ return false;
}
dcm_service_mode = iniparser_getint(dict, "media-content-config:dcm_activation", 0);
iniparser_freedict(dict);
- return (isFaceRecognitionSupported && (dcm_service_mode == 1)) ? TRUE : FALSE;
+ return (isFaceRecognitionSupported && (dcm_service_mode == 1)) ? true : false;
}
ms_set_storage_validity(handle, storage_id, 1, uid);
/* update storage_id table set validity=0 first */
ms_validity_change_all_items(handle, storage_id, false, uid);
- ms_set_folder_validity(handle, storage_id, storage_path, MS_INVALID, TRUE, uid);
+ ms_set_folder_validity(handle, storage_id, storage_path, MS_INVALID, true, uid);
/* update folder table set scan_status=0 first */
ms_set_folder_scan_status(handle, storage_id, NULL, MS_DIR_SCAN_NONE, uid);
}
int send_msg = MS_MEDIA_ERR_NONE;
ms_peer_credentials creds;
- if (power_off == TRUE) {
+ if (power_off) {
MS_DBG_WARN("in the power off sequence");
return TRUE;
}
MS_SAFE_FREE(creds.smack);
MS_SAFE_FREE(creds.uid);
- if (media_db_connect(&db_handle, recv_msg.uid, TRUE) != MS_MEDIA_ERR_NONE) {
+ if (media_db_connect(&db_handle, recv_msg.uid, true) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("Failed to connect DB");
goto ERROR;
}
ms_peer_credentials creds;
while (1) {
- if (power_off == TRUE) {
+ if (power_off) {
MS_DBG_WARN("in the power off sequence");
break;
}
ret = media_db_update_db_batch_start(sql_query);
} else if (recv_msg.msg_type == MS_MSG_DB_UPDATE_BATCH_END) {
sqlite3 *db_handle = NULL;
- if (media_db_connect(&db_handle, recv_msg.uid, TRUE) != MS_MEDIA_ERR_NONE) {
+ if (media_db_connect(&db_handle, recv_msg.uid, true) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("Failed to connect DB");
send_msg = MS_MEDIA_ERR_DB_CONNECT_FAIL;
media_db_request_update_db_batch_clear();
if (close(client_sock) < 0)
MS_DBG_STRERROR("close failed");
- if (g_atomic_int_dec_and_test(&cur_running_task) == TRUE)
+ if (g_atomic_int_dec_and_test(&cur_running_task))
MS_DBG_INFO("There is no running task");
return;
if (close(client_sock) < 0)
MS_DBG_STRERROR("close failed");
- if (g_atomic_int_dec_and_test(&cur_running_task) == TRUE)
+ if (g_atomic_int_dec_and_test(&cur_running_task))
MS_DBG_INFO("There is no running task");
return;