SET(EXEC_PREFIX "\${prefix}")
SET(INCLUDEDIR "\${prefix}/${DEST_INCLUDE_DIR}")
SET(VERSION_MAJOR 0)
-SET(VERSION "${VERSION_MAJOR}.9.73.1")
+SET(VERSION "${VERSION_MAJOR}.9.75.1")
EXECUTE_PROCESS(COMMAND build-util/generator.sh)
int waiting_time = 500;
for (i=0;i<9;i++) {
usleep(waiting_time * 1000);
- DBG("retry cnt=%d, ret=%x, %d",(i+1), ret, waiting_time);
+ CTS_DBG("retry cnt=%d, ret=%x, %d",(i+1), ret, waiting_time);
ret = contacts_connect2();
if (ret == CONTACTS_ERROR_NONE)
break;
if (!initial_match &&
strlen(pinyinname[k].pinyin_name) <= strlen(temp_needle + j) &&
strncmp(pinyinname[k].pinyin_name, temp_needle + j, strlen(pinyinname[k].pinyin_name)) == 0) {
- DBG("A name matched");
match = true;
j+=strlen(pinyinname[k].pinyin_name);
break;
image->is_default = value;
break;
default:
- ERR("Invalid parameter : property_id(0x%x) is not supported in value(image)", property_id);
+ CTS_ERR("Invalid parameter : property_id(0x%x) is not supported in value(image)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
}
return CONTACTS_ERROR_NONE;
#define CTSVC_VCARD_IMAGE_LOCATION "/opt/usr/data/contacts-svc/img/vcard"
#define CTSVC_VCARD_APPEND_STR(buf, buf_size, len, str) do { \
- if ((len = __ctsvc_vcard_append_str(buf, buf_size, len, str)) < 0) { \
- ERR("__ctsvc_vcard_append_str() Failed"); \
+ if ((len = __ctsvc_vcard_append_str(buf, buf_size, len, str, false)) < 0) { \
+ CTS_ERR("__ctsvc_vcard_append_str() Failed"); \
return CONTACTS_ERROR_INTERNAL; \
} \
} while (0)
#define CTSVC_VCARD_APPEND_ENCODE_STR(buf, buf_size, len, content) do { \
if ((len = __ctsvc_vcard_append_encode_str(buf, buf_size, len, content)) < 0) { \
+ CTS_ERR("__ctsvc_vcard_append_encode_str() Failed"); \
+ return CONTACTS_ERROR_INTERNAL; \
+ } \
+} while (0)
+
+#define CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, content) do { \
+ if ((len = __ctsvc_vcard_append_str(buf, buf_size, len, content, true)) < 0) { \
ERR("__ctsvc_vcard_append_encode_str() Failed"); \
return CONTACTS_ERROR_INTERNAL; \
} \
} while (0)
+
#define CTSVC_VCARD_APPEND_CONTENT(buf, buf_size, len, content) do { \
if (__ctsvc_need_encode(content)) { \
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";ENCODING=BASE64:"); \
} \
else { \
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ":"); \
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, content); \
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, content); \
} \
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, CTSVC_CRLF); \
} while (0)
return false;
}
-static int __ctsvc_vcard_append_str(char **buf, int *buf_size, int len, const char *str)
+static int __ctsvc_vcard_append_str(char **buf, int *buf_size, int len, const char *str, bool need_conversion)
{
int len_temp = 0;
char *tmp = NULL;
}
if (need_realloc) {
- if (NULL == (tmp = realloc(*buf, *buf_size))) {
+ if (NULL == (tmp = realloc(*buf, *buf_size)))
return -1;
- }
else
*buf = tmp;
}
- len_temp = snprintf(*buf+len, *buf_size-len+1, "%s", safe_str);
+ if (need_conversion) {
+ const char *s = safe_str;
+ char *r = (char *)(*buf+len);
+
+ while (*s) {
+ switch (*s) {
+ case ';':
+ case ':':
+ case ',':
+ case '\\':
+ *r = '\\';
+ r++;
+ str_len++;
+ if (*buf_size<str_len+len+1) {
+ *buf_size = *buf_size * 2;
+ if (NULL == (tmp = realloc(*buf, *buf_size)))
+ return -1;
+ else
+ *buf = tmp;
+ }
+ break;
+ default:
+ break;
+ }
+ *r = *s;
+ r++;
+ s++;
+ }
+ len_temp = str_len;
+ }
+ else {
+ len_temp = snprintf(*buf+len, *buf_size-len+1, "%s", safe_str);
+ }
len += len_temp;
return len;
}
str_len = strlen(safe_str);
encoded_str = g_base64_encode((guchar *)safe_str, str_len);
- len = __ctsvc_vcard_append_str(buf, buf_size, len, encoded_str);
+ len = __ctsvc_vcard_append_str(buf, buf_size, len, encoded_str, false);
g_free(encoded_str);
return len;
}
}
else {
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ":");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, name->last);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, name->last);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, name->first);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, name->first);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, name->addition);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, name->addition);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, name->prefix);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, name->prefix);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, name->suffix);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, name->suffix);
}
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, CTSVC_CRLF);
}
else {
CTSVC_VCARD_APPEND_STR(buf,buf_size,len,":");
- CTSVC_VCARD_APPEND_STR(buf,buf_size,len,company->name);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf,buf_size,len,company->name);
if (company->department) {
CTSVC_VCARD_APPEND_STR(buf,buf_size,len,";");
- CTSVC_VCARD_APPEND_STR(buf,buf_size,len,company->department);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf,buf_size,len,company->department);
}
}
CTSVC_VCARD_APPEND_STR(buf,buf_size,len,CTSVC_CRLF);
}
else {
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ":");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, address->pobox);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, address->pobox);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, address->extended);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, address->extended);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, address->street);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, address->street);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, address->locality);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, address->locality);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, address->region);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, address->region);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, address->postalcode);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, address->postalcode);
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ";");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, address->country);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, address->country);
}
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, CTSVC_CRLF);
}
else {
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, ",");
- CTSVC_VCARD_APPEND_STR(buf, buf_size, len, nickname->nickname);
+ CTSVC_VCARD_APPEND_CONTENT_STR(buf, buf_size, len, nickname->nickname);
}
}
}
static int __ctsvc_vcard_append_person(ctsvc_person_s *person, ctsvc_list_s *list_contacts, char **buf, int *buf_size, int len)
{
- int ret;
int changed_time = 0;
ctsvc_contact_s *contact;
- ctsvc_simple_contact_s *simple_contact;
GList *cursor = NULL;
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->id == person->name_contact_id && contact->name) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->id == person->name_contact_id && contact->name) {
len = __ctsvc_vcard_append_name(contact->name, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->company && contact->company->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->company && contact->company->cursor) {
len = __ctsvc_vcard_append_company(contact->company, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->note && contact->note->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->note && contact->note->cursor) {
len = __ctsvc_vcard_append_note(contact->note, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->postal_addrs && contact->postal_addrs->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->postal_addrs && contact->postal_addrs->cursor) {
len = __ctsvc_vcard_append_postals(contact->postal_addrs, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->numbers && contact->numbers->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->numbers && contact->numbers->cursor) {
len = __ctsvc_vcard_append_numbers(contact->numbers, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->emails && contact->emails->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->emails && contact->emails->cursor) {
len = __ctsvc_vcard_append_emails(contact->emails, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->nicknames && contact->nicknames->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->nicknames && contact->nicknames->cursor) {
len = __ctsvc_vcard_append_nicknames(contact->nicknames, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->urls && contact->urls->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->urls && contact->urls->cursor) {
len = __ctsvc_vcard_append_webs(contact->urls, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->events && contact->events->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->events && contact->events->cursor) {
len = __ctsvc_vcard_append_events(contact->events, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->images && contact->images->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->images && contact->images->cursor) {
len = __ctsvc_vcard_put_photo(contact->images, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->messengers && contact->messengers->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->messengers && contact->messengers->cursor) {
len = __ctsvc_vcard_append_messengers(contact->messengers, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->relationships && contact->relationships->cursor) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->relationships && contact->relationships->cursor) {
len = __ctsvc_vcard_append_relationships(contact->relationships, buf, buf_size, len);
RETV_IF(len < 0, len);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && contact->uid) {
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && contact->uid) {
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, content_name[CTSVC_VCARD_VALUE_UID]);
CTSVC_VCARD_APPEND_CONTENT(buf, buf_size, len, contact->uid);
}
}
for(cursor=list_contacts->records;cursor;cursor=cursor->next) {
- simple_contact = (ctsvc_simple_contact_s *)cursor->data;
- ret = contacts_db_get_record(_contacts_contact._uri, simple_contact->contact_id, (contacts_record_h *)&contact);
- if (CONTACTS_ERROR_NONE == ret && contact && changed_time < contact->changed_time)
+ contact = (ctsvc_contact_s *)cursor->data;
+ if (contact && changed_time < contact->changed_time)
changed_time = contact->changed_time;
}
CTSVC_VCARD_APPEND_STR(buf, buf_size, len, temp);
}
+
#if 0
ctsvc_list_s* profile;
#endif
RETVM_IF(CTSVC_RECORD_PERSON != person->base.r_type, CONTACTS_ERROR_INVALID_PARAMETER,
"Invalid parameter : The record is not conatct record (type : %d)", person->base.r_type);
- contacts_filter_create(_contacts_simple_contact._uri, &filter);
- ret = contacts_filter_add_int(filter, _contacts_simple_contact.person_id, CONTACTS_MATCH_EQUAL, person->person_id);
+ contacts_filter_create(_contacts_contact._uri, &filter);
+ ret = contacts_filter_add_int(filter, _contacts_contact.person_id, CONTACTS_MATCH_EQUAL, person->person_id);
if (CONTACTS_ERROR_NONE != ret) {
CTS_ERR("Invalid parameter : contacts_filter_add_int is failed", ret);
contacts_filter_destroy(filter);
return CONTACTS_ERROR_INVALID_PARAMETER;
}
- contacts_query_create(_contacts_simple_contact._uri, &query);
+ contacts_query_create(_contacts_contact._uri, &query);
contacts_query_set_filter(query, filter);
ret = contacts_db_get_records_with_query(query, 0, 0, &list);
static char* __ctsvc_strtok(char *val, char c)
{
- while(*val) {
- if(*val == c) {
+ char *before = NULL;
+ while (*val) {
+ if (*val == c && (NULL == before || *before != '\\')) {
*val = '\0';
return (val+1);
}
+ before = val;
val++;
}
return val;
return temp;
}
+static char* __ctsvc_vcard_remove_escape_char(char *str)
+{
+ char *s = SAFE_STR(str);
+ char *r = s;
+ while (*s) {
+ if (*s == '\\' && *(s+1)) {
+ char *n = (char*)(s+1);
+ switch (*n) {
+ case 'n':
+ case 'N':
+ *r = '\n';
+ s++;
+ break;
+ case ';':
+ case ':':
+ case ',':
+ case '\\':
+ *r = *n;
+ s++;
+ break;
+ default:
+ *r = *s;
+ break;
+ }
+ r++;
+ s++;
+ }
+ else {
+ *r = *s;
+ r++;
+ s++;
+ }
+ }
+ *r = '\0';
+ return str;
+}
+
static inline int __ctsvc_vcard_get_display_name(ctsvc_list_s *name_list, char *val)
{
int ret;
WARN_IF(ret != CONTACTS_ERROR_NONE, "contacts_record_get_str_p is failed(%d)", ret);
if ((NULL == first_name || '\0' == *first_name) && (NULL == last_name || '\0' == *last_name))
- contacts_record_set_str(name, _contacts_name.first, temp);
+ contacts_record_set_str(name, _contacts_name.first, __ctsvc_vcard_remove_escape_char(temp));
return CONTACTS_ERROR_NONE;
}
}
temp = __ctsvc_strtok(start, separator);
- contacts_record_set_str(name, _contacts_name.last, start);
+ contacts_record_set_str(name, _contacts_name.last, __ctsvc_vcard_remove_escape_char(start));
start = temp;
temp = __ctsvc_strtok(start, separator);
- contacts_record_set_str(name, _contacts_name.first, start);
+ contacts_record_set_str(name, _contacts_name.first, __ctsvc_vcard_remove_escape_char(start));
start = temp;
temp = __ctsvc_strtok(start, separator);
- contacts_record_set_str(name, _contacts_name.addition, start);
+ contacts_record_set_str(name, _contacts_name.addition, __ctsvc_vcard_remove_escape_char(start));
start = temp;
temp = __ctsvc_strtok(start, separator);
- contacts_record_set_str(name, _contacts_name.prefix, start);
+ contacts_record_set_str(name, _contacts_name.prefix, __ctsvc_vcard_remove_escape_char(start));
start = temp;
__ctsvc_strtok(start, separator);
- contacts_record_set_str(name, _contacts_name.suffix, start);
+ contacts_record_set_str(name, _contacts_name.suffix, __ctsvc_vcard_remove_escape_char(start));
return CONTACTS_ERROR_NONE;
}
__ctsvc_strtok(start, separator);
if (CTSVC_VCARD_VALUE_PHONETIC_FIRST_NAME == type)
- contacts_record_set_str(name, _contacts_name.phonetic_first, start);
+ contacts_record_set_str(name, _contacts_name.phonetic_first, __ctsvc_vcard_remove_escape_char(start));
else if (CTSVC_VCARD_VALUE_PHONETIC_MIDDLE_NAME == type)
- contacts_record_set_str(name, _contacts_name.phonetic_middle, start);
+ contacts_record_set_str(name, _contacts_name.phonetic_middle, __ctsvc_vcard_remove_escape_char(start));
else if (CTSVC_VCARD_VALUE_PHONETIC_LAST_NAME == type)
- contacts_record_set_str(name, _contacts_name.phonetic_last, start);
+ contacts_record_set_str(name, _contacts_name.phonetic_last, __ctsvc_vcard_remove_escape_char(start));
return CONTACTS_ERROR_NONE;
}
}
__ctsvc_strtok(start, separator);
- contacts_record_set_str(name, _contacts_name.phonetic_last, start);
+ contacts_record_set_str(name, _contacts_name.phonetic_last, __ctsvc_vcard_remove_escape_char(start));
return CONTACTS_ERROR_NONE;
}
nickname_list->count = 0;
return ret;
}
- contacts_record_set_str(nickname, _contacts_nickname.name, temp);
+ contacts_record_set_str(nickname, _contacts_nickname.name, __ctsvc_vcard_remove_escape_char(start));
contacts_list_add((contacts_list_h)nickname_list, nickname);
temp = strtok(NULL, separator);
contacts_record_set_str(contact, _contacts_contact.image_thumbnail_path, dest);
return CONTACTS_ERROR_NONE;
+
}
static inline void __ctsvc_vcard_get_event_type(contacts_record_h event, char *val)
temp = __ctsvc_get_content_value(cpy);
if (NULL == temp) {
free(cpy);
- ERR("Invalid parameter : vcard(%s)", val);
+ CTS_ERR("Invalid parameter : vcard(%s)", val);
return CONTACTS_ERROR_INVALID_PARAMETER;
}
*dest = '\0';
if ('\0' == *val) {
free(cpy);
- ERR("Invalid parameter : val(%d)", val);
+ CTS_ERR("Invalid parameter : val(%d)", val);
return CONTACTS_ERROR_INVALID_PARAMETER;
}
ret = contacts_record_create(_contacts_event._uri, &event);
if (ret < CONTACTS_ERROR_NONE) {
free(cpy);
- ERR("contacts_record_create is failed(%d)", ret);
+ CTS_ERR("contacts_record_create is failed(%d)", ret);
return ret;
}
value = __ctsvc_get_content_value(val);
RETV_IF(NULL == value, CONTACTS_ERROR_NO_DATA);
- contacts_record_set_str(company, property_id, value);
+ contacts_record_set_str(company, property_id, __ctsvc_vcard_remove_escape_char(value));
return CONTACTS_ERROR_NONE;
}
{
int ret;
char *temp, *start;
+ const char separator = ';';
contacts_record_h company;
ret = contacts_record_create(_contacts_company._uri, &company);
start = __ctsvc_get_content_value(val);
RETV_IF(NULL == start, CONTACTS_ERROR_NO_DATA);
- temp = strchr(start, ';');
- if (NULL == temp) {
- contacts_record_set_str(company, _contacts_company.name, start);
- return CONTACTS_ERROR_NONE;
- }
+ temp = __ctsvc_strtok(start, separator);
+ contacts_record_set_str(company, _contacts_company.name, __ctsvc_vcard_remove_escape_char(start));
- *temp = '\0';
- contacts_record_set_str(company, _contacts_company.name, start);
- contacts_record_set_str(company, _contacts_company.department, temp+1);
+ temp = __ctsvc_strtok(temp, separator);
+ if (temp)
+ contacts_record_set_str(company, _contacts_company.department, __ctsvc_vcard_remove_escape_char(temp));
if (val != temp) {
*(temp-1) = '\0';
temp = __ctsvc_get_content_value(val);
RETV_IF(NULL == temp, CONTACTS_ERROR_NO_DATA);
- contacts_record_set_str(note, _contacts_note.note, g_strcompress(temp));
+ contacts_record_set_str(note, _contacts_note.note, g_strcompress(__ctsvc_vcard_remove_escape_char(temp)));
return CONTACTS_ERROR_NONE;
}
ret = contacts_record_create(_contacts_url._uri, &url);
RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create is failed(%d)", ret);
- contacts_record_set_str(url, _contacts_url.url, temp);
+ contacts_record_set_str(url, _contacts_url.url, __ctsvc_vcard_remove_escape_char(temp));
if (val != temp) {
*(temp-1) = '\0';
__ctsvc_vcard_get_url_type(url, val);
ret = contacts_record_create(_contacts_number._uri, &number);
RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create is failed(%d)", ret);
- contacts_record_set_str(number, _contacts_number.number, temp);
+ contacts_record_set_str(number, _contacts_number.number, __ctsvc_vcard_remove_escape_char(temp));
if (val != temp) {
*(temp-1) = '\0';
contacts_record_set_bool(number, _contacts_number.is_default, __ctsvc_vcard_get_number_type(number, val));
ret = contacts_record_create(_contacts_email._uri, &email);
RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create is failed(%d)", ret);
- contacts_record_set_str(email, _contacts_email.email, temp);
+ contacts_record_set_str(email, _contacts_email.email, __ctsvc_vcard_remove_escape_char(temp));
if (val != temp) {
*(temp-1) = '\0';
contacts_record_set_bool(email, _contacts_email.is_default, __ctsvc_vcard_get_email_type(email, val));
ret = contacts_record_create(_contacts_messenger._uri, &messenger);
RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create is failed(%d)", ret);
- contacts_record_set_str(messenger, _contacts_messenger.im_id, temp);
+ contacts_record_set_str(messenger, _contacts_messenger.im_id, __ctsvc_vcard_remove_escape_char(temp));
switch (type) {
case CTSVC_VCARD_VALUE_X_MSN:
ret = contacts_record_create(_contacts_relationship._uri, &relationship);
RETVM_IF(ret < CONTACTS_ERROR_NONE, ret, "contacts_record_create is failed(%d)", ret);
- contacts_record_set_str(relationship, _contacts_relationship.name, temp);
+ contacts_record_set_str(relationship, _contacts_relationship.name, __ctsvc_vcard_remove_escape_char(temp));
if (val != temp) {
*(temp-1) = '\0';
__ctsvc_vcard_get_relationship_type(relationship, val);
free(val);
break;
case CTSVC_VCARD_VALUE_ADR:
- case CTSVC_VCARD_VALUE_LABEL:
__ctsvc_vcard_get_address(contact->postal_addrs, val);
free(val);
break;
free(val);
break;
case CTSVC_VCARD_VALUE_UID:
- contacts_record_set_str((contacts_record_h)contact, _contacts_contact.uid, val);
+ contacts_record_set_str((contacts_record_h)contact, _contacts_contact.uid, __ctsvc_vcard_remove_escape_char(val));
free(val);
break;
case CTSVC_VCARD_VALUE_URL:
tmp_properties_flags = (unsigned char*)pims_ipc_data_get(ipc_data, &size);
common->properties_flags = calloc(common->property_max_count, sizeof(char));
if (common->properties_flags == NULL) {
- ERR("calloc fail");
+ CTS_ERR("calloc fail");
return CONTACTS_ERROR_OUT_OF_MEMORY;
}
memcpy(common->properties_flags, tmp_properties_flags, sizeof(char)*common->property_max_count);
</request>
</define>
<assign>
- <filesystem path="/usr/lib/libcontacts-service2.so.0.9.73.1" label="_"/>
+ <filesystem path="/usr/lib/libcontacts-service2.so.0.9.75.1" label="_"/>
<filesystem path="/usr/lib/libcontacts-service2.so.0" label="_"/>
- <filesystem path="/usr/lib/libcontacts-service3.so.0.9.73.1" label="_"/>
+ <filesystem path="/usr/lib/libcontacts-service3.so.0.9.75.1" label="_"/>
<filesystem path="/usr/lib/libcontacts-service3.so.0" label="_"/>
<filesystem path="/opt/usr/dbspace/.contacts-svc.db" label="contacts-service::db"/>
<filesystem path="/opt/usr/dbspace/.contacts-svc.db-journal" label="contacts-service::db"/>
CONTACTS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
CONTACTS_ERROR_FILE_NO_SPACE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< FS Full */
/* LOGIC & DATA */
- CONTACTS_ERROR_NO_DATA = TIZEN_ERROR_SOCIAL_CLASS | TIZEN_ERROR_NO_DATA, /**< Requested data does not exist */
+ CONTACTS_ERROR_NO_DATA = TIZEN_ERROR_SOCIAL_CLASS | TIZEN_ERROR_NO_DATA, /**< Requested data does not exist */
+ CONTACTS_ERROR_PERMISSION_DENIED = TIZEN_ERROR_SOCIAL_CLASS | TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
/* DB */
// CONTACTS_ERROR_DB_NOT_OPENED = TIZEN_ERROR_SOCIAL_CLASS | 0x80, /**< Database didn't opened not yet */
// CONTACTS_ERROR_DB_FULL = TIZEN_ERROR_SOCIAL_CLASS | 0x84, /**< Database Full */
// CONTACTS_ERROR_DB_IO_ERROR = TIZEN_ERROR_SOCIAL_CLASS | 0x85, /**< Database I/O error */
- CONTACTS_ERROR_DB = TIZEN_ERROR_SOCIAL_CLASS | 0x9F, /**< Unknown DB error */
+ CONTACTS_ERROR_DB = TIZEN_ERROR_SOCIAL_CLASS | 0x9F, /**< Unknown DB error */
/* IPC */
// CONTACTS_ERROR_IPC_BUSY = TIZEN_ERROR_SOCIAL_CLASS | 0xB0, /**< IPC bus locked */
CONTACTS_ERROR_IPC_NOT_AVALIABLE = TIZEN_ERROR_SOCIAL_CLASS | 0xB1, /**< IPC server is not available */
- CONTACTS_ERROR_IPC = TIZEN_ERROR_SOCIAL_CLASS | 0xBF, /**< Unknown IPC error */
+ CONTACTS_ERROR_IPC = TIZEN_ERROR_SOCIAL_CLASS | 0xBF, /**< Unknown IPC error */
/* VCARD */
// CONTACTS_ERROR_VCARD_UNKNOWN_ERROR = TIZEN_ERROR_SOCIAL_CLASS | 0xCF, /**< Unknown Vcard error */
/* ENVIRONMENT & OTEHR MODULE */
- CONTACTS_ERROR_SYSTEM = TIZEN_ERROR_SOCIAL_CLASS | 0xEF, /**< . */
+ CONTACTS_ERROR_SYSTEM = TIZEN_ERROR_SOCIAL_CLASS | 0xEF, /**< . */
/*
CONTACTS_ERROR_SOCKET_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0xE0,
CONTACTS_ERROR_INOTIFY_FAILED = TIZEN_ERROR_SOCIAL_CLASS | 0xE1,
*
*/
-#include <unistd.h>
#include <ctype.h>
+#include <unistd.h>
#include "contacts.h"
#include "ctsvc_internal.h"
static int __ctsvc_company_add_logo_file(int parent_id, int company_id, char *src_img, char *dest_name, int dest_size)
{
int ret;
- char *ext;
char *temp;
+ char *ext;
char dest[CTSVC_IMG_FULL_PATH_SIZE_MAX] = {0};
RETVM_IF(NULL == src_img, CONTACTS_ERROR_INVALID_PARAMETER, "img_path is NULL");
{
int ret;
- DBG("B ctsvc_contact_insert_data_name");
//Insert the name
if (contact->name) {
ret = ctsvc_contact_insert_data_name((contacts_list_h)contact->name, contact->id, false);
return ret;
}
}
- DBG("A ctsvc_contact_insert_data_name");
//Insert the company
if (contact->company) {
* limitations under the License.
*
*/
+#include <ctype.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <unistd.h>
#include <vconf.h>
#include <vconf-keys.h>
-#include <ctype.h>
#include "contacts.h"
#include "ctsvc_internal.h"
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
contacts_record_destroy(record, true);
return CONTACTS_ERROR_DB;
}
"SELECT contact_id, person_id FROM "CTSVC_DB_VIEW_CONTACT" WHERE contact_id = %d", email->contact_id);
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
"SELECT contact_id, person_id FROM "CTSVC_DB_VIEW_CONTACT" WHERE contact_id = %d", image->contact_id);
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
"SELECT contact_id, person_id FROM "CTSVC_DB_VIEW_CONTACT" WHERE contact_id = %d", number->contact_id);
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
s_record = (ctsvc_record_s *)record;
if (0 == s_record->property_max_count || NULL == s_record->properties_flags) {
- ERR("record don't have properties");
+ CTS_ERR("record don't have properties");
return CONTACTS_ERROR_INVALID_PARAMETER;
}
ret = cts_stmt_step(stmt);
if (1 /*CTS_TRUE*/ != ret) {
cts_stmt_finalize(stmt);
- ERR("person(%d) has no default image", id);
+ CTS_ERR("person(%d) has no default image", id);
return CONTACTS_ERROR_NO_DATA;
}
ret = CONTACTS_ERROR_NONE;
}
else
- ERR("contacts_record_create() Failed");
+ CTS_ERR("contacts_record_create() Failed");
cts_stmt_finalize(stmt);
return ret;
CTS_TABLE_CONTACTS, CTS_TABLE_ACTIVITIES, person->person_id);
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
free(image_thumbnail_path);
contacts_record_destroy((contacts_record_h)person, true);
return CONTACTS_ERROR_DB;
ctsvc_get_display_column(), CTS_TABLE_CONTACTS, person_id);
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
free(image_thumbnail_path);
free(ringtone_path);
free(vibration);
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("DB error : cts_query_prepare() Failed");
+ CTS_ERR("DB error : cts_query_prepare() Failed");
free(addressbook_ids);
free(image_thumbnail_path);
free(ringtone_path);
int waiting_time = 500;
for (i=0;i<9;i++) {
usleep(waiting_time * 1000);
- DBG("retry cnt=%d, ret=%x, %d",(i+1), ret, waiting_time);
+ CTS_DBG("retry cnt=%d, ret=%x, %d",(i+1), ret, waiting_time);
ret = contacts_connect2();
if (ret == CONTACTS_ERROR_NONE)
break;
API int contacts_setting_get_name_display_order(contacts_name_display_order_e *order)
{
int ret;
- if (name_display_order < 0){
+ if (name_display_order < 0) {
ret = vconf_get_int(CTSVC_VCONF_DISPLAY_ORDER, &name_display_order);
RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "System : vconf_get_int() Failed(%d)", ret);
}
CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : The parameter(order:%d) is Invalid", name_display_order);
ret = vconf_set_int(CTSVC_VCONF_DISPLAY_ORDER, order);
- RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "System : vconf_set_int(%s) Failed(%d)", CTSVC_VCONF_DISPLAY_ORDER, ret);
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "System : vconf_set_int(display order) Failed(%d)", ret);
name_display_order = order;
if (name_sorting_order < 0)
{
ret = vconf_get_int(CTSVC_VCONF_SORTING_ORDER, &name_sorting_order);
- RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "System : vconf_get_int() Failed(%d)", ret);
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "System : vconf_get_int(sort order) Failed(%d)", ret);
}
*order = name_sorting_order;
CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : The parameter(order:%d) is Invalid", name_sorting_order);
ret = vconf_set_int(CTSVC_VCONF_SORTING_ORDER, order);
- RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "System : vconf_set_int(%s) Failed(%d)", CTSVC_VCONF_SORTING_ORDER, ret);
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "System : vconf_set_int(sort order) Failed(%d)", ret);
name_sorting_order = order;
}
ret = vconf_notify_key_changed(CTSVC_VCONF_DISPLAY_ORDER,
ctsvc_vconf_display_order_cb, NULL);
- RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
- CTSVC_VCONF_DISPLAY_ORDER, ret);
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(display order) Failed(%d)", ret);
// sorting order
ret = vconf_get_int(CTSVC_VCONF_SORTING_ORDER, &name_sorting_order);
}
ret = vconf_notify_key_changed(CTSVC_VCONF_SORTING_ORDER,
ctsvc_vconf_sorting_order_cb, NULL);
- RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
- CTSVC_VCONF_SORTING_ORDER, ret);
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(sort order) Failed(%d)", ret);
// phonenumber min match digit
ret = vconf_get_int(CTSVC_VCONF_PHONENUMBER_MIN_MATCH_DIGIT, &phonenumber_min_match_digit);
int ret;
ret = vconf_ignore_key_changed(CTSVC_VCONF_DISPLAY_ORDER, ctsvc_vconf_display_order_cb);
- RETM_IF(ret<0,"vconf_ignore_key_changed(%s) Failed(%d)",CTSVC_VCONF_DISPLAY_ORDER,ret);
+ RETM_IF(ret<0,"vconf_ignore_key_changed(display order) Failed(%d)", ret);
ret = vconf_ignore_key_changed(CTSVC_VCONF_SORTING_ORDER, ctsvc_vconf_sorting_order_cb);
- RETM_IF(ret<0,"vconf_ignore_key_changed(%s) Failed(%d)",CTSVC_VCONF_SORTING_ORDER,ret);
-
+ RETM_IF(ret<0,"vconf_ignore_key_changed(sort order) Failed(%d)", ret);
ret = vconf_ignore_key_changed(ctsvc_get_default_sort_vconfkey(), ctsvc_vconf_sort_change_cb);
RETM_IF(ret<0,"vconf_ignore_key_changed(default_lang) Failed(%d)", ret);
* limitations under the License.
*
*/
+#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <unicode/ulocdata.h>
#include <unicode/uset.h>
#include <unicode/ustring.h>
-#include <ctype.h>
#include "contacts.h"
#include "ctsvc_internal.h"
Name: contacts-service
Summary: Contacts Service
-Version: 0.9.73.1
+Version: 0.9.75.1
Release: 1
Group: TO_BE/FILLED_IN
License: Apache-2.0
ret = contacts_connect2();
- if (outdata)
- {
+ if (outdata) {
*outdata = pims_ipc_data_create(0);
- if (!*outdata)
- {
- ERR("pims_ipc_data_create fail");
+ if (!*outdata) {
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
- if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
- {
+ if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
}
- else
- {
- ERR("outdata is NULL");
+ else {
+ CTS_ERR("outdata is NULL");
}
return;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
}
ret = ctsvc_ipc_unmarshal_record(indata,&record);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
record = NULL;
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
if (ctsvc_ipc_marshal_int(id,*outdata) != CONTACTS_ERROR_NONE)
{
pims_ipc_data_destroy(*outdata);
- ERR("ctsvc_ipc_marshal fail");
+ CTS_ERR("ctsvc_ipc_marshal fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
// goto 주의..
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
ret = ctsvc_ipc_unmarshal_string(indata,&view_uri);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_string fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_string fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_record fail");
+ CTS_ERR("ctsvc_ipc_marshal_record fail");
goto DATA_FREE;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (record)
ret = ctsvc_ipc_unmarshal_record(indata,&record);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (record)
ret = ctsvc_ipc_unmarshal_string(indata,&view_uri);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (indata) {
ret = ctsvc_ipc_unmarshal_record(indata, &record);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
record = NULL;
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &id);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else {
- ERR("ctsvc_ipc_server_db_replace_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_replace_record fail");
goto ERROR_RETURN;
}
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
ret = ctsvc_ipc_unmarshal_string(indata,&view_uri);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&offset);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&limit);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto DATA_FREE;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
ret = ctsvc_ipc_unmarshal_query(indata,&query);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&offset);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&limit);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto DATA_FREE;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
ret = ctsvc_ipc_unmarshal_string(indata,&view_uri);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto DATA_FREE;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
CONTACTS_FREE(view_uri);
ret = ctsvc_ipc_unmarshal_query(indata,&query);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto DATA_FREE;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (query)
ret = ctsvc_ipc_unmarshal_list(indata,&list);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_list fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_list fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (list)
ret = ctsvc_ipc_unmarshal_list(indata,&list);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_list fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_list fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (list)
ret = ctsvc_ipc_unmarshal_string(indata,&uri);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_string fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_string fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&count);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
if (count <=0)
ret = ctsvc_ipc_unmarshal_int(indata,&ids[i]);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
CONTACTS_FREE(uri);
if (indata) {
ret = ctsvc_ipc_unmarshal_list(indata, &list);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_list fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_list fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_unsigned_int(indata, &count);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
for(i=0;i<count;i++) {
ret = ctsvc_ipc_unmarshal_int(indata, &ids[i]);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
}
else {
- ERR("ctsvc_ipc_server_db_repalce_records fail");
+ CTS_ERR("ctsvc_ipc_server_db_repalce_records fail");
goto ERROR_RETURN;
}
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
goto ERROR_RETURN;
}
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (list) {
ret = ctsvc_ipc_unmarshal_string(indata,&view_uri);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_string fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_string fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &address_book_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&contacts_db_version);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
ret = ctsvc_ipc_marshal_list(record_list,*outdata);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_marshal_list fail");
+ CTS_ERR("ctsvc_ipc_marshal_list fail");
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
ret = ctsvc_ipc_marshal_int(current_contacts_db_version,*outdata);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
ret = CONTACTS_ERROR_OUT_OF_MEMORY;
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
if (record_list)
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
ret = ctsvc_ipc_marshal_int(contacts_db_version,*outdata);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
}
ret = ctsvc_ipc_unmarshal_string(indata,&view_uri);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_string(indata,&keyword);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&offset);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&limit);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto DATA_FREE;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
ret = ctsvc_ipc_unmarshal_query(indata,&query);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_string(indata,&keyword);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_record fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_record fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&offset);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata,&limit);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto DATA_FREE;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
goto DATA_FREE;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
goto DATA_FREE;
}
if (pims_ipc_data_put(*outdata,(void*)&ret,sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
goto DATA_FREE;
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
DATA_FREE:
ret = ctsvc_ipc_unmarshal_int(indata, &contact_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_server_db_insert_record fail");
+ CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &account_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_activity_delete_by_account_id fail");
+ CTS_ERR("ctsvc_ipc_activity_delete_by_account_id fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &group_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &contact_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_group_add_contact fail");
+ CTS_ERR("ctsvc_ipc_group_add_contact fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &group_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &contact_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_group_remove_contact fail");
+ CTS_ERR("ctsvc_ipc_group_remove_contact fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &group_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &previous_group_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &next_group_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_group_link_group fail");
+ CTS_ERR("ctsvc_ipc_group_link_group fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &base_person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_person_link_person fail");
+ CTS_ERR("ctsvc_ipc_person_link_person fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &contact_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_person_link_person fail");
+ CTS_ERR("ctsvc_ipc_person_link_person fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
int temp = 0;
type = (int)temp;
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_person_link_person fail");
+ CTS_ERR("ctsvc_ipc_person_link_person fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &previous_person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &next_person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_person_link_person fail");
+ CTS_ERR("ctsvc_ipc_person_link_person fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
ret = ctsvc_ipc_unmarshal_int(indata, &person_id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_unsigned_int(indata, &property);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_int(indata, &id);
if (ret != CONTACTS_ERROR_NONE)
{
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else
{
- ERR("ctsvc_ipc_person_set_default_property fail");
+ CTS_ERR("ctsvc_ipc_person_set_default_property fail");
goto ERROR_RETURN;
}
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
if (indata) {
ret = ctsvc_ipc_unmarshal_int(indata, &person_id);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = ctsvc_ipc_unmarshal_unsigned_int(indata, &op);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else {
- ERR("ctsvc_ipc_person_get_default_property fail");
+ CTS_ERR("ctsvc_ipc_person_get_default_property fail");
goto ERROR_RETURN;
}
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail (return value)");
+ CTS_ERR("pims_ipc_data_put fail (return value)");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&id, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail (id)");
+ CTS_ERR("pims_ipc_data_put fail (id)");
return;
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
*outdata = pims_ipc_data_create(0);
if (!*outdata)
{
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0)
{
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
}
else
{
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
if (indata) {
ret = ctsvc_ipc_unmarshal_int(indata, (int*)&op);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
case CONTACTS_PHONE_LOG_DELETE_BY_ADDRESS:
ret = ctsvc_ipc_unmarshal_string(indata, &number);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_string fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_string fail");
goto ERROR_RETURN;
}
ret = contacts_phone_log_delete(op, number);
case CONTACTS_PHONE_LOG_DELETE_BY_EMAIL_EXTRA_DATA1:
ret = ctsvc_ipc_unmarshal_int(indata, &extra_data1);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
ret = contacts_phone_log_delete(op, extra_data1);
break;
default:
- ERR("Invalid parameter : the operation is not proper (op : %d)", op);
+ CTS_ERR("Invalid parameter : the operation is not proper (op : %d)", op);
ret = CONTACTS_ERROR_INVALID_PARAMETER;
break;
}
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
if (ret == CONTACTS_ERROR_NONE) {
if (ctsvc_ipc_marshal_int(transaction_ver, *outdata) != CONTACTS_ERROR_NONE) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("ctsvc_ipc_marshal_int fail");
+ CTS_ERR("ctsvc_ipc_marshal_int fail");
return;
}
}
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail (return value)");
+ CTS_ERR("pims_ipc_data_put fail (return value)");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&order, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail (id)");
+ CTS_ERR("pims_ipc_data_put fail (id)");
return;
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail (return value)");
+ CTS_ERR("pims_ipc_data_put fail (return value)");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&order, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail (id)");
+ CTS_ERR("pims_ipc_data_put fail (id)");
return;
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
if (indata) {
ret = ctsvc_ipc_unmarshal_int(indata, &order);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else {
- ERR("ctsvc_ipc_person_set_default_property fail");
+ CTS_ERR("ctsvc_ipc_person_set_default_property fail");
goto ERROR_RETURN;
}
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
if (indata) {
ret = ctsvc_ipc_unmarshal_int(indata, &order);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("ctsvc_ipc_unmarshal_int fail");
+ CTS_ERR("ctsvc_ipc_unmarshal_int fail");
goto ERROR_RETURN;
}
}
else {
- ERR("ctsvc_ipc_person_set_default_property fail");
+ CTS_ERR("ctsvc_ipc_person_set_default_property fail");
goto ERROR_RETURN;
}
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail");
+ CTS_ERR("pims_ipc_data_put fail");
return;
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
return;
if (outdata) {
*outdata = pims_ipc_data_create(0);
if (!*outdata) {
- ERR("pims_ipc_data_create fail");
+ CTS_ERR("pims_ipc_data_create fail");
free(indexs);
return;
}
if (pims_ipc_data_put(*outdata, (void*)&ret, sizeof(int)) != 0) {
pims_ipc_data_destroy(*outdata);
*outdata = NULL;
- ERR("pims_ipc_data_put fail (return value)");
+ CTS_ERR("pims_ipc_data_put fail (return value)");
free(indexs);
return;
}
}
}
else {
- ERR("outdata is NULL");
+ CTS_ERR("outdata is NULL");
}
free(indexs);
#include <sqlite3.h>
#include <contacts.h>
-#include "internal.h"
+#include "ctsvc_internal.h"
#include "ctsvc_server_sqlite.h"
#include "schema.h"
#include "ctsvc_sqlite.h"
#include "ctsvc_schema_recovery.h"
#include "ctsvc_schema.h"
+// Additional Error
+enum {
+ CTSVC_ERR_NO_DB_FILE = -10000,
+ CTSVC_ERR_NO_TABLE,
+};
+
static inline int __ctsvc_server_check_db_file(void)
{
int fd = open(CTSVC_DB_PATH, O_RDONLY);
- h_retvm_if(-1 == fd, CTSVC_ERR_NO_DB_FILE,
- "DB file(%s) is not exist", CTSVC_DB_PATH);
+ RETVM_IF(-1 == fd, CTSVC_ERR_NO_DB_FILE, "DB file is not exist");
close(fd);
return CONTACTS_ERROR_NONE;
sqlite3 *db;
ret = ctsvc_server_db_open(&db);
- h_retvm_if(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
ret = sqlite3_exec(db, schema_query, NULL, 0, &errmsg);
if (SQLITE_OK != ret) {
- ERR("remake contacts DB file is Failed : %s", errmsg);
+ CTS_ERR("remake contacts DB file is Failed : %s", errmsg);
sqlite3_free(errmsg);
}
ctsvc_server_db_close();
fd = open(CTSVC_DB_PATH, O_CREAT | O_RDWR, 0660);
- h_retvm_if(-1 == fd, CONTACTS_ERROR_SYSTEM, "open Failed");
+ RETVM_IF(-1 == fd, CONTACTS_ERROR_SYSTEM, "open Failed");
ret = fchown(fd, getuid(), CTS_SECURITY_FILE_GROUP);
if (0 != ret)
- ERR("fchown(%s) Failed(%d)", CTSVC_DB_PATH, ret);
+ CTS_ERR("fchown(%s) Failed(%d)", CTSVC_DB_PATH, ret);
ret = fchmod(fd, CTS_SECURITY_DEFAULT_PERMISSION);
if (0 != ret)
- ERR("fchown(%s) Failed(%d)", CTSVC_DB_PATH, ret);
+ CTS_ERR("fchown(%s) Failed(%d)", CTSVC_DB_PATH, ret);
close(fd);
fd = open(CTSVC_DB_JOURNAL_PATH, O_CREAT | O_RDWR, 0660);
- h_retvm_if(-1 == fd, CONTACTS_ERROR_SYSTEM, "open Failed");
+ RETVM_IF(-1 == fd, CONTACTS_ERROR_SYSTEM, "open Failed");
ret = fchown(fd, getuid(), CTS_SECURITY_FILE_GROUP);
if (0 != ret)
- ERR("fchown(%s) Failed(%d)", CTSVC_DB_JOURNAL_PATH, ret);
+ CTS_ERR("fchown(%s) Failed(%d)", CTSVC_DB_JOURNAL_PATH, ret);
ret = fchmod(fd, CTS_SECURITY_DEFAULT_PERMISSION);
if (0 != ret)
- ERR("fchown(%s) Failed(%d)", CTSVC_DB_JOURNAL_PATH, ret);
+ CTS_ERR("fchown(%s) Failed(%d)", CTSVC_DB_JOURNAL_PATH, ret);
close(fd);
return CONTACTS_ERROR_NONE;
cts_stmt stmt = NULL;
ret = ctsvc_server_db_open(&db);
- h_retvm_if(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
snprintf(query, sizeof(query),
"SELECT name FROM sqlite_master WHERE type='table' AND name='%s'",
CTS_TABLE_CONTACTS);
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if (SQLITE_OK != ret) {
- ERR("DB error : sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
+ CTS_ERR("DB error : sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
ctsvc_server_db_close();
return CONTACTS_ERROR_DB;
}
ret = sqlite3_step(stmt);
if (SQLITE_ROW != ret) {
- ERR("contacts table does not exist in contacts DB file : %s", sqlite3_errmsg(db));
+ CTS_ERR("contacts table does not exist in contacts DB file : %s", sqlite3_errmsg(db));
sqlite3_finalize(stmt);
ctsvc_server_db_close();
return CTSVC_ERR_NO_TABLE;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h> //getuid
#include <pims-ipc.h>
#include <pims-ipc-svc.h>
-#include "internal.h" // DBG
+#include "ctsvc_internal.h"
#include "ctsvc_db_init.h"
#include "ctsvc_schema.h"
#include "ctsvc_schema_recovery.h"
#include "ctsvc_ipc_server2.h"
#include "ctsvc_ipc_server_sim.h"
-//static GMainLoop *loop;
-
static int __server_main(void)
{
int ret;
ret = contacts_connect2();
if (CONTACTS_ERROR_NONE != ret) {\r
- SERVER_DBG("contacts_connect2 fail(%d)", ret);
+ CTS_ERR("contacts_connect2 fail(%d)", ret);
break;
}
ctsvc_server_bg_delete_start();
ret = ctsvc_server_init_configuration();
- SERVER_DBG("%d", ret);
+ CTS_DBG("%d", ret);
pims_ipc_svc_run_main_loop(NULL);
ret = contacts_disconnect2();
if (CONTACTS_ERROR_NONE != ret)\r
- SERVER_DBG("%d", ret);
+ CTS_DBG("%d", ret);
pims_ipc_svc_deinit_for_publish();
} while(0);
- ERR("pims_ipc_svc_register error");
+ CTS_ERR("pims_ipc_svc_register error");
return -1;
}
int main(int argc, char *argv[])
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
ctsvc_server_check_schema();
if (2 <= argc && !strcmp(argv[1], "schema"))
return CONTACTS_ERROR_NONE;
ret = ctsvc_server_socket_init();
- SERVER_DBG("%d", ret);
+ CTS_DBG("%d", ret);
__server_main();
#include <account.h>
#include "contacts.h"
-#include "internal.h"
+#include "ctsvc_internal.h"
#include "ctsvc_schema.h"
#include "ctsvc_sqlite.h"
#include "ctsvc_server_bg.h"
snprintf(query, sizeof(query), "SELECT contact_id FROM "CTS_TABLE_CONTACTS" WHERE deleted = 1");
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("cts_query_prepare() Failed");
+ CTS_ERR("cts_query_prepare() Failed");
return CONTACTS_ERROR_DB;
}
// remove data
static int __ctsvc_server_bg_contact_delete_step2(__ctsvc_delete_data_s* data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
char query[CTS_SQL_MIN_LEN] = {0};
GSList *list = NULL;
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("cts_query_prepare() Failed");
+ CTS_ERR("cts_query_prepare() Failed");
return CONTACTS_ERROR_DB;
}
return CONTACTS_ERROR_NO_DATA;
ret = ctsvc_begin_trans();
- h_retvm_if(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_DB, "DB failed" );
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_DB, "DB failed" );
cursor = g_slist_nth(list, 0);
while(cursor) {
snprintf(query, sizeof(query), "DELETE FROM "CTS_TABLE_DATA" WHERE id = %d", id);
ret = ctsvc_query_exec(query);
- SERVER_DBG("%s",query);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("DB failed");
+ CTS_ERR("DB failed");
ctsvc_end_trans(false);
g_slist_free(list);
return CONTACTS_ERROR_DB;
// remove activities
static int __ctsvc_server_bg_contact_delete_step3(__ctsvc_delete_data_s* data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
char query[CTS_SQL_MIN_LEN] = {0};
stmt = cts_query_prepare(query);
if (NULL == stmt) {
- ERR("cts_query_prepare() Failed");
+ CTS_ERR("cts_query_prepare() Failed");
return CONTACTS_ERROR_DB;
}
return CONTACTS_ERROR_NO_DATA;
ret = ctsvc_begin_trans();
- h_retvm_if(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_DB, "DB failed" );
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_DB, "DB failed" );
cursor = g_slist_nth(list, 0);
while(cursor) {
snprintf(query, sizeof(query), "DELETE FROM "CTS_TABLE_ACTIVITIES" WHERE id = %d", id);
ret = ctsvc_query_exec(query);
- SERVER_DBG("%s",query);
if (ret != CONTACTS_ERROR_NONE) {
- ERR("DB failed");
+ CTS_ERR("DB failed");
ctsvc_end_trans(false);
g_slist_free(list);
return CONTACTS_ERROR_DB;
char query[CTS_SQL_MIN_LEN] = {0};
ret = ctsvc_begin_trans();
- h_retvm_if(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_DB, "DB failed" );
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_DB, "DB failed" );
snprintf(query, sizeof(query), "DELETE FROM "CTS_TABLE_SEARCH_INDEX" WHERE contact_id = %d",
data->current_contact_id);
ret = ctsvc_query_exec(query);
- SERVER_DBG("%s",query);
if (CONTACTS_ERROR_NONE != ret) {
- ERR("DB failed");
+ CTS_ERR("DB failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
snprintf(query, sizeof(query), "DELETE FROM "CTS_TABLE_CONTACTS" WHERE contact_id = %d",
data->current_contact_id);
ret = ctsvc_query_exec(query);
- SERVER_DBG("%s",query);
if (CONTACTS_ERROR_NONE != ret) {
- ERR("DB failed");
+ CTS_ERR("DB failed");
ctsvc_end_trans(false);
return CONTACTS_ERROR_DB;
}
if (ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NO_DATA) {
if(data->contact_ids)
g_slist_free(data->contact_ids);
- ERR("fail (%d)",ret);
+ CTS_ERR("fail (%d)",ret);
return false;
}
if (ret == CONTACTS_ERROR_NO_DATA) {
if(data->contact_ids)
g_slist_free(data->contact_ids);
- ERR("step_1 no_data");
+ CTS_ERR("step_1 no_data");
return false;
}
data->step = STEP_2;
static bool __ctsvc_server_db_delete_run(__ctsvc_delete_data_s* data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret = CONTACTS_ERROR_NONE;
if(data == NULL) {
- ERR("data is NULL");
+ CTS_ERR("data is NULL");
return false;
}
ret = __ctsvc_server_bg_contact_delete_step4(data);
break;
default:
- ERR("invalid step");
+ CTS_ERR("invalid step");
if(data->contact_ids)
g_slist_free(data->contact_ids);
return false;
static gpointer __ctsvc_server_bg_delete(gpointer user_data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
__ctsvc_delete_data_s *callback_data = NULL;
while(1) {
callback_data = calloc(1,sizeof(__ctsvc_delete_data_s));
if (callback_data == NULL) {
- ERR("calloc fail");
+ CTS_ERR("calloc fail");
continue;
}
callback_data->step = STEP_1;
ret = contacts_connect2();
if (CONTACTS_ERROR_NONE != ret) {
- SERVER_DBG("%d", ret);
+ CTS_ERR("contacts_connect2() fail(%d)", ret);
free(callback_data);
continue;
}
while(1) {
sleep(CTSVC_SERVER_BG_DELETE_STEP_TIME); // sleep 1 sec.
if (__ctsvc_server_db_delete_run(callback_data) == false) {
- SERVER_DBG("end");
+ CTS_DBG("end");
free(callback_data);
break;
}
}
ret = contacts_disconnect2();
if (CONTACTS_ERROR_NONE != ret)
- SERVER_DBG("%d", ret);
+ CTS_ERR("contacts_disconnect2 Fail(%d)", ret);
g_mutex_lock(&__ctsvc_server_bg_delete_mutex);
- SERVER_DBG("wait");
+ CTS_DBG("wait");
g_cond_wait(&__ctsvc_server_bg_delete_cond, &__ctsvc_server_bg_delete_mutex);
g_mutex_unlock(&__ctsvc_server_bg_delete_mutex);
}
- return NULL;
+ return NULL;
}
void ctsvc_server_bg_delete_start()
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
if (__ctsvc_server_bg_delete_thread == NULL) {
g_mutex_init(&__ctsvc_server_bg_delete_mutex);
static bool __ctsvc_server_account_delete_cb(const char* event_type, int account_id, void* user_data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
if (strcmp(event_type, ACCOUNT_NOTI_NAME_DELETE) == 0)
ctsvc_addressbook_delete(account_id);
return true;
{
int ret;
ret = contacts_db_add_changed_cb(_contacts_address_book._uri, __ctsvc_server_addressbook_deleted_cb, NULL);
- SERVER_DBG("call contacts_db_add_changed_cb (_contacts_address_book) : return (%d)", ret);
+ CTS_DBG("call contacts_db_add_changed_cb (_contacts_address_book) : return (%d)", ret);
ret = contacts_db_add_changed_cb(_contacts_contact._uri, __ctsvc_server_contact_deleted_cb, NULL);
- SERVER_DBG("call contacts_db_add_changed_cb (_contacts_contact): return (%d)", ret);
+ CTS_DBG("call contacts_db_add_changed_cb (_contacts_contact): return (%d)", ret);
ret = account_subscribe_create(&account);
if (ACCOUNT_ERROR_NONE == ret) {
ret = account_subscribe_notification(account, __ctsvc_server_account_delete_cb, NULL);
if (ACCOUNT_ERROR_NONE != ret) {
- SERVER_DBG("account_subscribe_notification Failed (%d)", ret);
+ CTS_ERR("account_subscribe_notification Failed (%d)", ret);
}
}
else
- SERVER_DBG("account_subscribe_create Failed (%d)", ret);
+ CTS_ERR("account_subscribe_create Failed (%d)", ret);
}
void ctsvc_server_bg_remove_cb()
{
int ret;
ret = contacts_db_remove_changed_cb(_contacts_address_book._uri, __ctsvc_server_addressbook_deleted_cb, NULL);
- SERVER_DBG("call contacts_db_remove_changed_cb (_contacts_address_book): return (%d)", ret);
+ CTS_DBG("call contacts_db_remove_changed_cb (_contacts_address_book): return (%d)", ret);
ret = contacts_db_remove_changed_cb(_contacts_contact._uri, __ctsvc_server_contact_deleted_cb, NULL);
- SERVER_DBG("call contacts_db_remove_changed_cb (_contacts_contact) : return (%d)", ret);
+ CTS_DBG("call contacts_db_remove_changed_cb (_contacts_contact) : return (%d)", ret);
if (account) {
account_unsubscribe_notification(account); // unsubscirbe & destroy
\r
indata = pims_ipc_data_create(0);\r
if (!indata) {\r
- ERR("pims_ipc_data_create error\n");\r
+ CTS_ERR("pims_ipc_data_create error\n");\r
return false;\r
}\r
\r
if (pims_ipc_data_put(indata, data, strlen(data) + 1) != 0) {\r
- ERR("pims_ipc_data_put error\n");\r
+ CTS_ERR("pims_ipc_data_put error\n");\r
return false;\r
}\r
\r
if (pims_ipc_svc_publish(CTSVC_IPC_SUBSCRIBE_MODULE, (char*)view_uri, indata) != 0) {\r
- ERR("pims_ipc_svc_publish error\n");\r
+ CTS_ERR("pims_ipc_svc_publish error (%s)\n", view_uri);\r
return false;\r
}\r
\r
#include <contacts.h>
-#include "internal.h"
+#include "ctsvc_internal.h"
#include "ctsvc_struct.h"
#include "ctsvc_server_socket.h"
#include "ctsvc_server_sqlite.h"
static inline GSList* __ctsvc_server_get_contact_records(void)
{
- h_retvm_if(gcontact_records == NULL, NULL, "gcontact_records is NULL");
+ RETVM_IF(gcontact_records == NULL, NULL, "gcontact_records is NULL");
return gcontact_records;
}
static inline void __ctsvc_server_sim_set_init_completed(bool init)
{
- SERVER_DBG("set ginit_completed = %d ", init);
+ CTS_DBG("set ginit_completed = %d ", init);
ginit_completed = init;
}
bool ctsvc_server_sim_get_init_completed(void)
{
- SERVER_DBG("get complete_init_flag = %d ", ginit_completed);
+ CTS_DBG("get complete_init_flag = %d ", ginit_completed);
return ginit_completed;
}
static inline void __ctsvc_server_set_sim_addressbook_id(int id)
vconf_get_bool(VCONFKEY_TELEPHONY_READY, &bReady);
if(!bReady) {
- SERVER_DBG("telephony is not ready ");
+ CTS_ERR("telephony is not ready ");
return NULL;
}
else {
ghandle = tel_init(NULL);
- h_retvm_if(NULL == ghandle, NULL, "tel_init() Failed");
+ RETVM_IF(NULL == ghandle, NULL, "tel_init() Failed");
}
}
return ghandle;
void ctsvc_server_sim_destroy_contact_record(sim_contact_s *record)
{
- h_retm_if(record == NULL, "record is NULL ");
+ RETM_IF(record == NULL, "record is NULL ");
free(record->name);
free(record->number);
free(record->anr1);
}
int ctsvc_server_sim_finalize(void)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
GSList *cursor = NULL;
sim_contact_s *record = NULL;
int ret = 0;
if (ghandle) {
ret = tel_deinit(ghandle);
- h_retvm_if(TAPI_API_SUCCESS != ret, CONTACTS_ERROR_SYSTEM,
+ RETVM_IF(TAPI_API_SUCCESS != ret, CONTACTS_ERROR_SYSTEM,
"tel_deinit() Failed(%d)", ret);
}
int err = 0;
TelSimCardType_t cardtype = TAPI_SIM_PB_UNKNOWNN;
err = tel_get_sim_type(__ctsvc_server_get_tapi_handle(), &cardtype);
- h_retm_if(err != TAPI_API_SUCCESS,"tel_get_sim_type failed");
+ RETM_IF(err != TAPI_API_SUCCESS,"tel_get_sim_type failed");
if(cardtype == TAPI_SIM_CARD_TYPE_USIM)
gsim_type = TAPI_SIM_PB_3GSIM;
static inline void* __ctsvc_server_get_return_data(void)
{
- h_retvm_if(greturn_data == NULL, NULL, "ghelper_data is NULL");
+ RETVM_IF(greturn_data == NULL, NULL, "ghelper_data is NULL");
return greturn_data;
}
{
int ret;
- h_retvm_if(number == NULL,CONTACTS_ERROR_INVALID_PARAMETER, "invalid number");
+ RETVM_IF(number == NULL,CONTACTS_ERROR_INVALID_PARAMETER, "invalid number");
ret = contacts_record_create(_contacts_number._uri, record);
- h_retvm_if(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_destroy() Failed(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_destroy() Failed(%d)", ret);
ret = contacts_record_set_str(*record, _contacts_number.number, number);
- h_retvm_if(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_str() Failed(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_str() Failed(%d)", ret);
ret = contacts_record_set_int(*record, _contacts_number.type, CONTACTS_NUMBER_TYPE_OTHER);
- h_retvm_if(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_int() Failed(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_int() Failed(%d)", ret);
return ret;
}
{
int ret;
- h_retvm_if(email == NULL,CONTACTS_ERROR_INVALID_PARAMETER, "invalid email");
+ RETVM_IF(email == NULL,CONTACTS_ERROR_INVALID_PARAMETER, "invalid email");
ret = contacts_record_create(_contacts_email._uri, record);
- h_retvm_if(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_destroy() Failed(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_destroy() Failed(%d)", ret);
ret = contacts_record_set_str(*record, _contacts_email.email, email);
- h_retvm_if(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_str() Failed(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_str() Failed(%d)", ret);
ret = contacts_record_set_int(*record, _contacts_email.type,CONTACTS_EMAIL_TYPE_OTHER);
- h_retvm_if(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_int() Failed(%d)", ret);
+ RETVM_IF(ret < CONTACTS_ERROR_NONE,ret, "contacts_record_set_int() Failed(%d)", ret);
return ret;
}
static int __ctsvc_server_insert_contact_to_db(sim_contact_s *record,int* contact_id, int addressbook_id)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
char sim_id[20] = {0};
contacts_record_h contact = NULL;
contacts_record_h email = NULL;
// contacts_record_h nick = NULL;
- h_retvm_if(record == NULL, CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : record is NULL");
- h_retvm_if(contact_id == NULL, CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : contact_id is NULL");
- h_retvm_if(record->sim_index <= 0, CONTACTS_ERROR_INVALID_PARAMETER, "The index(%d) is invalid", record->sim_index);
+ RETVM_IF(record == NULL, CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : record is NULL");
+ RETVM_IF(contact_id == NULL, CONTACTS_ERROR_INVALID_PARAMETER, "Invalid parameter : contact_id is NULL");
+ RETVM_IF(record->sim_index <= 0, CONTACTS_ERROR_INVALID_PARAMETER, "The index(%d) is invalid", record->sim_index);
- SERVER_DBG("insert record -> sim_index %d",record->sim_index);
+ CTS_DBG("insert record -> sim_index %d",record->sim_index);
ret = contacts_record_create(_contacts_contact._uri, &contact);
- h_retvm_if(CONTACTS_ERROR_NONE != ret, ret, "contacts_record_create failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "contacts_record_create failed(%d)", ret);
snprintf(sim_id, sizeof(sim_id), "%d", record->sim_index);
contacts_record_set_str(contact, _contacts_contact.uid, sim_id);
contacts_record_add_child_record(contact, _contacts_contact.name, name);
}
}
- SERVER_DBG("insert record -> name %s", record->name);
+ CTS_DBG("insert record -> name %s", record->name);
/* if (record->nickname) {
contacts_record_create(_contacts_nickname._uri, &nick);
contacts_record_add_child_record(contact, _contacts_contact.nickname, nick);
}
}
- SERVER_DBG("insert record -> nick name %s", record->nickname);
+ CTS_DBG("insert record -> nick name %s", record->nickname);
*/
ret = __ctsvc_server_insert_db_num(&number, (char *)record->number);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.number, number);
- SERVER_DBG("insert record ->number %s", record->number);
+ CTS_DBG("insert record ->number %s", record->number);
/* ret = __ctsvc_server_insert_db_num(&number, (char *)record->anr1);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.number, number);
- SERVER_DBG("insert record ->anr1 %s", record->anr1);
+ CTS_DBG("insert record ->anr1 %s", record->anr1);
ret = __ctsvc_server_insert_db_num(&number, (char *)record->anr2);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.number, number);
- SERVER_DBG("insert record ->anr2 %s", record->anr2);
+ CTS_DBG("insert record ->anr2 %s", record->anr2);
ret = __ctsvc_server_insert_db_num(&number, (char *)record->anr3);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.number, number);
- SERVER_DBG("insert record ->anr3 %s", record->anr3);
+ CTS_DBG("insert record ->anr3 %s", record->anr3);
*/
ret = __ctsvc_server_insert_db_email(&email, (char *)record->email1);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.email, email);
- SERVER_DBG("insert record ->email1 %s", record->email1);
+ CTS_DBG("insert record ->email1 %s", record->email1);
/*
ret = __ctsvc_server_insert_db_email(&email, (char *)record->email2);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.email, email);
- SERVER_DBG("insert record ->email2 %s", record->email2);
+ CTS_DBG("insert record ->email2 %s", record->email2);
ret = __ctsvc_server_insert_db_email(&email, (char *)record->email3);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.email, email);
- SERVER_DBG("insert record ->email3 %s", record->email3);
+ CTS_DBG("insert record ->email3 %s", record->email3);
ret = __ctsvc_server_insert_db_email(&email, (char *)record->email4);
if (CONTACTS_ERROR_NONE == ret)
contacts_record_add_child_record(contact, _contacts_contact.email, email);
- SERVER_DBG("insert record ->email4 %s", record->email4);
+ CTS_DBG("insert record ->email4 %s", record->email4);
*/
contacts_record_set_int(contact, _contacts_contact.address_book_id, addressbook_id);
ret = contacts_db_insert_record(contact, contact_id);
- h_warn_if(ret < CONTACTS_ERROR_NONE, "contacts_db_insert_record() Failed(%d)", ret);
+ WARN_IF(ret < CONTACTS_ERROR_NONE, "contacts_db_insert_record() Failed(%d)", ret);
record->contact_id = *contact_id;
- SERVER_DBG("inserted contact id = %d",record->contact_id);
+ CTS_DBG("inserted contact id = %d",record->contact_id);
contacts_record_destroy(contact, true);
- h_warn_if(ret < CONTACTS_ERROR_NONE, "contacts_record_destroy() Failed(%d)", ret);
+ WARN_IF(ret < CONTACTS_ERROR_NONE, "contacts_record_destroy() Failed(%d)", ret);
return ret;
}
static void __ctsvc_server_sim_import_read_cb(TapiHandle *handle, int result, void *data, void* user_data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret = 0;
TelSimPbAccessResult_t access_rt = result;
TelSimPbRecord_t *sim_info = data;
if (NULL == sim_info) {
- ERR("sim_info is NULL, result = %d", access_rt);
+ CTS_ERR("sim_info is NULL, result = %d", access_rt);
ret = CONTACTS_ERROR_SYSTEM;
goto ERROR_RETURN;
}
if(access_rt == TAPI_SIM_PB_INVALID_INDEX) {
- SERVER_DBG("TAPI_SIM_PB_INVALID_INDEX : start_index = %d",start_index);
+ CTS_DBG("TAPI_SIM_PB_INVALID_INDEX : start_index = %d",start_index);
start_index++; //search for start index
sim_file_s *file = __ctsvc_server_sim_get_file_record(TAPI_PB_3G_NAME);
if(start_index > file->get_index_max((void*)file)){
- ERR("start_index is invalid start_index = %d, total = %d", start_index,file->get_index_max((void*)file));
+ CTS_ERR("start_index is invalid start_index = %d, total = %d", start_index,file->get_index_max((void*)file));
ret = CONTACTS_ERROR_SYSTEM;
goto ERROR_RETURN;
}
ret = tel_read_sim_pb_record(handle, __ctsvc_server_get_sim_type(), start_index, __ctsvc_server_sim_import_read_cb, (void*)start_index);
if(ret != TAPI_API_SUCCESS){
- ERR("SIM phonebook access Failed(%d) start_indext(%d)", access_rt,start_index);
+ CTS_ERR("SIM phonebook access Failed(%d) start_indext(%d)", access_rt,start_index);
ret = CONTACTS_ERROR_SYSTEM;
goto ERROR_RETURN;
}
}
if (TAPI_SIM_PB_SUCCESS != access_rt) {
- ERR("SIM phonebook access Failed(%d)", access_rt);
+ CTS_ERR("SIM phonebook access Failed(%d)", access_rt);
ret = CONTACTS_ERROR_SYSTEM;
goto ERROR_RETURN;
}
ret = __ctsvc_server_insert_contact_to_db(record, &contact_id,PHONE_ADDRESSBOOK_ID);
ctsvc_server_sim_destroy_contact_record(record);
if(ret < CONTACTS_ERROR_NONE || contact_id <= 0) {
- ERR("__ctsvc_server_insert_or_update_contact_to_db is fail(%d)",ret);
+ CTS_ERR("__ctsvc_server_insert_or_update_contact_to_db is fail(%d)",ret);
goto ERROR_RETURN;
}
break;
case TAPI_SIM_PB_FDN:
case TAPI_SIM_PB_SDN:
default:
- ERR("Unknown storage type(%d)", sim_info->phonebook_type);
+ CTS_ERR("Unknown storage type(%d)", sim_info->phonebook_type);
ret = CONTACTS_ERROR_SYSTEM;
goto ERROR_RETURN;
}
if (sim_info->next_index && CTSVC_TAPI_SIM_PB_MAX != sim_info->next_index) {
- SERVER_DBG("NextIndex = %d", sim_info->next_index);
+ CTS_DBG("NextIndex = %d", sim_info->next_index);
ret = tel_read_sim_pb_record(__ctsvc_server_get_tapi_handle(), sim_info->phonebook_type,
sim_info->next_index, __ctsvc_server_sim_import_read_cb, NULL);
if (TAPI_API_SUCCESS != ret) {
- ERR("tel_read_sim_pb_record() Failed(%d)", ret);
+ CTS_ERR("tel_read_sim_pb_record() Failed(%d)", ret);
ret = CONTACTS_ERROR_SYSTEM;
goto ERROR_RETURN;
}
else {
if (__ctsvc_server_get_return_data()) {
ret = ctsvc_server_socket_return(__ctsvc_server_get_return_data(), CONTACTS_ERROR_NONE, 0, NULL);
- h_warn_if(CONTACTS_ERROR_NONE != ret, "ctsvc_server_socket_return() Failed(%d)", ret);
+ WARN_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_server_socket_return() Failed(%d)", ret);
__ctsvc_server_set_return_data(NULL);
}
}
ERROR_RETURN:
if (__ctsvc_server_get_return_data()) {
ret = ctsvc_server_socket_return(__ctsvc_server_get_return_data(), ret, 0, NULL);
- h_warn_if(CONTACTS_ERROR_NONE != ret, "ctsvc_server_socket_return() Failed(%d)", ret);
+ WARN_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_server_socket_return() Failed(%d)", ret);
__ctsvc_server_set_return_data(NULL);
}
return;
int ctsvc_server_sim_import(void* data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
- h_retvm_if(false == ctsvc_server_sim_get_init_completed(), CONTACTS_ERROR_SYSTEM,"sim init is not completed");
- h_retvm_if(NULL != __ctsvc_server_get_return_data(), CONTACTS_ERROR_INTERNAL,"Helper is already processing with sim");
+ RETVM_IF(false == ctsvc_server_sim_get_init_completed(), CONTACTS_ERROR_SYSTEM,"sim init is not completed");
+ RETVM_IF(NULL != __ctsvc_server_get_return_data(), CONTACTS_ERROR_INTERNAL,"Helper is already processing with sim");
__ctsvc_server_set_return_data(data);
sim_file_s *file = __ctsvc_server_sim_get_file_record(TAPI_PB_3G_NAME);
if(file->get_unused_count((void*)file) == file->get_index_max((void*)file)){
ret = ctsvc_server_socket_return(__ctsvc_server_get_return_data(), CONTACTS_ERROR_NO_DATA, 0, NULL);
- h_warn_if(CONTACTS_ERROR_SYSTEM != ret, "helper_socket_return() Failed(%d)", ret);
+ WARN_IF(CONTACTS_ERROR_SYSTEM != ret, "helper_socket_return() Failed(%d)", ret);
__ctsvc_server_set_return_data(NULL);
return ret;
}
ret = tel_read_sim_pb_record(__ctsvc_server_get_tapi_handle(), __ctsvc_server_get_sim_type(), 1,
__ctsvc_server_sim_import_read_cb, NULL);
if (ret != TAPI_API_SUCCESS) {
- ERR("tel_read_sim_pb_record = %d",ret);
+ CTS_ERR("tel_read_sim_pb_record = %d",ret);
__ctsvc_server_set_return_data(NULL);
return CONTACTS_ERROR_SYSTEM;
}
static void __ctsvc_server_sim_sdn_read_cb(TapiHandle *handle, int result, void *data, void *user_data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret=0;
TelSimPbAccessResult_t sec_rt = result;
TelSimPbRecord_t *sim_info = data;
- h_retm_if(sim_info == NULL, "sim_info is NULL");
+ RETM_IF(sim_info == NULL, "sim_info is NULL");
if (TAPI_SIM_PB_SUCCESS != sec_rt) {
if (TAPI_SIM_PB_SDN == sim_info->phonebook_type &&
TAPI_SIM_PB_INVALID_INDEX == sec_rt) {
- SERVER_DBG("Index = %d", sim_info->index);
+ CTS_DBG("Index = %d", sim_info->index);
ret = tel_read_sim_pb_record(handle, sim_info->phonebook_type,sim_info->index+1,
__ctsvc_server_sim_sdn_read_cb, NULL);
- h_retm_if(ret != TAPI_API_SUCCESS, "tel_read_sim_pb_record() Failed(%d)", ret);
+ RETM_IF(ret != TAPI_API_SUCCESS, "tel_read_sim_pb_record() Failed(%d)", ret);
}
- ERR("SIM phonebook access Failed(%d)", sec_rt);
+ CTS_ERR("SIM phonebook access Failed(%d)", sec_rt);
goto ERROR_RETURN;
}
switch (sim_info->phonebook_type) {
case TAPI_SIM_PB_SDN:
ret = ctsvc_server_insert_sdn_contact((char *)sim_info->name, (char *)sim_info->number);
- h_warn_if(ret != CONTACTS_ERROR_NONE, "ctsvc_server_insert_sdn_contact() Failed(%d)", ret);
+ WARN_IF(ret != CONTACTS_ERROR_NONE, "ctsvc_server_insert_sdn_contact() Failed(%d)", ret);
break;
case TAPI_SIM_PB_ADN:
case TAPI_SIM_PB_3GSIM:
case TAPI_SIM_PB_FDN:
default:
- ERR("Unknown storage type(%d)", sim_info->phonebook_type);
+ CTS_ERR("Unknown storage type(%d)", sim_info->phonebook_type);
goto ERROR_RETURN;
}
if (sim_info->next_index && CTSVC_TAPI_SIM_PB_MAX != sim_info->next_index) {
- SERVER_DBG("NextIndex = %d", sim_info->next_index);
+ CTS_DBG("NextIndex = %d", sim_info->next_index);
ret = tel_read_sim_pb_record(handle, sim_info->phonebook_type,sim_info->next_index,
__ctsvc_server_sim_sdn_read_cb, NULL);
if (TAPI_API_SUCCESS != ret) {
- ERR("tel_read_sim_pb_record() Failed(%d)", ret);
+ CTS_ERR("tel_read_sim_pb_record() Failed(%d)", ret);
goto ERROR_RETURN;
}
}
}
static void __ctsvc_server_sim_sdn_meta_info_cb(TapiHandle *handle, int result, void *data, void *user_data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
TelSimPbAccessResult_t sec_rt = result;
int ret=0;
if (TAPI_SIM_PB_SUCCESS != sec_rt) {
- ERR("__ctsvc_server_sim_sdn_meta_info_cb() Failed(%d)", sec_rt);
+ CTS_ERR("__ctsvc_server_sim_sdn_meta_info_cb() Failed(%d)", sec_rt);
goto ERROR_RETURN;
}
ret = tel_read_sim_pb_record(__ctsvc_server_get_tapi_handle(), TAPI_SIM_PB_SDN,1, __ctsvc_server_sim_sdn_read_cb, NULL);
if(TAPI_API_SUCCESS != ret) {
- ERR("tel_read_sim_pb_record() Failed(%d)", ret);
+ CTS_ERR("tel_read_sim_pb_record() Failed(%d)", ret);
goto ERROR_RETURN;
}
}
int ctsvc_server_sim_read_sdn(void* data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret, card_changed = 0;
TelSimCardStatus_t sim_status;
- h_retvm_if(NULL != __ctsvc_server_get_return_data(), CONTACTS_ERROR_INVALID_PARAMETER,
+ RETVM_IF(NULL != __ctsvc_server_get_return_data(), CONTACTS_ERROR_INVALID_PARAMETER,
"Helper is already processing with sim");
ret = tel_get_sim_init_info(__ctsvc_server_get_tapi_handle(), &sim_status, &card_changed);
if(TAPI_API_SUCCESS != ret) {
- ERR("tel_get_sim_init_info() Failed(%d)", ret);
- SERVER_DBG("sim_status = %d, card_changed = %d", sim_status, card_changed);
+ CTS_ERR("tel_get_sim_init_info() Failed(%d)", ret);
+ CTS_DBG("sim_status = %d, card_changed = %d", sim_status, card_changed);
goto ERROR_RETURN;
}
TAPI_SIM_STATUS_CARD_REMOVED == sim_status) {
ret = ctsvc_server_delete_sdn_contact();
if(CONTACTS_ERROR_NONE != ret) {
- ERR("__ctsvc_server_delete_SDN_contact() Failed(%d)", ret);
+ CTS_ERR("__ctsvc_server_delete_SDN_contact() Failed(%d)", ret);
goto ERROR_RETURN;
}
}
else if (TAPI_SIM_STATUS_SIM_INIT_COMPLETED == sim_status) {
ret = ctsvc_server_delete_sdn_contact();
if(CONTACTS_ERROR_NONE != ret) {
- ERR("__ctsvc_server_delete_SDN_contact() Failed(%d)", ret);
+ CTS_ERR("__ctsvc_server_delete_SDN_contact() Failed(%d)", ret);
goto ERROR_RETURN;
}
ret = tel_get_sim_pb_meta_info(__ctsvc_server_get_tapi_handle(), TAPI_SIM_PB_SDN, __ctsvc_server_sim_sdn_meta_info_cb, NULL);
- h_retvm_if(ret != TAPI_API_SUCCESS, CONTACTS_ERROR_SYSTEM, "tel_get_sim_(usim)_meta_info =%d",ret);
+ RETVM_IF(ret != TAPI_API_SUCCESS, CONTACTS_ERROR_SYSTEM, "tel_get_sim_(usim)_meta_info =%d",ret);
if(TAPI_API_SUCCESS != ret) {
- ERR("tel_get_sim_pb_meta_info() Failed(%d)", ret);
+ CTS_ERR("tel_get_sim_pb_meta_info() Failed(%d)", ret);
goto ERROR_RETURN;
}
else
- ERR("sim_status Failed(%d)", sim_status);
+ CTS_ERR("sim_status Failed(%d)", sim_status);
}
return CONTACTS_ERROR_NONE;
static void __ctsvc_server_sim_initialize_cb(TapiHandle *handle, int result, void *data, void *user_data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int i=0;
TelSimPbAccessResult_t access_rt = result;
TelSimPbType_t sim_type = __ctsvc_server_get_sim_type();
- SERVER_DBG("sim_type = %d",sim_type);
+ CTS_DBG("sim_type = %d",sim_type);
if (TAPI_SIM_PB_3GSIM == sim_type) {
TelSimPbCapabilityInfo_t *capa = data;
- h_retm_if(capa == NULL, "capa is NULL result =%d",access_rt);
+ RETM_IF(capa == NULL, "capa is NULL result =%d",access_rt);
for (i=0; i < capa->FileTypeCount; i++) {
sim_file_s *file_record = NULL;
int type = capa->FileTypeInfo[i].field_type;
- SERVER_DBG("TYPE = %d",type);
+ CTS_DBG("TYPE = %d",type);
file_record = __ctsvc_server_sim_get_file_record(type);
file_record->set(file_record,capa->FileTypeInfo[i].index_max, capa->FileTypeInfo[i].text_max,
capa->FileTypeInfo[i].used_count);
- SERVER_DBG(" field_type[%d] : i_max(%d), t_max(%d), un_count(%d)", type,
+ CTS_DBG(" field_type[%d] : i_max(%d), t_max(%d), un_count(%d)", type,
gfile_record[type].get_index_max(&gfile_record[type]), gfile_record[type].get_text_max(&gfile_record[type]), gfile_record[type].get_unused_count(&gfile_record[type]));
}
}
else if(TAPI_SIM_PB_ADN == sim_type){
TelSimPbEntryInfo_t *pe = data;
- h_retm_if(pe == NULL, "pe is NULL result =%d",access_rt);
+ RETM_IF(pe == NULL, "pe is NULL result =%d",access_rt);
sim_file_s *file_record = NULL;
file_record =__ctsvc_server_sim_get_file_record(CTSVC_2GSIM_NAME);
file_record->set(file_record,pe->PbIndexMax,pe->PbTextLenMax,pe->PbIndexMin);
- SERVER_DBG(" CTSVC_2GSIM_NAME : i_max(%d), t_max(%d), i_min(%d)", pe->PbIndexMax,pe->PbTextLenMax,pe->PbIndexMin);
+ CTS_DBG(" CTSVC_2GSIM_NAME : i_max(%d), t_max(%d), i_min(%d)", pe->PbIndexMax,pe->PbTextLenMax,pe->PbIndexMin);
file_record =__ctsvc_server_sim_get_file_record(CTSVC_2GSIM_NUMBER);
file_record->set(file_record,pe->PbIndexMax,pe->PbNumLenMax,pe->PbIndexMin);
- SERVER_DBG(" CTSVC_2GSIM_NUMBER : i_max(%d), t_max(%d), i_min(%d)", pe->PbIndexMax,pe->PbNumLenMax,pe->PbIndexMin);
+ CTS_DBG(" CTSVC_2GSIM_NUMBER : i_max(%d), t_max(%d), i_min(%d)", pe->PbIndexMax,pe->PbNumLenMax,pe->PbIndexMin);
}
else{
- ERR("sim_type [%d]error ", sim_type);
+ CTS_ERR("sim_type [%d]error ", sim_type);
return;
}
__ctsvc_server_sim_set_init_completed(true);
int ctsvc_server_sim_initialize(void)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
__ctsvc_server_get_tapi_handle();
__ctsvc_server_set_sim_type();
ret = contacts_connect2();
- h_retvm_if(ret != CONTACTS_ERROR_NONE, ret, "contacts_connect2 fail : %d", ret);
+ RETVM_IF(ret != CONTACTS_ERROR_NONE, ret, "contacts_connect2 fail : %d", ret);
ret = TAPI_API_SUCCESS;
TelSimPbType_t sim_type;
ret = tel_get_sim_pb_usim_meta_info(sim_handle, __ctsvc_server_sim_initialize_cb, NULL);
else if(sim_type == TAPI_SIM_PB_ADN)
ret = tel_get_sim_pb_meta_info(sim_handle, sim_type, __ctsvc_server_sim_initialize_cb, NULL);
- h_retvm_if(ret != TAPI_API_SUCCESS, CONTACTS_ERROR_SYSTEM, "tel_get_sim_(usim)_meta_info =%d",ret);
+ RETVM_IF(ret != TAPI_API_SUCCESS, CONTACTS_ERROR_SYSTEM, "tel_get_sim_(usim)_meta_info =%d",ret);
return CONTACTS_ERROR_NONE;
}
#include <errno.h>
#include "contacts.h"
-#include "internal.h"
+#include "ctsvc_internal.h"
#include "ctsvc_struct.h"
#include "ctsvc_schema.h"
#include "ctsvc_sqlite.h"
int ctsvc_server_socket_return(GIOChannel *src, int value, int attach_num, int *attach_size)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
ctsvc_socket_msg_s msg = {0};
- // h_retvm_if(CONTACTS_ERROR_SYSTEM == value, value, "Socket has problems");
- h_retvm_if(CTSVC_SOCKET_MSG_REQUEST_MAX_ATTACH < attach_num, CONTACTS_ERROR_INTERNAL,
+ // RETVM_IF(CONTACTS_ERROR_SYSTEM == value, value, "Socket has problems");
+ RETVM_IF(CTSVC_SOCKET_MSG_REQUEST_MAX_ATTACH < attach_num, CONTACTS_ERROR_INTERNAL,
"Invalid msg(attach_num = %d)", attach_num);
msg.type = CTSVC_SOCKET_MSG_TYPE_REQUEST_RETURN_VALUE;
memcpy(msg.attach_sizes, attach_size, attach_num * sizeof(int));
- SERVER_DBG("fd = %d, MSG_TYPE=%d, MSG_VAL=%d, MSG_ATTACH_NUM=%d,"
+ CTS_DBG("fd = %d, MSG_TYPE=%d, MSG_VAL=%d, MSG_ATTACH_NUM=%d,"
"MSG_ATTACH1=%d, MSG_ATTACH2=%d, MSG_ATTACH3=%d, MSG_ATTACH4=%d",
g_io_channel_unix_get_fd(src), msg.type, msg.val, msg.attach_num,
msg.attach_sizes[0], msg.attach_sizes[1], msg.attach_sizes[2],
msg.attach_sizes[3]);
ret = __ctsvc_server_socket_safe_write(g_io_channel_unix_get_fd(src), (char *)&msg, sizeof(msg));
- h_retvm_if(-1 == ret, CONTACTS_ERROR_SYSTEM,
+ RETVM_IF(-1 == ret, CONTACTS_ERROR_SYSTEM,
"__ctsvc_server_socket_safe_write() Failed(errno = %d)", errno);
return CONTACTS_ERROR_NONE;
static void __ctsvc_server_socket_import_sim(GIOChannel *src)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
ret = ctsvc_server_sim_import(src);
if (CONTACTS_ERROR_NONE != ret) {
- ERR("ctsvc_server_sim_import() Failed(%d)", ret);
+ CTS_ERR("ctsvc_server_sim_import() Failed(%d)", ret);
ctsvc_server_socket_return(src, ret, 0, NULL);
}
}
\r
static void __ctsvc_server_socket_get_sim_init_status(GIOChannel *src)\r
{\r
- SERVER_FN_CALL;\r
+ CTS_FN_CALL;
\r
int ret;\r
ret = ctsvc_server_socket_return_sim_int(src, ctsvc_server_sim_get_init_completed());\r
- h_retm_if(CONTACTS_ERROR_NONE != ret, "ctsvc_server_socket_return_sim_int() Failed(%d)", ret);\r
+ RETM_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_server_socket_return_sim_int() Failed(%d)", ret);
}\r
\r
int ctsvc_server_socket_return_sim_int(GIOChannel *src, int value)\r
{\r
- SERVER_FN_CALL;\r
+ CTS_FN_CALL;
int ret;\r
int str_len;\r
char count_str[CTS_SQL_MAX_LEN] = {0};\r
\r
str_len = snprintf(count_str, sizeof(count_str), "%d", value);\r
ret = ctsvc_server_socket_return(src, CONTACTS_ERROR_NONE, 1, &str_len);\r
- h_retvm_if(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_SYSTEM, "ctsvc_server_socket_return() Failed(%d)", ret);\r
- INFO("count_str : %s", count_str);\r
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, CONTACTS_ERROR_SYSTEM, "ctsvc_server_socket_return() Failed(%d)", ret);
+ CTS_DBG("count_str : %s", count_str);
ret = __ctsvc_server_socket_safe_write(g_io_channel_unix_get_fd(src), count_str, str_len);\r
- h_retvm_if(-1 == ret, CONTACTS_ERROR_SYSTEM, "__ctsvc_server_socket_safe_write() Failed(errno = %d)", errno);\r
+ RETVM_IF(-1 == ret, CONTACTS_ERROR_SYSTEM, "__ctsvc_server_socket_safe_write() Failed(errno = %d)", errno);
\r
return CONTACTS_ERROR_NONE;\r
}
{
int ret;
ctsvc_socket_msg_s msg = {0};
- SERVER_FN_CALL;
+ CTS_FN_CALL;
if (G_IO_HUP & condition) {
close(g_io_channel_unix_get_fd(src));
}
ret = __ctsvc_server_socket_safe_read(g_io_channel_unix_get_fd(src), (char *)&msg, sizeof(msg));
- h_retvm_if(-1 == ret, TRUE, "__ctsvc_server_socket_safe_read() Failed(errno = %d)", errno);
+ RETVM_IF(-1 == ret, TRUE, "__ctsvc_server_socket_safe_read() Failed(errno = %d)", errno);
- SERVER_DBG("attach number = %d", msg.attach_num);
+ CTS_DBG("attach number = %d", msg.attach_num);
switch (msg.type) {
case CTSVC_SOCKET_MSG_TYPE_REQUEST_IMPORT_SIM:
__ctsvc_server_socket_get_sim_init_status(src);\r
break;
default:
- ERR("Unknown request type(%d)", msg.type);
+ CTS_ERR("Unknown request type(%d)", msg.type);
break;
}
return TRUE;
static gboolean __ctsvc_server_socket_handler(GIOChannel *src,
GIOCondition condition, gpointer data)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
GIOChannel *channel;
int client_sockfd, sockfd = (int)data;
struct sockaddr_un clientaddr;
socklen_t client_len = sizeof(clientaddr);
- SERVER_FN_CALL;
-
client_sockfd = accept(sockfd, (struct sockaddr *)&clientaddr, &client_len);
- h_retvm_if(-1 == client_sockfd, TRUE, "accept() Failed(errno = %d)", errno);
+ RETVM_IF(-1 == client_sockfd, TRUE, "accept() Failed(errno = %d)", errno);
channel = g_io_channel_unix_new(client_sockfd);
g_io_add_watch(channel, G_IO_IN|G_IO_HUP, __ctsvc_server_socket_request_handler, NULL);
int ctsvc_server_socket_init(void)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int sockfd, ret;
struct sockaddr_un addr;
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", CTSVC_SOCKET_PATH);
sockfd = socket(PF_UNIX, SOCK_STREAM, 0);
- h_retvm_if(-1 == sockfd, CONTACTS_ERROR_SYSTEM, "socket() Failed(errno = %d)", errno);
+ RETVM_IF(-1 == sockfd, CONTACTS_ERROR_SYSTEM, "socket() Failed(errno = %d)", errno);
ret = bind(sockfd, (struct sockaddr *)&addr, sizeof(addr));
- h_retvm_if(-1 == ret, CONTACTS_ERROR_SYSTEM, "bind() Failed(errno = %d)", errno);
+ RETVM_IF(-1 == ret, CONTACTS_ERROR_SYSTEM, "bind() Failed(errno = %d)", errno);
ret = chown(CTSVC_SOCKET_PATH, getuid(), CTS_SECURITY_FILE_GROUP);
if (0 != ret)
- ERR("chown(%s) Failed(%d)", CTSVC_SOCKET_PATH, ret);
+ CTS_ERR("chown(%s) Failed(%d)", CTSVC_SOCKET_PATH, ret);
ret = chmod(CTSVC_SOCKET_PATH, CTS_SECURITY_DEFAULT_PERMISSION);
if (0 != ret)
- ERR("chmod(%s) Failed(%d)", CTSVC_SOCKET_PATH, ret);
+ CTS_ERR("chmod(%s) Failed(%d)", CTSVC_SOCKET_PATH, ret);
ret = listen(sockfd, 30);
- h_retvm_if(-1 == ret, CONTACTS_ERROR_SYSTEM, "listen() Failed(errno = %d)", errno);
+ RETVM_IF(-1 == ret, CONTACTS_ERROR_SYSTEM, "listen() Failed(errno = %d)", errno);
gio = g_io_channel_unix_new(sockfd);
g_io_add_watch(gio, G_IO_IN, __ctsvc_server_socket_handler, (gpointer)sockfd);
- SERVER_DBG("enter here!!!!!");
- DBG("enter here!!!!!");
return CONTACTS_ERROR_NONE;
}
#include <db-util.h>
#include <fcntl.h>
-#include "internal.h"
+#include "ctsvc_internal.h"
#include "contacts.h"
#include "ctsvc_schema.h"
#include "ctsvc_sqlite.h"
int ctsvc_server_db_open(sqlite3 **db)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
if (!server_db) {
ret = db_util_open(CTSVC_DB_PATH, &server_db, 0);
- h_retvm_if(ret != SQLITE_OK, CONTACTS_ERROR_DB,
+ RETVM_IF(ret != SQLITE_OK, CONTACTS_ERROR_DB,
"db_util_open() Failed(%d)", ret);
ret = sqlite3_create_function(server_db, "_DATA_DELETE_", 2, SQLITE_UTF8, NULL,
ctsvc_db_data_delete_callback, NULL, NULL);
- h_retvm_if(SQLITE_OK != ret, CONTACTS_ERROR_DB,
+ RETVM_IF(SQLITE_OK != ret, CONTACTS_ERROR_DB,
"sqlite3_create_function() Failed(%d)", ret);
ret = sqlite3_create_function(server_db, "_DATA_IMAGE_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_data_image_delete_callback, NULL, NULL);
- h_retvm_if(SQLITE_OK != ret, CONTACTS_ERROR_DB,
+ RETVM_IF(SQLITE_OK != ret, CONTACTS_ERROR_DB,
"sqlite3_create_function() Failed(%d)", ret);
ret = sqlite3_create_function(server_db, "_DATA_COMPANY_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_data_company_delete_callback, NULL, NULL);
- h_retvm_if(SQLITE_OK != ret, CONTACTS_ERROR_DB,
+ RETVM_IF(SQLITE_OK != ret, CONTACTS_ERROR_DB,
"sqlite3_create_function() Failed(%d)", ret);
ret = sqlite3_create_function(server_db, "_PHONE_LOG_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_phone_log_delete_callback, NULL, NULL);
- h_retvm_if(SQLITE_OK != ret, CONTACTS_ERROR_DB,
+ RETVM_IF(SQLITE_OK != ret, CONTACTS_ERROR_DB,
"sqlite3_create_function() Failed(%d)", ret);
ret = sqlite3_create_function(server_db, "_PERSON_DELETE_", 1, SQLITE_UTF8, NULL,
ctsvc_db_person_delete_callback, NULL, NULL);
- h_retvm_if(SQLITE_OK != ret, CONTACTS_ERROR_DB,
+ RETVM_IF(SQLITE_OK != ret, CONTACTS_ERROR_DB,
"sqlite3_create_function() Failed(%d)", ret);
}
if (db)
}
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec() Failed(%d)", ret);
+ CTS_ERR("sqlite3_exec() Failed(%d)", ret);
return CONTACTS_ERROR_DB;
}
return CONTACTS_ERROR_NONE;
ret = sqlite3_exec(server_db, "COMMIT TRANSACTION",
NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(COMMIT) Failed(%d, %s)", ret, errmsg);
+ CTS_ERR("sqlite3_exec(COMMIT) Failed(%d, %s)", ret, errmsg);
sqlite3_free(errmsg);
while (SQLITE_BUSY == ret && i<CTS_COMMIT_TRY_MAX) {
NULL, NULL, NULL);
}
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec() Failed(%d)", ret);
+ CTS_ERR("sqlite3_exec() Failed(%d)", ret);
sqlite3_exec(server_db, "ROLLBACK TRANSACTION",
NULL, NULL, NULL);
return CONTACTS_ERROR_DB;
int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int new_sort_primary, int new_sort_secondary)
{
- SERVER_FN_CALL;
+ CTS_FN_CALL;
int ret;
sqlite3* db = NULL;
char *errmsg = NULL;
char query[CTS_SQL_MIN_LEN] = {0};
ret = ctsvc_server_db_open(&db);
- h_retvm_if(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
ret = ctsvc_server_begin_trans();
- h_retvm_if(ret, ret, "ctsvc_server_begin_trans() Failed(%d)", ret);
+ RETVM_IF(ret, ret, "ctsvc_server_begin_trans() Failed(%d)", ret);
snprintf(query, sizeof(query), "UPDATE %s SET display_name_language=%d WHERE display_name_language =%d" ,
CTS_TABLE_CONTACTS, prev_sort_primary, CTSVC_SORT_PRIMARY);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
CTS_TABLE_CONTACTS, prev_sort_secondary, CTSVC_SORT_SECONDARY);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
CTS_TABLE_CONTACTS, CTSVC_SORT_PRIMARY, new_sort_primary);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
CTS_TABLE_CONTACTS, CTSVC_SORT_SECONDARY, new_sort_secondary);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
CTS_TABLE_CONTACTS, prev_sort_primary, CTSVC_SORT_PRIMARY);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
CTS_TABLE_CONTACTS, prev_sort_secondary, CTSVC_SORT_SECONDARY);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
CTS_TABLE_CONTACTS, CTSVC_SORT_PRIMARY, new_sort_primary);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
CTS_TABLE_CONTACTS, CTSVC_SORT_SECONDARY, new_sort_secondary);
ret = sqlite3_exec(db, query, NULL, NULL, &errmsg);
if (SQLITE_OK != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, errmsg);
sqlite3_free(errmsg);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
char query[CTS_SQL_MIN_LEN] = {0};
ret = ctsvc_server_db_open(&db);
- h_retvm_if(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "ctsvc_server_db_open() Failed(%d)", ret);
snprintf(query, sizeof(query), "INSERT INTO %s(name, number) VALUES(?,?)",
CTS_TABLE_SDN);
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if(SQLITE_OK != ret) {
- ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
+ CTS_ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
ctsvc_server_db_close();
return CONTACTS_ERROR_DB;
}
ret = sqlite3_step(stmt);
if (SQLITE_DONE != ret) {
- ERR("sqlite3_step() Failed(%d)", ret);
+ CTS_ERR("sqlite3_step() Failed(%d)", ret);
sqlite3_finalize(stmt);
ctsvc_server_db_close();
return CONTACTS_ERROR_DB;
char query[CTS_SQL_MAX_LEN] = {0};
ret = ctsvc_server_db_open(&db);
- h_retvm_if(CONTACTS_ERROR_NONE != ret, ret, "helper_db_open() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "helper_db_open() Failed(%d)", ret);
snprintf(query, sizeof(query), "DELETE FROM %s", CTS_TABLE_SDN);
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if(SQLITE_OK != ret) {
- ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
+ CTS_ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
ctsvc_server_db_close();
return CONTACTS_ERROR_DB;
}
ret = sqlite3_step(stmt);
if (SQLITE_DONE != ret) {
- ERR("sqlite3_step() Failed(%d)", ret);
+ CTS_ERR("sqlite3_step() Failed(%d)", ret);
sqlite3_finalize(stmt);
ctsvc_server_db_close();
return CONTACTS_ERROR_DB;
// char dest[CTS_SQL_MIN_LEN] = {0};
ret = ctsvc_server_db_open(&db);
- h_retvm_if(CONTACTS_ERROR_NONE != ret, ret, "helper_db_open() Failed(%d)", ret);
+ RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "helper_db_open() Failed(%d)", ret);
ret = ctsvc_server_begin_trans();
if(CONTACTS_ERROR_NONE != ret) {
- ERR("ctsvc_server_begin_trans() Failed(%d)", ret);
+ CTS_ERR("ctsvc_server_begin_trans() Failed(%d)", ret);
ctsvc_server_db_close();
return ret;
}
"FROM "CTS_TABLE_CONTACTS" WHERE deleted = 0");
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if(SQLITE_OK != ret) {
- ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
+ CTS_ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
return CONTACTS_ERROR_DB;
"WHERE contact_id = ?");
ret = sqlite3_prepare_v2(db, query, strlen(query), &update_stmt, NULL);
if(SQLITE_OK != ret) {
- ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
+ CTS_ERR("sqlite3_prepare_v2(%s) Failed(%s)", query, sqlite3_errmsg(db));
sqlite3_finalize(stmt);
ctsvc_server_end_trans(false);
ctsvc_server_db_close();
free(reverse_sortkey);
if (SQLITE_DONE != ret) {
- ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, sqlite3_errmsg(db));
+ CTS_ERR("sqlite3_exec(%s) Failed(%d, %s)", query, ret, sqlite3_errmsg(db));
sqlite3_finalize(stmt);
sqlite3_finalize(update_stmt);
ctsvc_server_end_trans(false);
}
if (SQLITE_ROW != ret && SQLITE_DONE != ret) {
- ERR("sqlite3_step() Failed(%d)", ret);
+ CTS_ERR("sqlite3_step() Failed(%d)", ret);
sqlite3_finalize(update_stmt);
sqlite3_finalize(stmt);
ctsvc_server_end_trans(false);
#include <vconf.h>
#include <vconf-keys.h>
-#include "internal.h"
+#include "ctsvc_internal.h"
#include "ctsvc_setting.h"
#include "ctsvc_server_utils.h"
#include "ctsvc_server_sim.h"
inline int ctsvc_server_set_default_sort(int sort)
{
int ret = vconf_set_int(ctsvc_get_default_sort_vconfkey(), sort);
- h_retvm_if(ret<0, CONTACTS_ERROR_INTERNAL, "vconf_set_int() Failed(%d)", ret);
+ RETVM_IF(ret<0, CONTACTS_ERROR_INTERNAL, "vconf_set_int() Failed(%d)", ret);
ctscts_set_sort_memory(sort);
return CONTACTS_ERROR_NONE;
}
old_primary_sort = ctsvc_get_primary_sort();
if (old_primary_sort < 0) {
- h_retm_if(ret<0, "ctsvc_get_primary_sort() Fail(%d)", ret);
+ RETM_IF(ret<0, "ctsvc_get_primary_sort() Fail(%d)", ret);
}
old_secondary_sort = ctsvc_get_secondary_sort();
if (old_secondary_sort < 0) {
- h_retm_if(ret<0, "ctsvc_get_secondary_sort() Fail(%d)", ret);
+ RETM_IF(ret<0, "ctsvc_get_secondary_sort() Fail(%d)", ret);
}
langset = vconf_keynode_get_str(key);
init_stat = vconf_keynode_get_int(key);
if (VCONFKEY_TELEPHONY_SIM_PB_INIT_COMPLETED == init_stat) {
ret = ctsvc_server_sim_initialize();
- h_warn_if(CONTACTS_ERROR_NONE != ret, "ctsvc_server_sim_initialize() Failed(%d)", ret);
+ WARN_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_server_sim_initialize() Failed(%d)", ret);
vconf_ignore_key_changed(CTSVC_SERVER_VCONF_TAPI_SIM_PB_INIT, ctsvc_server_tapi_sim_complete_cb);
}
int ret = -1;
ret = vconf_ignore_key_changed(CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE, ctsvc_server_change_language_cb);
- h_retm_if(ret<0,"vconf_ignore_key_changed(%s) Failed(%d)",CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE,ret);
+ RETM_IF(ret<0,"vconf_ignore_key_changed(%s) Failed(%d)",CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE,ret);
ret = vconf_ignore_key_changed(VCONFKEY_REGIONFORMAT, ctsvc_server_update_collation_cb);
- h_retm_if(ret<0,"vconf_ignore_key_changed(%s) Failed(%d)",VCONFKEY_REGIONFORMAT,ret);
+ RETM_IF(ret<0,"vconf_ignore_key_changed(%s) Failed(%d)",VCONFKEY_REGIONFORMAT,ret);
ctsvc_server_sim_finalize();
}
int sort_type;
langset = vconf_get_str(CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE);
- h_warn_if(NULL == langset, "vconf_get_str(%s) return NULL", CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE);
+ WARN_IF(NULL == langset, "vconf_get_str(%s) return NULL", CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE);
system_language = ctsvc_get_language_type(langset);
ret = vconf_get_int(ctsvc_get_default_sort_vconfkey(), &sort_type);
if (ret < 0 || sort_type == CTSVC_SORT_OTHERS) {
- 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;
ret = vconf_notify_key_changed(CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE,
ctsvc_server_change_language_cb, NULL);
- h_retvm_if(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
CTSVC_SERVER_VCONF_SYSTEM_LANGUAGE, ret);
ret = vconf_notify_key_changed(VCONFKEY_REGIONFORMAT,
ctsvc_server_update_collation_cb, NULL);
- h_retvm_if(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
VCONFKEY_REGIONFORMAT, ret);
ret = vconf_get_int(CTSVC_SERVER_VCONF_TAPI_SIM_PB_INIT, &sim_stat);
if (VCONFKEY_TELEPHONY_SIM_PB_INIT_COMPLETED == sim_stat) {
ret = ctsvc_server_sim_initialize();
- h_warn_if(CONTACTS_ERROR_NONE != ret, "ctsvc_server_sim_initialize() Failed(%d)", ret);
+ WARN_IF(CONTACTS_ERROR_NONE != ret, "ctsvc_server_sim_initialize() Failed(%d)", ret);
}
else {
ret = vconf_notify_key_changed(CTSVC_SERVER_VCONF_TAPI_SIM_PB_INIT,
ctsvc_server_tapi_sim_complete_cb, NULL);
- h_retvm_if(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
+ RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Failed(%d)",
CTSVC_SERVER_VCONF_TAPI_SIM_PB_INIT, ret);
}
+++ /dev/null
-/*
- * Contacts Service Helper
- *
- * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#ifndef __CTSVC_SERVER_INTERNAL_H__
-#define __CTSVC_SERVER_INTERNAL_H__
-
-#include <stdio.h>
-
-#ifndef API
-#define API __attribute__ ((visibility("default")))
-#endif
-
-// Additional Error
-enum {
- CTSVC_ERR_NO_DB_FILE = -10000,
- CTSVC_ERR_NO_TABLE,
-};
-
-#define SERVER_DLOG_OUT
-#define SERVER_DEBUGGING
-
-#ifdef SERVER_DLOG_OUT
-#define LOG_TAG "CONTACTS_SVC_SERVER"
-#include <dlog.h>
-#define DLOG(prio, fmt, arg...) \
- do { SLOG(prio, LOG_TAG, fmt, ##arg); } while (0)
-#define INFO(fmt, arg...) SLOGI("[SERVER] "fmt, ##arg)
-#define ERR(fmt, arg...) SLOGE("[SERVER] "fmt, ##arg)
-#define DBG(fmt, arg...) SLOGD("[SERVER] "fmt, ##arg)
-#else //SERVER_DLOG_OUT
-#define PRT(prio, fmt, arg...) \
- do { fprintf((prio?stderr:stdout),"[SERVER] %s(%d): "fmt"\n", __FUNCTION__, __LINE__, ##arg); } while (0)
-#define INFO(fmt, arg...) PRT(0, fmt, ##arg)
-#define ERR(fmt, arg...) PRT(1, fmt, ##arg)
-#define DBG(fmt, arg...) \
- do { \
- printf("\x1b[105;37m[SERVER]\x1b[0m(%s:%d) "fmt"\n", __FUNCTION__, __LINE__, ##arg); \
- } while (0)
-#endif //SERVER_DLOG_OUT
-
-#ifdef SERVER_DEBUGGING
-#define SERVER_FN_CALL DBG(">>>>>>>> called")
-#define SERVER_FN_END DBG("<<<<<<<< ended")
-#define SERVER_DBG(fmt, arg...) DBG(fmt, ##arg)
-#else /* SERVER_DEBUGGING */
-#define SERVER_FN_CALL
-#define SERVER_FN_END
-#define SERVER_DBG(fmt, arg...)
-#endif /* SERVER_DEBUGGING */
-
-#define h_warn_if(expr, fmt, arg...) do { \
- if (expr) { \
- ERR(fmt, ##arg); \
- } \
-} while (0)
-#define h_ret_if(expr) do { \
- if (expr) { \
- ERR("(%s)", #expr); \
- return; \
- } \
-} while (0)
-#define h_retv_if(expr, val) do { \
- if (expr) { \
- ERR("(%s)", #expr); \
- return (val); \
- } \
-} while (0)
-#define h_retm_if(expr, fmt, arg...) do { \
- if (expr) { \
- ERR(fmt, ##arg); \
- return; \
- } \
-} while (0)
-#define h_retvm_if(expr, val, fmt, arg...) do { \
- if (expr) { \
- ERR(fmt, ##arg); \
- return (val); \
- } \
-} while (0)
-
-#endif // __CTSVC_SERVER_INTERNAL_H__
-