merge from 2.4. 65/48165/1 accepted/tizen/mobile/20150917.041241 accepted/tizen/tv/20150917.041356 submit/tizen_mobile/20150915.235733 submit/tizen_tv/20150915.235956 tizen_3.0.m2.a1_tv_release
authorjiseob.jang <jiseob.jang@samsung.com>
Tue, 15 Sep 2015 09:53:50 +0000 (18:53 +0900)
committerjiseob.jang <jiseob.jang@samsung.com>
Tue, 15 Sep 2015 09:53:50 +0000 (18:53 +0900)
Change-Id: I640a8fbb8790622d230a0d6c814d83af16592c8c
Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
CMakeLists.txt
LICENSE.APLv2 [moved from LICENSE with 99% similarity]
NOTICE [new file with mode: 0644]
common/CMakeLists.txt
common/include/account_free.h [new file with mode: 0644]
common/src/account_free.c [new file with mode: 0644]
packaging/account-common.spec

index 65905a8..70f1950 100644 (file)
@@ -6,6 +6,6 @@ SET(EXEC_PREFIX "\${prefix}")
 #SET(LIBDIR "\${prefix}/lib")
 #SET(INCLUDEDIR "\${prefix}/include ")
 SET(VERSION_MAJOR 0)
-SET(VERSION "${VERSION_MAJOR}.0.4")
+SET(VERSION "${VERSION_MAJOR}.0.6")
 
 ADD_SUBDIRECTORY(common)
similarity index 99%
rename from LICENSE
rename to LICENSE.APLv2
index f94008a..d645695 100644 (file)
--- a/LICENSE
@@ -1,4 +1,3 @@
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
 
                                  Apache License
                            Version 2.0, January 2004
@@ -201,6 +200,3 @@ Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-
-
-
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..0e0f016
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,3 @@
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
index 0996bb7..2535c78 100644 (file)
@@ -1,6 +1,7 @@
 
 SET(SRCS
        ./src/account_ipc_marshal.c
+       ./src/account_free.c
 )
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
@@ -45,6 +46,7 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
 
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/common/account-mgr-stub.h DESTINATION include)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/common/include/account_ipc_marshal.h DESTINATION include)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/common/include/account_free.h DESTINATION include)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/common/include/account-private.h DESTINATION include)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/common/include/dbg.h DESTINATION include)
 
