Initialize Tizen 2.3
[framework/api/system-info.git] / include / system_info_private.h
1 /*
2  * Copyright (c) 2011 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 #ifndef API
27 #define API __attribute__ ((visibility("default")))
28 #endif
29
30 #define INFO_FILE_PATH "/etc/info.ini"
31 #define OS_RELEASE_FILE_PATH "/etc/os-release"
32 #define CPU_INFO_FILE_PATH "/proc/cpuinfo"
33 #define CPU_INFO_MAX_FREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
34 #define CONFIG_FILE_PATH "/etc/config/model-config.xml"
35 #define MAXBUFSIZE 512
36
37 #define PLATFORM_TAG    "platform"
38 #define CUSTOM_TAG              "custom"
39 #define INTERNAL_TAG    "internal"
40
41 #define BOOL_TYPE       "bool"
42 #define INT_TYPE        "int"
43 #define DBL_TYPE        "double"
44 #define STR_TYPE        "string"
45
46 #define BOARD_CONFIG    "board"
47
48 typedef enum {
49         SYSTEM_INFO_DATA_TYPE_STRING,
50         SYSTEM_INFO_DATA_TYPE_INT,
51         SYSTEM_INFO_DATA_TYPE_DOUBLE,
52         SYSTEM_INFO_DATA_TYPE_BOOL
53 } system_info_data_type_e;
54
55 /**
56  * @brief Enumeration of Mode type
57  */
58 typedef enum {
59         SYSTEM_INFO_MODEL_TYPE_EMULATOR,
60         SYSTEM_INFO_MODEL_TYPE_TARGET
61 } system_info_mode_type_e;
62
63 typedef int (*system_info_get_value_cb) (system_info_key_e key, system_info_data_type_e data_type, void **value);
64
65 system_info_mode_type_e system_info_get_system_info_model_type(void);
66
67 int system_info_ini_get_string(char *ini_file, char *key, char **output);
68 int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value);
69 int system_info_get_value_from_config_xml(char *feature_tag, const char *name_field, char *type_field, char **value);
70
71 int system_info_get_bsp_info(const char *key, char **value);
72
73 int system_info_vconf_get_value_int(const char *vconf_key, int *value);
74 int system_info_vconf_get_value_bool(const char *vconf_key, bool *value);
75 int system_info_vconf_get_value_double(const char *vconf_key, double *value);
76 int system_info_vconf_get_value_string(const char *vconf_key, char **value);
77
78 int system_info_get_model(system_info_key_e key, system_info_data_type_e data_type, void **value);
79 int system_info_get_tizen_version(system_info_key_e key, system_info_data_type_e data_type, void **value);
80 int system_info_get_platform_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
81 int system_info_get_tizen_version_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
82 int system_info_get_core_cpu_arch(system_info_key_e key, system_info_data_type_e data_type, void **value);
83 int system_info_get_core_cpu_freq(system_info_key_e key, system_info_data_type_e data_type, void **value);
84 int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
85 int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value);
86 int system_info_get_physical_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
87 int system_info_get_physical_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value);
88 int system_info_get_manufacturer(system_info_key_e key, system_info_data_type_e data_type, void **value);
89 int system_info_get_build_string(system_info_key_e key, system_info_data_type_e data_type, void **value);
90 int system_info_get_build_date(system_info_key_e key, system_info_data_type_e data_type, void **value);
91 int system_info_get_build_time(system_info_key_e key, system_info_data_type_e data_type, void **value);
92 int system_info_get_tethering_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif /* __TIZEN_SYSTEM_SYSTEM_INFO_PRIVATE_H__ */