Fix bugs 07/320707/2
authorjh9216.park <jh9216.park@samsung.com>
Thu, 6 Mar 2025 07:58:57 +0000 (16:58 +0900)
committerjh9216.park <jh9216.park@samsung.com>
Thu, 6 Mar 2025 09:35:17 +0000 (18:35 +0900)
- Fixed bugs about C# TCT

Change-Id: I07e80f92df5eca3dfbda2533df0724435f343b03
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
lib/src/shortcut_manager.cc
packaging/libshortcut.spec
pkgmgr_shortcut/CMakeLists.txt
pkgmgr_shortcut/shortcut.info [new file with mode: 0644]
pkgmgr_shortcut/src/service_register.c

index 689e75ee0415555555828076966a1b536db3ad02..1b78d4d2d1906db2d39dfc540f5fa5eaa263016a 100644 (file)
  *
  */
 
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
+#include "shortcut_manager.h"
 
-#include <aul.h>
 #include <app_common.h>
+#include <aul.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
 #include <system_info.h>
+#include <unistd.h>
 
 #include "log_private.h"
 #include "shortcut.h"
-#include "shortcut_manager.h"
 #include "shortcut_internal.h"
 #include "shortcut_proxy.h"
 
 #define EAPI __attribute__((visibility("default")))
 #endif
 
-#define SHORTCUT_IS_WIDGET_SIZE(size) (!!((size) & WIDGET_SIZE_DEFAULT))
+#define SHORTCUT_IS_WIDGET_SIZE(size) (!!((size)&WIDGET_SIZE_DEFAULT))
 
 #define SHORTCUT_FEATURE "http://tizen.org/feature/shortcut"
-#define CHECK_SHORTCUT_FEATURE() \
-  do { \
-    bool is_supported = false; \
+#define CHECK_SHORTCUT_FEATURE()                                           \
+  do {                                                                     \
+    bool is_supported = false;                                             \
     if (!system_info_get_platform_bool(SHORTCUT_FEATURE, &is_supported)) { \
-      if (is_supported == false) { \
-        _E("[%s] feature is disabled", SHORTCUT_FEATURE); \
-        return SHORTCUT_ERROR_NOT_SUPPORTED; \
-      } \
-    } \
+      if (is_supported == false) {                                         \
+        _E("[%s] feature is disabled", SHORTCUT_FEATURE);                  \
+        return SHORTCUT_ERROR_NOT_SUPPORTED;                               \
+      }                                                                    \
+    }                                                                      \
   } while (0)
 
-#define CHECK_SHORTCUT_FEATURE_RET_LAST_RESULT() \
-  do { \
-    bool is_supported = false; \
+#define CHECK_SHORTCUT_FEATURE_RET_LAST_RESULT()                           \
+  do {                                                                     \
+    bool is_supported = false;                                             \
     if (!system_info_get_platform_bool(SHORTCUT_FEATURE, &is_supported)) { \
-      if (is_supported == false) { \
-        _E("[%s] feature is disabled", SHORTCUT_FEATURE); \
-        set_last_result(SHORTCUT_ERROR_NOT_SUPPORTED); \
-        return; \
-      } \
-    } \
+      if (is_supported == false) {                                         \
+        _E("[%s] feature is disabled", SHORTCUT_FEATURE);                  \
+        set_last_result(SHORTCUT_ERROR_NOT_SUPPORTED);                     \
+        return;                                                            \
+      }                                                                    \
+    }                                                                      \
   } while (0)
 
 namespace rpc = rpc_port::shortcut_proxy;
@@ -73,13 +73,9 @@ class ShortcutConnection : public rpc_proxy::Shortcut::IEventListener {
   void OnConnected() override {}
 
   /* LCOV_EXCL_START */
-  void OnDisconnected() override {
-    shortcut_proxy_.reset();
-  }
+  void OnDisconnected() override { shortcut_proxy_.reset(); }
 
-  void OnRejected() override {
-    shortcut_proxy_.reset();
-  }
+  void OnRejected() override { shortcut_proxy_.reset(); }
   /* LCOV_EXCL_STOP */
 } connection_listener_;
 
