Update version 0.9.75.1
authorDonghee Ye <donghee.ye@samsung.com>
Thu, 2 May 2013 09:22:43 +0000 (18:22 +0900)
committerDonghee Ye <donghee.ye@samsung.com>
Thu, 2 May 2013 09:38:01 +0000 (18:38 +0900)
- Do not parse LABEL. It has same info with ADR
- Parse vcard which has special character
- Change log

Change-Id: Ibab41a9aed2c4e1165eff7fd4c350b05fac1b432

31 files changed:
CMakeLists.txt
client/ctsvc_client_service.c
common/ctsvc_normalize.c
common/ctsvc_record_contact.c
common/ctsvc_vcard.c
common/ipc/ctsvc_ipc_marshal.c
contacts-service2.manifest
include/contacts_errors.h
native/ctsvc_db_plugin_company_helper.c
native/ctsvc_db_plugin_contact.c
native/ctsvc_db_plugin_contact_helper.c
native/ctsvc_db_plugin_email.c
native/ctsvc_db_plugin_image.c
native/ctsvc_db_plugin_number.c
native/ctsvc_db_query.c
native/ctsvc_person.c
native/ctsvc_service.c
native/ctsvc_setting.c
native/ctsvc_utils.c
packaging/contacts-service.spec
server/ctsvc_ipc_server.c
server/ctsvc_ipc_server2.c
server/ctsvc_schema_recovery.c
server/ctsvc_server.c
server/ctsvc_server_bg.c
server/ctsvc_server_change_subject.c
server/ctsvc_server_sim.c
server/ctsvc_server_socket.c
server/ctsvc_server_sqlite.c
server/ctsvc_server_utils.c
server/internal.h [deleted file]

index 6d4a8ce..54de660 100755 (executable)
@@ -13,7 +13,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 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)
 
index 371ed80..54964a8 100644 (file)
@@ -51,7 +51,7 @@ API int contacts_connect_with_flags(unsigned int flags)
                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;
index 5bd5a7c..0e29655 100644 (file)
@@ -672,7 +672,6 @@ static bool __ctsvc_compare_pinyin_letter(const char *haystack, int haystack_lan
                        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;
index 1dd932b..1f88457 100644 (file)
@@ -3725,7 +3725,7 @@ static int __ctsvc_image_set_bool(contacts_record_h record, unsigned int propert
                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;
index d3b6f5a..0c66fc6 100644 (file)
 #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:"); \
@@ -60,7 +68,7 @@
        } \
        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)
@@ -196,7 +204,7 @@ static inline bool __ctsvc_need_encode(const char *str)
        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;
@@ -211,14 +219,45 @@ static int __ctsvc_vcard_append_str(char **buf, int *buf_size, int len, const ch
        }
 
        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;
 }
@@ -233,7 +272,7 @@ static int __ctsvc_vcard_append_encode_str(char **buf, int *buf_size, int len, c
        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;
 }
@@ -328,15 +367,15 @@ static inline int __ctsvc_vcard_append_name(ctsvc_list_s *names, char **buf, int
        }
        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);
@@ -545,10 +584,10 @@ static inline int __ctsvc_vcard_append_company(ctsvc_list_s *company_list, char
                }
                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);
@@ -704,19 +743,19 @@ static inline int __ctsvc_vcard_append_postals(ctsvc_list_s *address_list, char
                        }
                        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);
@@ -744,7 +783,7 @@ static inline int __ctsvc_vcard_append_nicknames(ctsvc_list_s *nickname_list, ch
                        }
                        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);
                        }
                }
        }
@@ -1496,127 +1535,111 @@ API int contacts_vcard_make_from_my_profile(contacts_record_h record, char **vca
 
 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;
        }
 
@@ -1632,6 +1655,7 @@ static int __ctsvc_vcard_append_person(ctsvc_person_s *person, ctsvc_list_s *lis
 
                CTSVC_VCARD_APPEND_STR(buf, buf_size, len, temp);
        }
+
 #if 0
        ctsvc_list_s* profile;
 #endif
@@ -1696,14 +1720,14 @@ API int contacts_vcard_make_from_person(contacts_record_h record, char **vcard_s
        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);
 
@@ -1796,11 +1820,13 @@ static inline char* __ctsvc_vcard_pass_unsupported(char *vcard)
 
 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;
@@ -2070,6 +2096,43 @@ static inline char* __ctsvc_get_content_value(char *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;
@@ -2098,7 +2161,7 @@ static inline int __ctsvc_vcard_get_display_name(ctsvc_list_s *name_list, char *
        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;
 }
@@ -2125,23 +2188,23 @@ static inline int __ctsvc_vcard_get_name(ctsvc_list_s *name_list, char *val)
        }
 
        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;
 }
@@ -2169,11 +2232,11 @@ static inline int __ctsvc_vcard_get_phonetic_name(ctsvc_list_s *name_list, int t
 
        __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;
 }
@@ -2200,7 +2263,7 @@ static inline int __ctsvc_vcard_get_phonetic_last_name(ctsvc_list_s *name_list,
        }
 
        __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;
 }
@@ -2234,7 +2297,7 @@ static inline int __ctsvc_vcard_get_nickname(ctsvc_list_s *nickname_list, char *
                        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);
