4 * Copyright (c) 2000 - 2019 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Junghyun Yeon <jungh.yeon@samsung.com>,
7 * Sangyoon Jang <jeremy.jang@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
28 #include "manager/pkginfo_manager.h"
29 #include "pkgmgrinfo_private.h"
30 #include "pkgmgrinfo_debug.h"
31 #include "pkgmgr-info.h"
33 API int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
34 const char *plugin_type, const char *plugin_name,
35 pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data)
39 GList *appid_list = NULL;
42 if (!pkgid || !plugin_type || !plugin_name || !plugin_list_cb) {
43 _LOGE("Invalid parameter");
44 return PMINFO_R_EINVAL;
47 ret = _plugininfo_get_appids(pkgid, plugin_type, plugin_name,
49 if (ret == PMINFO_R_ERROR) {
50 _LOGE("Fail to get plugininfo");
54 for (tmp_list = appid_list; tmp_list != NULL;
55 tmp_list = tmp_list->next) {
56 appid = (char *)tmp_list->data;
59 ret = plugin_list_cb(pkgid, appid, plugin_type,
60 plugin_name, user_data);
65 g_list_free_full(appid_list, free);