modify return type(void -> int) 73/86373/3
authoryoungman <yman.jung@samsung.com>
Thu, 1 Sep 2016 02:10:00 +0000 (11:10 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 6 Sep 2016 23:21:27 +0000 (16:21 -0700)
Change-Id: I147c507c8e707f2737f99098d43a07769d032210
Signed-off-by: youngman <yman.jung@samsung.com>
22 files changed:
include/iotcon-attributes.h
include/iotcon-list.h
include/iotcon-observers.h
include/iotcon-options.h
include/iotcon-query.h
include/iotcon-remote-resource.h
include/iotcon-representation.h
include/iotcon-resource-interfaces.h
include/iotcon-resource-types.h
include/iotcon-response.h
include/iotcon.h
src/ic-attributes.c
src/ic-list.c
src/ic-observation.c
src/ic-options.c
src/ic-query.c
src/ic-remote-resource.c
src/ic-representation.c
src/ic-resource-interfaces.c
src/ic-resource-types.c
src/ic-response.c
src/ic.c

index 5e64ad4..6796ad4 100644 (file)
@@ -59,7 +59,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
 
                ret = iotcon_representation_create(&representation);
                if (IOTCON_ERROR_NONE != ret) {
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -68,7 +68,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                ret = iotcon_attributes_create(&attributes);
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -76,7 +76,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -84,7 +84,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -92,7 +92,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -102,7 +102,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -110,13 +110,13 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
                iotcon_attributes_destroy(attributes);
                iotcon_representation_destroy(representation);
-               iotcon_response_destroy(resopnse);
+               iotcon_response_destroy(response);
        }
        ...
 }
@@ -165,11 +165,14 @@ int iotcon_attributes_create(iotcon_attributes_h *attributes);
  *
  * @param[in] attributes The attributes handle to free
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  *
  * @see iotcon_attributes_create()
  */
-void iotcon_attributes_destroy(iotcon_attributes_h attributes);
+int iotcon_attributes_destroy(iotcon_attributes_h attributes);
 
 /**
  * @brief Clones a attributes handle.
index 606a433..0c9b114 100644 (file)
@@ -58,7 +58,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
 
                ret = iotcon_representation_create(&representation);
                if (IOTCON_ERROR_NONE != ret) {
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -67,7 +67,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                ret = iotcon_attributes_create(&attributes);
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -75,7 +75,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                if (IOTCON_ERROR_NONE != ret) {
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -84,7 +84,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                        iotcon_list_destroy(list);
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -93,7 +93,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                        iotcon_list_destroy(list);
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -102,7 +102,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                        iotcon_list_destroy(list);
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -111,7 +111,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                        iotcon_list_destroy(list);
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -120,7 +120,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                        iotcon_list_destroy(list);
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -131,7 +131,7 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                        iotcon_list_destroy(list);
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
@@ -140,14 +140,14 @@ static void _request_handler(iotcon_resource_h resource, iotcon_request_h reques
                        iotcon_list_destroy(list);
                        iotcon_attributes_destroy(attributes);
                        iotcon_representation_destroy(representation);
-                       iotcon_response_destroy(resopnse);
+                       iotcon_response_destroy(response);
                        return;
                }
 
                iotcon_list_destroy(list);
                iotcon_attributes_destroy(attributes);
                iotcon_representation_destroy(representation);
-               iotcon_response_destroy(resopnse);
+               iotcon_response_destroy(response);
        }
        ...
 }
@@ -196,9 +196,12 @@ int iotcon_list_create(iotcon_type_e type, iotcon_list_h *list);
  *
  * @param[in] list The handle to the list
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  */
-void iotcon_list_destroy(iotcon_list_h list);
+int iotcon_list_destroy(iotcon_list_h list);
 
 /**
  * @brief Adds a new element integer value into the list at the given position.
index adb93c3..9961936 100644 (file)
@@ -32,7 +32,7 @@
  *  \#include <iotcon.h>
  *
  * @section CAPI_IOT_CONNECTIVITY_SERVER_OBSERVERS_MODULE_OVERVIEW Overview
- * The iotcon overview API provides methods for managing oberve id.
+ * The iotcon overview API provides methods for managing observe id.
  *
  * Example :
  * @code
@@ -157,13 +157,16 @@ int iotcon_observers_create(iotcon_observers_h *observers);
  *
  * @param[in] observers The handle of the observers
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  *
  * @see iotcon_observers_create()
  * @see iotcon_observers_add()
  * @see iotcon_observers_remove()
  */