@@ -2297,6 +2360,7 @@ static inline int __ctsvc_vcard_get_photo(contacts_record_h contact, ctsvc_list_
        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)
@@ -2337,7 +2401,7 @@ static inline int __ctsvc_vcard_get_event(ctsvc_list_s *event_list, int type, ch
        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;
        }
 
@@ -2354,14 +2418,14 @@ static inline int __ctsvc_vcard_get_event(ctsvc_list_s *event_list, int type, ch
        *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;
        }
 
@@ -2426,7 +2490,7 @@ static inline int __ctsvc_vcard_get_company_value(ctsvc_list_s *company_list, in
        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;
 }
@@ -2436,6 +2500,7 @@ static inline int __ctsvc_vcard_get_company(ctsvc_list_s *company_list, char *va
 {
        int ret;
        char *temp, *start;
+       const char separator = ';';
        contacts_record_h company;
 
        ret = contacts_record_create(_contacts_company._uri, &company);
@@ -2445,15 +2510,12 @@ static inline int __ctsvc_vcard_get_company(ctsvc_list_s *company_list, char *va
        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';
@@ -2533,7 +2595,7 @@ static inline int __ctsvc_vcard_get_note(ctsvc_list_s *note_list, char *val)
        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;
 }
@@ -2649,7 +2711,7 @@ static inline int __ctsvc_vcard_get_url(ctsvc_list_s* url_list, char *val)
        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);
@@ -2732,7 +2794,7 @@ static inline int __ctsvc_vcard_get_number(ctsvc_list_s *numbers, char *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));
@@ -2790,7 +2852,7 @@ static inline int __ctsvc_vcard_get_email(ctsvc_list_s* emails, char *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));
@@ -2944,7 +3006,7 @@ static inline int __ctsvc_vcard_get_messenger(ctsvc_list_s* messenger_list, int
        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:
@@ -3049,7 +3111,7 @@ static inline int __ctsvc_vcard_get_relationship(ctsvc_list_s* relationship_list
        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);
@@ -3151,7 +3213,6 @@ static inline int __ctsvc_vcard_get_contact(int ver, char *vcard, contacts_recor
                        free(val);
                        break;
                case CTSVC_VCARD_VALUE_ADR:
-               case CTSVC_VCARD_VALUE_LABEL:
                        __ctsvc_vcard_get_address(contact->postal_addrs, val);
                        free(val);
                        break;
@@ -3205,7 +3266,7 @@ static inline int __ctsvc_vcard_get_contact(int ver, char *vcard, contacts_recor
                        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:
index b1101e6..e0cd913 100644 (file)
@@ -731,7 +731,7 @@ int ctsvc_ipc_unmarshal_record_common(const pims_ipc_data_h ipc_data, ctsvc_reco
                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);
index 144a3b5..215fa27 100644 (file)
@@ -10,9 +10,9 @@
                </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"/>
index 1ec24cd..0c6fb88 100755 (executable)
@@ -39,7 +39,8 @@ typedef enum
        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 */
@@ -49,18 +50,18 @@ typedef enum
 //     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,
index bc21ef2..0e191c4 100644 (file)
@@ -17,8 +17,8 @@
  *
  */
 
-#include <unistd.h>
 #include <ctype.h>
+#include <unistd.h>
 
 #include "contacts.h"
 #include "ctsvc_internal.h"
@@ -36,8 +36,8 @@
 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");
index 35320d5..71ee6f3 100644 (file)
@@ -1531,7 +1531,6 @@ static int __ctsvc_contact_insert_data(ctsvc_contact_s *contact)
 {
        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);
@@ -1540,7 +1539,6 @@ static int __ctsvc_contact_insert_data(ctsvc_contact_s *contact)
                        return ret;
                }
        }
-       DBG("A ctsvc_contact_insert_data_name");
 
        //Insert the company
        if (contact->company) {
index 0859556..2ce7eea 100644 (file)
  * 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"
@@ -1802,7 +1802,7 @@ int ctsvc_contact_update_display_name(int contact_id, contacts_display_name_sour
 
                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;
                }
index ede164c..a0616b1 100644 (file)
@@ -194,7 +194,7 @@ static int __ctsvc_db_email_insert_record( contacts_record_h record, int *id )
                        "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;
        }
@@ -377,7 +377,7 @@ static int __ctsvc_db_email_delete_record( int 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;
        }
index 9ab826a..835016b 100644 (file)
@@ -223,7 +223,7 @@ static int __ctsvc_db_image_insert_record( contacts_record_h record, int *id )
                        "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;
        }
@@ -351,7 +351,7 @@ static int __ctsvc_db_image_update_record( contacts_record_h record )
 
        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;
        }
index 0739ec7..96ee872 100644 (file)
@@ -198,7 +198,7 @@ static int __ctsvc_db_number_insert_record( contacts_record_h record, int *id )
                        "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;
        }
@@ -372,7 +372,7 @@ static int __ctsvc_db_number_delete_record( int 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;
        }
index f543484..21e9a16 100755 (executable)
@@ -435,7 +435,7 @@ int ctsvc_db_create_set_query(contacts_record_h record, char **set, GSList **bin
 
        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;
        }
 
index c72b75f..48eb53c 100644 (file)
@@ -150,7 +150,7 @@ static inline int __ctsvc_get_person_default_image_value(int id, contacts_record
        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;
        }
 
