ret = iotcon_representation_create(&representation);
if (IOTCON_ERROR_NONE != ret) {
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
ret = iotcon_attributes_create(&attributes);
if (IOTCON_ERROR_NONE != ret) {
iotcon_representation_destroy(representation);
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_attributes_destroy(attributes);
iotcon_representation_destroy(representation);
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_attributes_destroy(attributes);
iotcon_representation_destroy(representation);
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_attributes_destroy(attributes);
iotcon_representation_destroy(representation);
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_attributes_destroy(attributes);
iotcon_representation_destroy(representation);
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
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);
}
...
}
*
* @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.
ret = iotcon_representation_create(&representation);
if (IOTCON_ERROR_NONE != ret) {
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
ret = iotcon_attributes_create(&attributes);
if (IOTCON_ERROR_NONE != ret) {
iotcon_representation_destroy(representation);
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
return;
}
if (IOTCON_ERROR_NONE != ret) {
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);
return;
}
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);
return;
}
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);
return;
}
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);
return;
}
iotcon_list_destroy(list);
iotcon_attributes_destroy(attributes);
iotcon_representation_destroy(representation);
- iotcon_response_destroy(resopnse);
+ iotcon_response_destroy(response);
}
...
}
*
* @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.
* \#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
*
* @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.
*
* @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
*
* @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.
* @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
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.
*
* @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.
*
* @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.
*
* @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.
*
* @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.
*
* @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);
/**
*
* @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.
}
-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;
}
}
-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) {
cur = cur->next;
}
free(list);
+
+ return IOTCON_ERROR_NONE;
}
}
-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;
}
}
-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--;
g_hash_table_unref(options->hash);
free(options);
}
+
+ return IOTCON_ERROR_NONE;
}
}
-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;
}
}
-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,
}
-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);
iotcon_attributes_destroy(repr->attributes);
free(repr);
+
+ return IOTCON_ERROR_NONE;
}
}
-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--;
g_list_free_full(ifaces->iface_list, free);
free(ifaces);
}
+
+ return IOTCON_ERROR_NONE;
}
}
-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--;
g_list_free_full(types->type_list, free);
free(types);
}
+
+ return IOTCON_ERROR_NONE;
}
}
-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,
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--;
}
ic_utils_mutex_unlock(IC_UTILS_MUTEX_INIT);
+
+ return IOTCON_ERROR_NONE;
}
API int iotcon_get_timeout(int *timeout_seconds)