Fix compatibility for x64 arch.
[platform/core/system/sync-agent.git] / include / plugin / device_info_interface.h
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef DEVICE_INFO_INTERFACE_H_
19 #define DEVICE_INFO_INTERFACE_H_
20
21 #include <glib.h>
22 #include <stdarg.h>
23
24 #include "device/common.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif                          /* __cplusplus */
29
30 /**
31  * @file device_info_interface.h
32  * @brief Defines plug-in interfaces about device information
33  */
34
35 /** @addtogroup plugin_deviceinfo DeviceInfo Domain
36  * @ingroup plugin
37  *      @{
38  */
39
40 /**
41  * Device information structure
42  * @remarks This structure is member of list (devInfo)
43  * Key(info_name) - value(value) pair
44  */
45         typedef struct {
46                 char *info_name;
47                 char *value;
48         } sync_agent_plugin_device_info_s;
49
50 /**
51  * API to get device information in the system and load this information on the memory
52  *
53  * @return 1 on success, 0 on error
54  *
55  * @par Since:
56  *
57  *
58  * @see dev_init_dev(int)
59  */
60         int sync_agent_plugin_load_devinfo(void);
61
62 /**
63  * API to get device information on the memory that user want to know
64  *
65  * @param[in] info_name name of device information
66  * @param[in] value as returned by sync_agent_plugin_get_devinfo() - value of device information
67  *
68  * @return 1 on success, 0 on error
69  *
70  * @par Since:
71  *
72  *
73  * @see sync_agent_get_devinfo(int, char *, char **)
74  *
75  */
76         int sync_agent_plugin_get_devinfo(char *info_name, char **value);
77
78 /**
79  * API to clear device information on the memory (free memory)
80  *
81  * @return 1 on success, 0 on error
82  *
83  * @par Since:
84  *
85  *
86  * @see dev_destroy_dev(int)
87  *
88  */
89         int sync_agent_plugin_clear_devinfo(void);
90
91 /**
92  * API to execute device function
93  *
94  * @param[in] function_name name of device function
95  * @param[in] args_cnt number of following parameters
96  * @param[in] ap varius type of parameters
97  *
98  * @return 1 on success, 0 on error
99  *
100  * @par Since:
101  *
102  *
103  * @see sync_agent_execute_dev_function(int, char *, int, ...)
104  *
105  */
106         int sync_agent_plugin_execute_dev_function(char *function_name, int args_cnt, va_list ap);
107
108 /**
109  * API to set function pointer of common type API which fetches device info
110  *
111  * @param[in] func function pointer to set
112  *
113  * @return 1 on success, 0 on error
114  *
115  * @par Since:
116  *
117  *
118  * @see __process_plugin(xmlNode *)
119  *
120  */
121         void sync_agent_plugin_set_common_devinfo_function(sync_agent_get_devinfo_cb func);
122
123 /**
124  * API to set function pointer of common type API which executes device function
125  *
126  * @param[in] func function pointer to set
127  *
128  * @return 1 on success, 0 on error
129  *
130  * @par Since:
131  *
132  *
133  * @see __process_plugin(xmlNode *)
134  *
135  */
136         void sync_agent_plugin_set_common_execute_dev_function(sync_agent_execute_dev_cb func);
137
138 /**
139  *      @}
140  */
141
142 #ifdef __cplusplus
143 }
144 #endif                          /* __cplusplus */
145 #endif                          /* DEVICE_INFO_INTERFACE_H_ */