@@ -169,7 +169,7 @@ static inline int __ctsvc_get_person_default_image_value(int id, contacts_record
                ret = CONTACTS_ERROR_NONE;
        }
        else
-               ERR("contacts_record_create() Failed");
+               CTS_ERR("contacts_record_create() Failed");
 
        cts_stmt_finalize(stmt);
        return ret;
@@ -549,7 +549,7 @@ int ctsvc_person_aggregate(int person_id)
                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;
@@ -576,7 +576,7 @@ int ctsvc_person_aggregate(int person_id)
                        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);
@@ -667,7 +667,7 @@ int ctsvc_person_aggregate(int 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(addressbook_ids);
                free(image_thumbnail_path);
                free(ringtone_path);
index 0f59630..dca23c1 100644 (file)
@@ -132,7 +132,7 @@ API int contacts_connect_with_flags(unsigned int flags)
                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;
index 3d759aa..cda95db 100644 (file)
@@ -45,7 +45,7 @@ static const char *CTSVC_VCONF_PHONENUMBER_MIN_MATCH_DIGIT = VCONFKEY_CONTACTS_S
 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);
        }
@@ -62,7 +62,7 @@ API int contacts_setting_set_name_display_order(contacts_name_display_order_e or
                        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;
 
@@ -75,7 +75,7 @@ API int contacts_setting_get_name_sorting_order(contacts_name_sorting_order_e *o
        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;
@@ -90,7 +90,7 @@ API int contacts_setting_set_name_sorting_order(contacts_name_sorting_order_e or
                        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;
 
@@ -137,8 +137,7 @@ int ctsvc_register_vconf(void)
        }
        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);
@@ -148,8 +147,7 @@ int ctsvc_register_vconf(void)
        }
        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);
@@ -174,10 +172,9 @@ void ctsvc_deregister_vconf(void)
        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);
index 76b3661..2e588a1 100644 (file)
@@ -16,6 +16,7 @@
  * limitations under the License.
  *
  */
+#include <ctype.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -28,7 +29,6 @@
 #include <unicode/ulocdata.h>
 #include <unicode/uset.h>
 #include <unicode/ustring.h>
-#include <ctype.h>
 
 #include "contacts.h"
 #include "ctsvc_internal.h"
index 6c61c02..7176112 100644 (file)
@@ -1,6 +1,6 @@
 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
index fb406f2..036bd36 100644 (file)
@@ -34,25 +34,21 @@ void ctsvc_ipc_server_connect(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ipc_d
 
        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;
 }
@@ -68,20 +64,20 @@ void ctsvc_ipc_server_disconnect(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ip
                *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;
 }
@@ -97,14 +93,14 @@ void ctsvc_ipc_server_db_insert_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                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;
        }
 
@@ -115,14 +111,14 @@ void ctsvc_ipc_server_db_insert_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                *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) {
@@ -130,14 +126,14 @@ void ctsvc_ipc_server_db_insert_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                        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;
                        }
@@ -145,7 +141,7 @@ void ctsvc_ipc_server_db_insert_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
        }
        else
        {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
        goto DATA_FREE;
        // goto 주의..
@@ -155,20 +151,20 @@ 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:
@@ -191,19 +187,19 @@ void ctsvc_ipc_server_db_get_record(pims_ipc_h ipc, pims_ipc_data_h indata, pims
                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;
        }
 
@@ -216,14 +212,14 @@ 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;
                }
 
@@ -237,14 +233,14 @@ ERROR_RETURN:
                        {
                                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)
@@ -265,13 +261,13 @@ void ctsvc_ipc_server_db_update_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                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;
        }
 
@@ -282,14 +278,14 @@ void ctsvc_ipc_server_db_update_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                *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;
                }
 
@@ -298,7 +294,7 @@ void ctsvc_ipc_server_db_update_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                        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;
                        }
@@ -313,20 +309,20 @@ 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)
@@ -347,19 +343,19 @@ void ctsvc_ipc_server_db_delete_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                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;
        }
 
@@ -370,14 +366,14 @@ void ctsvc_ipc_server_db_delete_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                *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;
                }
 
@@ -386,7 +382,7 @@ void ctsvc_ipc_server_db_delete_record(pims_ipc_h ipc, pims_ipc_data_h indata, p
                        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;
                        }
@@ -401,20 +397,20 @@ 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:
@@ -433,18 +429,18 @@ void ctsvc_ipc_server_db_replace_record(pims_ipc_h ipc, pims_ipc_data_h indata,
        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;
        }
 
@@ -453,13 +449,13 @@ void ctsvc_ipc_server_db_replace_record(pims_ipc_h ipc, pims_ipc_data_h indata,
        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;
                }
 
@@ -468,14 +464,14 @@ void ctsvc_ipc_server_db_replace_record(pims_ipc_h ipc, pims_ipc_data_h indata,
                        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;
 
@@ -483,18 +479,18 @@ 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;
                }
        }
        else {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
 
 DATA_FREE:
@@ -517,25 +513,25 @@ void ctsvc_ipc_server_db_get_all_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                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;
        }
 
@@ -546,14 +542,14 @@ void ctsvc_ipc_server_db_get_all_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                *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;
                }
 