-void iotcon_observers_destroy(iotcon_observers_h observers);
+int iotcon_observers_destroy(iotcon_observers_h observers);
 
 /**
  * @brief Adds a observer id into the observers handle.
index 7a03f82..0fcaa44 100644 (file)
@@ -147,17 +147,20 @@ int iotcon_options_create(iotcon_options_h *options);
  *
  * @param[in] options The handle of the options
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
  *
  * @see iotcon_options_create()
  * @see iotcon_options_add()
  * @see iotcon_options_remove()
  * @see iotcon_options_lookup()
  */
-void iotcon_options_destroy(iotcon_options_h options);
+int iotcon_options_destroy(iotcon_options_h options);
 
 /**
- * @brief Adds a new id and a correspoding data into the options.
+ * @brief Adds a new id and a corresponding data into the options.
  *
  * @since_tizen 3.0
  * @remarks iotcon_options_h can have up to 2 options. \n
index 5dd1064..908984b 100644 (file)
@@ -137,14 +137,17 @@ int iotcon_query_create(iotcon_query_h *query);
  *
  * @param[in] query The handle of the query
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  *
  * @see iotcon_query_create()
  * @see iotcon_query_add()
  * @see iotcon_query_remove()
  * @see iotcon_query_lookup()
  */
-void iotcon_query_destroy(iotcon_query_h query);
+int iotcon_query_destroy(iotcon_query_h query);
 
 /**
  * @brief Gets resource type from the query.
@@ -204,7 +207,7 @@ int iotcon_query_get_interface(iotcon_query_h query, char **resource_iface);
  * @since_tizen 3.0
  *
  * @param[in] query The handle of the query
- * @param[in] resource_type The resoure type to set into the query
+ * @param[in] resource_type The resource type to set into the query
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #IOTCON_ERROR_NONE  Successful
@@ -247,7 +250,7 @@ int iotcon_query_set_resource_type(iotcon_query_h query, const char *resource_ty
 int iotcon_query_set_interface(iotcon_query_h query, const char *resource_iface);
 
 /**
- * @brief Adds a new key and correspoding value into the query.
+ * @brief Adds a new key and corresponding value into the query.
  *
  * @since_tizen 3.0
  * @remarks The full length of query should be less than or equal to 64.
index 360fb4c..7976e12 100644 (file)
@@ -158,12 +158,15 @@ int iotcon_remote_resource_create(const char *host_address,
  *
  * @param[in] resource The handle of the resource
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  *
  * @see iotcon_remote_resource_create()
  * @see iotcon_remote_resource_clone()
  */
-void iotcon_remote_resource_destroy(iotcon_remote_resource_h resource);
+int iotcon_remote_resource_destroy(iotcon_remote_resource_h resource);
 
 /**
  * @brief Clones a clone of a remote resource.
index def9ec6..2c57218 100644 (file)
@@ -228,11 +228,14 @@ int iotcon_representation_create(iotcon_representation_h *repr);
  *
  * @param[in] repr The representation handle to free
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  *
  * @see iotcon_representation_create()
  */
-void iotcon_representation_destroy(iotcon_representation_h repr);
+int iotcon_representation_destroy(iotcon_representation_h repr);
 
 /**
  * @brief Clones from the source representation.
index 01bd0eb..c67c0e7 100644 (file)
@@ -132,14 +132,17 @@ int iotcon_resource_interfaces_create(iotcon_resource_interfaces_h *ifaces);
  *
  * @param[in] ifaces The handle of the resource ifaces
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  *
  * @see iotcon_resource_interfaces_create()
  * @see iotcon_resource_interfaces_add()
  * @see iotcon_resource_interfaces_remove()
  * @see iotcon_resource_interfaces_clone()
  */
-void iotcon_resource_interfaces_destroy(iotcon_resource_interfaces_h ifaces);
+int iotcon_resource_interfaces_destroy(iotcon_resource_interfaces_h ifaces);
 
 /**
  * @brief Inserts a resource iface into the list.
index c2ce105..d3fc7e3 100644 (file)
@@ -132,14 +132,17 @@ int iotcon_resource_types_create(iotcon_resource_types_h *types);
  *
  * @param[in] types The handle of the resource types
  *
- * @return void
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  *
  * @see iotcon_resource_types_create()
  * @see iotcon_resource_types_add()
  * @see iotcon_resource_types_remove()
  * @see iotcon_resource_types_clone()
  */
