*/
int system_info_get_custom_string(const char *key, char **value);
-/**
- * @brief Gets the boolean value of the internal feature
- * @param[in] key The name of the custom feature to get
- * @param[out] value The value of the given internal feature
- * @return 0 on success, otherwise a negative error value.
- * @retval #SYSTEM_INFO_ERROR_NONE Successful
- * @retval #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
- * @retval #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
- */
-int system_info_get_internal_bool(const char *key, bool *value);
-
-/**
- * @brief Gets the string value of the internal feature
- * @remarks The @a value must be released with free() by you.
- * @param[in] key The name of the custom feature to get
- * @param[out] value The value of the given internal feature
- * @return 0 on success, otherwise a negative error value.
- * @retval #SYSTEM_INFO_ERROR_NONE Successful
- * @retval #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
- * @retval #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
- */
-int system_info_get_internal_int(const char *key, int *value);
-
-/**
- * @brief Gets the string value of the internal feature
- * @remarks The @a value must be released with free() by you.
- * @param[in] key The name of the custom feature to get
- * @param[out] value The value of the given internal feature
- * @return 0 on success, otherwise a negative error value.
- * @retval #SYSTEM_INFO_ERROR_NONE Successful
- * @retval #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
- * @retval #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
- */
-int system_info_get_internal_double(const char *key, double *value);
-
-/**
- * @brief Gets the string value of the internal feature
- * @remarks The @a value must be released with free() by you.
- * @param[in] key The name of the internal feature to get
- * @param[out] value The value of the given internal feature
- * @return 0 on success, otherwise a negative error value.
- * @retval #SYSTEM_INFO_ERROR_NONE Successful
- * @retval #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
- * @retval #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
- */
-int system_info_get_internal_string(const char *key, char **value);
-
/**
* @}
*/
return SYSTEM_INFO_ERROR_NONE;
}
-
-int system_info_get_internal_bool(const char *key, bool *value)
-{
- int ret;
- bool *supported;
- char *string = NULL;
-
- supported = (bool *)value;
-
- if (access(CONFIG_FILE_PATH, R_OK)) {
- LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
- return SYSTEM_INFO_ERROR_IO_ERROR;
- }
-
- ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, BOOL_TYPE, &string);
- if (ret) {
- LOGI("cannot get %s", key);
- *supported = false;
- return SYSTEM_INFO_ERROR_NONE;
- }
-
- if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
- *supported = true;
- else
- *supported = false;
-
- free(string);
-
- return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_internal_int(const char *key, int *value)
-{
- int ret;
- int *ret_val;
- char *string = NULL;
-
- ret_val = (int *)value;
-
- if (access(CONFIG_FILE_PATH, R_OK)) {
- LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
- return SYSTEM_INFO_ERROR_IO_ERROR;
- }
-
- ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, INT_TYPE, &string);
- if (ret) {
- LOGI("cannot get %s", key);
- *ret_val = 0;
- return SYSTEM_INFO_ERROR_NONE;
- }
-
- *ret_val = atoi(string);
-
- free(string);
-
- return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_internal_double(const char *key, double *value)
-{
- int ret;
- double *ret_val;
- char *string = NULL;
-
- ret_val = (double *)value;
-
- if (access(CONFIG_FILE_PATH, R_OK)) {
- LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
- return SYSTEM_INFO_ERROR_IO_ERROR;
- }
-
- ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, DBL_TYPE, &string);
- if (ret) {
- LOGI("cannot get %s", key);
- *ret_val = 0;
- return SYSTEM_INFO_ERROR_NONE;
- }
-
- *ret_val = atof(string);
-
- free(string);
-
- return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_internal_string(const char *key, char **value)
-{
- int ret;
- char *string = NULL;
-
- if (access(CONFIG_FILE_PATH, R_OK)) {
- LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
- return SYSTEM_INFO_ERROR_IO_ERROR;
- }
-
- ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, STR_TYPE, &string);
- if (ret) {
- LOGE("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
- return ret;
- }
-
- *value = string;
-
- return SYSTEM_INFO_ERROR_NONE;
-}