Delay Creation of cache if backup database is exist
[platform/core/appfw/pkgmgr-info.git] / src / pkgmgrinfo_plugininfo.c
index 9d9fb5e..e63ee01 100644 (file)
@@ -3,7 +3,8 @@
  *
  * Copyright (c) 2000 - 2019 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Junghyun Yeon <jungh.yeon@samsung.com>, Sangyoon Jang <jeremy.jang@samsung.com>
+ * Contact: Junghyun Yeon <jungh.yeon@samsung.com>,
+ * Sangyoon Jang <jeremy.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.
 
 #include <stdlib.h>
 #include <stdbool.h>
-#include <sqlite3.h>
 
+#include "manager/pkginfo_manager.h"
 #include "pkgmgrinfo_private.h"
 #include "pkgmgrinfo_debug.h"
 #include "pkgmgr-info.h"
 
-static void _free_plugin(gpointer data)
-{
-       plugin_x *plugin = (plugin_x *)data;
-       if (plugin == NULL)
-               return;
-       if (plugin->appid)
-               free((void *)plugin->appid);
-       free((void *)plugin);
-}
-
 API int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
                const char *plugin_type, const char *plugin_name,
                pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data)
@@ -53,18 +44,20 @@ API int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
                return PMINFO_R_EINVAL;
        }
 
-       ret = _plugininfo_get_appids(pkgid, plugin_type, plugin_name, &appid_list);
+       ret = _plugininfo_get_appids(pkgid, plugin_type, plugin_name,
+                       &appid_list);
        if (ret != PMINFO_R_OK) {
                _LOGE("Fail to get plugininfo");
                return ret;
        }
 
-       for (tmp_list = appid_list; tmp_list != NULL; tmp_list = tmp_list->next) {
+       for (tmp_list = appid_list; tmp_list != NULL;
+                       tmp_list = tmp_list->next) {
                appid = (char *)tmp_list->data;
                if (!appid)
                        continue;
                ret = plugin_list_cb(pkgid, appid, plugin_type,
-                                                        plugin_name, user_data);
+                               plugin_name, user_data);
                if (ret != 0)
                        break;
        }
@@ -73,4 +66,4 @@ API int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
 
        return ret;
 
-}
\ No newline at end of file
+}