Code Sync [Tizen3.0]: Merged the tizen_2.4 Spin code to tizen.org
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-util.h
1 /*
2  * Bluetooth-frwk
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24
25 #ifndef _BT_SERVICE_UTIL_H_
26 #define _BT_SERVICE_UTIL_H_
27
28 #include <sys/types.h>
29 #include <dbus/dbus-glib.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34
35 #define BT_NODE_NAME_LEN 50
36
37 typedef struct {
38         int req_id;
39         int service_function;
40         char name[BT_NODE_NAME_LEN];
41         DBusGMethodInvocation *context;
42 } request_info_t;
43
44
45 void _bt_init_request_id(void);
46
47 int _bt_assign_request_id(void);
48
49 void _bt_delete_request_id(int request_id);
50
51
52 void _bt_init_request_list(void);
53
54 int _bt_insert_request_list(int req_id, int service_function,
55                         char *name, DBusGMethodInvocation *context);
56
57 int _bt_delete_request_list(int req_id);
58
59 request_info_t *_bt_get_request_info(int req_id);
60
61 void _bt_clear_request_list(void);
62
63 #ifdef __cplusplus
64 }
65 #endif /* __cplusplus */
66 #endif /*_BT_SERVICE_UTIL_H_*/
67