ctsvc_mutex_unlock(CTS_MUTEX_HANDLE);
if (NULL == contact) {
+ /* LCOV_EXCL_START */
ret = _client_handle_get_key(ctsvc_client_get_pid(), key, sizeof(key));
RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "_client_handle_get_key() Fail(%d)", ret);
contact = g_hash_table_lookup(_ctsvc_handle_table, key);
ctsvc_mutex_unlock(CTS_MUTEX_HANDLE);
RETVM_IF(NULL == contact, CONTACTS_ERROR_NO_DATA, "g_hash_table_lookup(%s) Fail", key);
+ /* LCOV_EXCL_STOP */
}
*p_contact = contact;
return CONTACTS_ERROR_NONE;
if (0 == base->connection_count) {
ret = ctsvc_ipc_connect(contact, ctsvc_client_get_pid());
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_connect() Fail(%d)", ret);
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
base->connection_count++;
if (0 == _ctsvc_connection) {
ret = ctsvc_socket_init();
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_socket_init() Fail(%d)", ret);
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = ctsvc_inotify_init();
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_inotify_init() Fail(%d)", ret);
ctsvc_socket_final();
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
ctsvc_view_uri_init();
} else {
if (1 == base->connection_count) {
ret = ctsvc_ipc_disconnect(contact, ctsvc_client_get_pid(), _ctsvc_connection);
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
ERR("ctsvc_ipc_disconnect() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ctsvc_inotify_unsubscribe_ipc_ready();
}
} else if (1 < _ctsvc_connection) {
DBG("connection count is %d", _ctsvc_connection);
} else {
+ /* LCOV_EXCL_START */
DBG("call contacts_connect(), connection count is %d", _ctsvc_connection);
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return CONTACTS_ERROR_DB;
+ /* LCOV_EXCL_STOP */
}
_ctsvc_connection--;
if (0 == base->connection_count) {
ret = ctsvc_ipc_connect(contact, ctsvc_client_get_tid());
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_connect() Fail(%d)", ret);
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
base->connection_count++;
if (0 == _ctsvc_connection_on_thread) {
ret = ctsvc_socket_init();
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_socket_init() Fail(%d)", ret);
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = ctsvc_inotify_init();
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_inotify_init() Fail(%d)", ret);
ctsvc_socket_final();
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
ctsvc_view_uri_init();
} else if (0 < _ctsvc_connection_on_thread) {
ret = ctsvc_ipc_disconnect(contact, ctsvc_client_get_tid(),
_ctsvc_connection_on_thread);
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_disconnect() Fail(%d)", ret);
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
ctsvc_inotify_unsubscribe_ipc_ready();
}
} else if (1 < _ctsvc_connection_on_thread) {
DBG("connection count is %d", _ctsvc_connection_on_thread);
} else {
+ /* LCOV_EXCL_START */
DBG("call contacts_connect_on_thread(), connection count is %d",
_ctsvc_connection_on_thread);
ctsvc_mutex_unlock(CTS_MUTEX_CONNECTION);
return CONTACTS_ERROR_DB;
+ /* LCOV_EXCL_STOP */
}
_ctsvc_connection_on_thread--;
ret = sd_pid_get_slice(getpid(), &slice);
if (0 <= ret && slice) {
if (STRING_EQUAL == strncmp(slice, CTSVC_SYSTEM_SLICE, strlen(CTSVC_SYSTEM_SLICE))) {
+ /* LCOV_EXCL_START */
free(slice);
return TRUE;
+ /* LCOV_EXCL_STOP */
}
} else {
+ /* LCOV_EXCL_START */
ERR("sd_pid_get_slice() Fail(%d)", ret);
+ /* LCOV_EXCL_STOP */
}
free(slice);
return FALSE;
}
+/* LCOV_EXCL_START */
int ctsvc_client_get_active_uid(uid_t *uid)
{
int active_user_count = 0;
free(active_user_list);
return CONTACTS_ERROR_NONE;
}
+/* LCOV_EXCL_STOP */
info->size = size;
info->ret = CONTACTS_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("transform_run() Fail(%d)", error);
info->ret = CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
media_packet_destroy(*dst);
g_mutex_lock(&info->mutex);
g_mutex_unlock(&info->mutex);
g_mutex_clear(&info->mutex);
g_cond_clear(&info->cond);
+ free(info);
return CONTACTS_ERROR_SYSTEM;
/* LCOV_EXCL_STOP */
}
end_time = g_get_monotonic_time() + 4000 * G_TIME_SPAN_MILLISECOND;
if (!g_cond_wait_until(&info->cond, &info->mutex, end_time)) {
/* timeout has passed */
+ /* LCOV_EXCL_START */
ERR("g_cond_wait_until() return FALSE");
info->ret = CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
g_mutex_unlock(&info->mutex);
g_mutex_clear(&info->mutex);
*path = ctsvc_inotify_makepath(file);
if (NULL == *path) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_inotify_makepath() fail");
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
struct socket_init_noti_info *noti_info = NULL;
if (NULL == noti_path) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_inotify_makepath() fail");
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
if (NULL == _ctsvc_socket_init_noti_table)
struct socket_init_noti_info *noti_info = NULL;
if (NULL == noti_path) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_inotify_makepath() fail");
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
noti_info = g_hash_table_lookup(_ctsvc_socket_init_noti_table, noti_path);
ret = __ctsvc_noti_get_file_path(view_uri, &path);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_noti_get_file_path() fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
wd = __ctsvc_inotify_get_wd(__inoti_fd, path);
ret = __ctsvc_noti_get_file_path(view_uri, &path);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_noti_get_file_path() fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
wd = __ctsvc_inotify_get_wd(__inoti_fd, path);
return inotify_rm_watch(__inoti_fd, wd);
}
+ /* LCOV_EXCL_START */
ret = __ctsvc_inotify_watch(__inoti_fd, path);
free(path);
return ret;
+ /* LCOV_EXCL_STOP */
}
static void __clear_nslot_list(gpointer data, gpointer user_data)
int ret = getpwuid_r(uid, &pwd, tmp, sizeof(tmp), &pwd_result);
if (ret != 0 || pwd_result == NULL) {
+ /* LCOV_EXCL_START */
ERR("getpwuid_r() fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
return SAFE_STRDUP(pwd.pw_name);
#ifdef _CONTACTS_IPC_CLIENT
if (ctsvc_client_is_in_system_session()) {
+ /* LCOV_EXCL_START */
if (CONTACTS_ERROR_NONE != ctsvc_client_get_active_uid(&uid))
return NULL;
+ /* LCOV_EXCL_STOP */
}
#endif
if (user_name) {
snprintf(path, path_len, CTSVC_NOTI_PATH"/%s", user_name, file);
} else {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_inotify_get_username() fail");
free(path);
return NULL;
+ /* LCOV_EXCL_STOP */
}
free(user_name);
if (src->properties_flags) {
dest->properties_flags = calloc(dest->property_max_count, sizeof(char));
if (NULL == dest->properties_flags) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (dest->properties_flags)
memcpy(dest->properties_flags, src->properties_flags, sizeof(char)*dest->property_max_count);
int ret = ctsvc_record_copy_base(&(out_data->base), &(src_data->base));
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_record_copy_base() Fail");
__ctsvc_group_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
*out = group->addressbook_id;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(group)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*out_str = GET_STR(copy, group->extra_data);
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(group)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
group->addressbook_id = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(group)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
FREEandSTRDUP(group->extra_data, str);
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(group)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*value = group->is_read_only;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(group)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
group->is_read_only = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(group)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
int ret = ctsvc_record_copy_base(&(out_data->base), &(src_data->base));
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_record_copy_base() Fail");
__ctsvc_person_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
*out = person->snippet_type;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(person)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(person)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*out_str = GET_STR(copy, person->snippet_string);
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(person)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*value = person->has_email;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(company)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
person->snippet_type = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(0x%0x) is not supported in value(person)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
FREEandSTRDUP(person->snippet_string, str);
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(person)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
person->is_favorite = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(person)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
int ret = ctsvc_record_copy_base(&(out_data->base), &(src_data->base));
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_record_copy_base() Fail");
__ctsvc_phonelog_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
*out = phonelog->sim_slot_no;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(phonelog)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*out_str = GET_STR(copy, phonelog->extra_data2);
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(phonelog)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
phonelog->sim_slot_no = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(phonelog)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
FREEandSTRDUP(phonelog->extra_data2, str);
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(phonelog)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
ctsvc_result_value_s *src = cursor->data;
ctsvc_result_value_s *dest = calloc(1, sizeof(ctsvc_result_value_s));
if (NULL == dest) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
__ctsvc_result_destroy((contacts_record_h)out_data, true);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
dest->property_id = src->property_id;
int ret = ctsvc_record_copy_base(&(out_data->base), &(src_data->base));
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_record_copy_base() Fail");
__ctsvc_result_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
data = calloc(1, sizeof(ctsvc_result_value_s));
if (NULL == data) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
data->property_id = property_id;
data->type = CTSVC_VIEW_DATA_TYPE_INT;
data->value.b = value;
return CONTACTS_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("use another get_type API, (type : %d)", data->type);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
data = calloc(1, sizeof(ctsvc_result_value_s));
if (NULL == data) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
data->property_id = property_id;
data->type = CTSVC_VIEW_DATA_TYPE_BOOL;
str_len = strlen(CTSVC_CONTACT_IMG_FULL_LOCATION) + strlen(str) + 2;
full_path = calloc(1, str_len);
if (NULL == full_path) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
snprintf(full_path, str_len, "%s/%s", CTSVC_CONTACT_IMG_FULL_LOCATION, str);
}
data = calloc(1, sizeof(ctsvc_result_value_s));
if (NULL == data) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
data->property_id = property_id;
data->type = CTSVC_VIEW_DATA_TYPE_STR;
str_len = strlen(CTSVC_CONTACT_IMG_FULL_LOCATION) + strlen(str) + 2;
full_path = calloc(1, str_len);
if (NULL == full_path) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
free(data);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
snprintf(full_path, str_len, "%s/%s", CTSVC_CONTACT_IMG_FULL_LOCATION, str);
}
*out_value = data->value.b;
return CONTACTS_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("use another get_type API, (type : %d)", data->type);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
int ret = ctsvc_record_copy_base(&(out_data->base), &(src_data->base));
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_record_copy_base() Fail");
__ctsvc_sdn_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
return CONTACTS_ERROR_NONE;
}
+/* Can't find the SIM include SDN */
+/* LCOV_EXCL_START */
static int __ctsvc_sdn_get_int(contacts_record_h record, unsigned int property_id, int *out)
{
ctsvc_sdn_s *sdn = (ctsvc_sdn_s*)record;
}
return CONTACTS_ERROR_NONE;
}
+/* LCOV_EXCL_STOP */
int ret = ctsvc_record_copy_base(&(out_data->base), &(src_data->base));
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_record_copy_base() Fail");
__ctsvc_speeddial_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
*out = speeddial->person_id;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(speeddial)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*out_str = GET_STR(copy, speeddial->label);
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(speeddial)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
speeddial->number_id = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(speeddial)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
FREEandSTRDUP(speeddial->label, str);
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(speeddial)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
int ret = ctsvc_record_copy_base(&(out_data->base), &(src_data->base));
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_record_copy_base() Fail");
__ctsvc_updated_info_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
*out = updated_info->last_changed_type;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(updated_info)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
updated_info->last_changed_type = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(updated_info)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*out = updated_info->image_changed;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(updated_info)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
updated_info->image_changed = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("This field(%d) is not supported in value(updated_info)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
#ifdef _CONTACTS_IPC_CLIENT
if (ctsvc_client_is_in_system_session()) {
+ /* LCOV_EXCL_START */
if (CONTACTS_ERROR_NONE != ctsvc_client_get_active_uid(&uid))
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
#endif
ret = connect(__ctsvc_sockfd, (struct sockaddr *)&caddr, sizeof(caddr));
if (-1 == ret) {
+ /* LCOV_EXCL_START */
ERR("connect() Fail(errno = %d)", errno);
close(__ctsvc_sockfd);
__ctsvc_sockfd = -1;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
__ctsvc_conn_refcnt++;
g_free(buf_image);
if (len < 0) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_vcard_append_str() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
}
return len;
ret = ctsvc_image_util_get_mimetype(colorspace, &mimetype);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
info->ret = CONTACTS_ERROR_SYSTEM;
return true;
+ /* LCOV_EXCL_STOP */
}
ret = image_util_decode_jpeg(info->src, colorspace, (unsigned char **)&buffer,
&width, &height, &size_decode);
if (IMAGE_UTIL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
info->ret = CONTACTS_ERROR_SYSTEM;
return true;
+ /* LCOV_EXCL_STOP */
}
size = (uint64_t)size_decode;
fmt = ctsvc_image_util_create_media_format(mimetype, width, height);
if (NULL == fmt) {
+ /* LCOV_EXCL_START */
ERR("_ctsvc_image_create_media_format() Fail");
info->ret = CONTACTS_ERROR_SYSTEM;
free(buffer);
return false;
+ /* LCOV_EXCL_STOP */
}
packet = ctsvc_image_util_create_media_packet(fmt, buffer, (unsigned int)size);
if (NULL == packet) {
+ /* LCOV_EXCL_START */
ERR("_ctsvc_image_create_media_packet() Fail");
media_format_unref(fmt);
info->ret = CONTACTS_ERROR_SYSTEM;
free(buffer);
return false;
+ /* LCOV_EXCL_STOP */
}
ret = ctsvc_image_util_resize(packet, resized_width, resized_height, &buffer_temp,
CTSVC_IMAGE_ENCODE_QUALITY, info->image, info->image_size);
free(buffer);
if (IMAGE_UTIL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("image_util_encode_jpeg_to_memory", ret);
info->ret = CONTACTS_ERROR_SYSTEM;
return false;
+ /* LCOV_EXCL_STOP */
}
info->ret = CONTACTS_ERROR_NONE;
img_buf_size = CTSVC_VCARD_PHOTO_MAX_SIZE * sizeof(unsigned char);
image = calloc(1, img_buf_size);
if (NULL == image) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
fd = open(data->path, O_RDONLY);
if (fd < 0) {
+ /* LCOV_EXCL_START */
ERR("System : Open Fail(%d)", errno);
free(image);
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
read_len = 0;
}
close(fd);
if (ret < 0) {
+ /* LCOV_EXCL_START */
ERR("System : read() Fail(%d)", errno);
free(image);
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
}
g_free(buf_image);
if (len < 0) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_vcard_append_str() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
}
}
buf = calloc(1, buf_size);
if (NULL == buf) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_start_vcard_3_0(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_contact(contact, &buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_end_vcard(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_add_folding(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
*vcard_stream = buf;
buf = calloc(1, buf_size);
if (NULL == buf) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_start_vcard_3_0(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_my_profile(my_profile, &buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_end_vcard(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_add_folding(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
*vcard_stream = buf;
buf = calloc(1, buf_size);
if (NULL == buf) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_start_vcard_3_0(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_person(person, list_contacts, &buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_append_end_vcard(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len = __ctsvc_vcard_add_folding(&buf, &buf_size, len);
if (len < 0) {
+ /* LCOV_EXCL_START */
free(buf);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
*vcard_stream = buf;
fd = open(dest, O_WRONLY|O_CREAT|O_TRUNC, 0660);
if (fd < 0) {
+ /* LCOV_EXCL_START */
g_free(buf);
ERR("System : open Fail(%d)", errno);
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
while (0 < size) {
fd = open(dest, O_WRONLY|O_CREAT|O_TRUNC, 0660);
if (fd < 0) {
+ /* LCOV_EXCL_START */
g_free(buf);
ERR("System : open Fail(%d)", errno);
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
while (0 < size) {
if (base64_encoded) {
char *temp = __ctsvc_vcard_decode_base64_val(val);
if (NULL == temp) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_vcard_decode_base64_val() Fail");
free(prefix);
free(val);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
free(val);
val = temp;
static int _ctsvc_safe_add(unsigned int *total, unsigned int value)
{
if (UINT_MAX - *total < value) {
+ /* LCOV_EXCL_START */
ERR("overflow occurs when %d + %d", *total, value);
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
*total += value;
buf_size = CTSVC_VCARD_MAX_SIZE;
stream = malloc(CTSVC_VCARD_MAX_SIZE);
if (NULL == stream) {
+ /* LCOV_EXCL_START */
ERR("Out of memory : malloc() Fail");
fclose(file);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
while (fgets(line, sizeof(line), file)) {
if (new_stream) {
stream = new_stream;
} else {
+ /* LCOV_EXCL_START */
free(stream);
fclose(file);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
}
written_len = snprintf(stream + len, buf_size - len, "%s", line);
if (written_len < 0) {
+ /* LCOV_EXCL_START */
free(stream);
fclose(file);
ERR("snprintf() Fail(%d)", written_len);
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
ret = _ctsvc_safe_add(&len, (unsigned int)written_len);
#endif
if (NULL == __ctsvc_view_uri_hash) {
+ /* LCOV_EXCL_START */
ERR("contacts-service is not initialized");
return;
+ /* LCOV_EXCL_STOP */
}
g_hash_table_destroy(__ctsvc_view_uri_hash);
ctsvc_record_type_e type = CTSVC_RECORD_INVALID;
if (NULL == __ctsvc_view_uri_hash) {
+ /* LCOV_EXCL_START */
ERR("contacts-service is not initialized");
return type;
+ /* LCOV_EXCL_STOP */
}
view_uri_info = g_hash_table_lookup(__ctsvc_view_uri_hash, view_uri);
view_uri_info_s *view_uri_info = NULL;
if (NULL == __ctsvc_view_uri_hash) {
+ /* LCOV_EXCL_START */
ERR("contacts-service is not initialized");
return NULL;
+ /* LCOV_EXCL_STOP */
}
view_uri_info = g_hash_table_lookup(__ctsvc_view_uri_hash, view_uri);
view_uri_info_s *view_uri_info = NULL;
if (NULL == __ctsvc_view_uri_hash) {
+ /* LCOV_EXCL_START */
ERR("contacts-service is not initialized");
return NULL;
+ /* LCOV_EXCL_STOP */
}
view_uri_info = g_hash_table_lookup(__ctsvc_view_uri_hash, view_uri);
} while (0);
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_activity() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_activity(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
-
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} while (0);
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_activity_photo() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_activity_photo(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
-
return CONTACTS_ERROR_INVALID_PARAMETER;
-
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_activity_photo_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_address() Fail");
-
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_address(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
-
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_address_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_addressbook() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_addressbook(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
-
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_addressbook_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_company() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_company(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_company_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_contact() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_contact(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_contact_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_email() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_email(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_email_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_event() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_event(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_event_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_extension() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_extension(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_extension_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_group() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_group(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_group_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_group_relation() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_group_relation(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_group_relation_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_image() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_image(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_image_plugin_cb = {
extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_image_plugin_cb;
extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_sip_plugin_cb;
-static ctsvc_ipc_marshal_record_plugin_cb_s* __ctsvc_ipc_marshal_get_plugin_cb(ctsvc_record_type_e type);
-
-
-static int __ctsvc_ipc_unmarshal_composite_filter(const pims_ipc_data_h ipc_data, ctsvc_composite_filter_s *filter);
-static int __ctsvc_ipc_marshal_composite_filter(const ctsvc_composite_filter_s *filter, pims_ipc_data_h ipc_data);
-static int __ctsvc_ipc_unmarshal_attribute_filter(const pims_ipc_data_h ipc_data, const ctsvc_filter_type_e filter_type, ctsvc_attribute_filter_s *filter);
-static int __ctsvc_ipc_marshal_attribute_filter(const ctsvc_attribute_filter_s *filter, pims_ipc_data_h ipc_data);
-
-
static ctsvc_ipc_marshal_record_plugin_cb_s* __ctsvc_ipc_marshal_get_plugin_cb(ctsvc_record_type_e type)
{
switch (type) {
case CTSVC_RECORD_SIP:
return (&_ctsvc_ipc_record_sip_plugin_cb);
default:
+ /* LCOV_EXCL_START */
ASSERT_NOT_REACHED("Unimplemented IPC module (%d)", type);
return NULL;
+ /* LCOV_EXCL_STOP */
}
}
+#ifdef _CONTACTS_IPC_SERVER
static void __ctsvc_ipc_unmarshal_composite_filter_free(ctsvc_composite_filter_s *filter)
{
if (filter->filters) {
free(filter->view_uri);
}
+static int __ctsvc_ipc_unmarshal_attribute_filter(const pims_ipc_data_h ipc_data, const ctsvc_filter_type_e filter_type, ctsvc_attribute_filter_s *filter)
+{
+ filter->filter_type = filter_type;
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &filter->property_id)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_unmarshal_int() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP*/
+ }
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &filter->match)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_unmarshal_int() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ switch (filter->filter_type) {
+ case CTSVC_FILTER_STR:
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_string(ipc_data, &filter->value.s)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_unmarshal_string() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ break;
+ case CTSVC_FILTER_INT:
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &filter->value.i)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_unmarshal_int() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ break;
+ case CTSVC_FILTER_BOOL:
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_bool(ipc_data, &filter->value.b)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_unmarshal_bool() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ break;
+ case CTSVC_FILTER_DOUBLE:
+ case CTSVC_FILTER_LLI:
+ default:
+ break;
+ }
+ return CONTACTS_ERROR_NONE;
+}
+
+
static int __ctsvc_ipc_unmarshal_composite_filter(const pims_ipc_data_h ipc_data, ctsvc_composite_filter_s *filter)
{
unsigned int size = 0;
/* filters */
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &count)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, (int*)&filter_type)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail");
__ctsvc_ipc_unmarshal_composite_filter_free(filter);
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (filter_type == CTSVC_FILTER_COMPOSITE) {
ctsvc_composite_filter_s *com_filter = NULL;
com_filter = calloc(1, sizeof(ctsvc_composite_filter_s));
if (com_filter == NULL) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
__ctsvc_ipc_unmarshal_composite_filter_free(filter);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != __ctsvc_ipc_unmarshal_composite_filter(ipc_data, com_filter)) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_composite_filter() Fail");
free(com_filter);
__ctsvc_ipc_unmarshal_composite_filter_free(filter);
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
filter->filters = g_slist_append(filter->filters, com_filter);
} else {
ctsvc_attribute_filter_s *attr_filter = NULL;
attr_filter = calloc(1, sizeof(ctsvc_attribute_filter_s));
if (attr_filter == NULL) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
__ctsvc_ipc_unmarshal_composite_filter_free(filter);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != __ctsvc_ipc_unmarshal_attribute_filter(ipc_data, filter_type, attr_filter)) {
+ /* LCOV_EXCL_START */
free(attr_filter);
ERR("__ctsvc_ipc_unmarshal_attribute_filter() Fail");
__ctsvc_ipc_unmarshal_composite_filter_free(filter);
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
filter->filters = g_slist_append(filter->filters, attr_filter);
}
/* filters */
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &count)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail");
__ctsvc_ipc_unmarshal_composite_filter_free(filter);
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, (int *)&op)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail");
__ctsvc_ipc_unmarshal_composite_filter_free(filter);
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
filter->filter_ops = g_slist_append(filter->filter_ops, (void*)op);
}
return CONTACTS_ERROR_NONE;
}
+#else /* _CONTACTS_IPC_SERVER */
+
+static int __ctsvc_ipc_marshal_attribute_filter(const ctsvc_attribute_filter_s *filter, pims_ipc_data_h ipc_data)
+{
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->filter_type), ipc_data)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_marshal_int() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->property_id), ipc_data)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_marshal_int() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->match), ipc_data)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_marshal_int() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ switch (filter->filter_type) {
+ case CTSVC_FILTER_STR:
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_string((filter->value.s), ipc_data)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_marshal_string() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ break;
+ case CTSVC_FILTER_INT:
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->value.i), ipc_data)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_marshal_int() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ break;
+ case CTSVC_FILTER_BOOL:
+ if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_bool((filter->value.b), ipc_data)) {
+ /* LCOV_EXCL_START */
+ ERR("ctsvc_ipc_marshal_bool() Fail");
+ return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+ break;
+ case CTSVC_FILTER_DOUBLE:
+ case CTSVC_FILTER_LLI:
+ default:
+ break;
+ }
+
+ return CONTACTS_ERROR_NONE;
+}
+
static int __ctsvc_ipc_marshal_composite_filter(const ctsvc_composite_filter_s *filter, pims_ipc_data_h ipc_data)
{
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->filter_type), ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* view_uri */
int length = strlen(filter->view_uri);
if (pims_ipc_data_put(ipc_data, (void*)filter->view_uri, length+1) < 0) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_put() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* filter->filters */
if (filter->filters) {
ctsvc_filter_s *child_filter;
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(count, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
while (cursor) {
child_filter = cursor->data;
if (child_filter->filter_type == CTSVC_FILTER_COMPOSITE) {
if (CONTACTS_ERROR_NONE != __ctsvc_ipc_marshal_composite_filter((ctsvc_composite_filter_s*)child_filter, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_marshal_composite_filter() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else {
if (CONTACTS_ERROR_NONE != __ctsvc_ipc_marshal_attribute_filter((ctsvc_attribute_filter_s*)child_filter, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_marshal_attribute_filter() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
cursor = g_slist_next(cursor);
}
} else {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(0, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
GSList *cursor = filter->filter_ops;
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(count, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
while (cursor) {
contacts_filter_operator_e op = (contacts_filter_operator_e)cursor->data;
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(op, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
cursor = g_slist_next(cursor);
}
} else {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(0, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
return CONTACTS_ERROR_NONE;
}
-
-static int __ctsvc_ipc_unmarshal_attribute_filter(const pims_ipc_data_h ipc_data, const ctsvc_filter_type_e filter_type, ctsvc_attribute_filter_s *filter)
-{
- filter->filter_type = filter_type;
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &filter->property_id)) {
- ERR("ctsvc_ipc_unmarshal_int() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &filter->match)) {
- ERR("ctsvc_ipc_unmarshal_int() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- switch (filter->filter_type) {
- case CTSVC_FILTER_STR:
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_string(ipc_data, &filter->value.s)) {
- ERR("ctsvc_ipc_unmarshal_string() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- break;
- case CTSVC_FILTER_INT:
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &filter->value.i)) {
- ERR("ctsvc_ipc_unmarshal_int() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- break;
- case CTSVC_FILTER_BOOL:
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_bool(ipc_data, &filter->value.b)) {
- ERR("ctsvc_ipc_unmarshal_bool() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- break;
- case CTSVC_FILTER_DOUBLE:
- case CTSVC_FILTER_LLI:
- default:
- break;
- }
- return CONTACTS_ERROR_NONE;
-}
-
-static int __ctsvc_ipc_marshal_attribute_filter(const ctsvc_attribute_filter_s *filter, pims_ipc_data_h ipc_data)
-{
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->filter_type), ipc_data)) {
- ERR("ctsvc_ipc_marshal_int() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->property_id), ipc_data)) {
- ERR("ctsvc_ipc_marshal_int() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->match), ipc_data)) {
- ERR("ctsvc_ipc_marshal_int() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- switch (filter->filter_type) {
- case CTSVC_FILTER_STR:
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_string((filter->value.s), ipc_data)) {
- ERR("ctsvc_ipc_marshal_string() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- break;
- case CTSVC_FILTER_INT:
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int((filter->value.i), ipc_data)) {
- ERR("ctsvc_ipc_marshal_int() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- break;
- case CTSVC_FILTER_BOOL:
- if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_bool((filter->value.b), ipc_data)) {
- ERR("ctsvc_ipc_marshal_bool() Fail");
- return CONTACTS_ERROR_INVALID_PARAMETER;
- }
- break;
- case CTSVC_FILTER_DOUBLE:
- case CTSVC_FILTER_LLI:
- default:
- break;
- }
-
- return CONTACTS_ERROR_NONE;
-}
+#endif /* _CONTACTS_IPC_SERVER */
int ctsvc_ipc_marshal_handle(const contacts_h contact, pims_ipc_data_h ipc_data)
{
RETV_IF(NULL == ipc_data, CONTACTS_ERROR_INVALID_PARAMETER);
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_record_common(ipc_data, &common)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_record_common() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
plugin_cb = __ctsvc_ipc_marshal_get_plugin_cb(common.r_type);
if (NULL == plugin_cb || NULL == plugin_cb->unmarshal_record) {
+ /* LCOV_EXCL_START */
ERR("Invalid parameter");
free(common.properties_flags);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = contacts_record_create(common.view_uri, precord);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("contacts_record_create() Fail");
free(common.properties_flags);
return ret;
+ /* LCOV_EXCL_STOP */
}
precord_common = (ctsvc_record_s*)(*precord);
ret = plugin_cb->unmarshal_record(ipc_data, common.view_uri, *precord);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
contacts_record_destroy(*precord, true);
*precord = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
return ret;
RETV_IF(NULL == ipc_data, CONTACTS_ERROR_INVALID_PARAMETER);
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_record_common(common, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_record_common() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s *plugin_cb = __ctsvc_ipc_marshal_get_plugin_cb(common->r_type);
tmp = pims_ipc_data_get(ipc_data, &size);
if (tmp == NULL) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
length = *(int*)tmp;
if (str) {
*ppbufchar = strdup(str);
if (NULL == *ppbufchar) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
return CONTACTS_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
}
return ret;
void *tmp = pims_ipc_data_get(data, &size);
if (tmp == NULL) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
} else {
*pout = *(int*)tmp;
}
void *tmp = pims_ipc_data_get(data, &size);
if (tmp == NULL) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
} else {
*pout = *(unsigned int*)tmp;
}
void *tmp = pims_ipc_data_get(data, &size);
if (tmp == NULL) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
} else {
*pout = *(double*)tmp;
}
void *tmp = pims_ipc_data_get(data, &size);
if (tmp == NULL) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
} else {
*pout = *(bool*)tmp;
}
tmp = pims_ipc_data_get(ipc_data, &size);
if (tmp == NULL) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
} else {
common->r_type = *(ctsvc_record_type_e*)tmp;
}
str = (char*)pims_ipc_data_get(ipc_data, &size);
if (NULL == str) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
common->view_uri = ctsvc_view_get_uri(str);
tmp = pims_ipc_data_get(ipc_data, &size);
if (NULL == tmp) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
common->property_max_count = *(unsigned int*)tmp;
unsigned char *tmp_properties_flags;
tmp_properties_flags = (unsigned char*)pims_ipc_data_get(ipc_data, &size);
if (NULL == tmp_properties_flags) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
common->properties_flags = calloc(common->property_max_count, sizeof(char));
if (common->properties_flags == NULL) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
memcpy(common->properties_flags, tmp_properties_flags, sizeof(char)*common->property_max_count);
}
tmp = pims_ipc_data_get(ipc_data, &size);
if (NULL == tmp) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_get() Fail");
free(common->properties_flags);
common->properties_flags = NULL;
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
common->property_flag = *(unsigned char*)tmp;
int length = strlen(common->view_uri);
if (pims_ipc_data_put(ipc_data, (void*)common->view_uri, length+1) < 0) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_put() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (pims_ipc_data_put(ipc_data, (void*)&common->property_max_count, sizeof(unsigned int)) < 0)
if (0 < common->property_max_count) {
if (pims_ipc_data_put(ipc_data, (void*)common->properties_flags, sizeof(unsigned char)*common->property_max_count) < 0) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_put() Fail");
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
}
return CONTACTS_ERROR_NONE;
}
+#ifdef _CONTACTS_IPC_SERVER
int ctsvc_ipc_unmarshal_query(const pims_ipc_data_h ipc_data, contacts_query_h *out_query)
{
ctsvc_query_s *query = NULL;
ret = contacts_query_create(str, out_query);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("contacts_query_create() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
query = (ctsvc_query_s*)*out_query;
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &count)) {
+ /* LCOV_EXCL_START */
ERR("contacts_query_create() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (0 == count) {
ctsvc_composite_filter_s *filter = NULL;
filter = calloc(1, sizeof(ctsvc_composite_filter_s));
if (NULL == filter) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
filter->filter_type = CTSVC_FILTER_COMPOSITE;
filter->properties = (property_info_s*)ctsvc_view_get_all_property_infos(query->view_uri, &filter->property_count);
/* for filter_type */
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &count)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_unsigned_int() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != __ctsvc_ipc_unmarshal_composite_filter(ipc_data, query->filter)) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_composite_filter() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &(query->projection_count))) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_unsigned_int() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (0 < query->projection_count) {
query->projection = malloc(sizeof(unsigned int)*query->projection_count);
if (query->projection == NULL) {
+ /* LCOV_EXCL_START */
ERR("malloc() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < query->projection_count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &(query->projection[i]))) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_unsigned_int() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
}
} else {
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &(query->sort_property_id))) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_unsigned_int() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_bool(ipc_data, &(query->sort_asc))) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_bool() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_bool(ipc_data, &(query->distinct))) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_bool() Fail");
contacts_query_destroy(*out_query);
*out_query = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
+#else /* _CONTACTS_IPC_SERVER */
+
int ctsvc_ipc_marshal_query(const contacts_query_h query, pims_ipc_data_h ipc_data)
{
ctsvc_query_s *que = NULL;
/* view_uri */
length = strlen(que->view_uri);
if (pims_ipc_data_put(ipc_data, (void*)que->view_uri, length+1) < 0) {
+ /* LCOV_EXCL_START */
ERR("pims_ipc_data_put() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (que->filter) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(1, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != __ctsvc_ipc_marshal_composite_filter(que->filter, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_marshal_composite_filter() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(0, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_unsigned_int(que->projection_count, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_unsigned_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < que->projection_count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_unsigned_int(que->projection[i], ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_unsigned_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_unsigned_int(que->sort_property_id, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_unsigned_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_bool(que->sort_asc, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_bool() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_bool(que->distinct, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_bool() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
+#endif /* _CONTACTS_IPC_SERVER */
int ctsvc_ipc_unmarshal_list(const pims_ipc_data_h ipc_data, contacts_list_h *list)
{
RETV_IF(NULL == ipc_data, CONTACTS_ERROR_INVALID_PARAMETER);
if (CONTACTS_ERROR_NONE != contacts_list_create(list)) {
+ /* LCOV_EXCL_START */
ERR("contacts_list_create() Fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &(count))) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail");
contacts_list_destroy(*list, true);
*list = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
unsigned int i = 0;
for (i = 0; i < count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_record(ipc_data, &record)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_record() Fail");
contacts_list_destroy(*list, true);
*list = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != contacts_list_add(*list, record)) {
+ /* LCOV_EXCL_START */
ERR("contacts_list_add() Fail");
contacts_list_destroy(*list, true);
*list = NULL;
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &deleted_count)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_unsigned_int() Fail");
contacts_list_destroy(*list, true);
*list = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
i = 0;
for (i = 0; i < deleted_count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_record(ipc_data, &record)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_record() Fail");
contacts_list_destroy(*list, true);
*list = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_list_append_deleted_record(*list, record)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_list_append_deleted_record() Fail");
contacts_list_destroy(*list, true);
*list = NULL;
return CONTACTS_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
}
RETV_IF(NULL == ipc_data, CONTACTS_ERROR_INVALID_PARAMETER);
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_int(ipc_data, &(count))) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_record(ipc_data, &record)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_record() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != contacts_list_add(*list, record)) {
+ /* LCOV_EXCL_START */
ERR("contacts_list_add() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &deleted_count)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_unsigned_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
i = 0;
for (i = 0; i < deleted_count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_ipc_unmarshal_record(ipc_data, &record)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_record() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_list_append_deleted_record(*list, record)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_list_append_deleted_record() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
/* count */
if (CONTACTS_ERROR_NONE != contacts_list_get_count(list, &count)) {
+ /* LCOV_EXCL_START */
ERR("contacts_list_get_count() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(count, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
contacts_list_first(list);
unsigned int i = 0;
for (i = 0; i < count; i++) {
if (CONTACTS_ERROR_NONE != contacts_list_get_current_record_p(list, &record)) {
+ /* LCOV_EXCL_START */
ERR("contacts_list_get_current_record_p() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_record(record, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_record() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NO_DATA == contacts_list_next(list))
/* count */
if (ctsvc_list_get_deleted_count(list, &deleted_count)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_list_get_deleted_count() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_int(deleted_count, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
i = 0;
for (i = 0; i < deleted_count; i++) {
if (CONTACTS_ERROR_NONE != ctsvc_list_get_deleted_nth_record_p(list, i, &record)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_list_get_deleted_nth_record_p() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_ERROR_NONE != ctsvc_ipc_marshal_record(record, ipc_data)) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal_record() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
* marsharl : view_uri + other
* unmarshal : view_uri를 먼저 get 하고 난 이후 나머지를 ..
*/
+
+#ifdef _CONTACTS_IPC_SERVER
int ctsvc_ipc_unmarshal_query(const pims_ipc_data_h ipc_data, contacts_query_h *query);
+#else
int ctsvc_ipc_marshal_query(const contacts_query_h query, pims_ipc_data_h ipc_data);
+#endif
int ctsvc_ipc_unmarshal_list(const pims_ipc_data_h ipc_data, contacts_list_h *list);
int ctsvc_ipc_unmarshal_child_list(const pims_ipc_data_h ipc_data, contacts_list_h *list);
int ctsvc_ipc_marshal_list(const contacts_list_h list, pims_ipc_data_h ipc_data);
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_messenger() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_messenger(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_messenger_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_my_profile() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_my_profile(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_my_profile_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_name() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_name(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_name_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_nickname() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_nickname(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_nickname_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_note() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_note(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_note_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_number() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_number(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_number_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_person() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_person(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_person_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_phonelog() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_phonelog(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_phonelog_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_profile() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_profile(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_profile_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_relationship() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_relationship(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_relationship_plugin_cb = {
ret = ctsvc_ipc_unmarshal_int(ipc_data, &pvalue->property_id);
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail(%d)", ret);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = ctsvc_ipc_unmarshal_int(ipc_data, &pvalue->type);
if (ret != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail(%d)", ret);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_STR) == true) {
if (ctsvc_ipc_unmarshal_string(ipc_data, &pvalue->value.s) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_string() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_BOOL) == true) {
if (ctsvc_ipc_unmarshal_bool(ipc_data, &pvalue->value.b) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_bool() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_INT) == true) {
if (ctsvc_ipc_unmarshal_int(ipc_data, &pvalue->value.i) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_int() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_DOUBLE) == true) {
return CONTACTS_ERROR_NONE;
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_LLI) == true) {
return CONTACTS_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ASSERT_NOT_REACHED("invalid parameter (property:%d)", pvalue->property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
pims_ipc_data_h ipc_data)
{
if (ctsvc_ipc_marshal_int(pvalue->property_id, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (ctsvc_ipc_marshal_int(pvalue->type, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_STR) == true) {
if (ctsvc_ipc_marshal_string(pvalue->value.s, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_BOOL) == true) {
if (ctsvc_ipc_marshal_bool(pvalue->value.b, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_INT) == true) {
if (ctsvc_ipc_marshal_int(pvalue->value.i, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_DOUBLE) == true) {
return CONTACTS_ERROR_NONE;
} else if (CTSVC_VIEW_CHECK_DATA_TYPE(pvalue->property_id, CTSVC_VIEW_DATA_TYPE_LLI) == true) {
return CONTACTS_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ASSERT_NOT_REACHED("invalid parameter (property:%d)", pvalue->property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
unsigned int count = 0;
if (ctsvc_ipc_unmarshal_unsigned_int(ipc_data, &count) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_unmarshal_unsigned_int() fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
unsigned int i = 0;
for (i = 0; i < count; i++) {
ctsvc_result_value_s *value_data = NULL;
value_data = calloc(1, sizeof(ctsvc_result_value_s));
- if (value_data == NULL)
+ if (value_data == NULL) {
+ /* LCOV_EXCL_START */
+ ERR("calloc() fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
-
+ /* LCOV_EXCL_STOP */
+ }
if (__ctsvc_ipc_unmarshal_search_value(ipc_data, value_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_search_value() Fail");
free(value_data);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
result_p->values = g_slist_append(result_p->values, value_data);
}
if (result_p->values) {
unsigned int count = g_slist_length(result_p->values);
if (ctsvc_ipc_marshal_unsigned_int(count, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
GSList *cursor = result_p->values;
continue;
}
if (__ctsvc_ipc_marshal_search_value(value_data, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
cursor = g_slist_next(cursor);
}
} else {
if (ctsvc_ipc_marshal_int(0, ipc_data) != CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
#include "ctsvc_ipc_marshal.h"
#include "contacts_record.h"
-
+/* Can't find the SIM include SDN */
+/* LCOV_EXCL_START */
static int __ctsvc_ipc_unmarshal_sdn(pims_ipc_data_h ipc_data, const char *view_uri,
contacts_record_h record)
{
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
}
+/* LCOV_EXCL_STOP */
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_sdn_plugin_cb = {
.unmarshal_record = __ctsvc_ipc_unmarshal_sdn,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_simple_contact() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_simple_contact(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_simple_contact_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_unmarshal fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_sip(const contacts_record_h record, pims_ipc_data_h ipc_data)
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_speeddial() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_speeddial(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_speeddial_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_updated_info() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_updated_info(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_updated_info_plugin_cb = {
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("__ctsvc_ipc_unmarshal_url() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_ipc_marshal_url(const contacts_record_h record,
return CONTACTS_ERROR_NONE;
} while (0);
-
+ /* LCOV_EXCL_START */
ERR("_ctsvc_ipc_marshal() Fail");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_url_plugin_cb = {