From d1be81f6815c994a52fba5ddd3779213be7904ae Mon Sep 17 00:00:00 2001 From: "sung.goo.kim" Date: Wed, 14 Oct 2015 10:00:30 +0900 Subject: [PATCH] (ACR) Integrate iotcon_list_del_nth_xxx -> iotcon_list_del_nth Change-Id: I97ae385acce2bbe642a17728819d9fb71b1cab86 --- lib/icl-repr-list.c | 69 ++-------------------------- lib/include/iotcon-representation.h | 90 +------------------------------------ 2 files changed, 5 insertions(+), 154 deletions(-) diff --git a/lib/icl-repr-list.c b/lib/icl-repr-list.c index 22fb4cf..d119707 100644 --- a/lib/icl-repr-list.c +++ b/lib/icl-repr-list.c @@ -372,14 +372,12 @@ API int iotcon_list_get_nth_state(iotcon_list_h list, int pos, iotcon_state_h *s } -static int _icl_list_del_nth_value(iotcon_list_h list, int pos, iotcon_types_e value_type) +static int _icl_list_del_nth_value(iotcon_list_h list, int pos) { iotcon_value_h value; RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER); RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER); - RETVM_IF(value_type != list->type, IOTCON_ERROR_INVALID_TYPE, - "Type Mismatching(list:%d, value:%d)", list->type, value_type); value = g_list_nth_data(list->list, pos); if (NULL == value) { @@ -403,78 +401,17 @@ static int _icl_list_del_nth_value(iotcon_list_h list, int pos, iotcon_types_e v } -API int iotcon_list_del_nth_int(iotcon_list_h list, int pos) +API int iotcon_list_del_nth(iotcon_list_h list, int pos) { int ret; - ret = _icl_list_del_nth_value(list, pos, IOTCON_TYPE_INT); - if (IOTCON_ERROR_NONE != ret) - ERR("iotcon_list_del_nth_int() Fail(%d)", ret); - - return ret; -} - - -API int iotcon_list_del_nth_bool(iotcon_list_h list, int pos) -{ - int ret; - - ret = _icl_list_del_nth_value(list, pos, IOTCON_TYPE_BOOL); - if (IOTCON_ERROR_NONE != ret) - ERR("_icl_list_del_nth_value() Fail(%d)", ret); - - return ret; -} - - -API int iotcon_list_del_nth_double(iotcon_list_h list, int pos) -{ - int ret; - - ret = _icl_list_del_nth_value(list, pos, IOTCON_TYPE_DOUBLE); - if (IOTCON_ERROR_NONE != ret) - ERR("_icl_list_del_nth_value() Fail(%d)", ret); - - return ret; -} - - -API int iotcon_list_del_nth_str(iotcon_list_h list, int pos) -{ - int ret; - - ret = _icl_list_del_nth_value(list, pos, IOTCON_TYPE_STR); + ret = _icl_list_del_nth_value(list, pos); if (IOTCON_ERROR_NONE != ret) ERR("_icl_list_del_nth_value() Fail(%d)", ret); return ret; } - -API int iotcon_list_del_nth_list(iotcon_list_h list, int pos) -{ - int ret; - - ret = _icl_list_del_nth_value(list, pos, IOTCON_TYPE_LIST); - if (IOTCON_ERROR_NONE != ret) - ERR("_icl_list_del_nth_value() Fail(%d)", ret); - - return ret; -} - - -API int iotcon_list_del_nth_state(iotcon_list_h list, int pos) -{ - int ret; - - ret = _icl_list_del_nth_value(list, pos, IOTCON_TYPE_STATE); - if (IOTCON_ERROR_NONE != ret) - ERR("_icl_list_del_nth_value() Fail(%d)", ret); - - return ret; -} - - API int iotcon_list_get_type(iotcon_list_h list, int *type) { RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER); diff --git a/lib/include/iotcon-representation.h b/lib/include/iotcon-representation.h index 972b9aa..03360f7 100644 --- a/lib/include/iotcon-representation.h +++ b/lib/include/iotcon-representation.h @@ -1017,7 +1017,7 @@ int iotcon_list_get_nth_list(iotcon_list_h src, int pos, iotcon_list_h *dest); int iotcon_list_get_nth_state(iotcon_list_h list, int pos, iotcon_state_h *state); /** - * @brief Deletes the integer value at the given position. + * @brief Deletes the value at the given position. * @details Iterates over the list until it reaches the @a pos-1 position. * * @since_tizen 3.0 @@ -1029,94 +1029,8 @@ int iotcon_list_get_nth_state(iotcon_list_h list, int pos, iotcon_state_h *state * @retval #IOTCON_ERROR_NONE Successful * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter * @retval #IOTCON_ERROR_NO_DATA No data available - * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type - */ -int iotcon_list_del_nth_int(iotcon_list_h list, int pos); - -/** - * @brief Deletes the boolean value at the given position. - * @details Iterates over the list until it reaches the @a pos-1 position. - * - * @since_tizen 3.0 - * - * @param[in] list The list handle - * @param[in] pos The position to delete - * - * @return 0 on success, otherwise a negative error value. - * @retval #IOTCON_ERROR_NONE Successful - * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #IOTCON_ERROR_NO_DATA No data available - * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type - */ -int iotcon_list_del_nth_bool(iotcon_list_h list, int pos); - -/** - * @brief Deletes the double value at the given position. - * @details Iterates over the list until it reaches the @a pos-1 position. - * - * @since_tizen 3.0 - * - * @param[in] list The list handle - * @param[in] pos The position to delete - * - * @return 0 on success, otherwise a negative error value. - * @retval #IOTCON_ERROR_NONE Successful - * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #IOTCON_ERROR_NO_DATA No data available - * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type - */ -int iotcon_list_del_nth_double(iotcon_list_h list, int pos); - -/** - * @brief Deletes the string value at the given position. - * @details Iterates over the list until it reaches the @a pos-1 position. - * - * @since_tizen 3.0 - * - * @param[in] list The list handle - * @param[in] pos The position to delete - * - * @return 0 on success, otherwise a negative error value. - * @retval #IOTCON_ERROR_NONE Successful - * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #IOTCON_ERROR_NO_DATA No data available - * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type - */ -int iotcon_list_del_nth_str(iotcon_list_h list, int pos); - -/** - * @brief Deletes the list value at the given position. - * @details Iterates over the list until it reaches the @a pos-1 position. - * - * @since_tizen 3.0 - * - * @param[in] list The list handle - * @param[in] pos The position to delete - * - * @return 0 on success, otherwise a negative error value. - * @retval #IOTCON_ERROR_NONE Successful - * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #IOTCON_ERROR_NO_DATA No data available - * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type - */ -int iotcon_list_del_nth_list(iotcon_list_h list, int pos); - -/** - * @brief Deletes the state value at the given position. - * @details Iterates over the list until it reaches the @a pos-1 position. - * - * @since_tizen 3.0 - * - * @param[in] list The list handle - * @param[in] pos The position to delete - * - * @return 0 on success, otherwise a negative error value. - * @retval #IOTCON_ERROR_NONE Successful - * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #IOTCON_ERROR_NO_DATA No data available - * @retval #IOTCON_ERROR_INVALID_TYPE Invalid type */ -int iotcon_list_del_nth_state(iotcon_list_h list, int pos); +int iotcon_list_del_nth(iotcon_list_h list, int pos); /** * @brief Gets the type of the list. -- 2.7.4