@@ -90,11 +86,10 @@ class AddedEvent : public rpc_proxy::Shortcut::AddedCb {
 
   void OnReceived(rpc::Context cxt) override {
     const auto& id = cxt.GetId();
-    if (!request_cb_)
-      return;
+    if (!request_cb_) return;
     request_cb_(id.GetAppid().c_str(), id.GetName().c_str(), cxt.GetType(),
-        cxt.GetUri().c_str(), cxt.GetIcon().c_str(), id.GetPid(), 0,
-        cxt.GetAllowDup() ? 1 : 0, data_);
+                cxt.GetUri().c_str(), cxt.GetIcon().c_str(), id.GetPid(), 0,
+                cxt.GetAllowDup() ? 1 : 0, data_);
   }
 
  private:
@@ -109,11 +104,10 @@ class WidgetAddedEvent : public rpc_proxy::Shortcut::WidgetAddedCb {
 
   void OnReceived(rpc::WidgetContext cxt) override {
     const auto& id = cxt.GetId();
-    if (!request_cb_)
-      return;
-    request_cb_(id.GetAppid().c_str(), id.GetName().c_str(), 0,
-        cxt.GetUri().c_str(), cxt.GetIcon().c_str(), id.GetPid(), cxt.GetPeriod(),
-        cxt.GetAllowDup() ? 1 : 0, data_);
+    if (!request_cb_) return;
+    request_cb_(id.GetAppid().c_str(), id.GetName().c_str(), cxt.GetSize(),
+                cxt.GetUri().c_str(), cxt.GetIcon().c_str(), id.GetPid(),
+                cxt.GetPeriod(), cxt.GetAllowDup() ? 1 : 0, data_);
   }
 
  private:
@@ -127,10 +121,8 @@ class RemovedEvent : public rpc_proxy::Shortcut::RemovedCb {
       : remove_cb_(remove_cb), data_(data) {}
 
   void OnReceived(rpc::Id id) override {
-    if (!remove_cb_)
-      return;
-    remove_cb_(id.GetAppid().c_str(), id.GetName().c_str(), id.GetPid(),
-        data_);
+    if (!remove_cb_) return;
+    remove_cb_(id.GetAppid().c_str(), id.GetName().c_str(), id.GetPid(), data_);
   }
 
  private:
@@ -140,12 +132,10 @@ class RemovedEvent : public rpc_proxy::Shortcut::RemovedCb {
 
 class ResultEvent : public rpc_proxy::Shortcut::ResultCb {
  public:
-  ResultEvent(result_cb res_cb, void* data)
-      : res_cb_(res_cb), data_(data) {}
+  ResultEvent(result_cb res_cb, void* data) : res_cb_(res_cb), data_(data) {}
 
   void OnReceived(int ret) override {
-    if (!res_cb_)
-      return;
+    if (!res_cb_) return;
     res_cb_(ret, data_);
   }
 
@@ -156,8 +146,8 @@ class ResultEvent : public rpc_proxy::Shortcut::ResultCb {
 
 void Connect() {
   if (!shortcut_proxy_) {
-    shortcut_proxy_.reset(new rpc_proxy::Shortcut(&connection_listener_,
-        "d::org.tizen.appfw.service.esd"));
+    shortcut_proxy_.reset(new rpc_proxy::Shortcut(
+        &connection_listener_, "d::org.tizen.appfw.service.esd"));
     shortcut_proxy_->Connect(true);
   }
 
@@ -169,10 +159,11 @@ void Connect() {
 }  // namespace
 
 EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void* data) {
-  LOGW("DEPRECATION WARNING: shortcut_set_request_cb() is deprecated and will be removed from next release");
+  LOGW(
+      "DEPRECATION WARNING: shortcut_set_request_cb() is deprecated and will "
+      "be removed from next release");
   CHECK_SHORTCUT_FEATURE();
-  if (request_cb == nullptr)
-    return SHORTCUT_ERROR_INVALID_PARAMETER;
+  if (request_cb == nullptr) return SHORTCUT_ERROR_INVALID_PARAMETER;
 
   try {
     ::Connect();
@@ -182,7 +173,7 @@ EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void* data) {
     shortcut_proxy_->ListenWidgetAddedEvents(
         std::unique_ptr<rpc_proxy::Shortcut::WidgetAddedCb>(
             new WidgetAddedEvent(request_cb, data)));
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -193,14 +184,16 @@ EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void* data) {
 }
 
 EAPI void shortcut_unset_request_cb() {
-  LOGW("DEPRECATION WARNING: shortcut_unset_request_cb() is deprecated and will be removed from next release");
+  LOGW(
+      "DEPRECATION WARNING: shortcut_unset_request_cb() is deprecated and will "
+      "be removed from next release");
   CHECK_SHORTCUT_FEATURE_RET_LAST_RESULT();
 
   try {
     ::Connect();
     shortcut_proxy_->UnlistenAddedEvents();
     shortcut_proxy_->UnlistenWidgetAddedEvents();
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     set_last_result(SHORTCUT_ERROR_IO_ERROR);
@@ -212,18 +205,19 @@ EAPI void shortcut_unset_request_cb() {
 }
 
 EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void* data) {
-  LOGW("DEPRECATION WARNING: shortcut_set_remove_cb() is deprecated and will be removed from next release");
+  LOGW(
+      "DEPRECATION WARNING: shortcut_set_remove_cb() is deprecated and will be "
+      "removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
-  if (remove_cb == nullptr)
-    return SHORTCUT_ERROR_INVALID_PARAMETER;
+  if (remove_cb == nullptr) return SHORTCUT_ERROR_INVALID_PARAMETER;
 
   try {
     ::Connect();
     shortcut_proxy_->ListenRemovedEvents(
         std::unique_ptr<rpc_proxy::Shortcut::RemovedCb>(
             new RemovedEvent(remove_cb, data)));
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -234,12 +228,14 @@ EAPI int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void* data) {
 }
 
 EAPI void shortcut_unset_remove_cb() {
-  LOGW("DEPRECATION WARNING: shortcut_unset_remove_cb() is deprecated and will be removed from next release");
+  LOGW(
+      "DEPRECATION WARNING: shortcut_unset_remove_cb() is deprecated and will "
+      "be removed from next release");
   CHECK_SHORTCUT_FEATURE_RET_LAST_RESULT();
   try {
     ::Connect();
     shortcut_proxy_->UnlistenRemovedEvents();
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     set_last_result(SHORTCUT_ERROR_IO_ERROR);
@@ -251,9 +247,11 @@ EAPI void shortcut_unset_remove_cb() {
 }
 
 EAPI int shortcut_add_to_home(const char* name, shortcut_type type,
-    const char* uri, const char* icon, int allow_duplicate,
-    result_cb cb, void* data) {
-  LOGW("DEPRECATION WARNING: shortcut_add_to_home() is deprecated and will be removed from next release");
+                              const char* uri, const char* icon,
+                              int allow_duplicate, result_cb cb, void* data) {
+  LOGW(
+      "DEPRECATION WARNING: shortcut_add_to_home() is deprecated and will be "
+      "removed from next release");
   CHECK_SHORTCUT_FEATURE();
   if (ADD_TO_HOME_IS_DYNAMICBOX(type)) {
     _E("Invalid type used for adding a shortcut");
@@ -263,19 +261,13 @@ EAPI int shortcut_add_to_home(const char* name, shortcut_type type,
   try {
     ::Connect();
 
-    rpc::Context cxt {
-      rpc::Id {
-        getpid(),
-        sAppid ? sAppid : "",
-        name ? name : ""
-      },
-      type,
-      uri ? uri : "",
-      icon ? icon : "", static_cast<bool>(allow_duplicate)
-    };
+    rpc::Context cxt{rpc::Id{getpid(), sAppid ? sAppid : "", name ? name : ""},
+                     type, uri ? uri : "", icon ? icon : "",
+                     static_cast<bool>(allow_duplicate)};
     shortcut_proxy_->AddAsync(std::move(cxt),
-        std::unique_ptr<rpc_proxy::Shortcut::ResultCb>(new ResultEvent(cb, data)));
-  } catch(...) { /* LCOV_EXCL_LINE */
+                              std::unique_ptr<rpc_proxy::Shortcut::ResultCb>(
+                                  new ResultEvent(cb, data)));
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -286,9 +278,13 @@ EAPI int shortcut_add_to_home(const char* name, shortcut_type type,
 }
 
 EAPI int shortcut_add_to_home_widget(const char* name,
-    shortcut_widget_size_e size, const char* widget_id, const char* icon,
-    double period, int allow_duplicate, result_cb cb, void* data) {
-  LOGW("DEPRECATION WARNING: shortcut_add_to_home_widget() is deprecated and will be removed from next release");
+                                     shortcut_widget_size_e size,
+                                     const char* widget_id, const char* icon,
+                                     double period, int allow_duplicate,
+                                     result_cb cb, void* data) {
+  LOGW(
+      "DEPRECATION WARNING: shortcut_add_to_home_widget() is deprecated and "
+      "will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (name == nullptr) {
@@ -304,20 +300,17 @@ EAPI int shortcut_add_to_home_widget(const char* name,
   try {
     ::Connect();
 
-    rpc::WidgetContext cxt {
-      rpc::Id {
-        getpid(),
-        sAppid ? sAppid : "",
-        name ? name : ""
-      },
-      size,
-      "",
-      icon ? icon : "", period, static_cast<bool>(allow_duplicate)
-    };
-    shortcut_proxy_->AddWidgetAsync(std::move(cxt),
-        std::unique_ptr<rpc_proxy::Shortcut::ResultCb>(
-            new ResultEvent(cb, data)));
-  } catch(...) { /* LCOV_EXCL_LINE */
+    rpc::WidgetContext cxt{
+        rpc::Id{getpid(), widget_id ? widget_id : "", name ? name : ""},
+        size,
+        "",
+        icon ? icon : "",
+        period,
+        static_cast<bool>(allow_duplicate)};
+    shortcut_proxy_->AddWidgetAsync(
+        std::move(cxt), std::unique_ptr<rpc_proxy::Shortcut::ResultCb>(
+                            new ResultEvent(cb, data)));
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -328,8 +321,10 @@ EAPI int shortcut_add_to_home_widget(const char* name,
 }
 
 EAPI int shortcut_remove_from_home(const char* name, result_cb cb,
-    void* user_data) {
-  LOGW("DEPRECATION WARNING: shortcut_remove_from_home() is deprecated and will be removed from next release");
+                                   void* user_data) {
+  LOGW(
+      "DEPRECATION WARNING: shortcut_remove_from_home() is deprecated and will "
+      "be removed from next release");
   CHECK_SHORTCUT_FEATURE();
   if (name == nullptr) {
     _E("name is NULL.");
@@ -340,14 +335,10 @@ EAPI int shortcut_remove_from_home(const char* name, result_cb cb,
     ::Connect();
 
     shortcut_proxy_->RemoveAsync(
-        rpc::Id {
-          getpid(),
-          sAppid ? sAppid : "",
-          name ? name : ""
-        },
+        rpc::Id{getpid(), sAppid ? sAppid : "", name ? name : ""},
         std::unique_ptr<rpc_proxy::Shortcut::ResultCb>(
             new ResultEvent(cb, user_data)));
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -358,24 +349,24 @@ EAPI int shortcut_remove_from_home(const char* name, result_cb cb,
 }
 
 EAPI int shortcut_get_list(const char* package_name, shortcut_list_cb list_cb,
-    void* data) {
+                           void* data) {
   int ret = SHORTCUT_ERROR_NONE;
 
-  LOGW("DEPRECATION WARNING: shortcut_get_list() is deprecated and will be removed from next release");
+  LOGW(
+      "DEPRECATION WARNING: shortcut_get_list() is deprecated and will be "
+      "removed from next release");
   CHECK_SHORTCUT_FEATURE();
-  if (list_cb == nullptr)
-    return SHORTCUT_ERROR_INVALID_PARAMETER;
+  if (list_cb == nullptr) return SHORTCUT_ERROR_INVALID_PARAMETER;
 
   try {
     ::Connect();
 
-    auto info = shortcut_proxy_->GetList(package_name ? package_name : "",
-        ret);
+    auto info = shortcut_proxy_->GetList(package_name ? package_name : "", ret);
     for (const auto& i : info) {
       list_cb(i.GetAppid().c_str(), i.GetIcon().c_str(), i.GetName().c_str(),
-          i.GetExtraKey().c_str(), i.GetExtraData().c_str(), data);
+              i.GetExtraKey().c_str(), i.GetExtraData().c_str(), data);
     }
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -386,8 +377,11 @@ EAPI int shortcut_get_list(const char* package_name, shortcut_list_cb list_cb,
 }
 
 EAPI int shortcut_add_to_home_sync(const char* name, shortcut_type type,
-    const char* uri, const char* icon, int allow_duplicate) {
-  LOGW("DEPRECATION WARNING: shortcut_add_to_home_sync() is deprecated and will be removed from next release");
+                                   const char* uri, const char* icon,
+                                   int allow_duplicate) {
+  LOGW(
+      "DEPRECATION WARNING: shortcut_add_to_home_sync() is deprecated and will "
+      "be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (ADD_TO_HOME_IS_DYNAMICBOX(type)) {
@@ -399,18 +393,11 @@ EAPI int shortcut_add_to_home_sync(const char* name, shortcut_type type,
   try {
     ::Connect();
 
-    rpc::Context cxt {
-      rpc::Id {
-        getpid(),
-        sAppid ? sAppid : "",
-        name ? name : ""
-      },
-      type,
-      uri ? uri : "",
-      icon ? icon : "", static_cast<bool>(allow_duplicate)
-    };
+    rpc::Context cxt{rpc::Id{getpid(), sAppid ? sAppid : "", name ? name : ""},
+                     type, uri ? uri : "", icon ? icon : "",
+                     static_cast<bool>(allow_duplicate)};
     ret = shortcut_proxy_->Add(std::move(cxt));
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -420,10 +407,14 @@ EAPI int shortcut_add_to_home_sync(const char* name, shortcut_type type,
   return ret;
 }
 
-EAPI int shortcut_add_to_home_widget_sync(const char *name,
-    shortcut_widget_size_e size, const char *widget_id,
-    const char *icon, double period, int allow_duplicate) {
-  LOGW("DEPRECATION WARNING: shortcut_add_to_home_widget_sync() is deprecated and will be removed from next release");
+EAPI int shortcut_add_to_home_widget_sync(const char* name,
+                                          shortcut_widget_size_e size,
+                                          const char* widget_id,
+                                          const char* icon, double period,
+                                          int allow_duplicate) {
+  LOGW(
+      "DEPRECATION WARNING: shortcut_add_to_home_widget_sync() is deprecated "
+      "and will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (name == NULL) {
@@ -440,18 +431,15 @@ EAPI int shortcut_add_to_home_widget_sync(const char *name,
   try {
     ::Connect();
 
-    rpc::WidgetContext cxt {
-      rpc::Id {
-        getpid(),
-        sAppid ? sAppid : "",
-        name ? name : ""
-      },
-      size,
-      "",
-      icon ? icon : "", period, static_cast<bool>(allow_duplicate)
-    };
+    rpc::WidgetContext cxt{
+        rpc::Id{getpid(), widget_id ? widget_id : "", name ? name : ""},
+        size,
+        "",
+        icon ? icon : "",
+        period,
+        static_cast<bool>(allow_duplicate)};
     ret = shortcut_proxy_->AddWidget(std::move(cxt));
-  } catch(...) { /* LCOV_EXCL_LINE */
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
@@ -461,8 +449,10 @@ EAPI int shortcut_add_to_home_widget_sync(const char *name,
   return ret;
 }
 
-EAPI int shortcut_remove_from_home_sync(const char *name) {
-  LOGW("DEPRECATION WARNING: shortcut_remove_from_home_sync() is deprecated and will be removed from next release");
+EAPI int shortcut_remove_from_home_sync(const char* name) {
+  LOGW(
+      "DEPRECATION WARNING: shortcut_remove_from_home_sync() is deprecated and "
+      "will be removed from next release");
   CHECK_SHORTCUT_FEATURE();
 
   if (name == NULL) {
@@ -475,12 +465,8 @@ EAPI int shortcut_remove_from_home_sync(const char *name) {
     ::Connect();
 
     ret = shortcut_proxy_->Remove(
-        rpc::Id {
-          getpid(),
-          sAppid ? sAppid : "",
-          name ? name : ""
-        });
-  } catch(...) { /* LCOV_EXCL_LINE */
+        rpc::Id{getpid(), sAppid ? sAppid : "", name ? name : ""});
+  } catch (...) { /* LCOV_EXCL_LINE */
     /* LCOV_EXCL_START */
     shortcut_proxy_.reset();
     return SHORTCUT_ERROR_IO_ERROR;
index c229308074a0285354c9310ac19807414eb7cf9e..d9c9f172281728be4d0f09985b8651cd87cd84b4 100644 (file)
@@ -176,6 +176,7 @@ fi
 %{_sysconfdir}/package-manager/parserlib/*
 %{_moddir}/mod/libesd-mod-shortcut.so
 %{_unitdir}/esd-shortcut.socket
+%{_datarootdir}/parser-plugins/shortcut.info
 %{_unitdir}/sockets.target.wants/esd-shortcut.socket
 
 %files devel
index 7203d96bd8747e66fac6843e899d3ecf0750af20..abee6f2c65b8a5a0d8bb39b8f0bcfa855ffacafe 100644 (file)
@@ -28,6 +28,12 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED
 
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bin_pkgs_LDFLAGS})
 
+SET(PLUGINS_LIST_FILE_NAME shortcut.info)
+SET(PLUGINS_LIST_FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGINS_LIST_FILE_NAME})
+SET(PLUGINS_LIST_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/parser-plugins)
+ADD_DEFINITIONS("-DPLUGINS_LIST_INSTALL_PATH=\"${PLUGINS_LIST_INSTALL_PATH}\"")
+INSTALL(FILES ${PLUGINS_LIST_FILE_PATH} DESTINATION ${PLUGINS_LIST_INSTALL_PATH}/)
+
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${SYSCONFDIR}/package-manager/parserlib)
 
 # End of a file
diff --git a/pkgmgr_shortcut/shortcut.info b/pkgmgr_shortcut/shortcut.info
new file mode 100644 (file)
index 0000000..34b6299
--- /dev/null
@@ -0,0 +1,2 @@
+type="tag";name="short-list";path="/etc/package-manager/parserlib/libshortcut-list.so";vitalness="true"
+
index bb9c145e202b82e924e05c2d723f7ca1c14234f7..b0a081f66f1929ec4341c662616b945238c02480 100644 (file)
 
 #include "dlist.h"
 
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
 #if !defined(FLOG)
 #define DbgPrint(format, arg...)       SECURE_LOGD("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
 #define ErrPrint(format, arg...)       SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
@@ -1023,7 +1027,7 @@ static int do_install(xmlDocPtr docPtr, const char *appid)
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_PRE_UNINSTALL(const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_PRE_UNINSTALL(const char *appid)
 {
        if (!s_info.handle) {
                if (db_init() < 0)
@@ -1034,7 +1038,7 @@ int PKGMGR_PARSER_PLUGIN_PRE_UNINSTALL(const char *appid)
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_POST_UNINSTALL(const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_POST_UNINSTALL(const char *appid)
 {
        int ret;
 
@@ -1050,7 +1054,7 @@ int PKGMGR_PARSER_PLUGIN_POST_UNINSTALL(const char *appid)
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char *_appid)
+extern API int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char *_appid)
 {
        xmlNodePtr node = NULL;
        xmlChar *key;
@@ -1147,7 +1151,7 @@ int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char *_appid)
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_PRE_INSTALL(const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_PRE_INSTALL(const char *appid)
 {
        int ret;
 
@@ -1168,18 +1172,18 @@ int PKGMGR_PARSER_PLUGIN_PRE_INSTALL(const char *appid)
        return  0;
 }
 
-int PKGMGR_PARSER_PLUGIN_POST_INSTALL(const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_POST_INSTALL(const char *appid)
 {
        db_fini();
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char *appid)
 {
        return do_install(docPtr, appid);
 }
 
-int PKGMGR_PARSER_PLUGIN_PRE_UPGRADE(const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_PRE_UPGRADE(const char *appid)
 {
        int ret;
 
@@ -1200,13 +1204,13 @@ int PKGMGR_PARSER_PLUGIN_PRE_UPGRADE(const char *appid)
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_POST_UPGRADE(const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_POST_UPGRADE(const char *appid)
 {
        db_fini();
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char *appid)
+extern API int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char *appid)
 {
        /* So... ugly */
        return do_install(docPtr, appid);