2 * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <libxml/tree.h>
19 #include "launchpad_parser_plugin.hh"
20 #include "log_private.hh"
23 using namespace launchpad_parser_plugin;
25 extern "C" EXPORT_API int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr doc, const char *package)
27 LaunchpadParser parser;
29 return parser.Install(doc, package);
32 extern "C" EXPORT_API int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr doc, const char *package)
35 LaunchpadParser parser;
36 return parser.UnInstall(doc, package);
39 extern "C" EXPORT_API int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr doc, const char *package)
42 LaunchpadParser parser;
43 return parser.Upgrade(doc, package);
46 extern "C" EXPORT_API int PKGMGR_PARSER_PLUGIN_RECOVERINSTALL(xmlDocPtr doc,
49 LOGW("recover install");
50 LaunchpadParser parser;
51 return parser.UnInstall(doc, package);
54 extern "C" EXPORT_API int PKGMGR_PARSER_PLUGIN_RECOVERUNINSTALL(xmlDocPtr doc,
57 LOGW("recover uninstall");
58 LaunchpadParser parser;
59 return parser.UnInstall(doc, package);
62 extern "C" EXPORT_API int PKGMGR_PARSER_PLUGIN_RECOVERUPGRADE(xmlDocPtr doc,
65 LOGW("recover upgrade");
66 LaunchpadParser parser;
67 return parser.Upgrade(doc, package);