return ret;
}
-API int contacts_db_get_record(const char* view_uri, int id, contacts_record_h* out_record)
+API int contacts_db_get_record(const char* view_uri, int id, contacts_record_h* out_record)
{
int ret = CONTACTS_ERROR_NONE;
pims_ipc_data_h indata = NULL;
if (cb == noti->cb && user_data == noti->cb_data
&& 0 == strcmp(noti->view_uri, view_uri)) {
it = it->next;
- result = g_slist_remove(result , noti);
+ result = g_slist_remove(result, noti);
free(noti->view_uri);
free(noti);
del_cnt++;
__INVALID_PARAMETER_ERROR_HANDLING();
}
-API int contacts_record_set_bool(contacts_record_h record, unsigned int property_id, bool value)
+API int contacts_record_set_bool(contacts_record_h record, unsigned int property_id, bool value)
{
RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER);
}
// Record get/set child records
-API int contacts_record_add_child_record(contacts_record_h record,
+API int contacts_record_add_child_record(contacts_record_h record,
unsigned int property_id, contacts_record_h child_record)
{
ctsvc_record_s *s_record;
__INVALID_PARAMETER_ERROR_HANDLING();
}
-API int contacts_record_remove_child_record(contacts_record_h record,
+API int contacts_record_remove_child_record(contacts_record_h record,
unsigned int property_id, contacts_record_h child_record)
{
ctsvc_record_s *s_record;
break;
case CTSVC_PROPERTY_URL_TYPE:
RETVM_IF(value < CONTACTS_URL_TYPE_OTHER
- || value > CONTACTS_URL_TYPE_WORK ,
+ || value > CONTACTS_URL_TYPE_WORK,
CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : url type is in invalid range (%d)", value);
url->type = value;
int id;
int activity_id;
char *photo_url;
- int sort_index;
+ int sort_index;
}ctsvc_activity_photo_s;
typedef struct {
contacts_record_h image;
struct timeval tv;
- temp = strchr(val , ':');
+ temp = strchr(val, ':');
RETVM_IF(NULL == temp, CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : val is invalid");
*temp = '\0';
contacts_list_add((contacts_list_h)company_list, company);
}
- temp = strchr(val , ':');
+ temp = strchr(val, ':');
RETVM_IF(NULL == temp, CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : val is invalid");
*temp = '\0';
}
else if (auto_link_enabled) {
ret = __ctsvc_find_person_to_link((contacts_record_h)contact, contact->addressbook_id, &person_id);
- CTS_DBG("__ctsvc_find_person_to_link return %d , person_id(%d)", ret, person_id);
+ CTS_DBG("__ctsvc_find_person_to_link return %d, person_id(%d)", ret, person_id);
if (ret == CONTACTS_ERROR_NONE && person_id > 0) {
contact->person_id = person_id;
auto_linked = true;
len = snprintf(query, sizeof(query),
"UPDATE "CTS_TABLE_CONTACTS" SET changed_ver=%d, changed_time=%d, is_favorite=%d, "
- "has_phonenumber=%d, has_email=%d , display_name=?, "
+ "has_phonenumber=%d, has_email=%d, display_name=?, "
"reverse_display_name=?, display_name_source=%d, "
"display_name_language=%d, reverse_display_name_language=%d, "
"sort_name=?, reverse_sort_name=?, "
display_len = SAFE_STRLEN(name->prefix) + temp_display_len + 2;
display = calloc(1, display_len);
char * temp = __ctsvc_remove_first_space(name->prefix);
- snprintf(display, display_len , "%s %s", temp, temp_display);
+ snprintf(display, display_len, "%s %s", temp, temp_display);
free(temp);
contact->reverse_display_name = display;
contact->reverse_sort_name = temp_display;
if (name->prefix && temp_display) {
display_len = SAFE_STRLEN(name->prefix) + temp_display_len + 2;
display = calloc(1, display_len);
- snprintf(display, display_len , "%s %s", name->prefix, temp_display);
+ snprintf(display, display_len, "%s %s", name->prefix, temp_display);
contact->display_name = display;
contact->sort_name = temp_display;
}
if (name->prefix && temp_display) {
display_len = SAFE_STRLEN(name->prefix) + temp_display_len + 2;
display = calloc(1, display_len);
- snprintf(display, display_len , "%s %s", name->prefix, temp_display);
+ snprintf(display, display_len, "%s %s", name->prefix, temp_display);
my_profile->reverse_display_name = display;
free(temp_display);
}
if (name->prefix && temp_display) {
display_len = SAFE_STRLEN(name->prefix) + temp_display_len + 2;
display = calloc(1, display_len);
- snprintf(display, display_len , "%s %s", name->prefix, temp_display);
+ snprintf(display, display_len, "%s %s", name->prefix, temp_display);
my_profile->display_name = display;
free(temp_display);
}
if (temp_len >= 0) len+= temp_len;
free(temp_keyword);
}
- temp_len = SAFE_SNPRINTF(query, query_size, len, " , ");
+ temp_len = SAFE_SNPRINTF(query, query_size, len, ", ");
if (temp_len >= 0) len+= temp_len;
temp_len = SAFE_SNPRINTF(query, query_size, len, sortkey);
if (temp_len >= 0) len+= temp_len;
sortkey = ctsvc_get_sort_column();
if (sortkey) {
- len = __ctsvc_db_search_records_append_sort(view_uri, sortkey, keyword, len , &query, &query_size);
+ len = __ctsvc_db_search_records_append_sort(view_uri, sortkey, keyword, len, &query, &query_size);
}
else if (0 == strcmp(view_uri, CTSVC_VIEW_URI_GROUP)) {
temp_len = SAFE_SNPRINTF(&query, &query_size, len, " ORDER BY group_prio");
len += snprintf(query+len, sizeof(query)-len, ") ");
ret = ctsvc_query_get_first_int_result(query, out_count);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
return ret;
}
for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++)
ctsvc_stmt_bind_copy_text(stmt, i, cursor->data, strlen(cursor->data));
ret = ctsvc_stmt_get_first_int_result(stmt, out_count);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_stmt_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_stmt_get_first_int_result() Failed(%d)", ret);
}
else {
ret = ctsvc_query_get_first_int_result(query, out_count);
free(query);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
}
return ret;
}
"AND "CTS_TABLE_CONTACTS".addressbook_id = "CTS_TABLE_ADDRESSBOOKS".addressbook_id",
CONTACTS_CHANGE_UPDATED, version,
CONTACTS_CHANGE_DELETED, version, version,
- CONTACTS_CHANGE_DELETED, version ,version);
+ CONTACTS_CHANGE_DELETED, version,version);
}
ret = ctsvc_query_prepare(query, &stmt);
snprintf(query, sizeof(query), "SELECT ver FROM "CTS_TABLE_VERSION);
ret = ctsvc_query_get_first_int_result(query, out_current_version);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
*out_list = list;
return CONTACTS_ERROR_NONE;
snprintf(query, sizeof(query), "SELECT ver FROM "CTS_TABLE_VERSION);
ret = ctsvc_query_get_first_int_result(query, out_current_version);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
*out_list = list;
return CONTACTS_ERROR_NONE;
snprintf(query, sizeof(query), "SELECT ver FROM "CTS_TABLE_VERSION);
ret = ctsvc_query_get_first_int_result(query, out_current_version);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
*out_list = list;
return CONTACTS_ERROR_NONE;
snprintf(query, sizeof(query), "SELECT ver FROM "CTS_TABLE_VERSION);
ret = ctsvc_query_get_first_int_result(query, out_current_version);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
*out_list = list;
return CONTACTS_ERROR_NONE;
snprintf(query, sizeof(query), "SELECT ver FROM "CTS_TABLE_VERSION);
ret = ctsvc_query_get_first_int_result(query, out_current_version);
- RETVM_IF(CONTACTS_ERROR_NONE != ret, ret , "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_get_first_int_result() Failed(%d)", ret);
*out_list = list;
return CONTACTS_ERROR_NONE;
RETVM_IF(0.0 == previous_prio && 0.0 == next_prio, CONTACTS_ERROR_INVALID_PARAMETER,
"The indexes for previous and next are invalid.");
- RETVM_IF(previous_group_id && previous_addressbook_id != addressbook_id , CONTACTS_ERROR_INVALID_PARAMETER,
+ RETVM_IF(previous_group_id && previous_addressbook_id != addressbook_id, CONTACTS_ERROR_INVALID_PARAMETER,
"previous group(%d) and group(%d) are not the same addressbook(%d, %d) groups",
previous_group_id, group_id, previous_addressbook_id, addressbook_id);
- RETVM_IF(next_group_id && next_addressbook_id != addressbook_id , CONTACTS_ERROR_INVALID_PARAMETER,
+ RETVM_IF(next_group_id && next_addressbook_id != addressbook_id, CONTACTS_ERROR_INVALID_PARAMETER,
"next group(%d) and group(%d) are not the same addressbook(%d, %d) groups",
next_group_id, group_id, next_addressbook_id, addressbook_id);
int count=0;
offset = src - CHINESE_UNICODE_START;
- RETVM_IF(offset < 0 || offset >= CHINESE_COUNT , CONTACTS_ERROR_INVALID_PARAMETER, "src is invalid");
+ RETVM_IF(offset < 0 || offset >= CHINESE_COUNT, CONTACTS_ERROR_INVALID_PARAMETER, "src is invalid");
len = strlen(pinyin_spell_table[offset]);
return false;
}
-static inline bool
-__ctsvc_has_chinese(const UChar *src)
+static inline bool __ctsvc_has_chinese(const UChar *src)
{
- int i, len;
+ int i, len;
len = u_strlen(src);
int ctsvc_convert_chinese_to_pinyin(const char *src, pinyin_name_s **name, int *size)
{
UChar temp_result[strlen(src)+1];
- int count = 0, len=0, total_count=0;
+ int count = 0, len=0, total_count=0;
int ret, i, j;
int multi_pinyin_count = 0;
UErrorCode status = 0;
return d_pos;
}
-// vaild character : digit, +, *, #, , ;, alphabet(depends on replace_alphabet parameter)
+// vaild character : digit, +, *, #,, ;, alphabet(depends on replace_alphabet parameter)
// Remove invalid string from number
int ctsvc_clean_number(const char *src, char *dest, int dest_size, bool replace_alphabet)
{
&& (number1[0] == '0' || (cc && cc[0] == '7' && number1[0] == '8')))
return true;
//////////////////////////////////////////////////
- // + IP CC XXXXXXXX, + CC XXXXXXXX (ex. +001 82 11 1234 5678 , +82 10 1234 5678)
+ // + IP CC XXXXXXXX, + CC XXXXXXXX (ex. +001 82 11 1234 5678, +82 10 1234 5678)
else if ((CTSVC_PLUS_IP_CC == n1 || CTSVC_IP_CC == n1)
&& (CTSVC_PLUS_CC_ONLY == n2 || CTSVC_CC_ONLY == n2)) {
int p = (CTSVC_PLUS_CC_ONLY == n2)?1:0;
return true;
}
///////////////////////////////////////////////////
- // + CC XXXXXXXX, + IP CC XXXXXXXX (ex. +001 82 10 1234 5678 , +82 10 1234 5678)
+ // + CC XXXXXXXX, + IP CC XXXXXXXX (ex. +001 82 10 1234 5678, +82 10 1234 5678)
else if ((CTSVC_PLUS_IP_ONLY == n1 || CTSVC_IP_ONLY == n1)
&& CTSVC_PLUS_ONLY == n2) {
return true;
bool is_favorite = false;
double priority = 0.0;
- RETVM_IF(person_id <= 0 || contact_id <= 0 , CONTACTS_ERROR_INVALID_PARAMETER,
+ RETVM_IF(person_id <= 0 || contact_id <= 0, CONTACTS_ERROR_INVALID_PARAMETER,
"Invalid parameter : person_id(%d), person_id(%d)", person_id, person_id);
if (out_person_id)
CTS_DBG("size(%d, %d) -> resize(%d,%d)", width, height, resized_width, resized_height);
- image_util_calculate_buffer_size(resized_width, resized_height, colorspace , &size_decode);
+ image_util_calculate_buffer_size(resized_width, resized_height, colorspace, &size_decode);
img_target = malloc(size_decode);
ret = vconf_get_int(ctsvc_get_default_sort_vconfkey(), &sort_type);
if (ret < 0 || sort_type == CTSVC_SORT_OTHERS) {
- CTS_ERR("vconf_get_int(%s) Failed(%d)", ctsvc_get_default_sort_vconfkey() ,ret);
+ CTS_ERR("vconf_get_int(%s) Failed(%d)", ctsvc_get_default_sort_vconfkey(),ret);
sort_type = ctsvc_get_sort_type_from_language(system_language);
if (sort_type == CTSVC_SORT_OTHERS)
sort_type = CTSVC_SORT_WESTERN;