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
21 #include <pims-ipc-data.h>
\r
23 #include "contacts.h"
\r
24 #include "ctsvc_internal.h"
\r
25 #include "ctsvc_ipc_define.h"
\r
26 #include "ctsvc_ipc_marshal.h"
\r
27 #include "ctsvc_client_ipc.h"
\r
29 API int contacts_utils_get_index_characters(char **index_string)
\r
31 int ret = CONTACTS_ERROR_NONE;
\r
32 pims_ipc_data_h outdata = NULL;
\r
34 RETVM_IF(index_string == NULL, CONTACTS_ERROR_INVALID_PARAMETER, "The out param is NULL");
\r
35 *index_string = NULL;
\r
36 RETVM_IF(ctsvc_get_ipc_handle() == NULL,CONTACTS_ERROR_IPC, "contacts not connected");
\r
38 if (ctsvc_ipc_call(CTSVC_IPC_UTILS_MODULE, CTSVC_IPC_SERVER_UTILS_GET_INDEX_CHARACTERS, NULL, &outdata) != 0) {
\r
39 CTS_ERR("ctsvc_ipc_call Fail");
\r
40 return CONTACTS_ERROR_IPC;
\r
44 unsigned int size = 0;
\r
45 ret = *(int*) pims_ipc_data_get(outdata, &size);
\r
46 if (CONTACTS_ERROR_NONE == ret) {
\r
47 ret = ctsvc_ipc_unmarshal_string(outdata, index_string);
\r
48 if (CONTACTS_ERROR_NONE != ret) {
\r
49 CTS_ERR("ctsvc_ipc_unmarshal_string Fail9(%d)", ret);
\r
52 pims_ipc_data_destroy(outdata);
\r