Merge branch 'tizen_5.5' into tizen
[platform/core/uifw/capi-ui-sticker.git] / client / sticker_data.c
index 2603285..decbfe3 100644 (file)
@@ -46,14 +46,14 @@ static char* _make_absolute_path(const char *relative_path)
 
     ret = package_info_create(app_id, &package_info);
     if (ret != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) {
-        LOGE("faild to create package_info. ret: %d", ret);
+        LOGE("failed to create package_info. ret: %d", ret);
         ret = STICKER_ERROR_OPERATION_FAILED;
         goto cleanup;
     }
 
     ret = package_info_get_root_path(package_info, &app_path);
     if (ret != PACKAGE_MANAGER_ERROR_NONE || app_path == NULL) {
-        LOGE("faild to create package_info. ret: %d", ret);
+        LOGE("failed to create package_info. ret: %d", ret);
         ret = STICKER_ERROR_OPERATION_FAILED;
         goto cleanup;
     }
@@ -95,6 +95,8 @@ cleanup:
 
 EXPORT_API int sticker_data_create(sticker_data_h *data_handle)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -116,14 +118,15 @@ EXPORT_API int sticker_data_create(sticker_data_h *data_handle)
     *data_handle = data_struct;
 
 cleanup:
-    if (app_id)
-        free(app_id);
+    free(app_id);
 
     return ret;
 }
 
 EXPORT_API int sticker_data_destroy(sticker_data_h data_handle)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -170,8 +173,9 @@ EXPORT_API int sticker_data_destroy(sticker_data_h data_handle)
 
 EXPORT_API int sticker_data_clone(sticker_data_h origin_handle, sticker_data_h *target_handle)
 {
-    sticker_data_h handle;
+    CHECK_STICKER_FEATURE();
 
+    sticker_data_h handle;
     if (!origin_handle || !target_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -211,6 +215,8 @@ EXPORT_API int sticker_data_clone(sticker_data_h origin_handle, sticker_data_h *
 
 EXPORT_API int sticker_data_get_app_id(sticker_data_h data_handle, char **app_id)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !app_id)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -224,8 +230,9 @@ EXPORT_API int sticker_data_get_app_id(sticker_data_h data_handle, char **app_id
 
 EXPORT_API int sticker_data_set_uri(sticker_data_h data_handle, sticker_data_uri_type_e type, const char *uri)
 {
-    char *file_path = NULL;
+    CHECK_STICKER_FEATURE();
 
+    char *file_path = NULL;
     if (!data_handle || !type || !uri)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -253,6 +260,8 @@ EXPORT_API int sticker_data_set_uri(sticker_data_h data_handle, sticker_data_uri
 
 EXPORT_API int sticker_data_get_uri(sticker_data_h data_handle, sticker_data_uri_type_e *type, char **uri)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !type || !uri)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -267,6 +276,8 @@ EXPORT_API int sticker_data_get_uri(sticker_data_h data_handle, sticker_data_uri
 
 EXPORT_API int sticker_data_foreach_keyword(sticker_data_h data_handle, sticker_data_keyword_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !callback)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -283,8 +294,9 @@ EXPORT_API int sticker_data_foreach_keyword(sticker_data_h data_handle, sticker_
 
 EXPORT_API int sticker_data_add_keyword(sticker_data_h data_handle, const char *keyword)
 {
-    GList *node;
+    CHECK_STICKER_FEATURE();
 
+    GList *node;
     if (!data_handle || !keyword)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -302,8 +314,9 @@ EXPORT_API int sticker_data_add_keyword(sticker_data_h data_handle, const char *
 
 EXPORT_API int sticker_data_remove_keyword(sticker_data_h data_handle, const char *keyword)
 {
-    GList *node;
+    CHECK_STICKER_FEATURE();
 
+    GList *node;
     if (!data_handle || !keyword)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -321,6 +334,8 @@ EXPORT_API int sticker_data_remove_keyword(sticker_data_h data_handle, const cha
 
 EXPORT_API int sticker_data_set_group_name(sticker_data_h data_handle, const char *group)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !group)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -334,6 +349,8 @@ EXPORT_API int sticker_data_set_group_name(sticker_data_h data_handle, const cha
 
 EXPORT_API int sticker_data_get_group_name(sticker_data_h data_handle, char **group)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !group)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -347,8 +364,9 @@ EXPORT_API int sticker_data_get_group_name(sticker_data_h data_handle, char **gr
 
 EXPORT_API int sticker_data_set_thumbnail(sticker_data_h data_handle, const char *thumbnail)
 {
-    char *file_path = NULL;
+    CHECK_STICKER_FEATURE();
 
+    char *file_path = NULL;
     if (!data_handle || !thumbnail)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -369,6 +387,8 @@ EXPORT_API int sticker_data_set_thumbnail(sticker_data_h data_handle, const char
 
 EXPORT_API int sticker_data_get_thumbnail(sticker_data_h data_handle, char **thumbnail)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !thumbnail)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -382,6 +402,8 @@ EXPORT_API int sticker_data_get_thumbnail(sticker_data_h data_handle, char **thu
 
 EXPORT_API int sticker_data_set_description(sticker_data_h data_handle, const char *description)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !description)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -395,6 +417,8 @@ EXPORT_API int sticker_data_set_description(sticker_data_h data_handle, const ch
 
 EXPORT_API int sticker_data_get_description(sticker_data_h data_handle, char **description)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !description)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -408,6 +432,8 @@ EXPORT_API int sticker_data_get_description(sticker_data_h data_handle, char **d
 
 EXPORT_API int sticker_data_get_date(sticker_data_h data_handle, char **date)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !date)
         return STICKER_ERROR_INVALID_PARAMETER;