system-info: add function to return types of the keys
[platform/core/api/system-info.git] / include / system_info_private.h
1 /*
2  * Copyright (c) 2011 - 2015 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 __TIZEN_SYSTEM_SYSTEM_INFO_PRIVATE_H__
19 #define __TIZEN_SYSTEM_SYSTEM_INFO_PRIVATE_H__
20
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25
26 #include <stdbool.h>
27 #include <dlog.h>
28
29 #ifndef API
30 #define API __attribute__ ((visibility("default")))
31 #endif
32
33 #undef LOG_TAG
34 #define LOG_TAG "CAPI_SYSTEM_INFO"
35 #define _D(fmt, args...)   SLOGD(fmt, ##args)
36 #define _E(fmt, args...)   SLOGE(fmt, ##args)
37 #define _I(fmt, args...)   SLOGI(fmt, ##args)
38
39 #define PLATFORM_TAG    "platform"
40 #define CUSTOM_TAG              "custom"
41
42 #define BOOL_TYPE       "bool"
43 #define INT_TYPE        "int"
44 #define DBL_TYPE        "double"
45 #define STR_TYPE        "string"
46
47 typedef enum {
48         SYSTEM_INFO_DATA_TYPE_STRING,
49         SYSTEM_INFO_DATA_TYPE_INT,
50         SYSTEM_INFO_DATA_TYPE_DOUBLE,
51         SYSTEM_INFO_DATA_TYPE_BOOL
52 } system_info_data_type_e;
53
54 int system_info_ini_get_string(char *ini_file, char *key, char **output);
55 int system_info_get_value_from_config_xml(char *feature_tag, const char *name_field, char *type_field, char **value);
56 int system_info_get_type_from_config_xml(const char *feature_tag,
57                 const char *name_field, char *type_field, size_t len);
58
59 int system_info_get_file(const char *key, void **value);
60 int system_info_get_type_file(const char *key);
61
62 int external_get_value(const char *tag, const char *key, const char *type, char **value);
63
64 #ifdef __cplusplus
65 }
66 #endif
67
68 #endif /* __TIZEN_SYSTEM_SYSTEM_INFO_PRIVATE_H__ */