@@ -567,7 +563,7 @@ void ctsvc_ipc_server_db_get_all_records(pims_ipc_h ipc, pims_ipc_data_h indata,
 
                        if (ret != CONTACTS_ERROR_NONE)
                        {
-                               ERR("ctsvc_ipc_unmarshal_int fail");
+                               CTS_ERR("ctsvc_ipc_unmarshal_int fail");
                                goto DATA_FREE;
                        }
                }
@@ -575,7 +571,7 @@ void ctsvc_ipc_server_db_get_all_records(pims_ipc_h ipc, pims_ipc_data_h indata,
        }
        else
        {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
 
        goto DATA_FREE;
@@ -587,20 +583,20 @@ 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:
 
@@ -625,25 +621,25 @@ void ctsvc_ipc_server_db_get_records_with_query(pims_ipc_h ipc, pims_ipc_data_h
                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;
        }
 
@@ -654,14 +650,14 @@ void ctsvc_ipc_server_db_get_records_with_query(pims_ipc_h ipc, pims_ipc_data_h
                *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;
                }
 
@@ -675,14 +671,14 @@ void ctsvc_ipc_server_db_get_records_with_query(pims_ipc_h ipc, pims_ipc_data_h
 
                        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;
 
@@ -693,20 +689,20 @@ 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:
 
@@ -733,13 +729,13 @@ void ctsvc_ipc_server_db_get_count(pims_ipc_h ipc, pims_ipc_data_h indata, pims_
                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;
        }
 
@@ -750,14 +746,14 @@ void ctsvc_ipc_server_db_get_count(pims_ipc_h ipc, pims_ipc_data_h indata, pims_
                *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;
                }
 
@@ -771,14 +767,14 @@ void ctsvc_ipc_server_db_get_count(pims_ipc_h ipc, pims_ipc_data_h indata, pims_
 
                        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;
 
@@ -789,20 +785,20 @@ 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:
        CONTACTS_FREE(view_uri);
@@ -820,13 +816,13 @@ void ctsvc_ipc_server_db_get_count_with_query(pims_ipc_h ipc, pims_ipc_data_h in
                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;
        }
 
@@ -837,14 +833,14 @@ void ctsvc_ipc_server_db_get_count_with_query(pims_ipc_h ipc, pims_ipc_data_h in
                *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;
                }
 
@@ -858,14 +854,14 @@ void ctsvc_ipc_server_db_get_count_with_query(pims_ipc_h ipc, pims_ipc_data_h in
 
                        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;
 
@@ -876,20 +872,20 @@ 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 (query)
@@ -913,13 +909,13 @@ void ctsvc_ipc_server_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h 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;
                }
        }
        else
        {
-               ERR("ctsvc_ipc_server_db_insert_record fail");
+               CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
                goto ERROR_RETURN;
        }
 
@@ -930,14 +926,14 @@ void ctsvc_ipc_server_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                *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;
                }
 
@@ -947,7 +943,7 @@ void ctsvc_ipc_server_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                        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;
                        }
@@ -957,7 +953,7 @@ void ctsvc_ipc_server_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                        {
                                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;
                        }
@@ -970,7 +966,7 @@ void ctsvc_ipc_server_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                                {
                                        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;
                                }
@@ -979,7 +975,7 @@ void ctsvc_ipc_server_db_insert_records(pims_ipc_h ipc, pims_ipc_data_h indata,
        }
        else
        {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
        goto DATA_FREE;
 
@@ -989,20 +985,20 @@ 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 (list)
@@ -1024,13 +1020,13 @@ void ctsvc_ipc_server_db_update_records(pims_ipc_h ipc, pims_ipc_data_h 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;
                }
        }
        else
        {
-               ERR("ctsvc_ipc_server_db_insert_record fail");
+               CTS_ERR("ctsvc_ipc_server_db_insert_record fail");
                goto ERROR_RETURN;
        }
 
@@ -1041,14 +1037,14 @@ void ctsvc_ipc_server_db_update_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                *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;
                }
 
@@ -1057,7 +1053,7 @@ void ctsvc_ipc_server_db_update_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                        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;
                        }
@@ -1065,7 +1061,7 @@ void ctsvc_ipc_server_db_update_records(pims_ipc_h ipc, pims_ipc_data_h indata,
        }
        else
        {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
        goto DATA_FREE;
 
@@ -1076,20 +1072,20 @@ 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 (list)
@@ -1113,13 +1109,13 @@ void ctsvc_ipc_server_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                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)
@@ -1133,14 +1129,14 @@ void ctsvc_ipc_server_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                        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;
        }
 
@@ -1151,13 +1147,13 @@ void ctsvc_ipc_server_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                *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;
                }
 
@@ -1166,7 +1162,7 @@ void ctsvc_ipc_server_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                        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;
                        }
@@ -1174,7 +1170,7 @@ void ctsvc_ipc_server_db_delete_records(pims_ipc_h ipc, pims_ipc_data_h indata,
        }
        else
        {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
 
        goto DATA_FREE;
@@ -1185,20 +1181,20 @@ 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:
        CONTACTS_FREE(uri);
@@ -1218,13 +1214,13 @@ void ctsvc_ipc_server_db_replace_records(pims_ipc_h ipc, pims_ipc_data_h indata,
        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;
                }
 
@@ -1237,13 +1233,13 @@ void ctsvc_ipc_server_db_replace_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                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;
        }
 
