static int _ctsvc_tc_db_add_changed_cb_activity_photo(void);
static int _ctsvc_tc_db_remove_changed_cb_activity_photo(void);
-static int _ctsvc_tc_db_get_record_activity_photo(void);
-static int _ctsvc_tc_db_get_records_with_query_activity_photo(void);
-static int _ctsvc_tc_db_get_all_records_activity_photo(void);
-static int _ctsvc_tc_db_get_count_activity_photo(void);
-static int _ctsvc_tc_db_get_count_with_query_activity_photo(void);
-static int _ctsvc_tc_db_insert_record_activity_photo(void);
-static int _ctsvc_tc_db_insert_records_activity_photo(void);
-static int _ctsvc_tc_db_update_record_activity_photo(void);
-static int _ctsvc_tc_db_update_records_activity_photo(void);
-static int _ctsvc_tc_db_delete_record_activity_photo(void);
-static int _ctsvc_tc_db_delete_records_activity_photo(void);
+static int _ctsvc_tc_db_get_record_activity_photo(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_activity_photo(int account_id);
+static int _ctsvc_tc_db_get_all_records_activity_photo(int account_id);
+static int _ctsvc_tc_db_get_count_activity_photo(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_activity_photo(int account_id);
+static int _ctsvc_tc_db_insert_record_activity_photo(int account_id);
+static int _ctsvc_tc_db_insert_records_activity_photo(int account_id);
+static int _ctsvc_tc_db_update_record_activity_photo(int account_id);
+static int _ctsvc_tc_db_update_records_activity_photo(int account_id);
+static int _ctsvc_tc_db_delete_record_activity_photo(int account_id);
+static int _ctsvc_tc_db_delete_records_activity_photo(int account_id);
ctsvc_tc_db_plugin_s _tc_db_activity_photo = {
return ret;
}
-static int _ctsvc_tc_db_get_record_activity_photo(void)
+static int _ctsvc_tc_db_get_record_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_activity_photo(void)
+static int _ctsvc_tc_db_get_records_with_query_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_activity_photo(void)
+static int _ctsvc_tc_db_get_all_records_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_activity_photo(void)
+static int _ctsvc_tc_db_get_count_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_activity_photo(void)
+static int _ctsvc_tc_db_get_count_with_query_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_activity_photo(void)
+static int _ctsvc_tc_db_insert_record_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_activity_photo(void)
+static int _ctsvc_tc_db_insert_records_activity_photo(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_activity_photo(void)
+static int _ctsvc_tc_db_update_record_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_activity_photo(void)
+static int _ctsvc_tc_db_update_records_activity_photo(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_activity_photo(void)
+static int _ctsvc_tc_db_delete_record_activity_photo(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_activity_photo(void)
+static int _ctsvc_tc_db_delete_records_activity_photo(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int activity_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_activity(void);
static int _ctsvc_tc_db_remove_changed_cb_activity(void);
-static int _ctsvc_tc_db_get_record_activity(void);
-static int _ctsvc_tc_db_get_records_with_query_activity(void);
-static int _ctsvc_tc_db_get_all_records_activity(void);
-static int _ctsvc_tc_db_get_count_activity(void);
-static int _ctsvc_tc_db_get_count_with_query_activity(void);
-static int _ctsvc_tc_db_insert_record_activity(void);
-static int _ctsvc_tc_db_insert_records_activity(void);
-static int _ctsvc_tc_db_delete_record_activity(void);
-static int _ctsvc_tc_db_delete_records_activity(void);
+static int _ctsvc_tc_db_get_record_activity(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_activity(int account_id);
+static int _ctsvc_tc_db_get_all_records_activity(int account_id);
+static int _ctsvc_tc_db_get_count_activity(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_activity(int account_id);
+static int _ctsvc_tc_db_insert_record_activity(int account_id);
+static int _ctsvc_tc_db_insert_records_activity(int account_id);
+static int _ctsvc_tc_db_delete_record_activity(int account_id);
+static int _ctsvc_tc_db_delete_records_activity(int account_id);
ctsvc_tc_db_plugin_s _tc_db_activity = {
.db_add_changed_cb = _ctsvc_tc_db_add_changed_cb_activity,
return ret;
}
-static int _ctsvc_tc_db_get_record_activity(void)
+static int _ctsvc_tc_db_get_record_activity(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_activity(void)
+static int _ctsvc_tc_db_get_records_with_query_activity(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_activity(void)
+static int _ctsvc_tc_db_get_all_records_activity(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_activity(void)
+static int _ctsvc_tc_db_get_count_activity(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_activity(void)
+static int _ctsvc_tc_db_get_count_with_query_activity(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_activity(void)
+static int _ctsvc_tc_db_insert_record_activity(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_activity(void)
+static int _ctsvc_tc_db_insert_records_activity(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_activity(void)
+static int _ctsvc_tc_db_delete_record_activity(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_activity(void)
+static int _ctsvc_tc_db_delete_records_activity(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_address_book(void);
static int _ctsvc_tc_db_remove_changed_cb_address_book(void);
-static int _ctsvc_tc_db_get_record_address_book(void);
-static int _ctsvc_tc_db_get_records_with_query_address_book(void);
-static int _ctsvc_tc_db_get_all_records_address_book(void);
-static int _ctsvc_tc_db_get_count_address_book(void);
-static int _ctsvc_tc_db_get_count_with_query_address_book(void);
-static int _ctsvc_tc_db_insert_record_address_book(void);
-static int _ctsvc_tc_db_update_record_address_book(void);
-static int _ctsvc_tc_db_delete_record_address_book(void);
+static int _ctsvc_tc_db_get_record_address_book(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_address_book(int account_id);
+static int _ctsvc_tc_db_get_all_records_address_book(int account_id);
+static int _ctsvc_tc_db_get_count_address_book(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_address_book(int account_id);
+static int _ctsvc_tc_db_insert_record_address_book(int account_id);
+static int _ctsvc_tc_db_update_record_address_book(int account_id);
+static int _ctsvc_tc_db_delete_record_address_book(int account_id);
ctsvc_tc_db_plugin_s _tc_db_address_book = {
return ret;
}
-static int _ctsvc_tc_db_get_record_address_book(void)
+static int _ctsvc_tc_db_get_record_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
-
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
record = NULL;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_address_book(void)
+static int _ctsvc_tc_db_get_records_with_query_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
query = NULL;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_filter_destroy(filter);
contacts_query_destroy(query);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_address_book(void)
+static int _ctsvc_tc_db_get_all_records_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
-
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
list = NULL;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_list_destroy(list, true);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_address_book(void)
+static int _ctsvc_tc_db_get_count_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
-
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
break;
}
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_address_book(void)
+static int _ctsvc_tc_db_get_count_with_query_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int count = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
query = NULL;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_query_destroy(query);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_address_book(void)
+static int _ctsvc_tc_db_insert_record_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
-
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
record = NULL;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
-
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_address_book(void)
+static int _ctsvc_tc_db_update_record_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
-
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
record = NULL;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
-
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_address_book(void)
+static int _ctsvc_tc_db_delete_record_address_book(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_record_create_address_book(account_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_insert_record(record, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_record_destroy(record, true))) break;
ret = -1;
break;
}
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
-
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_address_book._uri, id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_address(void);
static int _ctsvc_tc_db_remove_changed_cb_address(void);
-static int _ctsvc_tc_db_get_record_address(void);
-static int _ctsvc_tc_db_get_records_with_query_address(void);
-static int _ctsvc_tc_db_get_all_records_address(void);
-static int _ctsvc_tc_db_get_count_address(void);
-static int _ctsvc_tc_db_get_count_with_query_address(void);
-static int _ctsvc_tc_db_insert_record_address(void);
-static int _ctsvc_tc_db_insert_records_address(void);
-static int _ctsvc_tc_db_update_record_address(void);
-static int _ctsvc_tc_db_update_records_address(void);
-static int _ctsvc_tc_db_delete_record_address(void);
-static int _ctsvc_tc_db_delete_records_address(void);
+static int _ctsvc_tc_db_get_record_address(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_address(int account_id);
+static int _ctsvc_tc_db_get_all_records_address(int account_id);
+static int _ctsvc_tc_db_get_count_address(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_address(int account_id);
+static int _ctsvc_tc_db_insert_record_address(int account_id);
+static int _ctsvc_tc_db_insert_records_address(int account_id);
+static int _ctsvc_tc_db_update_record_address(int account_id);
+static int _ctsvc_tc_db_update_records_address(int account_id);
+static int _ctsvc_tc_db_delete_record_address(int account_id);
+static int _ctsvc_tc_db_delete_records_address(int account_id);
ctsvc_tc_db_plugin_s _tc_db_address = {
return ret;
}
-static int _ctsvc_tc_db_get_record_address(void)
+static int _ctsvc_tc_db_get_record_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_address(void)
+static int _ctsvc_tc_db_get_records_with_query_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_address(void)
+static int _ctsvc_tc_db_get_all_records_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_address(void)
+static int _ctsvc_tc_db_get_count_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_address(void)
+static int _ctsvc_tc_db_get_count_with_query_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_address(void)
+static int _ctsvc_tc_db_insert_record_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_address(void)
+static int _ctsvc_tc_db_insert_records_address(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_address(void)
+static int _ctsvc_tc_db_update_record_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_address(void)
+static int _ctsvc_tc_db_update_records_address(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_address(void)
+static int _ctsvc_tc_db_delete_record_address(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_address(void)
+static int _ctsvc_tc_db_delete_records_address(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_company(void);
static int _ctsvc_tc_db_remove_changed_cb_company(void);
-static int _ctsvc_tc_db_get_record_company(void);
-static int _ctsvc_tc_db_get_records_with_query_company(void);
-static int _ctsvc_tc_db_get_all_records_company(void);
-static int _ctsvc_tc_db_get_count_company(void);
-static int _ctsvc_tc_db_get_count_with_query_company(void);
-static int _ctsvc_tc_db_insert_record_company(void);
-static int _ctsvc_tc_db_insert_records_company(void);
-static int _ctsvc_tc_db_update_record_company(void);
-static int _ctsvc_tc_db_update_records_company(void);
-static int _ctsvc_tc_db_delete_record_company(void);
-static int _ctsvc_tc_db_delete_records_company(void);
+static int _ctsvc_tc_db_get_record_company(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_company(int account_id);
+static int _ctsvc_tc_db_get_all_records_company(int account_id);
+static int _ctsvc_tc_db_get_count_company(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_company(int account_id);
+static int _ctsvc_tc_db_insert_record_company(int account_id);
+static int _ctsvc_tc_db_insert_records_company(int account_id);
+static int _ctsvc_tc_db_update_record_company(int account_id);
+static int _ctsvc_tc_db_update_records_company(int account_id);
+static int _ctsvc_tc_db_delete_record_company(int account_id);
+static int _ctsvc_tc_db_delete_records_company(int account_id);
ctsvc_tc_db_plugin_s _tc_db_company = {
return ret;
}
-static int _ctsvc_tc_db_get_record_company(void)
+static int _ctsvc_tc_db_get_record_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_company(void)
+static int _ctsvc_tc_db_get_records_with_query_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_company(void)
+static int _ctsvc_tc_db_get_all_records_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_company(void)
+static int _ctsvc_tc_db_get_count_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_company(void)
+static int _ctsvc_tc_db_get_count_with_query_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_company(void)
+static int _ctsvc_tc_db_insert_record_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_company(void)
+static int _ctsvc_tc_db_insert_records_company(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_company(void)
+static int _ctsvc_tc_db_update_record_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_company(void)
+static int _ctsvc_tc_db_update_records_company(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_company(void)
+static int _ctsvc_tc_db_delete_record_company(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_company(void)
+static int _ctsvc_tc_db_delete_records_company(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
#include "utc-contacts-service-db-contact.h"
#include "utc-contacts-service-db-contact-updated-info.h"
-static int _ctsvc_tc_db_get_chages_by_version_contact_updated_info(void);
+static int _ctsvc_tc_db_get_chages_by_version_contact_updated_info(int account_id);
ctsvc_tc_db_plugin_s _tc_db_contact_updated_info = {
.db_add_changed_cb = NULL,
.db_search_records_with_range_for_snippet = NULL,
};
-static int _ctsvc_tc_db_get_chages_by_version_contact_updated_info(void)
+static int _ctsvc_tc_db_get_chages_by_version_contact_updated_info(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_list_h list = NULL;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
+ if (account_id <= 0)
+ return -1;
do {
if (0 != (ret = contacts_db_get_current_version(&version))) break;
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
static int _ctsvc_tc_db_add_changed_cb_contact(void);
static int _ctsvc_tc_db_remove_changed_cb_contact(void);
-static int _ctsvc_tc_db_get_record_contact(void);
-static int _ctsvc_tc_db_get_records_with_query_contact(void);
-static int _ctsvc_tc_db_get_all_records_contact(void);
-static int _ctsvc_tc_db_get_count_contact(void);
-static int _ctsvc_tc_db_get_count_with_query_contact(void);
-static int _ctsvc_tc_db_insert_record_contact(void);
-static int _ctsvc_tc_db_insert_records_contact(void);
-static int _ctsvc_tc_db_update_record_contact(void);
-static int _ctsvc_tc_db_update_records_contact(void);
-static int _ctsvc_tc_db_delete_record_contact(void);
-static int _ctsvc_tc_db_delete_records_contact(void);
-static int _ctsvc_tc_db_replace_record_contact(void);
-static int _ctsvc_tc_db_replace_records_contact(void);
+static int _ctsvc_tc_db_get_record_contact(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_contact(int account_id);
+static int _ctsvc_tc_db_get_all_records_contact(int account_id);
+static int _ctsvc_tc_db_get_count_contact(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_contact(int account_id);
+static int _ctsvc_tc_db_insert_record_contact(int account_id);
+static int _ctsvc_tc_db_insert_records_contact(int account_id);
+static int _ctsvc_tc_db_update_record_contact(int account_id);
+static int _ctsvc_tc_db_update_records_contact(int account_id);
+static int _ctsvc_tc_db_delete_record_contact(int account_id);
+static int _ctsvc_tc_db_delete_records_contact(int account_id);
+static int _ctsvc_tc_db_replace_record_contact(int account_id);
+static int _ctsvc_tc_db_replace_records_contact(int account_id);
ctsvc_tc_db_plugin_s _tc_db_contact = {
return ret;
}
-static int _ctsvc_tc_db_get_record_contact(void)
+static int _ctsvc_tc_db_get_record_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_contact(void)
+static int _ctsvc_tc_db_get_records_with_query_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_contact(void)
+static int _ctsvc_tc_db_get_all_records_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_contact(void)
+static int _ctsvc_tc_db_get_count_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_contact(void)
+static int _ctsvc_tc_db_get_count_with_query_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int count = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_contact(void)
+static int _ctsvc_tc_db_insert_record_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_contact(void)
+static int _ctsvc_tc_db_insert_records_contact(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
free(ids);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_contact(void)
+static int _ctsvc_tc_db_update_record_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_contact(void)
+static int _ctsvc_tc_db_update_records_contact(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
free(ids);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_contact(void)
+static int _ctsvc_tc_db_delete_record_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_contact(void)
+static int _ctsvc_tc_db_delete_records_contact(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
free(ids);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_replace_record_contact(void)
+static int _ctsvc_tc_db_replace_record_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_replace_records_contact(void)
+static int _ctsvc_tc_db_replace_records_contact(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
free(ids);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_email(void);
static int _ctsvc_tc_db_remove_changed_cb_email(void);
-static int _ctsvc_tc_db_get_record_email(void);
-static int _ctsvc_tc_db_get_records_with_query_email(void);
-static int _ctsvc_tc_db_get_all_records_email(void);
-static int _ctsvc_tc_db_get_count_email(void);
-static int _ctsvc_tc_db_get_count_with_query_email(void);
-static int _ctsvc_tc_db_insert_record_email(void);
-static int _ctsvc_tc_db_insert_records_email(void);
-static int _ctsvc_tc_db_update_record_email(void);
-static int _ctsvc_tc_db_update_records_email(void);
-static int _ctsvc_tc_db_delete_record_email(void);
-static int _ctsvc_tc_db_delete_records_email(void);
+static int _ctsvc_tc_db_get_record_email(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_email(int account_id);
+static int _ctsvc_tc_db_get_all_records_email(int account_id);
+static int _ctsvc_tc_db_get_count_email(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_email(int account_id);
+static int _ctsvc_tc_db_insert_record_email(int account_id);
+static int _ctsvc_tc_db_insert_records_email(int account_id);
+static int _ctsvc_tc_db_update_record_email(int account_id);
+static int _ctsvc_tc_db_update_records_email(int account_id);
+static int _ctsvc_tc_db_delete_record_email(int account_id);
+static int _ctsvc_tc_db_delete_records_email(int account_id);
ctsvc_tc_db_plugin_s _tc_db_email = {
return ret;
}
-static int _ctsvc_tc_db_get_record_email(void)
+static int _ctsvc_tc_db_get_record_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_email(void)
+static int _ctsvc_tc_db_get_records_with_query_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_email(void)
+static int _ctsvc_tc_db_get_all_records_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_email(void)
+static int _ctsvc_tc_db_get_count_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_email(void)
+static int _ctsvc_tc_db_get_count_with_query_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_email(void)
+static int _ctsvc_tc_db_insert_record_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_email(void)
+static int _ctsvc_tc_db_insert_records_email(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_email(void)
+static int _ctsvc_tc_db_update_record_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_email(void)
+static int _ctsvc_tc_db_update_records_email(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_email(void)
+static int _ctsvc_tc_db_delete_record_email(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_email(void)
+static int _ctsvc_tc_db_delete_records_email(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_event(void);
static int _ctsvc_tc_db_remove_changed_cb_event(void);
-static int _ctsvc_tc_db_get_record_event(void);
-static int _ctsvc_tc_db_get_records_with_query_event(void);
-static int _ctsvc_tc_db_get_all_records_event(void);
-static int _ctsvc_tc_db_get_count_event(void);
-static int _ctsvc_tc_db_get_count_with_query_event(void);
-static int _ctsvc_tc_db_insert_record_event(void);
-static int _ctsvc_tc_db_insert_records_event(void);
-static int _ctsvc_tc_db_update_record_event(void);
-static int _ctsvc_tc_db_update_records_event(void);
-static int _ctsvc_tc_db_delete_record_event(void);
-static int _ctsvc_tc_db_delete_records_event(void);
+static int _ctsvc_tc_db_get_record_event(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_event(int account_id);
+static int _ctsvc_tc_db_get_all_records_event(int account_id);
+static int _ctsvc_tc_db_get_count_event(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_event(int account_id);
+static int _ctsvc_tc_db_insert_record_event(int account_id);
+static int _ctsvc_tc_db_insert_records_event(int account_id);
+static int _ctsvc_tc_db_update_record_event(int account_id);
+static int _ctsvc_tc_db_update_records_event(int account_id);
+static int _ctsvc_tc_db_delete_record_event(int account_id);
+static int _ctsvc_tc_db_delete_records_event(int account_id);
ctsvc_tc_db_plugin_s _tc_db_event = {
return ret;
}
-static int _ctsvc_tc_db_get_record_event(void)
+static int _ctsvc_tc_db_get_record_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_event(void)
+static int _ctsvc_tc_db_get_records_with_query_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_event(void)
+static int _ctsvc_tc_db_get_all_records_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_event(void)
+static int _ctsvc_tc_db_get_count_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_event(void)
+static int _ctsvc_tc_db_get_count_with_query_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_event(void)
+static int _ctsvc_tc_db_insert_record_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_event(void)
+static int _ctsvc_tc_db_insert_records_event(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_event(void)
+static int _ctsvc_tc_db_update_record_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_event(void)
+static int _ctsvc_tc_db_update_records_event(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_event(void)
+static int _ctsvc_tc_db_delete_record_event(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_event(void)
+static int _ctsvc_tc_db_delete_records_event(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_extension(void);
static int _ctsvc_tc_db_remove_changed_cb_extension(void);
-static int _ctsvc_tc_db_get_record_extension(void);
-static int _ctsvc_tc_db_get_records_with_query_extension(void);
-static int _ctsvc_tc_db_get_all_records_extension(void);
-static int _ctsvc_tc_db_get_count_extension(void);
-static int _ctsvc_tc_db_get_count_with_query_extension(void);
-static int _ctsvc_tc_db_insert_record_extension(void);
-static int _ctsvc_tc_db_insert_records_extension(void);
-static int _ctsvc_tc_db_update_record_extension(void);
-static int _ctsvc_tc_db_update_records_extension(void);
-static int _ctsvc_tc_db_delete_record_extension(void);
-static int _ctsvc_tc_db_delete_records_extension(void);
+static int _ctsvc_tc_db_get_record_extension(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_extension(int account_id);
+static int _ctsvc_tc_db_get_all_records_extension(int account_id);
+static int _ctsvc_tc_db_get_count_extension(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_extension(int account_id);
+static int _ctsvc_tc_db_insert_record_extension(int account_id);
+static int _ctsvc_tc_db_insert_records_extension(int account_id);
+static int _ctsvc_tc_db_update_record_extension(int account_id);
+static int _ctsvc_tc_db_update_records_extension(int account_id);
+static int _ctsvc_tc_db_delete_record_extension(int account_id);
+static int _ctsvc_tc_db_delete_records_extension(int account_id);
ctsvc_tc_db_plugin_s _tc_db_extension = {
return ret;
}
-static int _ctsvc_tc_db_get_record_extension(void)
+static int _ctsvc_tc_db_get_record_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_extension(void)
+static int _ctsvc_tc_db_get_records_with_query_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_extension(void)
+static int _ctsvc_tc_db_get_all_records_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_extension(void)
+static int _ctsvc_tc_db_get_count_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_extension(void)
+static int _ctsvc_tc_db_get_count_with_query_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_extension(void)
+static int _ctsvc_tc_db_insert_record_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_extension(void)
+static int _ctsvc_tc_db_insert_records_extension(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_extension(void)
+static int _ctsvc_tc_db_update_record_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_extension(void)
+static int _ctsvc_tc_db_update_records_extension(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_extension(void)
+static int _ctsvc_tc_db_delete_record_extension(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_extension(void)
+static int _ctsvc_tc_db_delete_records_extension(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
#include "utc-contacts-service-db-contact.h"
#include "utc-contacts-service-db-group-member-updated-info.h"
-static int _ctsvc_tc_db_get_chages_by_version_group_member_updated_info(void);
+static int _ctsvc_tc_db_get_chages_by_version_group_member_updated_info(int account_id);
ctsvc_tc_db_plugin_s _tc_db_group_member_updated_info = {
.db_add_changed_cb = NULL,
.db_search_records_with_range_for_snippet = NULL,
};
-static int _ctsvc_tc_db_get_chages_by_version_group_member_updated_info(void)
+static int _ctsvc_tc_db_get_chages_by_version_group_member_updated_info(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_list_h list = NULL;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
+ if (account_id <= 0)
+ return -1;
do {
if (0 != (ret = contacts_db_get_current_version(&version))) break;
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
static int _ctsvc_tc_db_add_changed_cb_group_relation(void);
static int _ctsvc_tc_db_remove_changed_cb_group_relation(void);
-static int _ctsvc_tc_db_get_records_with_query_group_relation(void);
-static int _ctsvc_tc_db_get_all_records_group_relation(void);
-static int _ctsvc_tc_db_get_count_group_relation(void);
-static int _ctsvc_tc_db_get_count_with_query_group_relation(void);
+static int _ctsvc_tc_db_get_records_with_query_group_relation(int account_id);
+static int _ctsvc_tc_db_get_all_records_group_relation(int account_id);
+static int _ctsvc_tc_db_get_count_group_relation(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_group_relation(int account_id);
ctsvc_tc_db_plugin_s _tc_db_group_relation = {
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_group_relation(void)
+static int _ctsvc_tc_db_get_records_with_query_group_relation(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_group_relation(void)
+static int _ctsvc_tc_db_get_all_records_group_relation(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_group_relation(void)
+static int _ctsvc_tc_db_get_count_group_relation(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_group_relation(void)
+static int _ctsvc_tc_db_get_count_with_query_group_relation(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
#include "utc-contacts-service-db-group.h"
#include "utc-contacts-service-db-group-updated-info.h"
-static int _ctsvc_tc_db_get_chages_by_version_group_updated_info(void);
+static int _ctsvc_tc_db_get_chages_by_version_group_updated_info(int account_id);
ctsvc_tc_db_plugin_s _tc_db_group_updated_info = {
.db_add_changed_cb = NULL,
.db_search_records_with_range_for_snippet = NULL,
};
-static int _ctsvc_tc_db_get_chages_by_version_group_updated_info(void)
+static int _ctsvc_tc_db_get_chages_by_version_group_updated_info(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int version = 0;
contacts_list_h list = NULL;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
+ if (account_id <= 0)
+ return -1;
do {
if (0 != (ret = contacts_db_get_current_version(&version))) break;
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
static int _ctsvc_tc_db_add_changed_cb_group(void);
static int _ctsvc_tc_db_remove_changed_cb_group(void);
-static int _ctsvc_tc_db_get_record_group(void);
-static int _ctsvc_tc_db_get_records_with_query_group(void);
-static int _ctsvc_tc_db_get_all_records_group(void);
-static int _ctsvc_tc_db_get_count_group(void);
-static int _ctsvc_tc_db_get_count_with_query_group(void);
-static int _ctsvc_tc_db_insert_record_group(void);
-static int _ctsvc_tc_db_insert_records_group(void);
-static int _ctsvc_tc_db_update_record_group(void);
-static int _ctsvc_tc_db_update_records_group(void);
-static int _ctsvc_tc_db_delete_record_group(void);
-static int _ctsvc_tc_db_delete_records_group(void);
+static int _ctsvc_tc_db_get_record_group(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_group(int account_id);
+static int _ctsvc_tc_db_get_all_records_group(int account_id);
+static int _ctsvc_tc_db_get_count_group(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_group(int account_id);
+static int _ctsvc_tc_db_insert_record_group(int account_id);
+static int _ctsvc_tc_db_insert_records_group(int account_id);
+static int _ctsvc_tc_db_update_record_group(int account_id);
+static int _ctsvc_tc_db_update_records_group(int account_id);
+static int _ctsvc_tc_db_delete_record_group(int account_id);
+static int _ctsvc_tc_db_delete_records_group(int account_id);
ctsvc_tc_db_plugin_s _tc_db_group = {
return ret;
}
-static int _ctsvc_tc_db_get_record_group(void)
+static int _ctsvc_tc_db_get_record_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_group(void)
+static int _ctsvc_tc_db_get_records_with_query_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_query_destroy(query);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_group(void)
+static int _ctsvc_tc_db_get_all_records_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_list_destroy(list, true);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_group(void)
+static int _ctsvc_tc_db_get_count_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
}
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_group(void)
+static int _ctsvc_tc_db_get_count_with_query_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int count = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_group(void)
+static int _ctsvc_tc_db_insert_record_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_group(void)
+static int _ctsvc_tc_db_insert_records_group(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_list_create(&list))) break;
ids_count = 0;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_group._uri, ids, ids_count);
free(ids);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_group(void)
+static int _ctsvc_tc_db_update_record_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_group(void)
+static int _ctsvc_tc_db_update_records_group(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_list_create(&list))) break;
ids_count = 0;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_group._uri, ids, ids_count);
free(ids);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_group(void)
+static int _ctsvc_tc_db_delete_record_group(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_group(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
}
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_group._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_group(void)
+static int _ctsvc_tc_db_delete_records_group(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_list_create(&list))) break;
ids_count = 0;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_group._uri, ids, ids_count);
free(ids);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
#include "utc-contacts-service-db-contact.h"
#include "utc-contacts-service-db-grouprel-updated-info.h"
-static int _ctsvc_tc_db_get_chages_by_version_grouprel_updated_info(void);
+static int _ctsvc_tc_db_get_chages_by_version_grouprel_updated_info(int account_id);
ctsvc_tc_db_plugin_s _tc_db_grouprel_updated_info = {
.db_add_changed_cb = NULL,
.db_search_records_with_range_for_snippet = NULL,
};
-static int _ctsvc_tc_db_get_chages_by_version_grouprel_updated_info(void)
+static int _ctsvc_tc_db_get_chages_by_version_grouprel_updated_info(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_list_h list = NULL;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
+ if (account_id <= 0)
+ return -1;
do {
if (0 != (ret = contacts_db_get_current_version(&version))) break;
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
static int _ctsvc_tc_db_add_changed_cb_image(void);
static int _ctsvc_tc_db_remove_changed_cb_image(void);
-static int _ctsvc_tc_db_get_record_image(void);
-static int _ctsvc_tc_db_get_records_with_query_image(void);
-static int _ctsvc_tc_db_get_all_records_image(void);
-static int _ctsvc_tc_db_get_count_image(void);
-static int _ctsvc_tc_db_get_count_with_query_image(void);
-static int _ctsvc_tc_db_insert_record_image(void);
-static int _ctsvc_tc_db_insert_records_image(void);
-static int _ctsvc_tc_db_update_record_image(void);
-static int _ctsvc_tc_db_update_records_image(void);
-static int _ctsvc_tc_db_delete_record_image(void);
-static int _ctsvc_tc_db_delete_records_image(void);
+static int _ctsvc_tc_db_get_record_image(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_image(int account_id);
+static int _ctsvc_tc_db_get_all_records_image(int account_id);
+static int _ctsvc_tc_db_get_count_image(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_image(int account_id);
+static int _ctsvc_tc_db_insert_record_image(int account_id);
+static int _ctsvc_tc_db_insert_records_image(int account_id);
+static int _ctsvc_tc_db_update_record_image(int account_id);
+static int _ctsvc_tc_db_update_records_image(int account_id);
+static int _ctsvc_tc_db_delete_record_image(int account_id);
+static int _ctsvc_tc_db_delete_records_image(int account_id);
ctsvc_tc_db_plugin_s _tc_db_image = {
return ret;
}
-static int _ctsvc_tc_db_get_record_image(void)
+static int _ctsvc_tc_db_get_record_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_image(void)
+static int _ctsvc_tc_db_get_records_with_query_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_image(void)
+static int _ctsvc_tc_db_get_all_records_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_image(void)
+static int _ctsvc_tc_db_get_count_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_image(void)
+static int _ctsvc_tc_db_get_count_with_query_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_image(void)
+static int _ctsvc_tc_db_insert_record_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_image(void)
+static int _ctsvc_tc_db_insert_records_image(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_image(void)
+static int _ctsvc_tc_db_update_record_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_image(void)
+static int _ctsvc_tc_db_update_records_image(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_image(void)
+static int _ctsvc_tc_db_delete_record_image(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_image(void)
+static int _ctsvc_tc_db_delete_records_image(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_messenger(void);
static int _ctsvc_tc_db_remove_changed_cb_messenger(void);
-static int _ctsvc_tc_db_get_record_messenger(void);
-static int _ctsvc_tc_db_get_records_with_query_messenger(void);
-static int _ctsvc_tc_db_get_all_records_messenger(void);
-static int _ctsvc_tc_db_get_count_messenger(void);
-static int _ctsvc_tc_db_get_count_with_query_messenger(void);
-static int _ctsvc_tc_db_insert_record_messenger(void);
-static int _ctsvc_tc_db_insert_records_messenger(void);
-static int _ctsvc_tc_db_update_record_messenger(void);
-static int _ctsvc_tc_db_update_records_messenger(void);
-static int _ctsvc_tc_db_delete_record_messenger(void);
-static int _ctsvc_tc_db_delete_records_messenger(void);
+static int _ctsvc_tc_db_get_record_messenger(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_messenger(int account_id);
+static int _ctsvc_tc_db_get_all_records_messenger(int account_id);
+static int _ctsvc_tc_db_get_count_messenger(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_messenger(int account_id);
+static int _ctsvc_tc_db_insert_record_messenger(int account_id);
+static int _ctsvc_tc_db_insert_records_messenger(int account_id);
+static int _ctsvc_tc_db_update_record_messenger(int account_id);
+static int _ctsvc_tc_db_update_records_messenger(int account_id);
+static int _ctsvc_tc_db_delete_record_messenger(int account_id);
+static int _ctsvc_tc_db_delete_records_messenger(int account_id);
ctsvc_tc_db_plugin_s _tc_db_messenger = {
return ret;
}
-static int _ctsvc_tc_db_get_record_messenger(void)
+static int _ctsvc_tc_db_get_record_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_messenger(void)
+static int _ctsvc_tc_db_get_records_with_query_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_messenger(void)
+static int _ctsvc_tc_db_get_all_records_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_messenger(void)
+static int _ctsvc_tc_db_get_count_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_messenger(void)
+static int _ctsvc_tc_db_get_count_with_query_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_messenger(void)
+static int _ctsvc_tc_db_insert_record_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_messenger(void)
+static int _ctsvc_tc_db_insert_records_messenger(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_messenger(void)
+static int _ctsvc_tc_db_update_record_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_messenger(void)
+static int _ctsvc_tc_db_update_records_messenger(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_messenger(void)
+static int _ctsvc_tc_db_delete_record_messenger(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_messenger(void)
+static int _ctsvc_tc_db_delete_records_messenger(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
#include "utc-contacts-service-db-my-profile.h"
#include "utc-contacts-service-db-contact-updated-info.h"
-static int _ctsvc_tc_db_get_chages_by_version_my_profile_updated_info(void);
+static int _ctsvc_tc_db_get_chages_by_version_my_profile_updated_info(int account_id);
ctsvc_tc_db_plugin_s _tc_db_my_profile_updated_info = {
.db_add_changed_cb = NULL,
.db_search_records_with_range_for_snippet = NULL,
};
-static int _ctsvc_tc_db_get_chages_by_version_my_profile_updated_info(void)
+static int _ctsvc_tc_db_get_chages_by_version_my_profile_updated_info(int account_id)
{
int ret = 0;
- int account_id = 0;
int address_book_id = 0;
int my_profile_id = 0;
int version = 0;
contacts_list_h list = NULL;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
+ if (account_id <= 0)
+ return -1;
do {
if (0 != (ret = contacts_db_get_current_version(&version))) break;
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_my_profile(address_book_id, &my_profile_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, my_profile_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_my_profile._uri, my_profile_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
static int _ctsvc_tc_db_add_changed_cb_my_profile(void);
static int _ctsvc_tc_db_remove_changed_cb_my_profile(void);
-static int _ctsvc_tc_db_get_record_my_profile(void);
-static int _ctsvc_tc_db_get_records_with_query_my_profile(void);
-static int _ctsvc_tc_db_get_all_records_my_profile(void);
-static int _ctsvc_tc_db_get_count_my_profile(void);
-static int _ctsvc_tc_db_get_count_with_query_my_profile(void);
-static int _ctsvc_tc_db_insert_record_my_profile(void);
-static int _ctsvc_tc_db_update_record_my_profile(void);
-static int _ctsvc_tc_db_delete_record_my_profile(void);
+static int _ctsvc_tc_db_get_record_my_profile(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_my_profile(int account_id);
+static int _ctsvc_tc_db_get_all_records_my_profile(int account_id);
+static int _ctsvc_tc_db_get_count_my_profile(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_my_profile(int account_id);
+static int _ctsvc_tc_db_insert_record_my_profile(int account_id);
+static int _ctsvc_tc_db_update_record_my_profile(int account_id);
+static int _ctsvc_tc_db_delete_record_my_profile(int account_id);
ctsvc_tc_db_plugin_s _tc_db_my_profile = {
return ret;
}
-static int _ctsvc_tc_db_get_record_my_profile(void)
+static int _ctsvc_tc_db_get_record_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_my_profile(void)
+static int _ctsvc_tc_db_get_records_with_query_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_query_destroy(query);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_my_profile(void)
+static int _ctsvc_tc_db_get_all_records_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_list_destroy(list, true);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_my_profile(void)
+static int _ctsvc_tc_db_get_count_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
}
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_my_profile(void)
+static int _ctsvc_tc_db_get_count_with_query_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int count = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_my_profile(void)
+static int _ctsvc_tc_db_insert_record_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_my_profile(void)
+static int _ctsvc_tc_db_update_record_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_my_profile._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_my_profile(void)
+static int _ctsvc_tc_db_delete_record_my_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_record_create_my_profile(address_book_id, PROPERTY_TYPE_CREATE1, &record))) break;
}
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_record_destroy(record, true);
contacts_db_delete_record(_contacts_my_profile._uri, id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_name(void);
static int _ctsvc_tc_db_remove_changed_cb_name(void);
-static int _ctsvc_tc_db_get_record_name(void);
-static int _ctsvc_tc_db_get_records_with_query_name(void);
-static int _ctsvc_tc_db_get_all_records_name(void);
-static int _ctsvc_tc_db_get_count_name(void);
-static int _ctsvc_tc_db_get_count_with_query_name(void);
-static int _ctsvc_tc_db_insert_record_name(void);
-static int _ctsvc_tc_db_insert_records_name(void);
-static int _ctsvc_tc_db_update_record_name(void);
-static int _ctsvc_tc_db_update_records_name(void);
-static int _ctsvc_tc_db_delete_record_name(void);
-static int _ctsvc_tc_db_delete_records_name(void);
+static int _ctsvc_tc_db_get_record_name(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_name(int account_id);
+static int _ctsvc_tc_db_get_all_records_name(int account_id);
+static int _ctsvc_tc_db_get_count_name(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_name(int account_id);
+static int _ctsvc_tc_db_insert_record_name(int account_id);
+static int _ctsvc_tc_db_insert_records_name(int account_id);
+static int _ctsvc_tc_db_update_record_name(int account_id);
+static int _ctsvc_tc_db_update_records_name(int account_id);
+static int _ctsvc_tc_db_delete_record_name(int account_id);
+static int _ctsvc_tc_db_delete_records_name(int account_id);
ctsvc_tc_db_plugin_s _tc_db_name = {
return ret;
}
-static int _ctsvc_tc_db_get_record_name(void)
+static int _ctsvc_tc_db_get_record_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_name(void)
+static int _ctsvc_tc_db_get_records_with_query_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_name(void)
+static int _ctsvc_tc_db_get_all_records_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_name(void)
+static int _ctsvc_tc_db_get_count_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_name(void)
+static int _ctsvc_tc_db_get_count_with_query_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_name(void)
+static int _ctsvc_tc_db_insert_record_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_name(void)
+static int _ctsvc_tc_db_insert_records_name(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id1 = 0;
int contact_id2 = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id1))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id2))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id2);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_name(void)
+static int _ctsvc_tc_db_update_record_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_name(void)
+static int _ctsvc_tc_db_update_records_name(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id1 = 0;
int contact_id2 = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id1))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id2))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id2);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_name(void)
+static int _ctsvc_tc_db_delete_record_name(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_name(void)
+static int _ctsvc_tc_db_delete_records_name(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id1 = 0;
int contact_id2 = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_empty_contact(address_book_id, group_id, &contact_id1))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id2))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id2);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_nickname(void);
static int _ctsvc_tc_db_remove_changed_cb_nickname(void);
-static int _ctsvc_tc_db_get_record_nickname(void);
-static int _ctsvc_tc_db_get_records_with_query_nickname(void);
-static int _ctsvc_tc_db_get_all_records_nickname(void);
-static int _ctsvc_tc_db_get_count_nickname(void);
-static int _ctsvc_tc_db_get_count_with_query_nickname(void);
-static int _ctsvc_tc_db_insert_record_nickname(void);
-static int _ctsvc_tc_db_insert_records_nickname(void);
-static int _ctsvc_tc_db_update_record_nickname(void);
-static int _ctsvc_tc_db_update_records_nickname(void);
-static int _ctsvc_tc_db_delete_record_nickname(void);
-static int _ctsvc_tc_db_delete_records_nickname(void);
+static int _ctsvc_tc_db_get_record_nickname(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_nickname(int account_id);
+static int _ctsvc_tc_db_get_all_records_nickname(int account_id);
+static int _ctsvc_tc_db_get_count_nickname(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_nickname(int account_id);
+static int _ctsvc_tc_db_insert_record_nickname(int account_id);
+static int _ctsvc_tc_db_insert_records_nickname(int account_id);
+static int _ctsvc_tc_db_update_record_nickname(int account_id);
+static int _ctsvc_tc_db_update_records_nickname(int account_id);
+static int _ctsvc_tc_db_delete_record_nickname(int account_id);
+static int _ctsvc_tc_db_delete_records_nickname(int account_id);
ctsvc_tc_db_plugin_s _tc_db_nickname = {
return ret;
}
-static int _ctsvc_tc_db_get_record_nickname(void)
+static int _ctsvc_tc_db_get_record_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_nickname(void)
+static int _ctsvc_tc_db_get_records_with_query_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_nickname(void)
+static int _ctsvc_tc_db_get_all_records_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_nickname(void)
+static int _ctsvc_tc_db_get_count_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_nickname(void)
+static int _ctsvc_tc_db_get_count_with_query_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_nickname(void)
+static int _ctsvc_tc_db_insert_record_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_nickname(void)
+static int _ctsvc_tc_db_insert_records_nickname(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_nickname(void)
+static int _ctsvc_tc_db_update_record_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_nickname(void)
+static int _ctsvc_tc_db_update_records_nickname(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_nickname(void)
+static int _ctsvc_tc_db_delete_record_nickname(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_nickname(void)
+static int _ctsvc_tc_db_delete_records_nickname(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_note(void);
static int _ctsvc_tc_db_remove_changed_cb_note(void);
-static int _ctsvc_tc_db_get_record_note(void);
-static int _ctsvc_tc_db_get_records_with_query_note(void);
-static int _ctsvc_tc_db_get_all_records_note(void);
-static int _ctsvc_tc_db_get_count_note(void);
-static int _ctsvc_tc_db_get_count_with_query_note(void);
-static int _ctsvc_tc_db_insert_record_note(void);
-static int _ctsvc_tc_db_insert_records_note(void);
-static int _ctsvc_tc_db_update_record_note(void);
-static int _ctsvc_tc_db_update_records_note(void);
-static int _ctsvc_tc_db_delete_record_note(void);
-static int _ctsvc_tc_db_delete_records_note(void);
+static int _ctsvc_tc_db_get_record_note(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_note(int account_id);
+static int _ctsvc_tc_db_get_all_records_note(int account_id);
+static int _ctsvc_tc_db_get_count_note(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_note(int account_id);
+static int _ctsvc_tc_db_insert_record_note(int account_id);
+static int _ctsvc_tc_db_insert_records_note(int account_id);
+static int _ctsvc_tc_db_update_record_note(int account_id);
+static int _ctsvc_tc_db_update_records_note(int account_id);
+static int _ctsvc_tc_db_delete_record_note(int account_id);
+static int _ctsvc_tc_db_delete_records_note(int account_id);
ctsvc_tc_db_plugin_s _tc_db_note = {
return ret;
}
-static int _ctsvc_tc_db_get_record_note(void)
+static int _ctsvc_tc_db_get_record_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_note(void)
+static int _ctsvc_tc_db_get_records_with_query_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_note(void)
+static int _ctsvc_tc_db_get_all_records_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_note(void)
+static int _ctsvc_tc_db_get_count_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_note(void)
+static int _ctsvc_tc_db_get_count_with_query_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_note(void)
+static int _ctsvc_tc_db_insert_record_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_note(void)
+static int _ctsvc_tc_db_insert_records_note(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_note(void)
+static int _ctsvc_tc_db_update_record_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_note(void)
+static int _ctsvc_tc_db_update_records_note(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_note(void)
+static int _ctsvc_tc_db_delete_record_note(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_note(void)
+static int _ctsvc_tc_db_delete_records_note(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_number(void);
static int _ctsvc_tc_db_remove_changed_cb_number(void);
-static int _ctsvc_tc_db_get_record_number(void);
-static int _ctsvc_tc_db_get_records_with_query_number(void);
-static int _ctsvc_tc_db_get_all_records_number(void);
-static int _ctsvc_tc_db_get_count_number(void);
-static int _ctsvc_tc_db_get_count_with_query_number(void);
-static int _ctsvc_tc_db_insert_record_number(void);
-static int _ctsvc_tc_db_insert_records_number(void);
-static int _ctsvc_tc_db_update_record_number(void);
-static int _ctsvc_tc_db_update_records_number(void);
-static int _ctsvc_tc_db_delete_record_number(void);
-static int _ctsvc_tc_db_delete_records_number(void);
+static int _ctsvc_tc_db_get_record_number(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_number(int account_id);
+static int _ctsvc_tc_db_get_all_records_number(int account_id);
+static int _ctsvc_tc_db_get_count_number(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_number(int account_id);
+static int _ctsvc_tc_db_insert_record_number(int account_id);
+static int _ctsvc_tc_db_insert_records_number(int account_id);
+static int _ctsvc_tc_db_update_record_number(int account_id);
+static int _ctsvc_tc_db_update_records_number(int account_id);
+static int _ctsvc_tc_db_delete_record_number(int account_id);
+static int _ctsvc_tc_db_delete_records_number(int account_id);
ctsvc_tc_db_plugin_s _tc_db_number = {
return ret;
}
-static int _ctsvc_tc_db_get_record_number(void)
+static int _ctsvc_tc_db_get_record_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_number(void)
+static int _ctsvc_tc_db_get_records_with_query_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_number(void)
+static int _ctsvc_tc_db_get_all_records_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_number(void)
+static int _ctsvc_tc_db_get_count_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_number(void)
+static int _ctsvc_tc_db_get_count_with_query_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_number(void)
+static int _ctsvc_tc_db_insert_record_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_number(void)
+static int _ctsvc_tc_db_insert_records_number(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_number(void)
+static int _ctsvc_tc_db_update_record_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_number(void)
+static int _ctsvc_tc_db_update_records_number(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_number(void)
+static int _ctsvc_tc_db_delete_record_number(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_number(void)
+static int _ctsvc_tc_db_delete_records_number(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_person(void);
static int _ctsvc_tc_db_remove_changed_cb_person(void);
-static int _ctsvc_tc_db_get_record_person(void);
-static int _ctsvc_tc_db_get_records_with_query_person(void);
-static int _ctsvc_tc_db_get_all_records_person(void);
-static int _ctsvc_tc_db_get_count_person(void);
-static int _ctsvc_tc_db_get_count_with_query_person(void);
-static int _ctsvc_tc_db_update_record_person(void);
-static int _ctsvc_tc_db_update_records_person(void);
-static int _ctsvc_tc_db_delete_record_person(void);
-static int _ctsvc_tc_db_delete_records_person(void);
-static int _ctsvc_tc_db_search_records_person(void);
-static int _ctsvc_tc_db_search_records_with_query_person(void);
-static int _ctsvc_tc_db_search_records_with_range_person(void);
-static int _ctsvc_tc_db_search_records_for_snippet_person(void);
-static int _ctsvc_tc_db_search_records_with_query_for_snippet_person(void);
-static int _ctsvc_tc_db_search_records_with_range_for_snippet_person(void);
+static int _ctsvc_tc_db_get_record_person(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_person(int account_id);
+static int _ctsvc_tc_db_get_all_records_person(int account_id);
+static int _ctsvc_tc_db_get_count_person(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_person(int account_id);
+static int _ctsvc_tc_db_update_record_person(int account_id);
+static int _ctsvc_tc_db_update_records_person(int account_id);
+static int _ctsvc_tc_db_delete_record_person(int account_id);
+static int _ctsvc_tc_db_delete_records_person(int account_id);
+static int _ctsvc_tc_db_search_records_person(int account_id);
+static int _ctsvc_tc_db_search_records_with_query_person(int account_id);
+static int _ctsvc_tc_db_search_records_with_range_person(int account_id);
+static int _ctsvc_tc_db_search_records_for_snippet_person(int account_id);
+static int _ctsvc_tc_db_search_records_with_query_for_snippet_person(int account_id);
+static int _ctsvc_tc_db_search_records_with_range_for_snippet_person(int account_id);
ctsvc_tc_db_plugin_s _tc_db_person = {
return ret;
}
-static int _ctsvc_tc_db_get_record_person(void)
+static int _ctsvc_tc_db_get_record_person(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_person._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_person._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_person(void)
+static int _ctsvc_tc_db_get_records_with_query_person(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_person._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_person._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_person(void)
+static int _ctsvc_tc_db_get_all_records_person(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_person._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_person._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_person(void)
+static int _ctsvc_tc_db_get_count_person(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_person._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_person._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_person(void)
+static int _ctsvc_tc_db_get_count_with_query_person(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int count = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_person._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_person._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_person(void)
+static int _ctsvc_tc_db_update_record_person(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_person._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_person._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_person(void)
+static int _ctsvc_tc_db_update_records_person(int account_id)
{
int ret = 0;
int ids[2]= {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_person(void)
+static int _ctsvc_tc_db_delete_record_person(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_person(address_book_id, group_id, PROPERTY_TYPE_CREATE1, &id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_person._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_person(void)
+static int _ctsvc_tc_db_delete_records_person(int account_id)
{
int ret = 0;
int ids[2] = {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_search_records_person(void)
+static int _ctsvc_tc_db_search_records_person(int account_id)
{
int ret = 0;
int ids[2]= {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_search_records_with_query_person(void)
+static int _ctsvc_tc_db_search_records_with_query_person(int account_id)
{
int ret = 0;
int ids[2]= {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_search_records_with_range_person(void)
+static int _ctsvc_tc_db_search_records_with_range_person(int account_id)
{
int ret = 0;
int ids[2]= {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_search_records_for_snippet_person(void)
+static int _ctsvc_tc_db_search_records_for_snippet_person(int account_id)
{
int ret = 0;
int ids[2]= {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_search_records_with_query_for_snippet_person(void)
+static int _ctsvc_tc_db_search_records_with_query_for_snippet_person(int account_id)
{
int ret = 0;
int ids[2]= {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_search_records_with_range_for_snippet_person(void)
+static int _ctsvc_tc_db_search_records_with_range_for_snippet_person(int account_id)
{
int ret = 0;
int ids[2]= {0};
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_records(_contacts_person._uri, ids, ids_count))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_records(_contacts_person._uri, ids, ids_count);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
#include "utc-contacts-service-db-contact.h"
#include "utc-contacts-service-db-phone-log.h"
-static int _ctsvc_tc_db_get_records_with_query_phone_log_stat(void);
-static int _ctsvc_tc_db_get_all_records_phone_log_stat(void);
-static int _ctsvc_tc_db_get_count_phone_log_stat(void);
-static int _ctsvc_tc_db_get_count_with_query_phone_log_stat(void);
+static int _ctsvc_tc_db_get_records_with_query_phone_log_stat(int account_id);
+static int _ctsvc_tc_db_get_all_records_phone_log_stat(int account_id);
+static int _ctsvc_tc_db_get_count_phone_log_stat(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_phone_log_stat(int account_id);
ctsvc_tc_db_plugin_s _tc_db_phone_log_stat = {
.db_add_changed_cb = NULL,
.db_search_records_with_range_for_snippet = NULL,
};
-static int _ctsvc_tc_db_get_records_with_query_phone_log_stat(void)
+static int _ctsvc_tc_db_get_records_with_query_phone_log_stat(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_get_all_records_phone_log_stat(void)
+static int _ctsvc_tc_db_get_all_records_phone_log_stat(int account_id)
{
int ret = 0;
int id = 0;
}
-static int _ctsvc_tc_db_get_count_phone_log_stat(void)
+static int _ctsvc_tc_db_get_count_phone_log_stat(int account_id)
{
int ret = 0;
int id = 0;
}
-static int _ctsvc_tc_db_get_count_with_query_phone_log_stat(void)
+static int _ctsvc_tc_db_get_count_with_query_phone_log_stat(int account_id)
{
int ret = 0;
int id = 0;
static int _ctsvc_tc_db_add_changed_cb_phone_log(void);
static int _ctsvc_tc_db_remove_changed_cb_phone_log(void);
-static int _ctsvc_tc_db_get_record_phone_log(void);
-static int _ctsvc_tc_db_get_records_with_query_phone_log(void);
-static int _ctsvc_tc_db_get_all_records_phone_log(void);
-static int _ctsvc_tc_db_get_count_phone_log(void);
-static int _ctsvc_tc_db_get_count_with_query_phone_log(void);
-static int _ctsvc_tc_db_insert_record_phone_log(void);
-static int _ctsvc_tc_db_insert_records_phone_log(void);
-static int _ctsvc_tc_db_update_record_phone_log(void);
-static int _ctsvc_tc_db_update_records_phone_log(void);
-static int _ctsvc_tc_db_delete_record_phone_log(void);
-static int _ctsvc_tc_db_delete_records_phone_log(void);
+static int _ctsvc_tc_db_get_record_phone_log(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_phone_log(int account_id);
+static int _ctsvc_tc_db_get_all_records_phone_log(int account_id);
+static int _ctsvc_tc_db_get_count_phone_log(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_phone_log(int account_id);
+static int _ctsvc_tc_db_insert_record_phone_log(int account_id);
+static int _ctsvc_tc_db_insert_records_phone_log(int account_id);
+static int _ctsvc_tc_db_update_record_phone_log(int account_id);
+static int _ctsvc_tc_db_update_records_phone_log(int account_id);
+static int _ctsvc_tc_db_delete_record_phone_log(int account_id);
+static int _ctsvc_tc_db_delete_records_phone_log(int account_id);
ctsvc_tc_db_plugin_s _tc_db_phone_log = {
return ret;
}
-static int _ctsvc_tc_db_get_record_phone_log(void)
+static int _ctsvc_tc_db_get_record_phone_log(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_phone_log(void)
+static int _ctsvc_tc_db_get_records_with_query_phone_log(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_get_all_records_phone_log(void)
+static int _ctsvc_tc_db_get_all_records_phone_log(int account_id)
{
int ret = 0;
int id = 0;
}
-static int _ctsvc_tc_db_get_count_phone_log(void)
+static int _ctsvc_tc_db_get_count_phone_log(int account_id)
{
int ret = 0;
int id = 0;
}
-static int _ctsvc_tc_db_get_count_with_query_phone_log(void)
+static int _ctsvc_tc_db_get_count_with_query_phone_log(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_insert_record_phone_log(void)
+static int _ctsvc_tc_db_insert_record_phone_log(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_insert_records_phone_log(void)
+static int _ctsvc_tc_db_insert_records_phone_log(int account_id)
{
int ret = 0;
int *ids = NULL;
return ret;
}
-static int _ctsvc_tc_db_update_record_phone_log(void)
+static int _ctsvc_tc_db_update_record_phone_log(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_update_records_phone_log(void)
+static int _ctsvc_tc_db_update_records_phone_log(int account_id)
{
int ret = 0;
int *ids = NULL;
return ret;
}
-static int _ctsvc_tc_db_delete_record_phone_log(void)
+static int _ctsvc_tc_db_delete_record_phone_log(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_delete_records_phone_log(void)
+static int _ctsvc_tc_db_delete_records_phone_log(int account_id)
{
int ret = 0;
int *ids = NULL;
static int _ctsvc_tc_db_add_changed_cb_profile(void);
static int _ctsvc_tc_db_remove_changed_cb_profile(void);
-static int _ctsvc_tc_db_get_record_profile(void);
-static int _ctsvc_tc_db_get_records_with_query_profile(void);
-static int _ctsvc_tc_db_get_all_records_profile(void);
-static int _ctsvc_tc_db_get_count_profile(void);
-static int _ctsvc_tc_db_get_count_with_query_profile(void);
-static int _ctsvc_tc_db_insert_record_profile(void);
-static int _ctsvc_tc_db_insert_records_profile(void);
-static int _ctsvc_tc_db_update_record_profile(void);
-static int _ctsvc_tc_db_update_records_profile(void);
-static int _ctsvc_tc_db_delete_record_profile(void);
-static int _ctsvc_tc_db_delete_records_profile(void);
+static int _ctsvc_tc_db_get_record_profile(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_profile(int account_id);
+static int _ctsvc_tc_db_get_all_records_profile(int account_id);
+static int _ctsvc_tc_db_get_count_profile(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_profile(int account_id);
+static int _ctsvc_tc_db_insert_record_profile(int account_id);
+static int _ctsvc_tc_db_insert_records_profile(int account_id);
+static int _ctsvc_tc_db_update_record_profile(int account_id);
+static int _ctsvc_tc_db_update_records_profile(int account_id);
+static int _ctsvc_tc_db_delete_record_profile(int account_id);
+static int _ctsvc_tc_db_delete_records_profile(int account_id);
ctsvc_tc_db_plugin_s _tc_db_profile = {
return ret;
}
-static int _ctsvc_tc_db_get_record_profile(void)
+static int _ctsvc_tc_db_get_record_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_profile(void)
+static int _ctsvc_tc_db_get_records_with_query_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_profile(void)
+static int _ctsvc_tc_db_get_all_records_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_profile(void)
+static int _ctsvc_tc_db_get_count_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_profile(void)
+static int _ctsvc_tc_db_get_count_with_query_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_profile(void)
+static int _ctsvc_tc_db_insert_record_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_profile(void)
+static int _ctsvc_tc_db_insert_records_profile(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_profile(void)
+static int _ctsvc_tc_db_update_record_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_profile(void)
+static int _ctsvc_tc_db_update_records_profile(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_profile(void)
+static int _ctsvc_tc_db_delete_record_profile(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_profile(void)
+static int _ctsvc_tc_db_delete_records_profile(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_relationship(void);
static int _ctsvc_tc_db_remove_changed_cb_relationship(void);
-static int _ctsvc_tc_db_get_record_relationship(void);
-static int _ctsvc_tc_db_get_records_with_query_relationship(void);
-static int _ctsvc_tc_db_get_all_records_relationship(void);
-static int _ctsvc_tc_db_get_count_relationship(void);
-static int _ctsvc_tc_db_get_count_with_query_relationship(void);
-static int _ctsvc_tc_db_insert_record_relationship(void);
-static int _ctsvc_tc_db_insert_records_relationship(void);
-static int _ctsvc_tc_db_update_record_relationship(void);
-static int _ctsvc_tc_db_update_records_relationship(void);
-static int _ctsvc_tc_db_delete_record_relationship(void);
-static int _ctsvc_tc_db_delete_records_relationship(void);
+static int _ctsvc_tc_db_get_record_relationship(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_relationship(int account_id);
+static int _ctsvc_tc_db_get_all_records_relationship(int account_id);
+static int _ctsvc_tc_db_get_count_relationship(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_relationship(int account_id);
+static int _ctsvc_tc_db_insert_record_relationship(int account_id);
+static int _ctsvc_tc_db_insert_records_relationship(int account_id);
+static int _ctsvc_tc_db_update_record_relationship(int account_id);
+static int _ctsvc_tc_db_update_records_relationship(int account_id);
+static int _ctsvc_tc_db_delete_record_relationship(int account_id);
+static int _ctsvc_tc_db_delete_records_relationship(int account_id);
ctsvc_tc_db_plugin_s _tc_db_relationship = {
return ret;
}
-static int _ctsvc_tc_db_get_record_relationship(void)
+static int _ctsvc_tc_db_get_record_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_relationship(void)
+static int _ctsvc_tc_db_get_records_with_query_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_relationship(void)
+static int _ctsvc_tc_db_get_all_records_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_relationship(void)
+static int _ctsvc_tc_db_get_count_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_relationship(void)
+static int _ctsvc_tc_db_get_count_with_query_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_relationship(void)
+static int _ctsvc_tc_db_insert_record_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_relationship(void)
+static int _ctsvc_tc_db_insert_records_relationship(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_relationship(void)
+static int _ctsvc_tc_db_update_record_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_relationship(void)
+static int _ctsvc_tc_db_update_records_relationship(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_relationship(void)
+static int _ctsvc_tc_db_delete_record_relationship(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_relationship(void)
+static int _ctsvc_tc_db_delete_records_relationship(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_sdn(void);
static int _ctsvc_tc_db_remove_changed_cb_sdn(void);
-static int _ctsvc_tc_db_get_record_sdn(void);
-static int _ctsvc_tc_db_get_records_with_query_sdn(void);
-static int _ctsvc_tc_db_get_all_records_sdn(void);
-static int _ctsvc_tc_db_get_count_sdn(void);
-static int _ctsvc_tc_db_get_count_with_query_sdn(void);
+static int _ctsvc_tc_db_get_record_sdn(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_sdn(int account_id);
+static int _ctsvc_tc_db_get_all_records_sdn(int account_id);
+static int _ctsvc_tc_db_get_count_sdn(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_sdn(int account_id);
ctsvc_tc_db_plugin_s _tc_db_sdn = {
.db_add_changed_cb = _ctsvc_tc_db_add_changed_cb_sdn,
return ret;
}
-static int _ctsvc_tc_db_get_record_sdn(void)
+static int _ctsvc_tc_db_get_record_sdn(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_sdn(void)
+static int _ctsvc_tc_db_get_records_with_query_sdn(int account_id)
{
int ret = 0;
int id = 0;
return ret;
}
-static int _ctsvc_tc_db_get_all_records_sdn(void)
+static int _ctsvc_tc_db_get_all_records_sdn(int account_id)
{
int ret = 0;
contacts_record_h record = NULL;
}
-static int _ctsvc_tc_db_get_count_sdn(void)
+static int _ctsvc_tc_db_get_count_sdn(int account_id)
{
int ret = 0;
int count = 0;
}
-static int _ctsvc_tc_db_get_count_with_query_sdn(void)
+static int _ctsvc_tc_db_get_count_with_query_sdn(int account_id)
{
int ret = 0;
int id = 0;
static int _ctsvc_tc_db_add_changed_cb_simple_contact(void);
static int _ctsvc_tc_db_remove_changed_cb_simple_contact(void);
-static int _ctsvc_tc_db_get_record_simple_contact(void);
-static int _ctsvc_tc_db_get_records_with_query_simple_contact(void);
-static int _ctsvc_tc_db_get_all_records_simple_contact(void);
-static int _ctsvc_tc_db_get_count_simple_contact(void);
-static int _ctsvc_tc_db_get_count_with_query_simple_contact(void);
+static int _ctsvc_tc_db_get_record_simple_contact(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_simple_contact(int account_id);
+static int _ctsvc_tc_db_get_all_records_simple_contact(int account_id);
+static int _ctsvc_tc_db_get_count_simple_contact(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_simple_contact(int account_id);
ctsvc_tc_db_plugin_s _tc_db_simple_contact = {
.db_add_changed_cb = _ctsvc_tc_db_add_changed_cb_simple_contact,
return ret;
}
-static int _ctsvc_tc_db_get_record_simple_contact(void)
+static int _ctsvc_tc_db_get_record_simple_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_simple_contact(void)
+static int _ctsvc_tc_db_get_records_with_query_simple_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_simple_contact(void)
+static int _ctsvc_tc_db_get_all_records_simple_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_simple_contact(void)
+static int _ctsvc_tc_db_get_count_simple_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_simple_contact(void)
+static int _ctsvc_tc_db_get_count_with_query_simple_contact(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int count = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_sip(void);
static int _ctsvc_tc_db_remove_changed_cb_sip(void);
-static int _ctsvc_tc_db_get_record_sip(void);
-static int _ctsvc_tc_db_get_records_with_query_sip(void);
-static int _ctsvc_tc_db_get_all_records_sip(void);
-static int _ctsvc_tc_db_get_count_sip(void);
-static int _ctsvc_tc_db_get_count_with_query_sip(void);
-static int _ctsvc_tc_db_insert_record_sip(void);
-static int _ctsvc_tc_db_insert_records_sip(void);
-static int _ctsvc_tc_db_update_record_sip(void);
-static int _ctsvc_tc_db_update_records_sip(void);
-static int _ctsvc_tc_db_delete_record_sip(void);
-static int _ctsvc_tc_db_delete_records_sip(void);
+static int _ctsvc_tc_db_get_record_sip(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_sip(int account_id);
+static int _ctsvc_tc_db_get_all_records_sip(int account_id);
+static int _ctsvc_tc_db_get_count_sip(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_sip(int account_id);
+static int _ctsvc_tc_db_insert_record_sip(int account_id);
+static int _ctsvc_tc_db_insert_records_sip(int account_id);
+static int _ctsvc_tc_db_update_record_sip(int account_id);
+static int _ctsvc_tc_db_update_records_sip(int account_id);
+static int _ctsvc_tc_db_delete_record_sip(int account_id);
+static int _ctsvc_tc_db_delete_records_sip(int account_id);
ctsvc_tc_db_plugin_s _tc_db_sip = {
return ret;
}
-static int _ctsvc_tc_db_get_record_sip(void)
+static int _ctsvc_tc_db_get_record_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_sip(void)
+static int _ctsvc_tc_db_get_records_with_query_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_sip(void)
+static int _ctsvc_tc_db_get_all_records_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_sip(void)
+static int _ctsvc_tc_db_get_count_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_sip(void)
+static int _ctsvc_tc_db_get_count_with_query_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_sip(void)
+static int _ctsvc_tc_db_insert_record_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_sip(void)
+static int _ctsvc_tc_db_insert_records_sip(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_sip(void)
+static int _ctsvc_tc_db_update_record_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_sip(void)
+static int _ctsvc_tc_db_update_records_sip(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_sip(void)
+static int _ctsvc_tc_db_delete_record_sip(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_sip(void)
+static int _ctsvc_tc_db_delete_records_sip(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_speeddial(void);
static int _ctsvc_tc_db_remove_changed_cb_speeddial(void);
-static int _ctsvc_tc_db_get_record_speeddial(void);
-static int _ctsvc_tc_db_get_records_with_query_speeddial(void);
-static int _ctsvc_tc_db_get_all_records_speeddial(void);
-static int _ctsvc_tc_db_get_count_speeddial(void);
-static int _ctsvc_tc_db_get_count_with_query_speeddial(void);
-static int _ctsvc_tc_db_insert_record_speeddial(void);
-static int _ctsvc_tc_db_insert_records_speeddial(void);
-static int _ctsvc_tc_db_update_record_speeddial(void);
-static int _ctsvc_tc_db_update_records_speeddial(void);
-static int _ctsvc_tc_db_delete_record_speeddial(void);
-static int _ctsvc_tc_db_delete_records_speeddial(void);
+static int _ctsvc_tc_db_get_record_speeddial(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_speeddial(int account_id);
+static int _ctsvc_tc_db_get_all_records_speeddial(int account_id);
+static int _ctsvc_tc_db_get_count_speeddial(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_speeddial(int account_id);
+static int _ctsvc_tc_db_insert_record_speeddial(int account_id);
+static int _ctsvc_tc_db_insert_records_speeddial(int account_id);
+static int _ctsvc_tc_db_update_record_speeddial(int account_id);
+static int _ctsvc_tc_db_update_records_speeddial(int account_id);
+static int _ctsvc_tc_db_delete_record_speeddial(int account_id);
+static int _ctsvc_tc_db_delete_records_speeddial(int account_id);
ctsvc_tc_db_plugin_s _tc_db_speeddial = {
return ret;
}
-static int _ctsvc_tc_db_get_record_speeddial(void)
+static int _ctsvc_tc_db_get_record_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_speeddial(void)
+static int _ctsvc_tc_db_get_records_with_query_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_speeddial(void)
+static int _ctsvc_tc_db_get_all_records_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_speeddial(void)
+static int _ctsvc_tc_db_get_count_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_speeddial(void)
+static int _ctsvc_tc_db_get_count_with_query_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_speeddial(void)
+static int _ctsvc_tc_db_insert_record_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_speeddial(void)
+static int _ctsvc_tc_db_insert_records_speeddial(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id2 = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_speeddial(void)
+static int _ctsvc_tc_db_update_record_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id = 0;
int number_id2 = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_speeddial(void)
+static int _ctsvc_tc_db_update_records_speeddial(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id4 = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_speeddial(void)
+static int _ctsvc_tc_db_delete_record_speeddial(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_speeddial(void)
+static int _ctsvc_tc_db_delete_records_speeddial(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int number_id2 = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
static int _ctsvc_tc_db_add_changed_cb_url(void);
static int _ctsvc_tc_db_remove_changed_cb_url(void);
-static int _ctsvc_tc_db_get_record_url(void);
-static int _ctsvc_tc_db_get_records_with_query_url(void);
-static int _ctsvc_tc_db_get_all_records_url(void);
-static int _ctsvc_tc_db_get_count_url(void);
-static int _ctsvc_tc_db_get_count_with_query_url(void);
-static int _ctsvc_tc_db_insert_record_url(void);
-static int _ctsvc_tc_db_insert_records_url(void);
-static int _ctsvc_tc_db_update_record_url(void);
-static int _ctsvc_tc_db_update_records_url(void);
-static int _ctsvc_tc_db_delete_record_url(void);
-static int _ctsvc_tc_db_delete_records_url(void);
+static int _ctsvc_tc_db_get_record_url(int account_id);
+static int _ctsvc_tc_db_get_records_with_query_url(int account_id);
+static int _ctsvc_tc_db_get_all_records_url(int account_id);
+static int _ctsvc_tc_db_get_count_url(int account_id);
+static int _ctsvc_tc_db_get_count_with_query_url(int account_id);
+static int _ctsvc_tc_db_insert_record_url(int account_id);
+static int _ctsvc_tc_db_insert_records_url(int account_id);
+static int _ctsvc_tc_db_update_record_url(int account_id);
+static int _ctsvc_tc_db_update_records_url(int account_id);
+static int _ctsvc_tc_db_delete_record_url(int account_id);
+static int _ctsvc_tc_db_delete_records_url(int account_id);
ctsvc_tc_db_plugin_s _tc_db_url = {
return ret;
}
-static int _ctsvc_tc_db_get_record_url(void)
+static int _ctsvc_tc_db_get_record_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_records_with_query_url(void)
+static int _ctsvc_tc_db_get_records_with_query_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_all_records_url(void)
+static int _ctsvc_tc_db_get_all_records_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_record_h record_p = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_url(void)
+static int _ctsvc_tc_db_get_count_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
int count = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_get_count_with_query_url(void)
+static int _ctsvc_tc_db_get_count_with_query_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_record_url(void)
+static int _ctsvc_tc_db_insert_record_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_insert_records_url(void)
+static int _ctsvc_tc_db_insert_records_url(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_record_url(void)
+static int _ctsvc_tc_db_update_record_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
-
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_update_records_url(void)
+static int _ctsvc_tc_db_update_records_url(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_record_url(void)
+static int _ctsvc_tc_db_delete_record_url(int account_id)
{
int ret = 0;
int id = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
-static int _ctsvc_tc_db_delete_records_url(void)
+static int _ctsvc_tc_db_delete_records_url(int account_id)
{
int ret = 0;
int *ids = NULL;
int ids_count = 0;
- int account_id = 0;
int address_book_id = 0;
int group_id = 0;
int contact_id = 0;
contacts_record_h record = NULL;
contacts_list_h list = NULL;
+ if (account_id <= 0)
+ return -1;
do {
- if (0 != (ret = ctsvc_tc_util_account_insert(&account_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_address_book(account_id, &address_book_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_group(address_book_id, &group_id))) break;
if (0 != (ret = ctsvc_tc_db_insert_record_contact(address_book_id, group_id, &contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_contact._uri, contact_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_group._uri, group_id))) break;
if (CONTACTS_ERROR_NONE != (ret = contacts_db_delete_record(_contacts_address_book._uri, address_book_id))) break;
- if (0 != (ret = ctsvc_tc_util_account_delete(account_id))) break;
return 0;
} while (0);
contacts_db_delete_record(_contacts_contact._uri, contact_id);
contacts_db_delete_record(_contacts_group._uri, group_id);
contacts_db_delete_record(_contacts_address_book._uri, address_book_id);
- ctsvc_tc_util_account_delete(account_id);
return ret;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_get_record) {
- ret = tc_db_plugin->db_get_record();
+ ret = tc_db_plugin->db_get_record(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_get_all_records) {
- ret = tc_db_plugin->db_get_all_records();
+ ret = tc_db_plugin->db_get_all_records(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_get_records_with_query) {
- ret = tc_db_plugin->db_get_records_with_query();
+ ret = tc_db_plugin->db_get_records_with_query(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
+
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_get_changes_by_version) {
- ret = tc_db_plugin->db_get_changes_by_version();
+ ret = tc_db_plugin->db_get_changes_by_version(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_get_count) {
- ret = tc_db_plugin->db_get_count();
+ ret = tc_db_plugin->db_get_count(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_get_count_with_query) {
- ret = tc_db_plugin->db_get_count_with_query();
+ ret = tc_db_plugin->db_get_count_with_query(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_insert_record) {
- ret = tc_db_plugin->db_insert_record();
+ ret = tc_db_plugin->db_insert_record(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_insert_records) {
- ret = tc_db_plugin->db_insert_records();
+ ret = tc_db_plugin->db_insert_records(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_update_record) {
- ret = tc_db_plugin->db_update_record();
+ ret = tc_db_plugin->db_update_record(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_update_records) {
- ret = tc_db_plugin->db_update_records();
+ ret = tc_db_plugin->db_update_records(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int utc_contacts_service2_db_replace_record_p(void)
{
assert_eq(_startup_err, 0);
-
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
+
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_replace_record) {
- ret = tc_db_plugin->db_replace_record();
+ ret = tc_db_plugin->db_replace_record(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
+
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_replace_records) {
- ret = tc_db_plugin->db_replace_records();
+ ret = tc_db_plugin->db_replace_records(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_delete_record) {
- ret = tc_db_plugin->db_delete_record();
+ ret = tc_db_plugin->db_delete_record(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_delete_records) {
- ret = tc_db_plugin->db_delete_records();
+ ret = tc_db_plugin->db_delete_records(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_search_records) {
- ret = tc_db_plugin->db_search_records();
+ ret = tc_db_plugin->db_search_records(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_search_records_with_query) {
- ret = tc_db_plugin->db_search_records_with_query();
+ ret = tc_db_plugin->db_search_records_with_query(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_search_records_with_range) {
- ret = tc_db_plugin->db_search_records_with_range();
+ ret = tc_db_plugin->db_search_records_with_range(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_search_records_for_snippet) {
- ret = tc_db_plugin->db_search_records_for_snippet();
+ ret = tc_db_plugin->db_search_records_for_snippet(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_search_records_with_query_for_snippet) {
- ret = tc_db_plugin->db_search_records_with_query_for_snippet();
+ ret = tc_db_plugin->db_search_records_with_query_for_snippet(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
int i;
int ret;
+ int account_id =0;
+
+ ret = ctsvc_tc_util_account_insert(&account_id);
+ assert_eq(0, ret);
for (i=0;i<VIEW_MAX;i++) {
ctsvc_tc_db_plugin_s *tc_db_plugin = _ctsvc_tc_get_db_plugin(i);
if (tc_db_plugin && tc_db_plugin->db_search_records_with_range_for_snippet) {
- ret = tc_db_plugin->db_search_records_with_range_for_snippet();
+ ret = tc_db_plugin->db_search_records_with_range_for_snippet(account_id);
+ if (0 != ret)
+ ctsvc_tc_util_account_delete(account_id);
assert_eq(0, ret);
}
}
+ ret = ctsvc_tc_util_account_delete(account_id);
+ assert_eq(0, ret);
return 0;
}
do {
if (0 != (ret = _tc_db_sdn.db_add_changed_cb())) break;
if (0 != (ret = _tc_db_sdn.db_remove_changed_cb())) break;
- if (0 != (ret = _tc_db_sdn.db_get_record())) break;
- if (0 != (ret = _tc_db_sdn.db_get_records_with_query())) break;
- if (0 != (ret = _tc_db_sdn.db_get_all_records())) break;
- if (0 != (ret = _tc_db_sdn.db_get_count())) break;
- if (0 != (ret = _tc_db_sdn.db_get_count_with_query())) break;
+ if (0 != (ret = _tc_db_sdn.db_get_record(0))) break;
+ if (0 != (ret = _tc_db_sdn.db_get_records_with_query(0))) break;
+ if (0 != (ret = _tc_db_sdn.db_get_all_records(0))) break;
+ if (0 != (ret = _tc_db_sdn.db_get_count(0))) break;
+ if (0 != (ret = _tc_db_sdn.db_get_count_with_query(0))) break;
return 0;
} while (0);
assert_eq(0, ret);
void ctsvc_tc_util_setting_name_display_order_chagned_cb(contacts_name_display_order_e name_display_order, void* user_data) {}
void ctsvc_tc_util_setting_name_sorting_order_chagned_cb(contacts_name_sorting_order_e name_display_order, void* user_data) {}
-
-
int ctsvc_tc_util_account_insert(int *account_id)
{
if (NULL == account_id)
if (0 != (ret = account_set_package_name(account, CTSVC_TC_UTIL_ACCOUNT_PACKAGE_NAME))) break;
if (0 != (ret = account_insert_to_db(account, account_id))) break;
if (0 != (ret = account_destroy(account))) break;
+ account = NULL;
} while (0);
+
+ account_destroy(account);
return ret;
}
do {
if (0 != (ret = account_delete_from_db_by_id(account_id))) break;
} while (0);
+
return ret;
}
#define STRING_EQUAL 0
typedef int (*tc)(void);
+typedef int (*tc_with_account_id)(int account_id);
typedef struct {
tc add_bool;
typedef struct {
tc db_add_changed_cb;
tc db_remove_changed_cb;
- tc db_get_record;
- tc db_get_records_with_query;
- tc db_get_all_records;
- tc db_get_changes_by_version;
- tc db_get_count;
- tc db_get_count_with_query;
- tc db_insert_record;
- tc db_insert_records;
- tc db_update_record;
- tc db_update_records;
- tc db_delete_record;
- tc db_delete_records;
- tc db_replace_record;
- tc db_replace_records;
- tc db_search_records;
- tc db_search_records_with_query;
- tc db_search_records_with_range;
- tc db_search_records_for_snippet;
- tc db_search_records_with_query_for_snippet;
- tc db_search_records_with_range_for_snippet;
+ tc_with_account_id db_get_record;
+ tc_with_account_id db_get_records_with_query;
+ tc_with_account_id db_get_all_records;
+ tc_with_account_id db_get_changes_by_version;
+ tc_with_account_id db_get_count;
+ tc_with_account_id db_get_count_with_query;
+ tc_with_account_id db_insert_record;
+ tc_with_account_id db_insert_records;
+ tc_with_account_id db_update_record;
+ tc_with_account_id db_update_records;
+ tc_with_account_id db_delete_record;
+ tc_with_account_id db_delete_records;
+ tc_with_account_id db_replace_record;
+ tc_with_account_id db_replace_records;
+ tc_with_account_id db_search_records;
+ tc_with_account_id db_search_records_with_query;
+ tc_with_account_id db_search_records_with_range;
+ tc_with_account_id db_search_records_for_snippet;
+ tc_with_account_id db_search_records_with_query_for_snippet;
+ tc_with_account_id db_search_records_with_range_for_snippet;
} ctsvc_tc_db_plugin_s;
typedef enum {