-void iotcon_resource_types_destroy(iotcon_resource_types_h types);
+int iotcon_resource_types_destroy(iotcon_resource_types_h types);
 
 /**
  * @brief Inserts a resource type into the list.
index 4fee6a8..b62227a 100644 (file)
@@ -218,9 +218,15 @@ int iotcon_response_create(iotcon_request_h request, iotcon_response_h *response
  *
  * @param[in] resp The handle of the response
  *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #IOTCON_ERROR_OUT_OF_MEMORY  Out of memory
+ *
  * @see iotcon_response_create()
  */
-void iotcon_response_destroy(iotcon_response_h resp);
+int iotcon_response_destroy(iotcon_response_h resp);
 
 
 /**
index 8c3b644..d37d598 100644 (file)
@@ -80,13 +80,15 @@ int iotcon_initialize(const char *file_path);
  *
  * @remarks This function must be called if IoTCon API is no longer needed.
  *
- * @return void
+ * @return  0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  *
  * @pre iotcon_initialize() should be called to initialize.
  *
  * @see iotcon_initialize()
  */
-void iotcon_deinitialize(void);
+int iotcon_deinitialize(void);
 
 /**
  * @brief Gets the timeout seconds of asynchronous API.
index c877991..b17e562 100644 (file)
@@ -58,17 +58,20 @@ API int iotcon_attributes_create(iotcon_attributes_h *ret_attributes)
 }
 
 
-API void iotcon_attributes_destroy(iotcon_attributes_h attributes)
+API int iotcon_attributes_destroy(iotcon_attributes_h attributes)
 {
-       RET_IF(NULL == attributes);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == attributes, IOTCON_ERROR_INVALID_PARAMETER);
 
        attributes->ref_count--;
 
        if (0 != attributes->ref_count)
-               return;
+               return IOTCON_ERROR_NONE;
 
        g_hash_table_destroy(attributes->hash_table);
        free(attributes);
+
+       return IOTCON_ERROR_NONE;
 }
 
 
index 9421b75..40714c3 100644 (file)
@@ -648,16 +648,17 @@ API int iotcon_list_foreach_attributes(iotcon_list_h list,
 }
 
 
-API void iotcon_list_destroy(iotcon_list_h list)
+API int iotcon_list_destroy(iotcon_list_h list)
 {
        GList *cur = NULL;
 
-       RET_IF(NULL == list);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
 
        list->ref_count--;
 
        if (0 != list->ref_count)
-               return;
+               return IOTCON_ERROR_NONE;
 
        cur = list->list;
        while (cur) {
@@ -665,4 +666,6 @@ API void iotcon_list_destroy(iotcon_list_h list)
                cur = cur->next;
        }
        free(list);
+
+       return IOTCON_ERROR_NONE;
 }
index 94e095a..02c12c3 100644 (file)
@@ -39,12 +39,15 @@ API int iotcon_observers_create(iotcon_observers_h *ret_observers)
 }
 
 
-API void iotcon_observers_destroy(iotcon_observers_h observers)
+API int iotcon_observers_destroy(iotcon_observers_h observers)
 {
-       RET_IF(NULL == observers);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == observers, IOTCON_ERROR_INVALID_PARAMETER);
 
        g_list_free(observers->observers_list);
        free(observers);
+
+       return IOTCON_ERROR_NONE;
 }
 
 
index 3fcab28..ad3821a 100644 (file)
@@ -87,9 +87,10 @@ API int iotcon_options_create(iotcon_options_h *ret_options)
 }
 
 
-API void iotcon_options_destroy(iotcon_options_h options)
+API int iotcon_options_destroy(iotcon_options_h options)
 {
-       RET_IF(NULL == options);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
 
        options->ref_count--;
 
@@ -97,6 +98,8 @@ API void iotcon_options_destroy(iotcon_options_h options)
                g_hash_table_unref(options->hash);
                free(options);
        }
+
+       return IOTCON_ERROR_NONE;
 }
 
 
index 8ddb96e..750c54e 100644 (file)
@@ -48,12 +48,15 @@ API int iotcon_query_create(iotcon_query_h *ret_query)
 }
 
 
-API void iotcon_query_destroy(iotcon_query_h query)
+API int iotcon_query_destroy(iotcon_query_h query)
 {
-       RET_IF(NULL == query);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
 
        g_hash_table_unref(query->hash);
        free(query);
+
+       return IOTCON_ERROR_NONE;
 }
 
 
index cc0235e..c1a73b3 100644 (file)
@@ -160,14 +160,17 @@ void icl_remote_resource_unref(iotcon_remote_resource_h resource)
 }
 
 
-API void iotcon_remote_resource_destroy(iotcon_remote_resource_h resource)
+API int iotcon_remote_resource_destroy(iotcon_remote_resource_h resource)
 {
-       RET_IF(NULL == resource);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (resource->observe_handle)
                iotcon_remote_resource_observe_deregister(resource);
 
        icl_remote_resource_unref(resource);
+
+       return IOTCON_ERROR_NONE;
 }
 
 static bool _icl_remote_resource_header_foreach_cb(unsigned short id,
index 2388c4e..2dc0288 100644 (file)
@@ -71,14 +71,15 @@ API int iotcon_representation_create(iotcon_representation_h *ret_repr)
 }
 
 
-API void iotcon_representation_destroy(iotcon_representation_h repr)
+API int iotcon_representation_destroy(iotcon_representation_h repr)
 {
-       RET_IF(NULL == repr);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
 
        repr->ref_count--;
 
        if (0 != repr->ref_count)
-               return;
+               return IOTCON_ERROR_NONE;
 
        free(repr->uri_path);
 
@@ -98,6 +99,8 @@ API void iotcon_representation_destroy(iotcon_representation_h repr)
                iotcon_attributes_destroy(repr->attributes);
 
        free(repr);
+
+       return IOTCON_ERROR_NONE;
 }
 
 
index 3d57280..f6f4515 100644 (file)
@@ -56,9 +56,10 @@ API int iotcon_resource_interfaces_create(iotcon_resource_interfaces_h *ret_ifac
 }
 
 
-API void iotcon_resource_interfaces_destroy(iotcon_resource_interfaces_h ifaces)
+API int iotcon_resource_interfaces_destroy(iotcon_resource_interfaces_h ifaces)
 {
-       RET_IF(NULL == ifaces);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
 
        ifaces->ref_count--;
 
@@ -66,6 +67,8 @@ API void iotcon_resource_interfaces_destroy(iotcon_resource_interfaces_h ifaces)
                g_list_free_full(ifaces->iface_list, free);
                free(ifaces);
        }
+
+       return IOTCON_ERROR_NONE;
 }
 
 
index edf5a18..7886a82 100644 (file)
@@ -56,9 +56,10 @@ API int iotcon_resource_types_create(iotcon_resource_types_h *ret_types)
 }
 
 
-API void iotcon_resource_types_destroy(iotcon_resource_types_h types)
+API int iotcon_resource_types_destroy(iotcon_resource_types_h types)
 {
-       RET_IF(NULL == types);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
 
        types->ref_count--;
 
@@ -66,6 +67,8 @@ API void iotcon_resource_types_destroy(iotcon_resource_types_h types)
                g_list_free_full(types->type_list, free);
                free(types);
        }
+
+       return IOTCON_ERROR_NONE;
 }
 
 
index b13fa46..f40ab9a 100644 (file)
@@ -55,15 +55,18 @@ API int iotcon_response_create(iotcon_request_h request,
 }
 
 
-API void iotcon_response_destroy(iotcon_response_h resp)
+API int iotcon_response_destroy(iotcon_response_h resp)
 {
-       RET_IF(NULL == resp);
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (resp->repr)
                iotcon_representation_destroy(resp->repr);
        if (resp->header_options)
                iotcon_options_destroy(resp->header_options);
        free(resp);
+
+       return IOTCON_ERROR_NONE;
 }
 
 API int iotcon_response_get_options(iotcon_response_h resp,
index 599e4a6..9754725 100644 (file)
--- a/src/ic.c
+++ b/src/ic.c
@@ -84,8 +84,10 @@ API int iotcon_initialize(const char *file_path)
        return icl_initialize(file_path, false);
 }
 
-API void iotcon_deinitialize(void)
+API int iotcon_deinitialize(void)
 {
+       RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+
        ic_utils_mutex_lock(IC_UTILS_MUTEX_INIT);
 
        icl_init_count--;
@@ -95,6 +97,8 @@ API void iotcon_deinitialize(void)
        }
 
        ic_utils_mutex_unlock(IC_UTILS_MUTEX_INIT);
+
+       return IOTCON_ERROR_NONE;
 }
 
 API int iotcon_get_timeout(int *timeout_seconds)