@@ -1252,13 +1248,13 @@ void ctsvc_ipc_server_db_replace_records(pims_ipc_h ipc, pims_ipc_data_h indata,
        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) {
@@ -1266,14 +1262,14 @@ void ctsvc_ipc_server_db_replace_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                        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;
 
@@ -1281,18 +1277,18 @@ 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;
                }
        }
        else {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
 DATA_FREE:
        if (list) {
@@ -1316,25 +1312,25 @@ void ctsvc_ipc_server_db_get_changes_by_version(pims_ipc_h ipc, pims_ipc_data_h
                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;
        }
 
@@ -1345,14 +1341,14 @@ void ctsvc_ipc_server_db_get_changes_by_version(pims_ipc_h ipc, pims_ipc_data_h
                *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;
                }
 
@@ -1365,7 +1361,7 @@ void ctsvc_ipc_server_db_get_changes_by_version(pims_ipc_h ipc, pims_ipc_data_h
                        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;
@@ -1374,7 +1370,7 @@ void ctsvc_ipc_server_db_get_changes_by_version(pims_ipc_h ipc, pims_ipc_data_h
                        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;
@@ -1384,7 +1380,7 @@ void ctsvc_ipc_server_db_get_changes_by_version(pims_ipc_h ipc, pims_ipc_data_h
        }
        else
        {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
        goto DATA_FREE;
 
@@ -1395,20 +1391,20 @@ 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_list)
@@ -1431,14 +1427,14 @@ void ctsvc_ipc_server_db_get_current_version(pims_ipc_h ipc, pims_ipc_data_h ind
                *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;
                }
 
@@ -1451,14 +1447,14 @@ void ctsvc_ipc_server_db_get_current_version(pims_ipc_h ipc, pims_ipc_data_h ind
                        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;
 }
@@ -1477,31 +1473,31 @@ void ctsvc_ipc_server_db_search_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                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;
        }
 
@@ -1512,14 +1508,14 @@ void ctsvc_ipc_server_db_search_records(pims_ipc_h ipc, pims_ipc_data_h indata,
                *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;
                }
 
@@ -1533,14 +1529,14 @@ void ctsvc_ipc_server_db_search_records(pims_ipc_h ipc, pims_ipc_data_h indata,
 
                        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;
 
@@ -1551,20 +1547,20 @@ 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:
 
@@ -1591,31 +1587,31 @@ void ctsvc_ipc_server_db_search_records_with_query(pims_ipc_h ipc, pims_ipc_data
                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;
        }
 
@@ -1626,14 +1622,14 @@ void ctsvc_ipc_server_db_search_records_with_query(pims_ipc_h ipc, pims_ipc_data
                *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;
                }
 
@@ -1647,14 +1643,14 @@ void ctsvc_ipc_server_db_search_records_with_query(pims_ipc_h ipc, pims_ipc_data
 
                        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;
 
@@ -1665,20 +1661,20 @@ 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:
 
index da41515..c1768ba 100644 (file)
@@ -38,13 +38,13 @@ void ctsvc_ipc_activity_delete_by_contact_id(pims_ipc_h ipc, pims_ipc_data_h ind
                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;
        }
 
@@ -58,14 +58,14 @@ 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;
                }
 
@@ -74,14 +74,14 @@ ERROR_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;
@@ -97,13 +97,13 @@ void ctsvc_ipc_activity_delete_by_account_id(pims_ipc_h ipc, pims_ipc_data_h ind
                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;
        }
 
@@ -116,14 +116,14 @@ 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;
                }
 
@@ -132,14 +132,14 @@ ERROR_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;
@@ -156,19 +156,19 @@ void ctsvc_ipc_group_add_contact(pims_ipc_h ipc, pims_ipc_data_h indata, pims_ip
                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;
        }
 
@@ -181,14 +181,14 @@ 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;
                }
 
@@ -197,14 +197,14 @@ ERROR_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;
@@ -221,19 +221,19 @@ void ctsvc_ipc_group_remove_contact(pims_ipc_h ipc, pims_ipc_data_h indata, pims
                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;
        }
 
@@ -246,14 +246,14 @@ 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) {
@@ -261,7 +261,7 @@ ERROR_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;
                        }
                }
@@ -269,7 +269,7 @@ ERROR_RETURN:
        }
        else
        {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
 
        return;
@@ -287,25 +287,25 @@ void ctsvc_ipc_group_set_group_order(pims_ipc_h ipc, pims_ipc_data_h indata, pim
                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;
        }
 
@@ -318,14 +318,14 @@ 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) {
@@ -333,14 +333,14 @@ ERROR_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;
@@ -357,19 +357,19 @@ void ctsvc_ipc_person_link_person(pims_ipc_h ipc, pims_ipc_data_h indata, pims_i
                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;
        }
 
@@ -382,14 +382,14 @@ 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) {
@@ -397,14 +397,14 @@ ERROR_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;
@@ -420,19 +420,19 @@ void ctsvc_ipc_person_unlink_contact(pims_ipc_h ipc, pims_ipc_data_h indata, pim
                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;
        }
 
@@ -446,14 +446,14 @@ 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) {
@@ -461,7 +461,7 @@ ERROR_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;
                        }
                }
