4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 #ifndef __IPC_LIBRARY_H
24 #define __IPC_LIBRARY_H
26 #include "email-types.h"
32 #define EM_PROXY_IF_NULL_RETURN_VALUE(expr1, expr2, val) { \
33 if (!expr1&& expr2) { \
34 EM_DEBUG_LOG ("EM_PROXY_IF_NULL_RETURN_VALUE : PARAM IS NULL \n"); \
35 emipc_destroy_email_api(expr2); \
40 /* ------------------------------------------------------------------------------------------------------------ */
42 /* ------------------------------------------------------------------------------------------------------------ */
46 } EPARAMETER_DIRECTION;
48 typedef void* HIPC_API;
49 typedef void* HIPC_PARAMETER;
50 typedef void (*PFN_PROXY_CALLBACK) (HIPC_API input_api_handle, void* pParam1, void* pParam2);
51 typedef void (*PFN_EXECUTE_API) (HIPC_API input_api_handle);
53 /* ------------------------------------------------------------------------------------------------------------ */
55 /* ------------------------------------------------------------------------------------------------------------ */
56 EXPORT_API int emipc_initialize_proxy();
58 EXPORT_API int emipc_finalize_proxy();
60 EXPORT_API int emipc_execute_proxy_api(HIPC_API input_api_handle);
62 /* ------------------------------------------------------------------------------------------------------------ */
64 /* ------------------------------------------------------------------------------------------------------------ */
65 EXPORT_API bool emipc_initialize_stub(PFN_EXECUTE_API input_api_mapper);
67 EXPORT_API bool emipc_finalize_stub();
69 EXPORT_API bool emipc_execute_stub_api(HIPC_API input_api_handle);
71 /* ------------------------------------------------------------------------------------------------------------ */
73 /* ------------------------------------------------------------------------------------------------------------ */
74 EXPORT_API HIPC_API emipc_create_email_api(long api_id);
75 EXPORT_API void emipc_destroy_email_api(HIPC_API input_api_handle);
77 EXPORT_API long emipc_get_api_id(HIPC_API input_api_handle);
78 EXPORT_API long emipc_get_app_id(HIPC_API input_api_handle);
80 EXPORT_API bool emipc_add_parameter(HIPC_API api, EPARAMETER_DIRECTION direction, void *data, int data_length);
81 EXPORT_API bool emipc_add_dynamic_parameter(HIPC_API api, EPARAMETER_DIRECTION direction, void *data, int data_length);
82 EXPORT_API int emipc_get_parameter(HIPC_API input_api_handle, EPARAMETER_DIRECTION input_parameter_direction, int input_parameter_index, int input_parameter_buffer_size, void *output_parameter);
83 EXPORT_API void* emipc_get_nth_parameter_data(HIPC_API api_handle, EPARAMETER_DIRECTION direction, int param_index);
84 EXPORT_API int emipc_get_parameter_length(HIPC_API input_api_handle, EPARAMETER_DIRECTION input_parameter_direction, int input_parameter_index);
85 EXPORT_API int emipc_get_nth_parameter_length(HIPC_API input_api_handle, EPARAMETER_DIRECTION input_parameter_direction, int input_parameter_index);