Fix wgt lib to extract manifest and icon only
[platform/core/appfw/wgt-backend.git] / src / lib / wgt_pkgmgr.cc
1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #include <package-manager-plugin.h>
6
7 #include "lib/wgt_archive_info.h"
8
9 #define EXPORT_API __attribute__((visibility("default")))
10
11 namespace {
12
13 int GetPackageArchiveInfo(const char* path,
14     package_manager_pkg_detail_info_t* info) {
15   if (!WgtArchiveInfo::Instance().GetArchiveInfo(path, info))
16     return -1;
17   return 0;
18 }
19
20 void PluginOnUnload() {
21 }
22
23 }  // namespace
24
25 extern "C" EXPORT_API int pkg_plugin_on_load(pkg_plugin_set* set) {
26   if (set == nullptr)
27     return -1;
28   set->plugin_on_unload = PluginOnUnload;
29   set->pkg_is_installed = nullptr;
30   set->get_installed_pkg_list = nullptr;
31   set->get_pkg_detail_info = nullptr;
32   set->get_pkg_detail_info_from_package = GetPackageArchiveInfo;
33   return 0;
34 }