@@ -469,13 +469,13 @@ ERROR_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;
@@ -491,7 +491,7 @@ void ctsvc_ipc_person_reset_usage(pims_ipc_h ipc, pims_ipc_data_h indata, pims_i
                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;
@@ -499,13 +499,13 @@ void ctsvc_ipc_person_reset_usage(pims_ipc_h ipc, pims_ipc_data_h indata, pims_i
                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;
        }
 
@@ -518,14 +518,14 @@ 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) {
@@ -533,14 +533,14 @@ ERROR_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;
@@ -557,25 +557,25 @@ void ctsvc_ipc_person_set_favorite_order(pims_ipc_h ipc, pims_ipc_data_h 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_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;
        }
 
@@ -588,14 +588,14 @@ 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) {
@@ -603,14 +603,14 @@ ERROR_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;
@@ -628,25 +628,25 @@ void ctsvc_ipc_person_set_default_property(pims_ipc_h ipc, pims_ipc_data_h indat
                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;
        }
 
@@ -659,14 +659,14 @@ 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) {
@@ -674,14 +674,14 @@ ERROR_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;
@@ -698,17 +698,17 @@ void ctsvc_ipc_person_get_default_property(pims_ipc_h ipc, pims_ipc_data_h indat
        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;
        }
 
@@ -719,24 +719,24 @@ 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;
@@ -751,14 +751,14 @@ void ctsvc_ipc_phone_log_reset_statistics(pims_ipc_h ipc, pims_ipc_data_h indata
                *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) {
@@ -766,14 +766,14 @@ void ctsvc_ipc_phone_log_reset_statistics(pims_ipc_h ipc, pims_ipc_data_h indata
                        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;
@@ -790,7 +790,7 @@ void ctsvc_ipc_phone_log_delete(pims_ipc_h ipc, pims_ipc_data_h indata,
        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;
                }
 
@@ -798,7 +798,7 @@ void ctsvc_ipc_phone_log_delete(pims_ipc_h ipc, pims_ipc_data_h indata,
                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);
@@ -807,13 +807,13 @@ void ctsvc_ipc_phone_log_delete(pims_ipc_h ipc, pims_ipc_data_h indata,
                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;
                }
@@ -823,13 +823,13 @@ 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;
                }
                if (ret == CONTACTS_ERROR_NONE) {
@@ -837,7 +837,7 @@ ERROR_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;
                        }
                }
@@ -855,24 +855,24 @@ void ctsvc_ipc_setting_get_name_display_order(pims_ipc_h ipc, pims_ipc_data_h in
        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;
@@ -889,24 +889,24 @@ void ctsvc_ipc_setting_get_name_sorting_order(pims_ipc_h ipc, pims_ipc_data_h in
        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;
@@ -921,12 +921,12 @@ void ctsvc_ipc_setting_set_name_display_order(pims_ipc_h ipc,
        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;
        }
 
@@ -936,18 +936,18 @@ 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;
@@ -962,12 +962,12 @@ void ctsvc_ipc_setting_set_name_sorting_order(pims_ipc_h ipc,
        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;
        }
 
@@ -977,18 +977,18 @@ 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;
@@ -1005,14 +1005,14 @@ void ctsvc_ipc_utils_get_index_characters(pims_ipc_h ipc, pims_ipc_data_h indata
        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;
                }
@@ -1025,7 +1025,7 @@ void ctsvc_ipc_utils_get_index_characters(pims_ipc_h ipc, pims_ipc_data_h indata
                }
        }
        else {
-               ERR("outdata is NULL");
+               CTS_ERR("outdata is NULL");
        }
 
        free(indexs);
index d564543..39d0af5 100755 (executable)
 #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;
@@ -47,36 +52,36 @@ static inline int __ctsvc_server_remake_db_file()
        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;
@@ -90,21 +95,21 @@ static int __ctsvc_server_check_table()
        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;
index b3f8413..c7b747f 100644 (file)
 #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"
@@ -37,8 +36,6 @@
 #include "ctsvc_ipc_server2.h"
 #include "ctsvc_ipc_server_sim.h"
 
-//static GMainLoop *loop;
-
 static int __server_main(void)
 {
        int ret;
@@ -97,7 +94,7 @@ static int __server_main(void)
 
                ret = contacts_connect2();
                if (CONTACTS_ERROR_NONE != ret) {\r
-                       SERVER_DBG("contacts_connect2 fail(%d)", ret);
+                       CTS_ERR("contacts_connect2 fail(%d)", ret);
                        break;
                }
 
@@ -105,7 +102,7 @@ static int __server_main(void)
                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);
 
@@ -115,7 +112,7 @@ static int __server_main(void)
 
                ret = contacts_disconnect2();
                if (CONTACTS_ERROR_NONE != ret)\r
-                       SERVER_DBG("%d", ret);
+                       CTS_DBG("%d", ret);
 
                pims_ipc_svc_deinit_for_publish();
 
@@ -125,20 +122,20 @@ static int __server_main(void)
 
        } 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();
 
index c2a2717..13072a9 100644 (file)
@@ -24,7 +24,7 @@
 #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"
@@ -68,7 +68,7 @@ static int __ctsvc_server_bg_contact_delete_step1(__ctsvc_delete_data_s* data)
                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;
                }
 
@@ -101,7 +101,7 @@ static int __ctsvc_server_bg_contact_delete_step1(__ctsvc_delete_data_s* data)
 // 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;
