4 * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
\r
6 * Licensed under the Apache License, Version 2.0 (the "License");
\r
7 * you may not use this file except in compliance with the License.
\r
8 * You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software
\r
13 * distributed under the License is distributed on an "AS IS" BASIS,
\r
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 * See the License for the specific language governing permissions and
\r
16 * limitations under the License.
\r
22 #include "contacts.h"
\r
23 #include "ctsvc_internal.h"
\r
24 #include "ctsvc_ipc_define.h"
\r
25 #include "ctsvc_ipc_marshal.h"
\r
26 #include "ctsvc_client_ipc.h"
\r
27 #include <pims-ipc-data.h>
\r
29 API int contacts_activity_delete_by_contact_id(int contact_id)
\r
31 int ret = CONTACTS_ERROR_NONE;
\r
32 pims_ipc_data_h indata = NULL;
\r
33 pims_ipc_data_h outdata = NULL;
\r
35 RETVM_IF(contact_id <= 0,CONTACTS_ERROR_INVALID_PARAMETER,"id should be greater than 0");
\r
38 indata = pims_ipc_data_create(0);
\r
41 CTS_ERR("ipc data created fail!");
\r
42 ret = CONTACTS_ERROR_OUT_OF_MEMORY;
\r
46 ret = ctsvc_ipc_marshal_int( contact_id, indata);
\r
47 if (ret != CONTACTS_ERROR_NONE)
\r
49 CTS_ERR("marshal fail");
\r
54 if (ctsvc_ipc_call( CTSVC_IPC_ACTIVITY_MODULE, CTSVC_IPC_SERVER_ACTIVITY_DELETE_BY_CONTACT_ID, indata, &outdata) != 0)
\r
56 CTS_ERR("ctsvc_ipc_call failed");
\r
57 pims_ipc_data_destroy(indata);
\r
58 return CONTACTS_ERROR_IPC;
\r
63 pims_ipc_data_destroy(indata);
\r
69 unsigned int size = 0;
\r
70 ret = *(int*) pims_ipc_data_get(outdata, &size);
\r
71 if (CONTACTS_ERROR_NONE == ret) {
\r
72 int transaction_ver = 0;
\r
73 transaction_ver = *(int*)pims_ipc_data_get(outdata,&size);
\r
74 ctsvc_client_ipc_set_change_version(transaction_ver);
\r
77 pims_ipc_data_destroy(outdata);
\r
83 API int contacts_activity_delete_by_account_id(int account_id)
\r
85 int ret = CONTACTS_ERROR_NONE;
\r
86 pims_ipc_data_h indata = NULL;
\r
87 pims_ipc_data_h outdata = NULL;
\r
89 RETVM_IF(account_id <= 0,CONTACTS_ERROR_INVALID_PARAMETER,"id should be greater than 0");
\r
92 indata = pims_ipc_data_create(0);
\r
95 CTS_ERR("ipc data created fail!");
\r
96 ret = CONTACTS_ERROR_OUT_OF_MEMORY;
\r
100 ret = ctsvc_ipc_marshal_int( account_id, indata);
\r
101 if (ret != CONTACTS_ERROR_NONE)
\r
103 CTS_ERR("marshal fail");
\r
108 if (ctsvc_ipc_call( CTSVC_IPC_ACTIVITY_MODULE, CTSVC_IPC_SERVER_ACTIVITY_DELETE_BY_ACCOUNT_ID, indata, &outdata) != 0)
\r
110 CTS_ERR("ctsvc_ipc_call failed");
\r
111 pims_ipc_data_destroy(indata);
\r
112 return CONTACTS_ERROR_IPC;
\r
117 pims_ipc_data_destroy(indata);
\r
123 unsigned int size = 0;
\r
124 ret = *(int*) pims_ipc_data_get(outdata, &size);
\r
125 if (CONTACTS_ERROR_NONE == ret) {
\r
126 int transaction_ver = 0;
\r
127 transaction_ver = *(int*)pims_ipc_data_get(outdata,&size);
\r
128 ctsvc_client_ipc_set_change_version(transaction_ver);
\r
131 pims_ipc_data_destroy(outdata);
\r