diff --git a/common/include/account_free.h b/common/include/account_free.h
new file mode 100644 (file)
index 0000000..016d021
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *  account
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jiseob Jang <jiseob.jang@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ACCOUNT_FREE_H__
+#define __ACCOUNT_FREE_H__
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <glib.h>
+#include <account-private.h>
+
+int _account_glist_account_free(GList* list);
+int _account_gslist_account_free(GSList *list);
+int _account_gslist_capability_free(GSList* list);
+int _account_gslist_custom_free(GSList* list);
+int _account_free_account_with_items(account_s *data);
+int _account_free_capability_with_items(account_capability_s *data);
+int _account_free_custom_with_items(account_custom_s *data);
+//int _account_type_glist_free(GList* list);
+int _account_type_gslist_account_type_free(GSList *list);
+int _account_type_gslist_label_free(GSList* list);
+int _account_type_gslist_feature_free(GSList* list);
+int _account_type_item_free(account_type_s *data);
+int _account_type_free_account_type_with_items(account_type_s *data);
+int _account_type_free_label_with_items(label_s *data);
+int _account_type_free_feature_with_items(provider_feature_s *data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ACCOUNT_FREE_H__*/
diff --git a/common/src/account_free.c b/common/src/account_free.c
new file mode 100644 (file)
index 0000000..de9e1dd
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "account-private.h"
+#include "dbg.h"
+#include "account_free.h"
+
+int _account_glist_account_free(GList* list)
+{
+       if(!list){
+               return -1;
+       }
+
+       GList* iter;
+
+       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
+               account_s *account_record = (account_s*)iter->data;
+               _account_free_account_with_items(account_record);
+       }
+
+       g_list_free(list);
+       list = NULL;
+
+       return 0;
+}
+
+int _account_gslist_account_free(GSList *list)
+{
+       if(!list){
+               return -1;
+       }
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_s *account_data = (account_s*)iter->data;
+               _account_free_account_with_items(account_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return 0;
+}
+
+int _account_gslist_capability_free(GSList* list)
+{
+       if(!list){
+               return -1;
+       }
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_capability_s *cap_data = (account_capability_s*)iter->data;
+               _account_free_capability_with_items(cap_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return 0;
+}
+
+int _account_gslist_custom_free(GSList* list)
+{
+       if(!list){
+               return -1;
+       }
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_custom_s *custom_data = (account_custom_s*)iter->data;
+               _account_free_custom_with_items(custom_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return 0;
+}
+
+int _account_free_capability_with_items(account_capability_s *data)
+{
+       if(!data)
+               return -1;
+
+       _ACCOUNT_FREE(data->type);
+       _ACCOUNT_FREE(data->package_name);
+       _ACCOUNT_FREE(data->user_name);
+
+       _ACCOUNT_FREE(data);
+
+       return 0;
+}
+
+int _account_free_custom_with_items(account_custom_s *data)
+{
+       if(!data)
+               return -1;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->key);
+       _ACCOUNT_FREE(data->value);
+
+       _ACCOUNT_FREE(data);
+
+       return 0;
+}
+
+int _account_free_account_with_items(account_s *data)
+{
+       if(!data)
+               return -1;
+
+       _ACCOUNT_FREE(data->user_name);
+       _ACCOUNT_FREE(data->email_address);
+       _ACCOUNT_FREE(data->display_name);
+       _ACCOUNT_FREE(data->icon_path);
+       _ACCOUNT_FREE(data->source);
+       _ACCOUNT_FREE(data->package_name);
+       _ACCOUNT_FREE(data->domain_name);
+       _ACCOUNT_FREE(data->access_token);
+
+       int i;
+       for(i=0;i<USER_TXT_CNT;i++)
+               _ACCOUNT_FREE(data->user_data_txt[i]);
+
+       _account_gslist_capability_free(data->capablity_list);
+       _account_glist_account_free(data->account_list);
+       _account_gslist_custom_free(data->custom_list);
+
+       _ACCOUNT_FREE(data);
+
+       return 0;
+}
+
+int _account_type_free_label_with_items(label_s *data)
+{
+       if(!data)
+               return -1;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->label);
+       _ACCOUNT_FREE(data->locale);
+
+       _ACCOUNT_FREE(data);
+
+       return 0;
+}
+
+int _account_type_free_feature_with_items(provider_feature_s *data)
+{
+       if(!data)
+               return -1;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->key);
+
+       _ACCOUNT_FREE(data);
+       return 0;
+}
+
+int _account_type_gslist_feature_free(GSList* list)
+{
+       if(!list)
+               return -1;
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               provider_feature_s *feature_data = (provider_feature_s*)iter->data;
+               _account_type_free_feature_with_items(feature_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return 0;
+}
+
+int _account_type_gslist_label_free(GSList* list)
+{
+       if(!list)
+               return -1;
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               label_s *label_data = (label_s*)iter->data;
+               _account_type_free_label_with_items(label_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return 0;
+}
+
+int _account_type_item_free(account_type_s *data)
+{
+       if(!data)
+               return -1;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->service_provider_id);
+       _ACCOUNT_FREE(data->icon_path);
+       _ACCOUNT_FREE(data->small_icon_path);
+
+       return 0;
+}
+/*
+int _account_type_glist_free(GList* list)
+{
+       if(!list)
+               return -1;
+
+       GList* iter;
+
+       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
+               account_type_s *account_type_record = (account_type_s*)iter->data;
+               _account_type_item_free(account_type_record);
+               _ACCOUNT_FREE(account_type_record);
+       }
+
+       g_list_free(list);
+       list = NULL;
+
+       return 0;
+}
+*/
+int _account_type_free_account_type_with_items(account_type_s *data)
+{
+       if(!data)
+               return -1;
+
+       _account_type_item_free(data);
+
+       _account_type_gslist_label_free(data->label_list);
+       _account_type_gslist_feature_free(data->provider_feature_list);
+//     _account_type_glist_free(data->account_type_list);
+
+       _ACCOUNT_FREE(data);
+
+       return 0;
+}
+
+int _account_type_gslist_account_type_free(GSList* list)
+{
+       _INFO("_account_type_gslist_account_type_free(GSList* list) start");
+       if(!list)
+               return -1;
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_type_s *account_type_data = (account_type_s*)iter->data;
+               _INFO("before _account_type_free_account_type_with_items(account_type_data)");
+               _account_type_free_account_type_with_items(account_type_data);
+               _INFO("after _account_type_free_account_type_with_items(account_type_data)");
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       _INFO("_account_type_gslist_account_type_free(GSList* list) end");
+       return 0;
+}
index 85e494f..88f212b 100644 (file)
@@ -1,7 +1,7 @@
 
 Name:       account-common
 Summary:    Account common library
-Version:    0.0.4
+Version:    0.0.6
 Release:    1
 Group:      Social & Content/API
 License:    Apache-2.0