@@ -116,7 +116,7 @@ static int __ctsvc_server_bg_contact_delete_step2(__ctsvc_delete_data_s* data)
 
        stmt = cts_query_prepare(query);
                if (NULL == stmt) {
-               ERR("cts_query_prepare() Failed");
+               CTS_ERR("cts_query_prepare() Failed");
                return CONTACTS_ERROR_DB;
        }
 
@@ -132,7 +132,7 @@ static int __ctsvc_server_bg_contact_delete_step2(__ctsvc_delete_data_s* data)
                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) {
@@ -140,9 +140,8 @@ static int __ctsvc_server_bg_contact_delete_step2(__ctsvc_delete_data_s* data)
                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;
@@ -158,7 +157,7 @@ static int __ctsvc_server_bg_contact_delete_step2(__ctsvc_delete_data_s* data)
 // 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};
@@ -174,7 +173,7 @@ static int __ctsvc_server_bg_contact_delete_step3(__ctsvc_delete_data_s* data)
 
        stmt = cts_query_prepare(query);
                if (NULL == stmt) {
-               ERR("cts_query_prepare() Failed");
+               CTS_ERR("cts_query_prepare() Failed");
                return CONTACTS_ERROR_DB;
        }
 
@@ -190,7 +189,7 @@ static int __ctsvc_server_bg_contact_delete_step3(__ctsvc_delete_data_s* data)
                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) {
@@ -198,9 +197,8 @@ static int __ctsvc_server_bg_contact_delete_step3(__ctsvc_delete_data_s* data)
                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;
@@ -219,14 +217,13 @@ static int __ctsvc_server_bg_contact_delete_step4(__ctsvc_delete_data_s* data)
        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;
        }
@@ -234,9 +231,8 @@ static int __ctsvc_server_bg_contact_delete_step4(__ctsvc_delete_data_s* data)
        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;
        }
@@ -250,7 +246,7 @@ static bool __ctsvc_server_bg_contact_delete_step(int ret, __ctsvc_delete_data_s
        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;
        }
 
@@ -259,7 +255,7 @@ static bool __ctsvc_server_bg_contact_delete_step(int ret, __ctsvc_delete_data_s
                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;
@@ -285,11 +281,11 @@ static bool __ctsvc_server_bg_contact_delete_step(int ret, __ctsvc_delete_data_s
 
 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;
        }
 
@@ -307,7 +303,7 @@ static bool  __ctsvc_server_db_delete_run(__ctsvc_delete_data_s* data)
                        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;
@@ -318,21 +314,21 @@ static bool  __ctsvc_server_db_delete_run(__ctsvc_delete_data_s* data)
 
 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;
                }
@@ -340,27 +336,27 @@ static gpointer __ctsvc_server_bg_delete(gpointer user_data)
                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);
@@ -385,7 +381,7 @@ static void __ctsvc_server_contact_deleted_cb(const char *view_uri, void *data)
 
 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;
@@ -395,28 +391,28 @@ void ctsvc_server_bg_add_cb()
 {
        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
index 34d57fe..da6aced 100644 (file)
@@ -43,17 +43,17 @@ static gboolean __ctsvc_publish_changes_with_data(const char *view_uri, char *da
 \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
index a4f47bb..2296e8b 100755 (executable)
@@ -26,7 +26,7 @@
 
 #include <contacts.h>
 
-#include "internal.h"
+#include "ctsvc_internal.h"
 #include "ctsvc_struct.h"
 #include "ctsvc_server_socket.h"
 #include "ctsvc_server_sqlite.h"
@@ -98,19 +98,19 @@ static inline void __ctsvc_server_set_contact_records(GSList * list)
 
 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)
@@ -137,12 +137,12 @@ static TapiHandle* __ctsvc_server_get_tapi_handle(void)
                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;
@@ -150,7 +150,7 @@ static TapiHandle* __ctsvc_server_get_tapi_handle(void)
 
 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);
@@ -169,14 +169,14 @@ static sim_file_s * __ctsvc_server_sim_get_file_record(TelSimPb3GFileType_t file
 }
 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);
        }
 
@@ -196,7 +196,7 @@ static void  __ctsvc_server_set_sim_type(void)
        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;
@@ -211,7 +211,7 @@ static inline void __ctsvc_server_set_return_data(void* data)
 
 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;
 }
 
@@ -267,14 +267,14 @@ static inline int __ctsvc_server_insert_db_num(contacts_record_h *record, char *
 {
 
        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;
 }
 
@@ -282,20 +282,20 @@ static inline int __ctsvc_server_insert_db_email(contacts_record_h *record, char
 {
        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;
@@ -304,14 +304,14 @@ static int __ctsvc_server_insert_contact_to_db(sim_contact_s *record,int* contac
        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);
 
@@ -322,7 +322,7 @@ static int __ctsvc_server_insert_contact_to_db(sim_contact_s *record,int* contac
                        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);
@@ -331,63 +331,63 @@ static int __ctsvc_server_insert_contact_to_db(sim_contact_s *record,int* contac
                        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;
@@ -400,30 +400,30 @@ static void __ctsvc_server_sim_import_read_cb(TapiHandle *handle, int result, vo
 
 
        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;
        }
@@ -434,23 +434,23 @@ static void __ctsvc_server_sim_import_read_cb(TapiHandle *handle, int result, vo
                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;
                }
@@ -458,7 +458,7 @@ static void __ctsvc_server_sim_import_read_cb(TapiHandle *handle, int result, vo
        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);
                }
        }
@@ -467,7 +467,7 @@ static void __ctsvc_server_sim_import_read_cb(TapiHandle *handle, int result, vo
 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;
@@ -475,18 +475,18 @@ ERROR_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;
        }
@@ -494,7 +494,7 @@ int ctsvc_server_sim_import(void* data)
        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;
        }
@@ -504,44 +504,44 @@ int ctsvc_server_sim_import(void* data)
 
 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;
                }
        }
