*
* 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)
return PMINFO_R_EINVAL;
}
- ret = _plugininfo_get_appids(pkgid, plugin_type, plugin_name, &appid_list);
- if (ret != PMINFO_R_OK) {
+ ret = _plugininfo_get_appids(pkgid, plugin_type, plugin_name,
+ &appid_list);
+ if (ret == PMINFO_R_ERROR) {
_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;
}
g_list_free_full(appid_list, free);
- return ret;
-
-}
\ No newline at end of file
+ return PMINFO_R_OK;
+}