common: remove legacy operations 00/52000/2
authortaeyoung <ty317.kim@samsung.com>
Wed, 18 Nov 2015 06:05:18 +0000 (15:05 +0900)
committertaeyoung <ty317.kim@samsung.com>
Wed, 18 Nov 2015 06:13:33 +0000 (15:13 +0900)
- The apis using enum values are legacy apis and will be removed

Change-Id: I45f3709e1b200fcb1cc7069a1d81c54428b1b1f4
Signed-off-by: taeyoung <ty317.kim@samsung.com>
doc/system_info_doc.h
include/system_info.h
include/system_info_private.h
include/system_info_type.h
src/system_info.c
src/system_info_device.c [deleted file]
src/system_info_hardware.c [deleted file]
src/system_info_parse.c
src/system_info_platform.c [deleted file]
src/system_info_screen.c [deleted file]

index 0822dd7..8ca7345 100644 (file)
@@ -29,7 +29,7 @@
  * @section CAPI_SYSTEM_SYSTEM_INFO_MODULE_OVERVIEW Overview
  * The System Information API provides functions which can be used to obtain system information such as the device API and platform versions, device model number, supported device features, and device screen dimensions.
  * The available system information is stored in key/value pairs. Depending on their respective key, values can have different data types.
- * The keys for the platform functions are specified by the Tizen platform and can be seen <a href="../org.tizen.mobile.native.appprogramming/html/guide/system/sysinfo.htm">here.</a>
+ * The keys for the platform functions are specified by the Tizen platform and can be seen <a href="https://developer.tizen.org/development/guides/native-application/system/system-information">here.</a>
  * The keys for the custom functions are specified by OEM's and vendors. Developers should check with their OEM's Tizen OS support if they wish to use a custom functions.
  *
  */
index 5550029..2a5b657 100644 (file)
@@ -149,25 +149,25 @@ int system_info_get_custom_string(const char *key, char **value);
 
 /**
  * @internal
- * @brief Gets the integer value of the system information
+ * @brief Do not use it. It will be removed
  */
 int system_info_get_value_int(system_info_key_e key, int *value);
 
 /**
  * @internal
- * @brief Gets the boolean value of the system information
+ * @brief Do not use it. It will be removed
  */
 int system_info_get_value_bool(system_info_key_e key, bool *value);
 
 /**
  * @internal
- * @brief Gets the double value of the system information
+ * @brief Do not use it. It will be removed
  */
 int system_info_get_value_double(system_info_key_e key, double *value);
 
 /**
  * @internal
- * @brief Gets the string value of the system information
+ * @brief Do not use it. It will be removed
  */
 int system_info_get_value_string(system_info_key_e key, char **value);
 
index f007e99..60cd51e 100644 (file)
@@ -39,8 +39,6 @@ extern "C"
 #define DBL_TYPE       "double"
 #define STR_TYPE       "string"
 
-#define BOARD_CONFIG   "board"
-
 typedef enum {
        SYSTEM_INFO_DATA_TYPE_STRING,
        SYSTEM_INFO_DATA_TYPE_INT,
@@ -48,37 +46,9 @@ typedef enum {
        SYSTEM_INFO_DATA_TYPE_BOOL
 } system_info_data_type_e;
 
-/**
- * @brief Enumeration of Mode type
- */
-typedef enum {
-       SYSTEM_INFO_MODEL_TYPE_EMULATOR,
-       SYSTEM_INFO_MODEL_TYPE_TARGET
-} system_info_mode_type_e;
-
-typedef int (*system_info_get_value_cb) (system_info_key_e key, system_info_data_type_e data_type, void **value);
-
-system_info_mode_type_e system_info_get_system_info_model_type(void);
-
 int system_info_ini_get_string(char *ini_file, char *key, char **output);
-int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value);
 int system_info_get_value_from_config_xml(char *feature_tag, const char *name_field, char *type_field, char **value);
 