@@ -556,17 +556,17 @@ 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;
        }
 
@@ -576,16 +576,16 @@ 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;
        }
 
@@ -593,26 +593,26 @@ int ctsvc_server_sim_read_sdn(void* data)
                        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;
@@ -624,41 +624,41 @@ ERROR_RETURN:
 
 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);
@@ -667,12 +667,12 @@ static void __ctsvc_server_sim_initialize_cb(TapiHandle *handle, int result, voi
 
 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;
@@ -687,7 +687,7 @@ int ctsvc_server_sim_initialize(void)
                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;
 }
index ea30d3a..b50147c 100644 (file)
@@ -26,7 +26,7 @@
 #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"
@@ -71,12 +71,12 @@ static inline int __ctsvc_server_socket_safe_read(int fd, char *buf, int buf_siz
 
 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;
@@ -85,14 +85,14 @@ int ctsvc_server_socket_return(GIOChannel *src, int value, int attach_num, int *
 
        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;
@@ -100,38 +100,38 @@ int ctsvc_server_socket_return(GIOChannel *src, int value, int attach_num, int *
 
 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
 }
@@ -141,7 +141,7 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
 {
        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));
@@ -149,9 +149,9 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
        }
 
        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:
@@ -161,7 +161,7 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
                __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;
@@ -170,17 +170,15 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
 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);
@@ -191,7 +189,7 @@ static gboolean __ctsvc_server_socket_handler(GIOChannel *src,
 
 int ctsvc_server_socket_init(void)
 {
-       SERVER_FN_CALL;
+       CTS_FN_CALL;
 
        int sockfd, ret;
        struct sockaddr_un addr;
@@ -204,27 +202,25 @@ int ctsvc_server_socket_init(void)
        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;
 }
 
index 28f09ee..fb96d89 100755 (executable)
@@ -21,7 +21,7 @@
 #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"
@@ -41,33 +41,33 @@ static sqlite3 *server_db;
 
 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)
@@ -99,7 +99,7 @@ int ctsvc_server_begin_trans(void)
        }
 
        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;
@@ -115,7 +115,7 @@ int ctsvc_server_end_trans(bool success)
                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) {
@@ -125,7 +125,7 @@ int ctsvc_server_end_trans(bool success)
                                                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;
@@ -141,23 +141,23 @@ int ctsvc_server_end_trans(bool success)
 
 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();
@@ -168,7 +168,7 @@ int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int
                        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();
@@ -179,7 +179,7 @@ int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int
                                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();
@@ -190,7 +190,7 @@ int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int
                        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();
@@ -201,7 +201,7 @@ int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int
                                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();
@@ -212,7 +212,7 @@ int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int
                        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();
@@ -223,7 +223,7 @@ int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int
                                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();
@@ -234,7 +234,7 @@ int ctsvc_server_update_sort(int prev_sort_primary, int prev_sort_secondary, int
                        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();
@@ -268,14 +268,14 @@ int ctsvc_server_insert_sdn_contact(const char *name, const char *number)
        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;
        }
@@ -285,7 +285,7 @@ int ctsvc_server_insert_sdn_contact(const char *name, const char *number)
 
        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;
@@ -313,19 +313,19 @@ int ctsvc_server_delete_sdn_contact(void)
        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;
@@ -347,11 +347,11 @@ int ctsvc_server_update_collation()
 //     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;
        }
@@ -361,7 +361,7 @@ int ctsvc_server_update_collation()
                                "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;
@@ -372,7 +372,7 @@ int ctsvc_server_update_collation()
                                "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();
@@ -407,7 +407,7 @@ int ctsvc_server_update_collation()
                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);
@@ -420,7 +420,7 @@ int ctsvc_server_update_collation()
        }
 
        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);
index f4ecd3d..a712e94 100755 (executable)
@@ -21,7 +21,7 @@
 #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"
@@ -38,7 +38,7 @@ static int system_language = -1;
 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;
 }
@@ -52,11 +52,11 @@ static void ctsvc_server_change_language_cb(keynode_t *key, void *data)
 
        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);
@@ -87,7 +87,7 @@ static void ctsvc_server_tapi_sim_complete_cb(keynode_t *key, void *data)
        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);
        }
@@ -97,10 +97,10 @@ void ctsvc_server_final_configuration(void)
        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();
 }
@@ -112,12 +112,12 @@ int ctsvc_server_init_configuration(void)
        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;
@@ -126,23 +126,23 @@ int ctsvc_server_init_configuration(void)
 
        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);
        }
 
diff --git a/server/internal.h b/server/internal.h
deleted file mode 100755 (executable)
index 6a55fb0..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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__
-