Remove last trailing comma
[framework/appfw/com-core.git] / include / com-core.h
1 /*
2  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17
18 #ifndef _COM_CORE_H
19 #define _COM_CORE_H
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 enum com_core_event_type {
26         CONNECTOR_CONNECTED,
27         CONNECTOR_DISCONNECTED
28 };
29
30 extern int com_core_server_create(const char *addr, int is_sync, int (*service_cb)(int fd, void *data), void *data);
31 extern int com_core_client_create(const char *addr, int is_sync, int (*service_cb)(int fd, void *data), void *data);
32 extern int com_core_server_destroy(int handle);
33 extern int com_core_client_destroy(int handle);
34
35 /*!
36  * \brief Used to handling the changing event of connection status.
37  *        These two functions can be work with com_core_thread series functions.
38  */
39 extern int com_core_add_event_callback(enum com_core_event_type type, int (*service_cb)(int handle, void *data), void *data);
40 extern void *com_core_del_event_callback(enum com_core_event_type type, int (*service_cb)(int handle, void *data), void *data);
41
42 /*!
43  * \brief If the connection is lost, this recv function will call the disconnected callback.
44  */
45 extern int com_core_recv(int handle, char *buffer, int size, int *sender_pid, double timeout);
46 extern int com_core_send(int handle, const char *buffer, int size, double timeout);
47
48 #ifdef __cplusplus
49 }
50 #endif
51
52 #endif
53 /* End of a file */