-int system_info_get_model(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_tizen_version(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_platform_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_tizen_version_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_core_cpu_arch(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_core_cpu_freq(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_physical_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_physical_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_manufacturer(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_build_string(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_build_date(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_build_time(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_tethering_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 
 int system_info_get_file(const char *key, void **value);
 
index d9d1636..c789e41 100644 (file)
@@ -39,6 +39,7 @@ typedef enum {
        SYSTEM_INFO_ERROR_OUT_OF_MEMORY     = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
        SYSTEM_INFO_ERROR_IO_ERROR          = TIZEN_ERROR_IO_ERROR,      /**< An input/output error occurred when reading value from system */
        SYSTEM_INFO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< No permission to use the API */
+       SYSTEM_INFO_ERROR_NOT_SUPPORTED     = TIZEN_ERROR_NOT_SUPPORTED,     /**< Not supported parameter (Since 3.0) */
 } system_info_error_e;
 
 /**
index 7d5c895..1441e89 100644 (file)
 
 #define SYSTEM_INFO_MAX -1
 
-typedef struct {
-       system_info_key_e key;
-       system_info_data_type_e data_type;
-       system_info_get_value_cb get_value_cb;
-} system_info_s;
-
-typedef system_info_s * system_info_h;
-
-system_info_s system_info_table[] = {
-
-{
-        /**< The model of the device */
-       SYSTEM_INFO_KEY_MODEL,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_model
-},
-
-{
-        /**< The version of the Tizen supported by the platform */
-       SYSTEM_INFO_KEY_TIZEN_VERSION,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_tizen_version
-},
-
-{
-       /**< The height of the screen in pixels */
-       SYSTEM_INFO_KEY_SCREEN_HEIGHT,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_screen_height
-},
-
-{
-       /**< The width of the screen in pixels */
-       SYSTEM_INFO_KEY_SCREEN_WIDTH,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_screen_width
-},
-
-{
-       /**< The Name of the Platform */
-       SYSTEM_INFO_KEY_PLATFORM_NAME,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_platform_name
-},
-
-{
-       /**< The Name of the Tizen version */
-       SYSTEM_INFO_KEY_TIZEN_VERSION_NAME,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_tizen_version_name
-},
-
-{
-       /**< The CORE CPU architecture of model */
-       SYSTEM_INFO_KEY_CORE_CPU_ARCH,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_core_cpu_arch
-},
-
-{
-       /**< The CORE CPU frequency of model */
-       SYSTEM_INFO_KEY_CORE_CPU_FREQ,
-       SYSTEM_INFO_DATA_TYPE_DOUBLE,
-       system_info_get_core_cpu_freq
-},
-
-{
-       /**< The height of the physical screen size in millimeters */
-       SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_physical_screen_height
-},
-
-{
-       /**< The width of the physical screen size in millimeters */
-       SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_physical_screen_width
-},
-
-{
-       /**< The build string of the platform binary */
-       SYSTEM_INFO_KEY_BUILD_STRING,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_build_string
-},
-
-{
-       /**< The build date of the platform binary */
-       SYSTEM_INFO_KEY_BUILD_DATE,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_build_date
-},
-
-{
-       /**< The build time of the platform binary */
-       SYSTEM_INFO_KEY_BUILD_TIME,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_build_time
-},
-
-{
-       /**< The manufacturer of the device */
-       SYSTEM_INFO_KEY_MANUFACTURER,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_manufacturer
-},
-
-{
-       /**< Indicates whether the device supports tethering */
-       SYSTEM_INFO_KEY_TETHERING_SUPPORTED,
-       SYSTEM_INFO_DATA_TYPE_BOOL,
-       system_info_get_tethering_supported
-},
-
-{
-       SYSTEM_INFO_MAX, -1, NULL
-}
-
-};
-
-static system_info_mode_type_e system_info_system_info_model_type;
-
-system_info_mode_type_e system_info_get_system_info_model_type(void)
-{
-       return system_info_system_info_model_type;
-}
-
-void __attribute__((constructor)) system_info_init(void)
-{
-       int ret, len, i;
-       char *str = NULL;
-
-       ret = system_info_get_platform_string("tizen.org/system/model_name", &str);
-
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("initialize error");
-               return;
-       }
-
-       if (!str) {
-               LOGE("Failed to get model name");
-               return;
-       }
-
-       len = strlen(str);
-       for (i = 0 ; i < len ; i++) {
-               str[i] = toupper(str[i]);
-       }
-
-       if (!strcmp(str, "EMULATOR"))
-               system_info_system_info_model_type = SYSTEM_INFO_MODEL_TYPE_EMULATOR;
-       else
-               system_info_system_info_model_type = SYSTEM_INFO_MODEL_TYPE_TARGET;
-
-       free(str);
-}
-
-static int system_info_get(system_info_key_e key, system_info_h *system_info)
-{
-       int index = 0;
-
-       while (system_info_table[index].key != SYSTEM_INFO_MAX) {
-               if (system_info_table[index].key == key) {
-                       *system_info = &system_info_table[index];
-                       return 0;
-               }
-
-               index++;
-       }
-
-       return -1;
-}
-
-int system_info_get_value(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       system_info_h system_info;
-       system_info_get_value_cb system_info_getter;
-
-       if (value == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x) : invalid output param", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
-               return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
-       }
-
-       if (system_info_get(key, &system_info)) {
-               LOGE("INVALID_PARAMETER(0x%08x) : invalid key", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
-               return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
-       }
-
-       if (system_info->data_type != data_type) {
-               LOGE("INVALID_PARAMETER(0x%08x) : invalid data type", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
-               return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
-       }
-
-       system_info_getter = system_info->get_value_cb;
-
-       if (system_info_getter == NULL) {
-               LOGE("IO_ERROR(0x%08x) : failed to call getter for the system information", SYSTEM_INFO_ERROR_IO_ERROR);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       return system_info_getter(key, system_info->data_type, value);
-}
-
 API int system_info_get_value_int(system_info_key_e key, int *value)
 {
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_INT, (void **)value);
+       return SYSTEM_INFO_ERROR_NOT_SUPPORTED;
 }
 
 API int system_info_get_value_bool(system_info_key_e key, bool *value)
 {
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_BOOL, (void **)value);
+       return SYSTEM_INFO_ERROR_NOT_SUPPORTED;
 }
 
 API int system_info_get_value_double(system_info_key_e key, double *value)
 {
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_DOUBLE, (void **)value);
+       return SYSTEM_INFO_ERROR_NOT_SUPPORTED;
 }
 
 API int system_info_get_value_string(system_info_key_e key, char **value)
 {
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_STRING, (void **)value);
+       return SYSTEM_INFO_ERROR_NOT_SUPPORTED;
 }
 
 API int system_info_get_platform_bool(const char *key, bool *value)
diff --git a/src/system_info_device.c b/src/system_info_device.c
deleted file mode 100644 (file)
index 26f3108..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-#define TETHERING_INFO_FILE_PATH "/etc/config/connectivity/sysinfo-tethering.xml"
-
-int system_info_get_manufacturer(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       int ret;
-       char *manufacturer;
-
-       ret = system_info_get_platform_string(
-                       "tizen.org/system/manufacturer",
-                       &manufacturer);
-       if (ret == SYSTEM_INFO_ERROR_NONE)
-               *value = manufacturer;
-
-       return ret;
-}
-
-int system_info_get_tethering_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       bool *supported;
-       bool tethering;
-       int ret;
-
-       supported = (bool *)value;
-
-       ret = system_info_get_platform_bool(
-                       "tizen.org/feature/network.tethering",
-                       &tethering);
-       if (ret == SYSTEM_INFO_ERROR_NONE)
-               *supported = tethering;
-
-       return ret;
-}
diff --git a/src/system_info_hardware.c b/src/system_info_hardware.c
deleted file mode 100644 (file)
index fc77c39..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <unistd.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-int system_info_get_value_from_cpuinfo(char *field, char **value)
-{
-       int tmpStrlen = 0;
-       FILE *cpuinfo = NULL;
-       char *name = NULL;
-       char str[MAXBUFSIZE] = { 0, };
-       char tmpStr[MAXBUFSIZE] = { 0, };
-
-       if (system_info_get_system_info_model_type() == SYSTEM_INFO_MODEL_TYPE_EMULATOR) {
-               snprintf(tmpStr, sizeof(tmpStr), "default");
-               goto out;
-       }
-
-       cpuinfo = fopen(CPU_INFO_FILE_PATH, "r");
-       if (NULL == cpuinfo) {
-               LOGE("cannot file open %s file!!!", CPU_INFO_FILE_PATH);
-               if (errno == EPERM || errno == EACCES)
-                       return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       while (fgets(str, sizeof(str), cpuinfo)) {
-               if (strncmp(field, str, strlen(field)))
-                       continue;
-
-               name = strchr(str, ':');
-               tmpStrlen = strlen(name+2);
-               strncpy(tmpStr, name+2, tmpStrlen);
-               tmpStr[tmpStrlen-1] = '\0';
-               break;
-       }
-
-       fclose(cpuinfo);
-
-out:
-       if (strlen(tmpStr) == 0) {
-               LOGE("Failed to get (%s) info", field);
-               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-       }
-
-       *value = strdup(tmpStr);
-       if (*value == NULL) {
-               LOGE("malloc() failed to get (%s) info", field);
-               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-       }
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
index 213cfaf..a65ecf0 100644 (file)
@@ -73,121 +73,6 @@ int system_info_ini_get_string(char *ini_file, char *key, char **output)
        return SYSTEM_INFO_ERROR_NONE;
 }
 
-int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value)
-{
-       xmlDocPtr doc = NULL;
-       xmlNodePtr cur = NULL;
-       xmlNodePtr default_node = NULL;
-       xmlNodePtr model_node = NULL;
-       xmlNode *cur_node = NULL;
-       char *id = NULL;
-       char *string = NULL;
-
-       doc = xmlParseFile(xml_file_path);
-
-       if (doc == NULL) {
-               LOGE("cannot file open %s file!!!", xml_file_path);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       cur = xmlDocGetRootElement(doc);
-       if (cur == NULL) {
-               LOGE("empty document %s file!!!", xml_file_path);
-               xmlFreeDoc(doc);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-               if (!xmlStrcmp(cur->name, (const xmlChar*)"sys-info"))
-                       break;
-       }
-
-       if (cur == NULL) {
-               LOGE("cannot find %s root element file!!!", "sys-info");
-               xmlFreeDoc(doc);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       cur = cur->xmlChildrenNode;
-
-       for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-               if (!xmlStrcmp(cur_node->name, (const xmlChar*)"default"))
-                       default_node = cur_node;
-               if (strcmp(model, "default") && !xmlStrcmp(cur_node->name, (const xmlChar*)model))
-                       model_node = cur_node;
-       }
-
-       if (model_node) {
-               cur = model_node->xmlChildrenNode;
-
-               for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-                       if (cur_node->type == XML_ELEMENT_NODE) {
-                               id = (char *)xmlGetProp(cur_node, (const xmlChar*)"id");
-                               string = (char *) xmlGetProp(cur_node, (const xmlChar*)"string");
-
-                               if (!strncmp(id, id_field, strlen(id))) {
-                                       if (!strncmp(id, id_field, strlen(id_field))) {
-                                               if (!string) {
-                                                       free(id);
-                                                       continue;
-                                               }
-
-                                               *value = strdup(string);
-                                               free(id);
-                                               free(string);
-                                               xmlFreeDoc(doc);
-                                               if (*value == NULL) {
-                                                               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
-                                                               xmlFreeDoc(doc);
-                                                               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-                                               }
-                                               return SYSTEM_INFO_ERROR_NONE;
-                                       }
-                               }
-                               free(id);
-                               free(string);
-                       }
-               }
-       }
-
-       if (*value == NULL && default_node) {
-               cur = default_node->xmlChildrenNode;
-
-               for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-                       if (cur_node->type == XML_ELEMENT_NODE) {
-                               id = (char *)xmlGetProp(cur_node, (const xmlChar*)"id");
-                               string = (char *) xmlGetProp(cur_node, (const xmlChar*)"string");
-
-                               if (!strncmp(id, id_field, strlen(id))) {
-                                       if (!strncmp(id, id_field, strlen(id_field))) {
-                                               if (!string) {
-                                                       free(id);
-                                                       continue;
-                                               }
-
-                                               *value = strdup(string);
-                                               free(id);
-                                               free(string);
-                                               xmlFreeDoc(doc);
-                                               if (*value == NULL) {
-                                                               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
-                                                               xmlFreeDoc(doc);
-                                                               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-                                               }
-                                               return SYSTEM_INFO_ERROR_NONE;
-                                       }
-                               }
-                               free(id);
-                               free(string);
-                       }
-               }
-       }
-
-       LOGE("cannot find %s field from %s file!!!", id_field, xml_file_path);
-       xmlFreeDoc(doc);
-       return SYSTEM_INFO_ERROR_IO_ERROR;
-}
-
 int system_info_get_value_from_config_xml(char *feature_tag, const char *name_field, char *type_field, char **value)
 {
        xmlDocPtr doc = NULL;
diff --git a/src/system_info_platform.c b/src/system_info_platform.c
deleted file mode 100644 (file)
index d89e3ab..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-int system_info_get_model(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/system/model_name", (char **)value);
-}
-
-int system_info_get_build_string(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/system/build.string", (char **)value);
-}
-
-int system_info_get_build_date(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/system/build.date", (char **)value);
-}
-
-int system_info_get_build_time(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/system/build.time", (char **)value);
-}
-
-int system_info_get_tizen_version(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/feature/platform.version", (char**)value);
-}
-
-int system_info_get_core_cpu_arch(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       bool cpu_arch;
-       char *CORE_CPU_ARCH = NULL;
-
-       if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv6", &cpu_arch) == SYSTEM_INFO_ERROR_NONE
-               && cpu_arch == true)
-               CORE_CPU_ARCH = strdup("armv6");
-       else if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv7", &cpu_arch) == SYSTEM_INFO_ERROR_NONE
-               && cpu_arch == true)
-               CORE_CPU_ARCH = strdup("armv7");
-       else if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.x86", &cpu_arch) == SYSTEM_INFO_ERROR_NONE
-               && cpu_arch == true)
-               CORE_CPU_ARCH = strdup("x86");
-
-       if (CORE_CPU_ARCH == NULL) {
-               LOGE("Unknown cpu");
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       *value = CORE_CPU_ARCH;
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_core_cpu_freq(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       double *count;
-       FILE *cpuinfo, *cpuinfo_max_freq;
-       double max_freq = 0.0;
-       char *name;
-       char str[MAXBUFSIZE];
-
-       if (system_info_get_system_info_model_type() != SYSTEM_INFO_MODEL_TYPE_EMULATOR) {
-               cpuinfo_max_freq = fopen(CPU_INFO_MAX_FREQ_PATH, "r");
-               if (NULL == cpuinfo_max_freq) {
-                       LOGE("cannot file open %s file!!!", CPU_INFO_MAX_FREQ_PATH);
-                       if (errno == EPERM || errno == EACCES)
-                               return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-                       return SYSTEM_INFO_ERROR_IO_ERROR;
-               } else {
-                       if (fscanf(cpuinfo_max_freq, "%lf", &max_freq) < 1) {
-                               fclose(cpuinfo_max_freq);
-                               return SYSTEM_INFO_ERROR_IO_ERROR;
-                       }
-                       max_freq = max_freq / 1024;
-               }
-               fclose(cpuinfo_max_freq);
-       } else {
-               /* Emulator */
-               cpuinfo = fopen(CPU_INFO_FILE_PATH, "r");
-               if (NULL == cpuinfo) {
-                       LOGE("cannot file open %s file!!!", CPU_INFO_FILE_PATH);
-                       if (errno == EPERM || errno == EACCES)
-                               return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-                       return SYSTEM_INFO_ERROR_IO_ERROR;
-               } else {
-                       while (fgets(str, MAXBUFSIZE, cpuinfo)) {
-                               if (!strncmp("cpu MHz", str, strlen("cpu MHz"))) {
-                                       name = strchr(str, ':');
-                                       max_freq = atof(name+2);
-                                       break;
-                               }
-                       }
-               }
-               fclose(cpuinfo);
-       }
-
-       count = (double *)value;
-
-       *count = max_freq;
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_platform_name(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/system/platform.name", (char**)value);
-}
-
-int system_info_get_tizen_version_name(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       char *TIZEN_VERSION_NAME = NULL;
-       char *name = NULL;
-       char str[MAXBUFSIZE];
-       char tmpStr[MAXBUFSIZE];
-       int tmpStrlen = 0;
-       FILE *info;
-       extern char *strcasestr(const char *s, const char *find);
-
-       info = fopen(OS_RELEASE_FILE_PATH, "r");
-       if (NULL == info) {
-               LOGE("cannot file open %s file!!!", OS_RELEASE_FILE_PATH);
-               if (errno == EPERM || errno == EACCES)
-                       return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       while (fgets(str, MAXBUFSIZE, info)) {
-               if (strcasestr(str, "VERSION")) {
-                       name = strchr(str, ',');
-                       name += 2;
-                       tmpStrlen = strlen(name);
-
-                       strncpy(tmpStr, name, tmpStrlen-2);
-                       tmpStr[tmpStrlen-2] = '\0';
-
-                       TIZEN_VERSION_NAME = strdup(tmpStr);
-                       if (TIZEN_VERSION_NAME == NULL) {
-                               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
-                               fclose(info);
-                               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-                       }
-                       break;
-               }
-       }
-
-       *value = TIZEN_VERSION_NAME;
-       fclose(info);
-       return SYSTEM_INFO_ERROR_NONE;
-}
diff --git a/src/system_info_screen.c b/src/system_info_screen.c
deleted file mode 100644 (file)
index c17cf9f..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-#define MM_PER_INCH (25.4)
-
-int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_int("tizen.org/feature/screen.width", (int *)value);
-}
-
-int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_int("tizen.org/feature/screen.height", (int *)value);
-}
-
-int system_info_get_physical_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       int ret;
-       int height, dpi;
-       int *physical;
-
-       physical = (int *)value;
-
-       ret = system_info_get_platform_int("tizen.org/feature/screen.dpi", &dpi);
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get dpi information(%d)", ret);
-               return ret;
-       }
-
-       ret = system_info_get_platform_int("tizen.org/feature/screen.height", &height);
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get height information(%d)", ret);
-               return ret;
-       }
-
-       *physical = (int)((height / dpi) * MM_PER_INCH);
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_physical_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       int ret;
-       int width, dpi;
-       int *physical;
-
-       physical = (int *)value;
-
-       ret = system_info_get_platform_int("tizen.org/feature/screen.dpi", &dpi);
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get dpi information(%d)", ret);
-               return ret;
-       }
-
-       ret = system_info_get_platform_int("tizen.org/feature/screen.width", &width);
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get height information(%d)", ret);
-               return ret;
-       }
-
-       *physical = (int)((width / dpi) * MM_PER_INCH);
-
-       return SYSTEM_INFO_ERROR_NONE;
-}