static pims_ipc_h __ipc = NULL;
static GSList *__db_change_subscribe_list = NULL;
-/* LCOV_EXCL_START */
static void _cnoti_subscribe_cb(pims_ipc_h ipc, pims_ipc_data_h data,
void *user_data)
{
if (CONTACTS_ERROR_INVALID_PARAMETER == ret)
return CONTACTS_ERROR_INTERNAL;
return ret;
+ /* LCOV_EXCL_STOP */
}
} else if (CONTACTS_ERROR_NONE != ret) {
/* LCOV_EXCL_START */
struct image_transform *info = user_data;
if (NULL == info) {
+ /* LCOV_EXCL_START */
ERR("NULL == info");
media_packet_destroy(*dst);
return;
+ /* LCOV_EXCL_STOP */
}
if(true == info->timeout) {
+ /* LCOV_EXCL_START */
media_packet_destroy(*dst);
g_mutex_unlock(&info->mutex);
g_mutex_clear(&info->mutex);
g_cond_clear(&info->cond);
free(info);
return;
+ /* LCOV_EXCL_STOP */
}
if (IMAGE_UTIL_ERROR_NONE == error) {
if (src && src[0]) {
length = ctsvc_check_utf8(src[0]);
- RETVM_IF(length <= 0, CONTACTS_ERROR_INTERNAL, "check_utf8() Fail");
+ RETVM_IF(length <= 0, CONTACTS_ERROR_INTERNAL, "check_utf8() Fail"); /* LCOV_EXCL_LINE */
strncpy(temp, src, length);
query_s = (ctsvc_query_s*)query;
find = __ctsvc_query_property_check(query_s->properties, query_s->property_count, QUERY_SORTKEY, property_id);
- RETVM_IF(false == find, CONTACTS_ERROR_INVALID_PARAMETER,
- "property_id(%d) is not supported on view_uri(%s)", property_id, query_s->view_uri);
+ RETVM_IF(false == find, CONTACTS_ERROR_INVALID_PARAMETER, /* LCOV_EXCL_LINE */
+ "property_id(%d) is not supported on view_uri(%s)", property_id, query_s->view_uri); /* LCOV_EXCL_LINE */
query_s->sort_property_id = property_id;
query_s->sort_asc = asc;
-/*
+ /*
* Contacts Service
*
* Copyright (c) 2010 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
case CTSVC_RECORD_SIP:
return &sip_plugin_cbs;
default:
- return NULL;
+ return NULL; /* LCOV_EXCL_LINE */
}
}
#ifdef _CONTACTS_IPC_CLIENT
ctsvc_view_uri_deinit();
#endif
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_destroy(contacts_record_h record, bool delete_child)
return s_record->plugin_cbs->destroy(record, delete_child);
}
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_clone(contacts_record_h record, contacts_record_h *out_record)
#endif
return s_record->plugin_cbs->clone(record, out_record);
}
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_get_uri_p(contacts_record_h record, const char **out_str)
ctsvc_record_s *temp = (ctsvc_record_s*)(record);
- RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == out_str, CONTACTS_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER); /* LCOV_EXCL_LINE */
+ RETV_IF(NULL == out_str, CONTACTS_ERROR_INVALID_PARAMETER); /* LCOV_EXCL_LINE */
*out_str = (temp->view_uri);
CHECK_CONTACT_SUPPORTED(CONTACT_FEATURE);
ctsvc_record_s *s_record;
- RETV_IF(NULL == out_str, CONTACTS_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == out_str, CONTACTS_ERROR_INVALID_PARAMETER); /* LCOV_EXCL_LINE */
*out_str = NULL;
- RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER); /* LCOV_EXCL_LINE */
s_record = (ctsvc_record_s*)record;
__CHECK_PROJECTED_PROPERTY();
if (s_record->plugin_cbs && s_record->plugin_cbs->get_str)
return s_record->plugin_cbs->get_str(record, property_id, out_str);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_get_lli(contacts_record_h record, unsigned int property_id, long long int *value)
CHECK_CONTACT_SUPPORTED(CONTACT_FEATURE);
ctsvc_record_s *s_record;
- RETV_IF(NULL == value, CONTACTS_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == value, CONTACTS_ERROR_INVALID_PARAMETER); /* LCOV_EXCL_LINE */
*value = 0;
- RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER); /* LCOV_EXCL_LINE */
s_record = (ctsvc_record_s*)record;
__CHECK_PROJECTED_PROPERTY();
if (s_record->plugin_cbs && s_record->plugin_cbs->get_lli)
return s_record->plugin_cbs->get_lli(record, property_id, value);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_get_double(contacts_record_h record, unsigned int property_id, double *value)
if (s_record->plugin_cbs && s_record->plugin_cbs->get_double)
return s_record->plugin_cbs->get_double(record, property_id, value);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_get_str_p(contacts_record_h record, unsigned int property_id, char **out_str)
if (s_record->plugin_cbs && s_record->plugin_cbs->get_int)
return s_record->plugin_cbs->get_int(record, property_id, out_value);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_set_str(contacts_record_h record, unsigned int property_id, const char *value)
return ret;
}
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_get_bool(contacts_record_h record,
if (s_record->plugin_cbs && s_record->plugin_cbs->get_bool)
return s_record->plugin_cbs->get_bool(record, property_id, value);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_set_bool(contacts_record_h record,
return ret;
}
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_set_int(contacts_record_h record, unsigned int property_id,
#ifdef _CONTACTS_IPC_CLIENT
if (CTSVC_RECORD_RESULT == ((ctsvc_record_s*)record)->r_type) {
- ERR("Can not set int to result record");
- return CONTACTS_ERROR_INVALID_PARAMETER;
+ ERR("Can not set int to result record"); /* LCOV_EXCL_LINE */
+ return CONTACTS_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
}
#endif
return ctsvc_record_set_int(record, property_id, value);
}
return ret;
}
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_set_lli(contacts_record_h record, unsigned int property_id,
return ret;
}
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_set_double(contacts_record_h record, unsigned int property_id,
return ret;
}
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
/* Record get/set child records */
if (s_record->plugin_cbs && s_record->plugin_cbs->add_child_record)
return s_record->plugin_cbs->add_child_record(record, property_id, child_record);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_remove_child_record(contacts_record_h record,
if (s_record->plugin_cbs && s_record->plugin_cbs->remove_child_record)
return s_record->plugin_cbs->remove_child_record(record, property_id, child_record);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_get_child_record_count(contacts_record_h record,
if (s_record->plugin_cbs && s_record->plugin_cbs->get_child_record_count)
return s_record->plugin_cbs->get_child_record_count(record, property_id, count);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_get_child_record_at_p(contacts_record_h record,
if (s_record->plugin_cbs && s_record->plugin_cbs->get_child_record_at_p)
return s_record->plugin_cbs->get_child_record_at_p(record, property_id, index, out_record);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
EXPORT_API int contacts_record_clone_child_record_list(contacts_record_h record,
if (s_record->plugin_cbs && s_record->plugin_cbs->clone_child_record_list)
return s_record->plugin_cbs->clone_child_record_list(record, property_id, out_list);
- __INVALID_PARAMETER_ERROR_HANDLING();
+ __INVALID_PARAMETER_ERROR_HANDLING(); /* LCOV_EXCL_LINE */
}
int ctsvc_record_set_projection_flags(contacts_record_h record,
return CONTACTS_ERROR_NONE;
}
-/* LCOV_EXCL_START */
static int __ctsvc_simple_contact_get_int(contacts_record_h record, unsigned int property_id, int *out)
{
ctsvc_simple_contact_s *contact = (ctsvc_simple_contact_s*)record;
return CONTACTS_ERROR_NONE;
} while (0);
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
free(my_profile->extensions);
free(my_profile->images);
free(my_profile->sips);
free(my_profile);
return CONTACTS_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
static int __ctsvc_my_profile_destroy(contacts_record_h record, bool delete_child)
*out = my_profile->changed_time;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(my_profile)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
my_profile->addressbook_id = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in valuecontact)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*out_str = GET_STR(copy, my_profile->uid);
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(my_profile)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
*list = (contacts_list_h)contact->sips;
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(contact)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
contacts_list_get_count(list, &count);
if (count < index) {
+ /* LCOV_EXCL_START */
ERR("The index(%d) is greather than total length(%d)", index, count);
*out_record = NULL;
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
} else {
return ctsvc_list_get_nth_record_p(list, index, out_record);
}
contacts_list_get_count(list, &count);
if (count <= 0) {
+ /* LCOV_EXCL_START */
*out_list = NULL;
return CONTACTS_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
ctsvc_list_clone(list, out_list);
((ctsvc_sip_s *)record)->id = 0;
break;
default:
+ /* LCOV_EXCL_START */
ERR("record(%d) is not child of contact", record->r_type);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CONTACTS_ERROR_NONE;
}
return ret;
if (CTSVC_RECORD_NAME == s_record->r_type && 1 == ((ctsvc_list_s*)list)->count) {
+ /* LCOV_EXCL_START */
ERR("This type(%d) of child_record can not be added anymore", s_record->r_type);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CTSVC_RECORD_IMAGE == s_record->r_type && 1 == ((ctsvc_list_s*)list)->count) {
+ /* LCOV_EXCL_START */
ERR("This type(%d) of child_record can not be added anymore", s_record->r_type);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = __ctsvc_my_profile_reset_child_record_id(child_record);
case CTSVC_RECORD_SIP:
return ((ctsvc_sip_s *)record)->id;
default:
+ /* LCOV_EXCL_START */
ERR("record(%d) is not child of contact", record->r_type);
return 0;
+ /* LCOV_EXCL_STOP */
}
return 0;
}
FREEandSTRDUP(my_profile->uid, str);
break;
default:
+ /* LCOV_EXCL_START */
ERR("property_id(%d) is not supported in value(my_profile)", 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_my_profile_destroy((contacts_record_h)out_data, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_record = (contacts_record_h)out_data;
wrn = snprintf(sock_file, sizeof(sock_file), CTSVC_SOCK_PATH"/%s", uid, CTSVC_SOCKET_FILE);
if (wrn < 0){
- WARN("Error writing in sock file (%s)", sock_file);
+ WARN("Error writing in sock file (%s)", sock_file); /* LCOV_EXCL_LINE */
}
bzero(&caddr, sizeof(caddr));
caddr.sun_family = AF_UNIX;
wrn = snprintf(caddr.sun_path, sizeof(caddr.sun_path), "%s", sock_file);
if (wrn < 0){
- WARN("Error writing in unix socket path (%s)", caddr.sun_path);
+ WARN("Error writing in unix socket path (%s)", caddr.sun_path); /* LCOV_EXCL_LINE */
}
__ctsvc_sockfd = socket(PF_UNIX, SOCK_STREAM, 0);
- RETVM_IF(-1 == __ctsvc_sockfd, CONTACTS_ERROR_IPC,
- "socket() Fail(errno = %d)", errno);
+ RETVM_IF(-1 == __ctsvc_sockfd, CONTACTS_ERROR_IPC, /* LCOV_EXCL_LINE */
+ "socket() Fail(errno = %d)", errno); /* LCOV_EXCL_LINE */
ret = connect(__ctsvc_sockfd, (struct sockaddr *)&caddr, sizeof(caddr));
if (-1 == ret) {
__ctsvc_sockfd = -1;
}
-/* LCOV_EXCL_START */
static inline int __ctsvc_safe_write(int fd, const char *buf, int buf_size)
{
int ret, writed = 0;
while (size) {
if (sizeof(dummy) < size) {
+
ret = read(fd, dummy, sizeof(dummy));
if (-1 == ret) {
+ /* LCOV_EXCL_START */
if (EINTR == errno)
continue;
else
return;
+ /* LCOV_EXCL_STOP */
}
size -= ret;
} else {
ret = read(fd, dummy, size);
if (-1 == ret) {
+ /* LCOV_EXCL_START */
if (EINTR == errno)
continue;
else
return;
+ /* LCOV_EXCL_STOP */
}
size -= ret;
}
#define SMART_STRDUP(src) (src && *src) ? strdup(src) : NULL
#define CTSVC_VCARD_PHOTO_MAX_SIZE 1024*1024
+/* LCOV_EXCL_START */
#define CTSVC_VCARD_APPEND_STR(buf, buf_size, len, str) do { \
if ((len = __ctsvc_vcard_append_str(buf, buf_size, len, str, false)) < 0) { \
ERR("__ctsvc_vcard_append_str() Fail"); \
return CONTACTS_ERROR_OUT_OF_MEMORY; \
} \
} while (0)
-
+/* LCOV_EXCL_STOP */
#define CTSVC_VCARD_APPEND_CONTENT(buf, buf_size, len, content) do { \
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";CHARSET=UTF-8"); \
}
};
-/* LCOV_EXCL_START */
-
static int __ctsvc_vcard_append_str(char **buf, int *buf_size, int len, const char *str, bool need_conversion)
{
int len_temp = 0;
buf_copy = calloc(1, *buf_size);
if (NULL == buf_copy) {
- ERR("calloc() Fail");
+ ERR("calloc() Fail"); /* LCOV_EXCL_LINE */
return 0;
}
type = __ctsvc_vcard_get_image_type((const char *)suffix);
fd = open(path, O_RDONLY);
- RETVM_IF(fd < 0, CONTACTS_ERROR_SYSTEM, "System : Open Fail(%d)", errno);
+ RETVM_IF(fd < 0, CONTACTS_ERROR_SYSTEM, "System : Open Fail(%d)", errno); /* LCOV_EXCL_LINE */
read_len = 0;
while ((ret = read(fd, image+read_len, sizeof(image)-read_len))) {
if (-1 == ret) {
if (EINTR == errno)
- continue;
+ continue; /* LCOV_EXCL_LINE */
else
break;
}
read_len += ret;
}
close(fd);
- RETVM_IF(ret < 0, CONTACTS_ERROR_SYSTEM, "System : read() Fail(%d)", errno);
+ RETVM_IF(ret < 0, CONTACTS_ERROR_SYSTEM, "System : read() Fail(%d)", errno); /* LCOV_EXCL_LINE */
buf_image = g_base64_encode(image, read_len);
if (buf_image) {
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, content_name[CTSVC_VCARD_VALUE_ORG]);
len = __ctsvc_vcard_put_company_type(company->type, SAFE_STR(company->label), buf, buf_size, len);
- RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY);
+ RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";CHARSET=UTF-8");
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ":");
if (company->logo) {
len = __ctsvc_vcard_put_company_logo(company->logo, buf, buf_size, len);
- RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY);
+ RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
}
}
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, content_name[CTSVC_VCARD_VALUE_ADR]);
len = __ctsvc_vcard_put_postal_type(address->type, SAFE_STR(address->label), buf, buf_size, len);
- RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY);
+ RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
if (address->is_default)
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";PREF");
else if ((c & (char)0xfe) == (char)0xfc)
return 6;
else
- return CONTACTS_ERROR_INVALID_PARAMETER;
+ return CONTACTS_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
}
static void __ctsvc_vcard_get_clean_number_for_export(char *str, char *dest)
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, content_name[CTSVC_VCARD_VALUE_TEL]);
len = __ctsvc_vcard_put_number_type(number->type, SAFE_STR(number->label), buf, buf_size, len);
- RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY);
+ RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
if (number->is_default)
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";PREF");
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, content_name[CTSVC_VCARD_VALUE_EMAIL]);
len = __ctsvc_vcard_put_email_type(email->type, SAFE_STR(email->label), buf, buf_size, len);
- RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY);
+ RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
if (email->is_default)
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";PREF");
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, content_name[CTSVC_VCARD_VALUE_URL]);
len = __ctsvc_vcard_put_url_type(url->type, SAFE_STR(url->label), buf, buf_size, len);
- RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY);
+ RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
CTSVC_VCARD_APPEND_CONTENT(buf, buf_size, len, url->url);
}
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, "X-TIZEN-RELATIONSHIP");
len = __ctsvc_vcard_put_relationship_type(relationship->type, SAFE_STR(relationship->label), buf, buf_size, len);
- RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY);
+ RETV_IF(len < 0, CONTACTS_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
CTSVC_VCARD_APPEND_CONTENT(buf, buf_size, len, relationship->name);
}
}
media_format_unref(fmt);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
free(buffer);
info->ret = CONTACTS_ERROR_SYSTEM;
return false;
+ /* LCOV_EXCL_STOP */
}
free(buffer);
buffer = buffer_temp;
temp_size = (src_len+1) * sizeof(UChar);
temp = malloc(temp_size);
if (NULL == temp) {
+ /* LCOV_EXCL_START */
ERR("malloc() Fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
conv = ucnv_open(enc, &err);
- WARN_IF(U_FAILURE(err), "ucnv_open() Fail(%d), enc=%s", err, enc);
+ WARN_IF(U_FAILURE(err), "ucnv_open() Fail(%d), enc=%s", err, enc); /* LCOV_EXCL_LINE */
ucnv_toUChars(conv, temp, temp_size, val, src_len, &err);
- WARN_IF(U_FAILURE(err), "ucnv_toUChars() Fail(%d), enc=%s", err, enc);
+ WARN_IF(U_FAILURE(err), "ucnv_toUChars() Fail(%d), enc=%s", err, enc); /* LCOV_EXCL_LINE */
ucnv_close(conv);
dest_size = temp_size*2;
dest = malloc(dest_size);
if (NULL == dest) {
+ /* LCOV_EXCL_START */
ERR("malloc() Fail");
free(temp);
return NULL;
+ /* LCOV_EXCL_STOP */
}
conv = ucnv_open("UTF-8", &err);
- WARN_IF(U_FAILURE(err), "ucnv_open() Fail(%d), enc=%s", err, enc);
+ WARN_IF(U_FAILURE(err), "ucnv_open() Fail(%d), enc=%s", err, enc); /* LCOV_EXCL_LINE */
ucnv_fromUChars(conv, dest, dest_size, temp, u_strlen(temp), &err);
- WARN_IF(U_FAILURE(err), "ucnv_fromUChars() Fail(%d), enc=%s", err, enc);
+ WARN_IF(U_FAILURE(err), "ucnv_fromUChars() Fail(%d), enc=%s", err, enc); /* LCOV_EXCL_LINE */
ucnv_close(conv);
free(temp);
*cursor = '\0';
*dest = strdup(src);
if (NULL == *dest) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
if (CTSVC_VCARD_VER_2_1 != ver)
__ctsvc_vcard_remove_folding(*dest);
contacts_list_get_count((contacts_list_h)name_list, &count);
if (count <= 0) {
ret = contacts_record_create(_contacts_name._uri, &name);
- RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create is Fail(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create is Fail(%d)", ret); /* LCOV_EXCL_LINE */
contacts_list_add((contacts_list_h)name_list, name);
} else {
contacts_list_get_current_record_p((contacts_list_h)name_list, &name);
contacts_list_get_count((contacts_list_h)name_list, &count);
if (count <= 0) {
ret = contacts_record_create(_contacts_name._uri, &name);
- RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create() Fail(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create() Fail(%d)", ret); /* LCOV_EXCL_LINE */
contacts_list_add((contacts_list_h)name_list, name);
} else {
contacts_list_get_current_record_p((contacts_list_h)name_list, &name);
contacts_record_h nickname = NULL;
ret = contacts_record_create(_contacts_nickname._uri, &nickname);
if (ret < CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
GList *cursor = NULL;
ERR("contacts_record_create() Fail(%d)", ret);
for (cursor = nickname_list->records; cursor; cursor = cursor->next)
nickname_list->cursor = NULL;
nickname_list->count = 0;
return ret;
+ /* LCOV_EXCL_STOP */
}
contacts_record_set_str(nickname, _contacts_nickname.name, __ctsvc_vcard_remove_escape_char(start));
contacts_list_add((contacts_list_h)nickname_list, nickname);
buf = g_base64_decode(temp+1, &size);
if ((0 == size) || (NULL == buf)) {
+ /* LCOV_EXCL_START */
g_free(buf);
return CONTACTS_ERROR_NONE;
+ /* LCOV_EXCL_STOP */
}
gettimeofday(&tv, NULL);
while (0 < size) {
ret = write(fd, buf, size);
if (ret <= 0) {
+ /* LCOV_EXCL_START */
if (EINTR == errno) {
continue;
} else {
return CONTACTS_ERROR_FILE_NO_SPACE; /* No space */
else
return CONTACTS_ERROR_SYSTEM; /* IO error */
+ /* LCOV_EXCL_STOP */
}
}
size -= ret;
while (temp) {
lower = strdup(temp);
if (NULL == lower) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
lower_temp = lower;
while (*lower_temp) {
date = __ctsvc_get_content_value(val);
if (NULL == date) {
+ /* LCOV_EXCL_START */
ERR("vcard");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
dest = src = date;
}
*dest = '\0';
if ('\0' == *date) {
+ /* LCOV_EXCL_START */
ERR("date(%s)", date);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = contacts_record_create(_contacts_event._uri, &event);
if (ret < CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("contacts_record_create() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
contacts_record_set_int(event, _contacts_event.date, atoi(date));
company = __ctsvc_vcard_get_company_empty_record(company_list, property_id);
if (NULL == company) {
int ret = contacts_record_create(_contacts_company._uri, &company);
- RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create() Fail(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create() Fail(%d)", ret); /* LCOV_EXCL_LINE */
contacts_list_add((contacts_list_h)company_list, company);
}
company = __ctsvc_vcard_get_company_empty_record(company_list, _contacts_company.logo);
if (NULL == company) {
ret = contacts_record_create(_contacts_company._uri, &company);
- RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create() Fail(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create() Fail(%d)", ret); /* LCOV_EXCL_LINE */
contacts_list_add((contacts_list_h)company_list, company);
}
while (0 < size) {
ret = write(fd, buf, size);
if (ret <= 0) {
+ /* LCOV_EXCL_START */
if (EINTR == errno) {
continue;
} else {
else
return CONTACTS_ERROR_SYSTEM; /* IO error */
}
+ /* LCOV_EXCL_STOP */
}
size -= ret;
}
while (temp) {
lower = strdup(temp);
if (NULL == lower) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
lower_temp = lower;
while (*lower_temp) {
while (temp) {
lower = strdup(temp);
if (NULL == lower) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
lower_temp = lower;
while (*lower_temp) {
while (temp) {
lower = strdup(temp);
if (NULL == lower) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
lower_temp = lower;
while (*lower_temp) {
CTS_GET_MULTIPLE_COMPONENT(((ctsvc_address_s*)address)->postalcode, text, text_temp, separator);
CTS_GET_MULTIPLE_COMPONENT(((ctsvc_address_s*)address)->country, text, text_temp, separator);
- ERR("invalid ADR type");
+ ERR("invalid ADR type"); /* LCOV_EXCL_LINE */
} while (0);
if (((ctsvc_address_s*)address)->pobox || ((ctsvc_address_s*)address)->extended
|| ((ctsvc_address_s*)address)->country) {
contacts_record_set_bool(address, _contacts_address.is_default, __ctsvc_vcard_get_postal_type(address, prefix));
} else {
+ /* LCOV_EXCL_START */
ERR("Invalid vcard");
contacts_record_destroy(address, true);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
contacts_list_add((contacts_list_h)address_list, address);
}
while (temp) {
lower = strdup(temp);
if (NULL == lower) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
lower_temp = lower;
while (*lower_temp) {
dest = calloc((src-val)+size+1, sizeof(char));
if (NULL == dest) {
+ /* LCOV_EXCL_START */
g_free(decoded_str);
ERR("calloc() Fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
snprintf(dest, (src-val)+1, "%s", val);
free(prefix);
return CONTACTS_ERROR_NONE;
default:
+ /* LCOV_EXCL_START */
ERR("__ctsvc_vcard_check_content_type() Fail(%d)", type);
free(val);
free(prefix);
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
free(val);
free(prefix);
cursor = new_start;
}
-
+ /* LCOV_EXCL_START */
ERR("Invalid vcard");
return CONTACTS_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
static inline int __ctsvc_vcard_check_version(const char *src)
temp_display_len += 7;
temp_display = calloc(1, temp_display_len);
if (NULL == temp_display) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
len = 0;
display_len = SAFE_STRLEN(name->prefix) + temp_display_len + 2;
reverse_display = calloc(1, display_len);
if (NULL == reverse_display) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
free(temp_display);
return;
+ /* LCOV_EXCL_STOP */
}
snprintf(reverse_display, display_len, "%s %s", name->prefix, temp_display);
free(temp_display);
/* make reverse_temp_display_name */
temp_display = calloc(1, temp_display_len);
if (NULL == temp_display) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
free(reverse_display);
return;
+ /* LCOV_EXCL_STOP */
}
len = 0;
display_len = SAFE_STRLEN(name->prefix) + temp_display_len + 2;
display = calloc(1, display_len);
if (NULL == display) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
free(temp_display);
free(reverse_display);
return;
+ /* LCOV_EXCL_STOP */
}
snprintf(display, display_len, "%s %s", name->prefix, temp_display);
free(temp_display);
ret = __ctsvc_vcard_get_contact(ver, vcard, (contacts_record_h*)&contact);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cts_vcard_get_contact() Fail(%d)", ret);
contacts_record_destroy((contacts_record_h)contact, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
__ctsvc_vcard_make_contact_display_name(contact);
__ctsvc_vcard_update_contact_has_properties(contact);
vcard_len += (vcard_cursor - pos_start);
vcard_object = calloc(vcard_len + 1, sizeof(char));
if (NULL == vcard_object) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
__contacts_vcard_free_sub_vcard_info_list(sub_vcard_list);
return NULL;
+ /* LCOV_EXCL_STOP */
}
vcard_len = 0;
/* sub vcard */
sub_vcard_info_s *sub_vcard_info = calloc(1, sizeof(sub_vcard_info_s));
if (NULL == sub_vcard_info) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
__contacts_vcard_free_sub_vcard_info_list(sub_vcard_list);
return NULL;
+ /* LCOV_EXCL_STOP */
}
sub_vcard_info->pos_start = vcard_cursor;
for (vcard_cursor = list_vcard_object; vcard_cursor; vcard_cursor = vcard_cursor->next) {
vcard_object = vcard_cursor->data;
if (NULL == vcard_object)
- continue;
+ continue; /* LCOV_EXCL_LINE */
ret = __ctsvc_vcard_parse(vcard_object, &record);
if (ret < CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("__ctsvc_vcard_parse() Fail(%d)", ret);
__contacts_vcard_free_vcard_object_list(list_vcard_object);
contacts_list_destroy(list, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (NULL == list)
ret = _ctsvc_safe_add(&len, (unsigned int)written_len);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
free(stream);
fclose(file);
ERR("_ctsvc_safe_add() Fail(len:%d, written_len:%d)", len, written_len);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (STRING_EQUAL == strncmp(line, "END:VCARD", 9)) {
char *vcard_object = vcard_cursor->data;
if (NULL == vcard_object)
- continue;
+ continue; /* LCOV_EXCL_LINE */
ret = __ctsvc_vcard_parse(vcard_object, &record);
if (ret < CONTACTS_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("vcard stream parsing error");
free(stream);
fclose(file);
__contacts_vcard_free_vcard_object_list(list_vcard_object);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (false == cb(record, data)) {
/* LCOV_EXCL_START */
ERR("ctsvc_ipc_server_db_insert_record() Fail");
goto ERROR_RETURN;
- /* LCOV_EXCL_START */
+ /* LCOV_EXCL_STOP */
}
if (!ctsvc_have_permission(ipc, ctsvc_required_read_permission(view_uri))) {
"xie", "yu"};
#define DUOYINZI_SEPERATOR '|'
-/* LCOV_EXCL_START */
+
static inline int __ctsvc_get_pinyinspell(UChar src, char spell[CHINESE_DUOYINZI_MAX_COUNT][CHINESE_PINYIN_SPELL_MAX_LEN])
{
int offset, len, i, j;
}
}
-/* LCOV_EXCL_START */
int ctsvc_convert_japanese_to_hiragana_unicode(UChar *src, UChar *dest, int dest_size)
{
int i, j = 0, len = 0;
int sim_info_id;
RETVM_IF(false == ctsvc_server_have_telephony_feature(), CONTACTS_ERROR_NOT_SUPPORTED, "Telephony feature disabled");
-/* LCOV_EXCL_START */
sim_info_id = ctsvc_server_sim_get_info_id_by_sim_slot_no(sim_slot_no);
if (sim_info_id <= 0) {
/* LCOV_EXCL_START */
return info->handle;
}
-/* LCOV_EXCL_START */
static inline void __ctsvc_server_sim_set_return_data(void *data)
{
greturn_data = data;
/* key : socket_fd, value : struct client_info* */
static GHashTable *_client_info_table = NULL;
-/* LCOV_EXCL_START */
static inline int __ctsvc_server_socket_safe_write(int fd, char *buf, int buf_size)
{
int ret, writed = 0;
static sqlite3 *server_db;
-/* LCOV_EXCL_START */
int ctsvc_server_db_open(sqlite3 **db, int *sqlite_error)
{
CTS_FN_CALL;
do {
ret = db_util_open(CTSVC_DB_PATH, &server_db, 0);
if (ret != SQLITE_OK || NULL == server_db) {
+ /* LCOV_EXCL_START */
ERR("db_util_open() Fail(%d), server_db(%s)", ret, sqlite3_errmsg(server_db));
break;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_create_function(server_db, "_DATA_DELETE_", 2, SQLITE_UTF8, NULL,
ctsvc_db_data_delete_callback, NULL, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_function() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_create_function(server_db, "_DATA_IMAGE_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_image_delete_callback, NULL, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_function() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_create_function(server_db, "_DATA_COMPANY_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_company_delete_callback, NULL, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_function() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
#ifdef ENABLE_LOG_FEATURE
ret = sqlite3_create_function(server_db, "_PHONE_LOG_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_phone_log_delete_callback, NULL, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_function() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
#endif /* ENABLE_LOG_FEATURE */
ret = sqlite3_create_function(server_db, "_PERSON_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_person_delete_callback, NULL, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_function() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_create_function(server_db, "_GROUP_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_group_delete_callback, NULL, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_function() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_create_function(server_db, "_NUMBER_COMPARE_", 4, SQLITE_UTF8, NULL,
ctsvc_db_phone_number_equal_callback, NULL, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_function() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_create_collation(server_db, "_NAME_SORT_", SQLITE_UTF8, (void *)SQLITE_UTF8,
ctsvc_db_group_name_sort_callback);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_create_collation() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
} while (0);
if (ret != SQLITE_OK || NULL == server_db) {
+ /* LCOV_EXCL_START */
if (sqlite_error)
*sqlite_error = ret;
return CONTACTS_ERROR_DB;
+ /* LCOV_EXCL_STOP */
}
}
#define CTSVC_SCHEMA_VERSION 104
#ifdef ENABLE_LOG_FEATURE
-/* LCOV_EXCL_START */
+
static int __ctsvc_server_find_person_id_of_phonelog(sqlite3 *__db, char *normal_num,
char *minmatch, int person_id, int *find_number_type)
{
#define CTSVC_CONTACT_INITIAL_DATA_MAX_LEN 128
-/* LCOV_EXCL_START */
int ctsvc_contact_add_image_file(int parent_id, int img_id,
char *src_img, char *dest, int dest_size)
{
static contacts_db_status_e __db_status = CONTACTS_DB_STATUS_NORMAL;
-/* LCOV_EXCL_START */
static const char * __ctsvc_db_get_property_field_name(const property_info_s *properties,
int count, db_query_property_type_e property_type, unsigned int property_id)
{
return p->fields;
}
- return NULL;
+ return NULL; /* LCOV_EXCL_LINE */
#if 0
} else if (property_id == CTSVC_PROPERTY_PERSON_DISPLAY_NAME_INDEX) {
if (property_type != QUERY_PROJECTION)
snprintf(out_cond, sizeof(out_cond), "%s <> %d", field_name, filter->value.i);
break;
case CONTACTS_MATCH_NONE:
+ /* LCOV_EXCL_START */
snprintf(out_cond, sizeof(out_cond), "%s IS NULL", field_name);
break;
+ /* LCOV_EXCL_STOP */
default:
/* LCOV_EXCL_START */
ERR("Invalid : match rule(%d) is not supported", filter->match);