From: Chanwoo Choi Date: Tue, 9 Aug 2022 03:55:19 +0000 (+0900) Subject: resource-monitor: Change prototype resource_monitor_get_value_string X-Git-Tag: submit/tizen/20220812.041529~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ec599c05d99e8093ff4a5f6eb95b66220d43984;p=platform%2Fcore%2Fapi%2Fresource-monitor.git resource-monitor: Change prototype resource_monitor_get_value_string Change prototype resource_monitor_get_value_string and add description about free opearion of get_array functions. Change-Id: Ibe9a8fa9db39457e90dcb637ee76a5d69d2186c7 Signed-off-by: Chanwoo Choi --- diff --git a/include/resource-monitor.h b/include/resource-monitor.h index b2294aa..662cb5b 100644 --- a/include/resource-monitor.h +++ b/include/resource-monitor.h @@ -256,6 +256,8 @@ int resource_monitor_update_resource(int id, int resource_id); /** * @brief Get [int/int64/uint/uint64/double/string] value of resource attribute + * @details resource_monitor_get_value_string returns the value stored on allocated memory. + * After using the value, must need to free the allocated memory of value. * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Resource attribute id @@ -267,10 +269,12 @@ int resource_monitor_get_value_int64(int id, int resource_id, u_int64_t attr, in int resource_monitor_get_value_uint(int id, int resource_id, u_int64_t attr, u_int32_t *value); int resource_monitor_get_value_uint64(int id, int resource_id, u_int64_t attr, u_int64_t *value); int resource_monitor_get_value_double(int id, int resource_id, u_int64_t attr, double *value); -int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char *value); +int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char **value); /** * @brief Get [int/int64/uint/uint64/double/string] array of resource attribute + * @details All get_array return the value stored on allocated memory. + * After using the value, must need to free the allocated memory of value. * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Resource attribute id diff --git a/src/resouce-monitor.c b/src/resouce-monitor.c index 4a044a9..1838358 100644 --- a/src/resouce-monitor.c +++ b/src/resouce-monitor.c @@ -102,7 +102,7 @@ int resource_monitor_get_value_double(int id, int resource_id, u_int64_t attr, d return pass_resource_monitor_get_value_double(id, resource_id, attr, value); } -int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char *value) +int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char **value) { return pass_resource_monitor_get_value_string(id, resource_id, attr, value); }